commit 52de1273fe2c7a9e70a6bfabeb0a07029e2b91ba Author: Relintai Date: Fri Mar 18 17:46:08 2022 +0100 Added the current 3.4 godot docs as a base. diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..7614d1b --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..bd70af6 --- /dev/null +++ b/.gitattributes @@ -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 diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..daa97e5 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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:** diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..cefdbcb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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. diff --git a/.github/ISSUE_TEMPLATE/enhancement_request.md b/.github/ISSUE_TEMPLATE/enhancement_request.md new file mode 100644 index 0000000..d6b2f3c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/enhancement_request.md @@ -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):** diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..a4f90c3 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,7 @@ + diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..2817110 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c732858 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/.mailmap b/.mailmap new file mode 100644 index 0000000..3ad8821 --- /dev/null +++ b/.mailmap @@ -0,0 +1,30 @@ +Andreas Haas +Andrew Conrad +Andrii Doroshenko +puchik <48544263+puchik@users.noreply.github.com> +Chris Bradfield +clayjohn +clayjohn +corrigentia <20541985+corrigentia@users.noreply.github.com> +Frido +Frido <43795127+mega-bit@users.noreply.github.com> +Hugo Locurcio +Hugo Locurcio +Ignacio Etcheverry +Julian Murgia +Kelly Thomas +Leon Krause +Leon Krause +Max Hilbrunner +Max Hilbrunner +Michael Alexsander +Nathan Lovato +Paul Joannon <437025+paulloz@users.noreply.github.com> +Rémi Verschelde +skyace65 +skyace65 +TwistedTwigleg +Will Nations +Yuri Roubinsky +Yuri Sizov +ZX-WT diff --git a/.readthedocs.yml b/.readthedocs.yml new file mode 100644 index 0000000..2bb1660 --- /dev/null +++ b/.readthedocs.yml @@ -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 diff --git a/AUTHORS.md b/AUTHORS.md new file mode 100644 index 0000000..71a5e0d --- /dev/null +++ b/AUTHORS.md @@ -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 diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..1a16e05 --- /dev/null +++ b/LICENSE.txt @@ -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/. diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..f1fa052 --- /dev/null +++ b/Makefile @@ -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 ' where 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." diff --git a/README.md b/README.md new file mode 100644 index 0000000..f48cfea --- /dev/null +++ b/README.md @@ -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 ` +``` + +## 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. diff --git a/_extensions/gdscript.py b/_extensions/gdscript.py new file mode 100644 index 0000000..57ae272 --- /dev/null +++ b/_extensions/gdscript.py @@ -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 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 `_. + """ + + 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"(? 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 = ( + '\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, + } diff --git a/_static/css/custom.css b/_static/css/custom.css new file mode 100644 index 0000000..8f88943 --- /dev/null +++ b/_static/css/custom.css @@ -0,0 +1,1029 @@ +/** + * Various tweaks to the Read the Docs theme to better conform with Godot's + * visual identity. Many colors are also overridden to use CSS variables. + * This makes it possible to provide an automatically-used dark theme + * based on browser preferences. + */ + + /* Default (light) theme colors */ + :root { + --body-color: #404040; + --content-wrap-background-color: #efefef; + --content-background-color: #fcfcfc; + --logo-opacity: 1.0; + --navbar-background-color: #333f67; + --navbar-background-color-hover: #29355c; + --navbar-background-color-active: #212d51; + --navbar-current-background-color: #212d51; + --navbar-current-background-color-hover: #182343; + --navbar-current-background-color-active: #131e3b; + --navbar-level-1-color: #c3e3ff; + --navbar-level-2-color: #b8d6f0; + --navbar-level-3-color: #a3c4e1; + --navbar-heading-color: #ff7381; + --navbar-scrollbar-color: #d45a66; + --navbar-scrollbar-hover-color: #b14550; + --navbar-scrollbar-active-color: #72383e; + --navbar-scrollbar-background: #131e2b; + + --link-color: #2980b9; + --link-color-hover: #3091d1; + --link-color-active: #105078; + --link-color-visited: #9b59b6; + --external-reference-icon: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyIiB3aWR0aD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjMjk4MGI5Ij48cGF0aCBkPSJtNy41IDcuMXYzLjRoLTZ2LTZoMy40Ii8+PHBhdGggZD0ibTUuNzY1IDFoNS4yMzV2NS4zOWwtMS41NzMgMS41NDctMS4zMS0xLjMxLTIuNzI0IDIuNzIzLTIuNjktMi42ODggMi44MS0yLjgwOC0xLjMxMy0xLjMxeiIvPjwvZz48L3N2Zz4K"); + + --hr-color: #e1e4e5; + --table-row-odd-background-color: #f3f6f6; + --code-background-color: #fff; + --code-border-color: #e1e4e5; + --code-literal-color: #d04c60; + --input-background-color: #fcfcfc; + --input-focus-border-color: #5f8cff; + + --search-input-background-color: #e6eef3; /* derived from --input-background-color */ + --search-match-color: #2c6b96; /* derived from --link-color */ + --search-match-background-color: #e3f2fd; /* derived from --link-color */ + --search-active-color: #efefef; + --search-credits-background-color: #333f67; /* derived from --navbar-background-color */ + --search-credits-color: #b3b3b3; /* derived from --footer-color */ + --search-credits-link-color: #4392c5; /* derived from --link-color */ + + --highlight-background-color: #f5ffe1; + --highlight-background-emph-color: #dbe6c3; + --highlight-default-color: #404040; + --highlight-comment-color: #408090; + --highlight-keyword-color: #007020; + --highlight-keyword2-color: #902000; + --highlight-number-color: #208050; + --highlight-decorator-color: #4070a0; + --highlight-type-color: #007020; + --highlight-type2-color: #0e84b5; + --highlight-function-color: #06287e; + --highlight-operator-color: #666666; + --highlight-string-color: #4070a0; + + --admonition-note-background-color: #e7f2fa; + --admonition-note-color: #404040; + --admonition-note-title-background-color: #6ab0de; + --admonition-note-title-color: #fff; + --admonition-attention-background-color: #ffedcc; + --admonition-attention-color: #404040; + --admonition-attention-title-background-color: #f0b37e; + --admonition-attention-title-color: #fff; + --admonition-danger-background-color: #fcf3f2; + --admonition-danger-color: #404040; + --admonition-danger-title-background-color: #e9a499; + --admonition-danger-title-color: #fff; + --admonition-tip-background-color: #dbfaf4; + --admonition-tip-color: #404040; + --admonition-tip-title-background-color: #1abc9c; + --admonition-tip-title-color: #fff; + + --kbd-background-color: #fafbfc; + --kbd-outline-color: #d1d5da; + --kbd-shadow-color: #b0b7bf; + --kbd-text-color: #444d56; + + --btn-neutral-background-color: #f3f6f6; + --btn-neutral-hover-background-color: #e5ebeb; + --footer-color: #808080; +} + +/* Dark theme colors */ +@media (prefers-color-scheme: dark) { + :root { + --body-color: rgba(255, 255, 255, 0.85); + --content-wrap-background-color: #202326; + --content-background-color: #2e3236; + /* Decrease the logo opacity when using the dark theme to be less distracting */ + --logo-opacity: 0.85; + --navbar-background-color: #25282b; + --navbar-background-color-hover: #333639; + --navbar-background-color-active: #111417; + --navbar-current-background-color: #333639; + --navbar-current-background-color-hover: #44474a; + --navbar-current-background-color-active: #222528; + --navbar-level-1-color: #ddd; + --navbar-level-2-color: #ccc; + --navbar-level-3-color: #bbb; + --navbar-heading-color: #ee7381; + --navbar-scrollbar-color: #be5460; + --navbar-scrollbar-hover-color: #963e48; + --navbar-scrollbar-active-color: #5f3034; + --navbar-scrollbar-background: #1c1e21; + + --link-color: #8cf; + --link-color-hover: #9df; + --link-color-active: #6ad; + --link-color-visited: #cb99f6; + --external-reference-icon: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEyIiB3aWR0aD0iMTIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGcgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjOGNmIj48cGF0aCBkPSJtNy41IDcuMXYzLjRoLTZ2LTZoMy40Ii8+PHBhdGggZD0ibTUuNzY1IDFoNS4yMzV2NS4zOWwtMS41NzMgMS41NDctMS4zMS0xLjMxLTIuNzI0IDIuNzIzLTIuNjktMi42ODggMi44MS0yLjgwOC0xLjMxMy0xLjMxeiIvPjwvZz48L3N2Zz4K"); + + --hr-color: #555; + --table-row-odd-background-color: #3b3e41; + --code-background-color: #434649; + --code-border-color: #505356; + --code-literal-color: #faa; + --input-background-color: #333537; + --input-focus-border-color: #5f8cff; + + --search-input-background-color: #43464a; /* derived from --input-background-color */ + --search-match-color: #52b4ff; /* derived from --link-color */ + --search-match-background-color: #414c56; /* derived from --link-color */ + --search-active-color: #202326; + --search-credits-background-color: #202123; /* derived from --navbar-background-color */ + --search-credits-color: #6b6b6b; /* derived from --footer-color */ + --search-credits-link-color: #628fb1; /* derived from --link-color */ + + /* Colors taken from the Godot script editor with the Adaptive theme */ + --highlight-background-color: #202531; + --highlight-background-emph-color: #2d3444; + --highlight-default-color: rgba(255, 255, 255, 0.85); + --highlight-comment-color: rgba(204, 206, 211, 0.5); + --highlight-keyword-color: #ff7085; + --highlight-keyword2-color: #42ffc2; + --highlight-number-color: #a1ffe0; + --highlight-decorator-color: #abc8ff; + --highlight-type-color: #8effda; + --highlight-type2-color: #c6ffed; + --highlight-function-color: #57b3ff; + --highlight-operator-color: #abc8ff; + --highlight-string-color: #ffeca1; + + --admonition-note-background-color: #303d4f; + --admonition-note-color: #bfeeff; + --admonition-note-title-background-color: #305070; + --admonition-note-title-color: #bfefff; + --admonition-attention-background-color: #444033; + --admonition-attention-color: #ffeeaf; + --admonition-attention-title-background-color: #665022; + --admonition-attention-title-color: #ffeeaf; + --admonition-danger-background-color: #433; + --admonition-danger-color: #fcc; + --admonition-danger-title-background-color: #633; + --admonition-danger-title-color: #fcc; + --admonition-tip-background-color: #28382d; + --admonition-tip-color: #dfd; + --admonition-tip-title-background-color: #336648; + --admonition-tip-title-color: #dfd; + + --kbd-background-color: #595b5d; + --kbd-outline-color: #3d4144; + --kbd-shadow-color: #1e2023; + --kbd-text-color: #e2f2ff; + + --btn-neutral-background-color: #404040; + --btn-neutral-hover-background-color: #505050; + --footer-color: #aaa; + } +} + +body, +h1, +h2, +h3, +h4, +h5, +h6, +input[type="text"], +input[type="button"], +input[type="reset"], +input[type="submit"], +textarea, +legend, +.btn, +.rst-content .toctree-wrapper p.caption, +.rst-versions { + /* Use a system font stack for better performance (no Web fonts required) */ + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; +} + +h1, +h2, +h3, +h4, +h5, +h6, +legend, +.rst-content .toctree-wrapper p.caption { + /* Use a lighter font for headers (Medium instead of Bold) */ + font-weight: 500; +} + +.rst-content div.figure p.caption { + /* Tweak caption styling to be closer to typical captions */ + text-align: center; + margin-top: 8px; + opacity: 0.75; +} + +.rst-content div.figure.figure-w480 { + max-width: 480px; +} + +.rst-content div.figure img { + border: 1px solid var(--body-color); +} + +p, +article ul, +article ol, +.wy-plain-list-disc, +.wy-plain-list-decimal, +.rst-content ol.arabic, +.rst-content .section ul, +.rst-content .toctree-wrapper ul, +.rst-content .section ol { + /* Increase the line height slightly to account for the different font */ + line-height: 25px; +} + +body, +.rst-content table.docutils thead { + color: var(--body-color); +} + +a { + color: var(--link-color); +} + +.sphinx-tabs-tab { + color: var(--link-color); +} + +.sphinx-tabs-tab[aria-selected="true"] { + background-color: var(--code-background-color); + border-bottom: 1px solid var(--code-background-color); +} + +.sphinx-tabs-panel { + background-color: var(--code-background-color); +} + +a:hover { + color: var(--link-color-hover); + text-decoration: underline; +} + +a:active { + /* Add visual feedback when clicking on a link */ + color: var(--link-color-active); +} + +a:visited { + color: var(--link-color-visited); +} + +a.btn:hover { + text-decoration: none; +} + +/* Style external links differently to make them easier to distinguish from internal links. */ +.reference.external { + background-position: center right; + background-repeat: no-repeat; + background-image: var(--external-reference-icon); + padding-right: 13px; +} + +hr, +#search-results .search li:first-child, +#search-results .search li { + border-color: var(--hr-color); +} + +/* JavaScript documentation directives */ +.rst-content dl:not(.docutils) dt { + background-color: var(--admonition-note-background-color) !important; + border-color: var(--admonition-note-title-background-color); + color: var(--admonition-note-color); +} +.rst-content dl:not(.docutils) dl dt { + background-color: var(--admonition-attention-background-color); + border-color: var(--admonition-attention-title-background-color); + color: var(--admonition-attention-color) !important; +} +.rst-content dl:not(.docutils).class dt, +.rst-content dl:not(.docutils).function dt, +.rst-content dl:not(.docutils).method dt, +.rst-content dl:not(.docutils).attribute dt { + width: 100%; +} +.rst-content dl:not(.docutils).class > dt, +.rst-content dl:not(.docutils).function > dt, +.rst-content dl:not(.docutils).method > dt, +.rst-content dl:not(.docutils).attribute > dt { + font-size: 100%; + font-weight: normal; + margin-bottom: 16px; + padding: 6px 8px; +} +.rst-content dl:not(.docutils) tt.descclassname, +.rst-content dl:not(.docutils) code.descclassname { + color: var(--highlight-type2-color); + font-weight: normal; +} +.rst-content dl:not(.docutils) tt.descname, +.rst-content dl:not(.docutils) code.descname { + color: var(--highlight-function-color); + font-weight: normal; +} +.rst-content dl:not(.docutils) .sig-paren, +.rst-content dl:not(.docutils) .optional { + color: var(--highlight-operator-color) !important; + font-weight: normal; + padding: 0 2px; +} +.rst-content dl:not(.docutils) .optional { + font-style: italic; +} +.rst-content dl:not(.docutils) .sig-param, +.rst-content dl:not(.docutils).class dt > em, +.rst-content dl:not(.docutils).function dt > em, +.rst-content dl:not(.docutils).method dt > em { + color: var(--code-literal-color); + font-style: normal; + padding: 0 4px; +} +.rst-content dl:not(.docutils) .sig-param, +.rst-content dl:not(.docutils).class dt > .optional ~ em, +.rst-content dl:not(.docutils).function dt > .optional ~ em, +.rst-content dl:not(.docutils).method dt > .optional ~ em { + color: var(--highlight-number-color); + font-style: italic; +} +.rst-content dl:not(.docutils).class dt > em.property { + color: var(--highlight-keyword-color); +} +.rst-content dl:not(.docutils) dt a.headerlink { + color: var(--link-color) !important; +} +.rst-content dl:not(.docutils) dt a.headerlink:visited { + color: var(--link-color-visited); +} + +footer, +#search-results .context { + color: var(--footer-color); +} + +/* Sphinx Search extension */ +/* .wy-body-for-nav is used for higher rule specificity */ + +/* Search popup body */ +.wy-body-for-nav .search__outer { + background-color: var(--content-background-color); + border: 2px solid var(--content-background-color); +} +.wy-body-for-nav .search__cross svg { + fill: var(--body-color); +} + +.wy-body-for-nav .search__outer::-webkit-scrollbar-track { + border-radius: 10px; + background-color: var(--content-background-color); +} +.wy-body-for-nav .search__outer::-webkit-scrollbar { + width: 7px; + height: 7px; + background-color: var(--content-background-color); +} +.wy-body-for-nav .search__outer::-webkit-scrollbar-thumb { + border-radius: 10px; + background-color: var(--hr-color); +} + +/* Search input */ +.wy-body-for-nav .search__outer__input { + background-color: var(--search-input-background-color); + background-image: none; + border-radius: 50px; + border: 2px solid transparent; + color: var(--body-color); + height: 36px; + padding: 6px 12px; +} +.wy-body-for-nav .search__outer__input:focus { + border-color: var(--input-focus-border-color); +} +.wy-body-for-nav .search__outer .bar:after, +.wy-body-for-nav .search__outer .bar:before { + display: none; +} + +/* Search results item */ +.wy-body-for-nav .search__result__single { + border-bottom-color: var(--hr-color); +} +/* Search item title */ +.wy-body-for-nav .search__result__title { + color: var(--link-color); + border-bottom: none; + font-size: 120%; + font-weight: 400; +} + +/* Search item section */ +.wy-body-for-nav .outer_div_page_results:hover, +.wy-body-for-nav .search__result__box .active { + background-color: var(--search-active-color); +} +.wy-body-for-nav .search__result__subheading{ + color: var(--body-color); + font-size: 100%; + font-weight: 400; +} +.wy-body-for-nav .search__result__content { + color: var(--footer-color); +} + +/* Search item matching substring */ +.wy-body-for-nav .search__outer .search__result__title span, +.wy-body-for-nav .search__outer .search__result__content span { + color: var(--search-match-color); + border-bottom: 1px solid var(--search-match-color); + background-color: var(--search-match-background-color); + padding: 0 2px; +} +.wy-body-for-nav .search__result__subheading span { + border-bottom-color: var(--body-color); +} + +/* Search empty results */ +/* The original styles are inlined, see https://github.com/readthedocs/readthedocs-sphinx-search/issues/48 */ +.wy-body-for-nav .search__result__box { + color: var(--body-color) !important; +} + +/* Search footer & credits */ +.wy-body-for-nav .rtd__search__credits { + background-color: var(--search-credits-background-color); + border-color: var(--search-credits-background-color); + color: var(--search-credits-color); + padding: 4px 8px; +} +.wy-body-for-nav .rtd__search__credits a { + color: var(--search-credits-link-color); +} + +/* Main sections */ + +.wy-nav-content-wrap { + background-color: var(--content-wrap-background-color); +} + +.wy-nav-content { + background-color: var(--content-background-color); +} + +.wy-body-for-nav { + background-color: var(--content-wrap-background-color); +} + +@media only screen and (min-width: 769px) { + .wy-body-for-nav { + /* Center the page on wide displays for better readability */ + max-width: 1100px; + margin: 0 auto; + } +} + +/* Table display tweaks */ + +.rst-content table.docutils, +.wy-table-bordered-all td, +.rst-content table.docutils td, +.wy-table thead th, +.rst-content table.docutils thead th, +.rst-content table.field-list thead th { + border-color: var(--code-border-color); +} + +.wy-table-odd td, +.wy-table-striped tr:nth-child(2n-1) td, +.rst-content table.docutils:not(.field-list) tr:nth-child(2n-1) td { + background-color: var(--table-row-odd-background-color); +} + +/* Override table no-wrap */ +/* The first column cells are not verbose, no need to wrap them */ +.wy-table-responsive table td:not(:nth-child(1)), +.wy-table-responsive table th:not(:nth-child(1)) { + white-space: normal; +} + +/* Make sure not to wrap keyboard shortcuts */ +.wy-table-responsive table td kbd { + white-space: nowrap; +} + +/* Code display tweaks */ + +code, +.rst-content tt, +.rst-content code { + font-size: 14px; + background-color: var(--code-background-color); + border: 1px solid var(--code-border-color); +} + +.rst-content tt.literal, +.rst-content code.literal { + color: var(--code-literal-color); +} + +.rst-content div[class^="highlight"] { + border-color: var(--code-border-color); +} + +.rst-content pre.literal-block, +.rst-content div[class^="highlight"] pre, +.rst-content .linenodiv pre { + /* Increase the font size and line height in code blocks */ + font-size: 14px; + line-height: 1.5; +} + +/* Code tab display tweaks */ + +.ui.tabular.menu .active.item, +.ui.segment { + background-color: var(--code-background-color); +} + +/* Syntax highlighting */ + +/* Remove default red boxes around Pygments errors */ +.highlight .err { + border: none; +} + +.highlight { + background-color: var(--highlight-background-color); +} + +/* Emphasized lines */ +.highlight .hll { + background-color: var(--highlight-background-emph-color); +} + +.highlight .gh /* Generic.Heading */, +.highlight .gu /* Generic.Subheading */, +.highlight .go /* Generic.Output */, +.highlight .gt /* Generic.Traceback */ { + color: var(--highlight-default-color); +} + +.highlight .c /* Comment */, +.highlight .c1 /* Comment.Single */, +.highlight .cm /* Comment.Multiline */, +.highlight .cs /* Comment.Special */ { + color: var(--highlight-comment-color); +} + +.highlight .bp /* Name.Builtin.Pseudo */, +.highlight .k /* Keyword */, +.highlight .kc /* Keyword.Constant */, +.highlight .kd /* Keyword.Declaration */, +.highlight .kn /* Keyword.Namespace */, +.highlight .kp /* Keyword.Pseudo */, +.highlight .kr /* Keyword.Reserved */, +.highlight .kt /* Keyword.Type */, +.highlight .ow /* Operator.Word */ { + color: var(--highlight-keyword-color); +} + +.highlight .ch /* Comment.Hashbang */, +.highlight .cp /* Comment.Preproc */ { + color: var(--highlight-keyword2-color); +} + +.highlight .m /* Literal.Number */, +.highlight .mf /* Literal.Number.Float */, +.highlight .mi /* Literal.Number.Integer */, +.highlight .il /* Literal.Number.Integer.Long */, +.highlight .mb /* Literal.Number.Bin */, +.highlight .mh /* Literal.Number.Hex */, +.highlight .mo /* Literal.Number.Oct */ { + color: var(--highlight-number-color); +} + +.highlight .na /* Name.Attribute */, +.highlight .nd /* Name.Decorator */, +.highlight .ni /* Name.Entity */, +.highlight .nl /* Name.Label */ { + color: var(--highlight-decorator-color); +} + +.highlight .nb /* Name.Builtin */, +.highlight .ne /* Name.Exception */ { + color: var(--highlight-type-color); +} + +.highlight .nc /* Name.Class */, +.highlight .nn /* Name.Namespace */, +.highlight .no /* Name.Constant */, +.highlight .nv /* Name.Variable */, +.highlight .vc /* Name.Variable.Class */, +.highlight .vg /* Name.Variable.Global */, +.highlight .vi /* Name.Variable.Instance */, +.highlight .vm /* Name.Variable.Magic */ { + color: var(--highlight-type2-color); +} + +.highlight .nf /* Name.Function */, +.highlight .fm /* Name.Function.Magic */, +.highlight .nt /* Name.Tag */ { + color: var(--highlight-function-color); +} + +.highlight .o /* Operator */, +.highlight .si /* Literal.String.Interpol */, +.highlight .sx /* Literal.String.Other */, +.highlight .sr /* Literal.String.Regex */, +.highlight .ss /* Literal.String.Symbol */ { + color: var(--highlight-operator-color); +} + +.highlight .cpf/* Comment.PreprocFile */, +.highlight .s /* Literal.String */, +.highlight .s1 /* Literal.String.Single */, +.highlight .s2 /* Literal.String.Double */, +.highlight .sc /* Literal.String.Char */, +.highlight .se /* Literal.String.Escape */, +.highlight .sa /* Literal.String.Affix */, +.highlight .sb /* Literal.String.Backtick */, +.highlight .dl /* Literal.String.Delimiter */, +.highlight .sd /* Literal.String.Doc */, +.highlight .sh /* Literal.String.Heredoc */ { + color: var(--highlight-string-color); +} + +/* Admonition tweaks */ + +.rst-content .admonition.note, +.rst-content .admonition.seealso { + background-color: var(--admonition-note-background-color); + color: var(--admonition-note-color); +} + +.rst-content .admonition.note .admonition-title, +.rst-content .admonition.seealso .admonition-title { + background-color: var(--admonition-note-title-background-color); + color: var(--admonition-note-title-color); +} + +.rst-content .admonition.attention, +.rst-content .admonition.caution, +.rst-content .admonition.warning { + background-color: var(--admonition-attention-background-color); + color: var(--admonition-attention-color); +} + +.rst-content .admonition.attention .admonition-title, +.rst-content .admonition.caution .admonition-title, +.rst-content .admonition.warning .admonition-title { + background-color: var(--admonition-attention-title-background-color); + color: var(--admonition-attention-title-color); +} + +.rst-content .admonition.danger { + background-color: var(--admonition-danger-background-color); + color: var(--admonition-danger-color); +} + +.rst-content .admonition.danger .admonition-title { + background-color: var(--admonition-danger-title-background-color); + color: var(--admonition-danger-title-color); +} + +.rst-content .admonition.tip, +.rst-content .admonition.important { + background-color: var(--admonition-tip-background-color); + color: var(--admonition-tip-color); +} + +.rst-content .admonition.tip .admonition-title, +.rst-content .admonition.important .admonition-title { + background-color: var(--admonition-tip-title-background-color); + color: var(--admonition-tip-title-color); +} + +/* Keyboard shortcuts tweaks */ +kbd, .kbd { + background-color: var(--kbd-background-color); + border: 1px solid var(--kbd-outline-color); + border-radius: 3px; + box-shadow: inset 0 -1px 0 var(--kbd-shadow-color); + color: var(--kbd-text-color); + display: inline-block; + font-size: 12px; + line-height: 11px; + padding: 4px 5px; + vertical-align: middle; +} + +/* Unset excessive styles for nested kbd tags. */ +kbd.compound > kbd, +kbd.compound > .kbd, +.kbd.compound > kbd, +.kbd.compound > .kbd { + border: none; + box-shadow: none; + padding: 0; +} + +/* Buttons */ + +.btn-neutral { + background-color: var(--btn-neutral-background-color) !important; + color: var(--body-color) !important; +} + +.btn-neutral:hover { + background-color: var(--btn-neutral-hover-background-color) !important; +} + +.btn-neutral:visited { + color: var(--body-color) !important; +} + +/* Navigation bar logo and search */ + +.logo { + opacity: var(--logo-opacity); +} + +.wy-side-nav-search > a img.logo { + /* Fixed size to prevent reflows and support hiDPI displays */ + /* A 5 pixel margin is added on each side. The logo itself displays at 200×200 at 100% scaling. */ + width: 210px; + height: 210px; +} + +.wy-side-nav-search { + background-color: var(--navbar-background-color); +} + +.wy-side-nav-search.fixed { + position: fixed; +} + +@media only screen and (min-width: 769px) { + /* Simulate a drop shadow that only affects the bottom edge */ + /* This is used to indicate the search bar is fixed */ + .wy-side-nav-search.fixed-and-scrolled::after { + content: ''; + position: absolute; + left: 0; + bottom: -8px; + width: 300px; + height: 8px; + pointer-events: none; + background: linear-gradient(hsla(0, 0%, 0%, 0.2), transparent); + } +} + +.wy-side-nav-search > a:hover, +.wy-side-nav-search .wy-dropdown > a:hover { + background-color: var(--navbar-background-color-hover); +} + +.wy-side-nav-search > a:active, +.wy-side-nav-search .wy-dropdown > a:active { + background-color: var(--navbar-background-color-active); +} + +.wy-side-nav-search input[type="text"] { + background-color: var(--input-background-color); + color: var(--body-color); + /* Avoid reflowing when toggling the focus state */ + border: 2px solid transparent; + box-shadow: none; + /* Make visual feedback instant */ + transition: none; + font-size: 14px; +} + +.wy-side-nav-search input[type="text"]:focus { + border: 2px solid var(--input-focus-border-color); +} + +.wy-side-nav-search input[type="text"]::placeholder { + color: var(--body-color); + opacity: 0.55; +} + +/* Navigation bar */ + +.wy-nav-side { + background-color: var(--navbar-background-color); +} + +@media only screen and (min-width: 769px) { + .wy-nav-side { + /* Required to center the page on wide displays */ + left: inherit; + } +} + +.wy-menu-vertical header, +.wy-menu-vertical p.caption { + color: var(--navbar-heading-color); + + /* Improves the appearance of uppercase text */ + letter-spacing: 0.75px; +} + +/* Mobile navigation */ + +.wy-nav-top, +.wy-nav-top a { + background-color: var(--navbar-background-color); + color: var(--navbar-level-1-color); +} + +/* Version branch label below the logo */ +.wy-side-nav-search > div.version { + color: var(--navbar-level-3-color); + opacity: 0.9; +} + +/* First level of navigation items */ + +.wy-menu-vertical a { + color: var(--navbar-level-1-color); +} + +.wy-menu-vertical a:hover { + background-color: var(--navbar-background-color-hover); + color: var(--navbar-level-1-color); +} + +.wy-menu-vertical a:active { + background-color: var(--navbar-background-color-active); +} + +.wy-menu-vertical li.toctree-l1.current > a { + border: none; +} + +.wy-side-nav-search, .wy-menu-vertical a, .wy-menu-vertical a button.toctree-expand, +.wy-menu-vertical li.toctree-l1 a button.toctree-expand, +.wy-menu-vertical li.toctree-l2 a button.toctree-expand { + color: var(--navbar-level-3-color); + opacity: 0.9; + margin-right: 8px; +} + +.wy-side-nav-search, .wy-menu-vertical a, .wy-menu-vertical a:hover button.toctree-expand, +.wy-menu-vertical li.toctree-l1 a:hover button.toctree-expand, +.wy-menu-vertical li.toctree-l2 a:hover button.toctree-expand { + color: var(--navbar-level-2-color); + opacity: 1; +} + +.wy-side-nav-search, .wy-menu-vertical a, .wy-menu-vertical a:active button.toctree-expand, +.wy-menu-vertical li.toctree-l1 a:active button.toctree-expand, +.wy-menu-vertical li.toctree-l2 a:active button.toctree-expand { + color: var(--navbar-level-1-color); + opacity: 1; +} + +/* Second (and higher) levels of navigation items */ + +.wy-menu-vertical li.current a { + /* Make long words always display on a single line, keep wrapping for multiple words */ + /* This fixes the class reference titles' display with very long class names */ + display: flex; +} + +.wy-menu-vertical li.current a, +.wy-menu-vertical li.toctree-l2.current > a, +.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a, +.wy-menu-vertical li.toctree-l2.current li.toctree-l4 > a { + background-color: var(--navbar-current-background-color); + color: var(--navbar-level-2-color); + border-color: var(--navbar-current-background-color); +} + +.wy-menu-vertical li.current a:hover, +.wy-menu-vertical li.toctree-l2.current > a:hover, +.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:hover, +.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a:hover { + background-color: var(--navbar-current-background-color-hover); +} + +.wy-menu-vertical li.current a:active, +.wy-menu-vertical li.toctree-l2.current > a:active, +.wy-menu-vertical li.toctree-l2.current li.toctree-l3 > a:active, +.wy-menu-vertical li.toctree-l3.current li.toctree-l4 > a:active { + background-color: var(--navbar-current-background-color-active); +} + +.wy-menu-vertical a { + /* This overrides 8px margin added in other multi-selector rules */ + margin-right: 0; +} + +/* Banner panel in sidebar */ +.wy-nav-side .ethical-rtd.fixed { + position: fixed; +} + +/* Version selector (only visible on Read the Docs) */ + +.rst-versions { + background-color: var(--navbar-current-background-color); +} + +@media only screen and (min-width: 769px) { + .rst-versions { + /* Required to center the page on wide displays */ + left: inherit; + } +} + +.rst-versions a, +.rst-versions .rst-current-version, +.rst-versions .rst-current-version .fa, +.rst-versions .rst-other-versions dd a { + color: var(--navbar-level-1-color); +} + +.rst-versions .rst-other-versions small { + color: var(--navbar-level-3-color); +} + +.rst-versions .rst-other-versions dd a:hover { + text-decoration: underline; +} + +.rst-versions .rst-other-versions { + color: var(--navbar-heading-color); +} + +.rst-versions .rst-current-version { + background-color: var(--navbar-current-background-color); +} + +.rst-versions .rst-current-version:hover { + background-color: var(--navbar-current-background-color-hover); +} + +.rst-versions .rst-current-version:active { + background-color: var(--navbar-current-background-color-active); +} + +/* Hide the obnoxious automatic highlight in search results */ +.rst-content .highlighted { + background-color: transparent; + font-weight: inherit; + padding: 0; +} + +/* Allows the scrollbar to be shown in the sidebar */ +@media only screen and (min-width: 769px) { + .wy-side-scroll { + overflow: hidden; + } + + .wy-nav-side .wy-side-scroll .ethical-rtd { + width: calc(300px - 1.25em); + padding: 0 0 0 1em; + } +} +.wy-menu.wy-menu-vertical { + overflow-y: auto; + overflow-x: hidden; + max-height: calc(100% - 348px); +} +@media screen and (max-width: 768px) { + .wy-nav-side { + padding-bottom: 44px; + } + .wy-menu.wy-menu-vertical { + overflow-y: initial; + max-height: initial; + } +} + +/* Scrollbar styling */ +.wy-menu.wy-menu-vertical { + scrollbar-color: var(--navbar-scrollbar-color) var(--navbar-scrollbar-background); +} +.wy-menu.wy-menu-vertical::-webkit-scrollbar { + width: .75rem; +} +.wy-menu.wy-menu-vertical::-webkit-scrollbar-track { + background-color: var(--navbar-scrollbar-background); +} +.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb { + background-color: var(--navbar-scrollbar-color); +} +/* Firefox does the dimming on hover automatically. We emulate it for Webkit-based browsers. */ +.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb:hover { + background-color: var(--navbar-scrollbar-hover-color); +} +.wy-menu.wy-menu-vertical::-webkit-scrollbar-thumb:active { + background-color: var(--navbar-scrollbar-active-color); +} diff --git a/_static/js/custom.js b/_static/js/custom.js new file mode 100644 index 0000000..f97f684 --- /dev/null +++ b/_static/js/custom.js @@ -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 = $('
'); + $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{v(o.href),t=void 0},l)},n),c&&document.addEventListener("mousedown",function(t){if(performance.now()-e1||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); +}); diff --git a/_templates/breadcrumbs.html b/_templates/breadcrumbs.html new file mode 100644 index 0000000..804ad69 --- /dev/null +++ b/_templates/breadcrumbs.html @@ -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 %} diff --git a/_templates/layout.html b/_templates/layout.html new file mode 100644 index 0000000..fdec13a --- /dev/null +++ b/_templates/layout.html @@ -0,0 +1,19 @@ +{% extends "!layout.html" -%} +{% block linktags -%} + + {% 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("_", "-") -%} + + {% endfor -%} + + + + {% endif -%} + {{ super() }} +{% endblock -%} + +{% block htmltitle -%} +{{ godot_title_prefix }}{{ title|striptags|e }}{{ titlesuffix }} +{% endblock -%} diff --git a/_tools/codespell-ignore-lines.txt b/_tools/codespell-ignore-lines.txt new file mode 100644 index 0000000..7a125d5 --- /dev/null +++ b/_tools/codespell-ignore-lines.txt @@ -0,0 +1 @@ +| te | Telugu | diff --git a/_tools/codespell-ignore.txt b/_tools/codespell-ignore.txt new file mode 100644 index 0000000..aaf1881 --- /dev/null +++ b/_tools/codespell-ignore.txt @@ -0,0 +1,6 @@ +doubleclick +dof +lod +que +raison +uint diff --git a/_tools/format.sh b/_tools/format.sh new file mode 100755 index 0000000..1b0e22f --- /dev/null +++ b/_tools/format.sh @@ -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 '\n" +rm -f patch.patch +exit 1 diff --git a/_tools/list-unused-images.sh b/_tools/list-unused-images.sh new file mode 100644 index 0000000..44c70f6 --- /dev/null +++ b/_tools/list-unused-images.sh @@ -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 diff --git a/about/complying_with_licenses.rst b/about/complying_with_licenses.rst new file mode 100644 index 0000000..663c792 --- /dev/null +++ b/about/complying_with_licenses.rst @@ -0,0 +1,150 @@ +.. _doc_complying_with_licenses: + +Complying with licenses +======================= + +What are licenses? +------------------ + +Godot is created and distributed under the `MIT License `_. +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() ` +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 `_. +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 `_ 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 © The FreeType Project (www.freetype.org). All rights reserved. + +Note that 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 `_ 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 `_ 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 `_ +instead. diff --git a/about/docs_changelog.rst b/about/docs_changelog.rst new file mode 100644 index 0000000..5f9ea44 --- /dev/null +++ b/about/docs_changelog.rst @@ -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 `. 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 ` + - :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` diff --git a/about/faq.rst b/about/faq.rst new file mode 100644 index 0000000..ba01f12 --- /dev/null +++ b/about/faq.rst @@ -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 `_ available under the `OSI-approved `_ 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 `_) 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 `_ as well +as the `LICENSE.txt `_ and `LOGO_LICENSE.txt `_ files +in the Godot repository. + +Also, see `the license page on the Godot website `_. + +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 ` +and :ref:`compiling Godot yourself `. + +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 ` 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 `_ 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 `_ and `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 `. + +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 `__ +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 `__, 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 `_ exporter (Maya, 3DSMax). +If you are using Blender, take a look at our own `Better Collada Exporter `_. + +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 ` +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 ` + 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 ` +and tool scripts. + +Also, see the official blog posts on these topics: + +* `A look at the GDNative architecture `_ +* `GDNative is here! `_ + +You can also take a look at the GDScript implementation, the Godot modules, +as well as the `unofficial Python support `_ 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 `_. +Find an issue that resonates with you, then proceed to the `How to Contribute `_ +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 `_, +`squashing bugs and addressing 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 ` +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 `__ and +`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 `, +but you can still +:ref:`use Godot to create non-game applications by using the editor `. + +.. _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 `_. diff --git a/about/img/eol.png b/about/img/eol.png new file mode 100644 index 0000000..ad9cb36 Binary files /dev/null and b/about/img/eol.png differ diff --git a/about/img/partial.png b/about/img/partial.png new file mode 100644 index 0000000..06f8610 Binary files /dev/null and b/about/img/partial.png differ diff --git a/about/img/supported.png b/about/img/supported.png new file mode 100644 index 0000000..668711c Binary files /dev/null and b/about/img/supported.png differ diff --git a/about/img/unstable.png b/about/img/unstable.png new file mode 100644 index 0000000..6815a73 Binary files /dev/null and b/about/img/unstable.png differ diff --git a/about/index.rst b/about/index.rst new file mode 100644 index 0000000..5a3f599 --- /dev/null +++ b/about/index.rst @@ -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 diff --git a/about/introduction.rst b/about/introduction.rst new file mode 100644 index 0000000..20509d4 --- /dev/null +++ b/about/introduction.rst @@ -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 ` 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 `, +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 `_ 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 +` 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 `_ markup +language and then compiled into a static website/offline document using the +open source `Sphinx `_ and `ReadTheDocs +`_ tools. + +.. note:: You can contribute to Godot's documentation by opening issue tickets + or sending patches via pull requests on its GitHub + `source repository `_, or + translating it into your language on `Hosted Weblate + `_. + +All the contents are under the permissive Creative Commons Attribution 3.0 +(`CC-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 + ` 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 `_. + +Have fun reading and making games with Godot Engine! diff --git a/about/list_of_features.rst b/about/list_of_features.rst new file mode 100644 index 0000000..8ee4f64 --- /dev/null +++ b/about/list_of_features.rst @@ -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 `__ + 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 `. +- :ref:`Headless Linux and macOS 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 ` such as + Visual Studio Code or Vim. +- GDScript :ref:`debugger `. + + - 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 ` 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 `. +- :ref:`Constructive solid geometry ` (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 `. +- 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 `. +- Many 2D and 3D linear algebra data types such as vectors and transforms. + +:ref:`GDScript: ` + +- :ref:`High-level interpreted language ` with + :ref:`optional static typing `. +- Syntax inspired by Python. +- Syntax highlighting is provided on GitHub. +- :ref:`Use threads ` to perform asynchronous actions + or make use of multiple processor cores. + +:ref:`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: ` + +- :ref:`Graph-based visual scripting language `. +- 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 ` 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 `. + +**Formats:** + +- *Images:* See :ref:`doc_import_images`. +- *Audio:* + + - WAV with optional IMA-ADPCM compression. + - Ogg Vorbis. + - MP3. + +- *3D scenes:* + + - glTF 2.0 *(recommended)*. + - `ESCN `__ + (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 ` + or :ref:`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 `. +- 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 ` layouts. + - :ref:`Grid ` layouts. + - :ref:`Margin ` and :ref:`centered ` + layouts. + - :ref:`Draggable splitter ` 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 ` 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` that can be read + by the engine to support mods and DLCs. + +Miscellaneous +^^^^^^^^^^^^^ + +- :ref:`Low-level access to 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 `__ + are available for Bash, zsh and fish. + +- Support for :ref:`C++ modules ` statically linked + into the engine binary. +- Engine and editor written in C++03. + + - Can be :ref:`compiled ` 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 `. + +.. seealso:: + + The `Godot proposals repository `__ + lists features that have been requested by the community and may be implemented + in future Godot releases. diff --git a/about/release_policy.rst b/about/release_policy.rst new file mode 100644 index 0000000..fc3f88e --- /dev/null +++ b/about/release_policy.rst @@ -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 `__ 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. diff --git a/about/troubleshooting.rst b/about/troubleshooting.rst new file mode 100644 index 0000000..9ac306b --- /dev/null +++ b/about/troubleshooting.rst @@ -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 `__ 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 `__ 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 `__ 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 `__ +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 `. + +The project window doesn't appear centered when I run the project. +------------------------------------------------------------------ + +This is a `known bug `__. 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 `. + +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 +` 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. diff --git a/classes/class_@gdscript.rst b/classes/class_@gdscript.rst new file mode 100644 index 0000000..9f09e3e --- /dev/null +++ b/classes/class_@gdscript.rst @@ -0,0 +1,1657 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the @GDScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_@GDScript: + +@GDScript +========= + +Built-in GDScript functions. + +Description +----------- + +List of core built-in GDScript functions. Math functions and other utilities. Everything else is provided by objects. (Keywords: builtin, built in, global functions.) + +Methods +------- + ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color8` **(** :ref:`int` r8, :ref:`int` g8, :ref:`int` b8, :ref:`int` a8=255 **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`ColorN` **(** :ref:`String` name, :ref:`float` alpha=1.0 **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`abs` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`acos` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`asin` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`assert` **(** :ref:`bool` condition, :ref:`String` message="" **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`atan` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`atan2` **(** :ref:`float` y, :ref:`float` x **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`bytes2var` **(** :ref:`PoolByteArray` bytes, :ref:`bool` allow_objects=false **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`cartesian2polar` **(** :ref:`float` x, :ref:`float` y **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`ceil` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`char` **(** :ref:`int` code **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`clamp` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`convert` **(** :ref:`Variant` what, :ref:`int` type **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cos` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cosh` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`db2linear` **(** :ref:`float` db **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`decimals` **(** :ref:`float` step **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dectime` **(** :ref:`float` value, :ref:`float` amount, :ref:`float` step **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`deg2rad` **(** :ref:`float` deg **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`dict2inst` **(** :ref:`Dictionary` dict **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`ease` **(** :ref:`float` s, :ref:`float` curve **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`exp` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`floor` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`fmod` **(** :ref:`float` a, :ref:`float` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`fposmod` **(** :ref:`float` a, :ref:`float` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`FuncRef` | :ref:`funcref` **(** :ref:`Object` instance, :ref:`String` funcname **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_stack` **(** **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** :ref:`Variant` var **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`inst2dict` **(** :ref:`Object` inst **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`instance_from_id` **(** :ref:`int` instance_id **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`inverse_lerp` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`float` a, :ref:`float` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_inf` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_instance_valid` **(** :ref:`Object` instance **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_nan` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_zero_approx` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`len` **(** :ref:`Variant` var **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`lerp` **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`float` weight **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`lerp_angle` **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`linear2db` **(** :ref:`float` nrg **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`load` **(** :ref:`String` path **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`log` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`max` **(** :ref:`float` a, :ref:`float` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`min` **(** :ref:`float` a, :ref:`float` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`move_toward` **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`nearest_po2` **(** :ref:`int` value **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`ord` **(** :ref:`String` char **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`parse_json` **(** :ref:`String` json **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`polar2cartesian` **(** :ref:`float` r, :ref:`float` th **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`posmod` **(** :ref:`int` a, :ref:`int` b **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`pow` **(** :ref:`float` base, :ref:`float` exp **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`preload` **(** :ref:`String` path **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_debug` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_stack` **(** **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printerr` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printraw` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`prints` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`printt` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_error` **(** :ref:`String` message **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_warning` **(** :ref:`String` message **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rad2deg` **(** :ref:`float` rad **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rand_range` **(** :ref:`float` from, :ref:`float` to **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`rand_seed` **(** :ref:`int` seed **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randf` **(** **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`randi` **(** **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`randomize` **(** **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`range` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`range_lerp` **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`round` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seed` **(** :ref:`int` seed **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sign` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sin` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sinh` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`smoothstep` **(** :ref:`float` from, :ref:`float` to, :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`sqrt` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`step_decimals` **(** :ref:`float` step **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`stepify` **(** :ref:`float` s, :ref:`float` step **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`str` **(** ... **)** |vararg| | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`str2var` **(** :ref:`String` string **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tan` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tanh` **(** :ref:`float` s **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_json` **(** :ref:`Variant` var **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`type_exists` **(** :ref:`String` type **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`typeof` **(** :ref:`Variant` what **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`validate_json` **(** :ref:`String` json **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`var2bytes` **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`var2str` **(** :ref:`Variant` var **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`WeakRef` | :ref:`weakref` **(** :ref:`Object` obj **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`wrapf` **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`wrapi` **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`GDScriptFunctionState` | :ref:`yield` **(** :ref:`Object` object=null, :ref:`String` signal="" **)** | ++-----------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_@GDScript_constant_PI: + +.. _class_@GDScript_constant_TAU: + +.. _class_@GDScript_constant_INF: + +.. _class_@GDScript_constant_NAN: + +- **PI** = **3.141593** --- Constant that represents how many times the diameter of a circle fits around its perimeter. This is equivalent to ``TAU / 2``. + +- **TAU** = **6.283185** --- The circle constant, the circumference of the unit circle in radians. This is equivalent to ``PI * 2``, or 360 degrees in rotations. + +- **INF** = **inf** --- Positive floating-point infinity. This is the result of floating-point division when the divisor is ``0.0``. For negative infinity, use ``-INF``. Dividing by ``-0.0`` will result in negative infinity if the numerator is positive, so dividing by ``0.0`` is not the same as dividing by ``-0.0`` (despite ``0.0 == -0.0`` returning ``true``). + +**Note:** Numeric infinity is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer number by ``0`` will not result in :ref:`INF` and will result in a run-time error instead. + +- **NAN** = **nan** --- "Not a Number", an invalid floating-point value. :ref:`NAN` has special properties, including that it is not equal to itself (``NAN == NAN`` returns ``false``). It is output by some invalid operations, such as dividing floating-point ``0.0`` by ``0.0``. + +**Note:** "Not a Number" is only a concept with floating-point numbers, and has no equivalent for integers. Dividing an integer ``0`` by ``0`` will not result in :ref:`NAN` and will result in a run-time error instead. + +Method Descriptions +------------------- + +.. _class_@GDScript_method_Color8: + +- :ref:`Color` **Color8** **(** :ref:`int` r8, :ref:`int` g8, :ref:`int` b8, :ref:`int` a8=255 **)** + +Returns a color constructed from integer red, green, blue, and alpha channels. Each channel should have 8 bits of information ranging from 0 to 255. + +``r8`` red channel + +``g8`` green channel + +``b8`` blue channel + +``a8`` alpha channel + +:: + + red = Color8(255, 0, 0) + +---- + +.. _class_@GDScript_method_ColorN: + +- :ref:`Color` **ColorN** **(** :ref:`String` name, :ref:`float` alpha=1.0 **)** + +Returns a color according to the standardized ``name`` with ``alpha`` ranging from 0 to 1. + +:: + + red = ColorN("red", 1) + +Supported color names are the same as the constants defined in :ref:`Color`. + +---- + +.. _class_@GDScript_method_abs: + +- :ref:`float` **abs** **(** :ref:`float` s **)** + +Returns the absolute value of parameter ``s`` (i.e. positive value). + +:: + + a = abs(-1) # a is 1 + +---- + +.. _class_@GDScript_method_acos: + +- :ref:`float` **acos** **(** :ref:`float` s **)** + +Returns the arc cosine of ``s`` in radians. Use to get the angle of cosine ``s``. ``s`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`acos` will return :ref:`NAN`. + +:: + + # c is 0.523599 or 30 degrees if converted with rad2deg(s) + c = acos(0.866025) + +---- + +.. _class_@GDScript_method_asin: + +- :ref:`float` **asin** **(** :ref:`float` s **)** + +Returns the arc sine of ``s`` in radians. Use to get the angle of sine ``s``. ``s`` must be between ``-1.0`` and ``1.0`` (inclusive), otherwise, :ref:`asin` will return :ref:`NAN`. + +:: + + # s is 0.523599 or 30 degrees if converted with rad2deg(s) + s = asin(0.5) + +---- + +.. _class_@GDScript_method_assert: + +- void **assert** **(** :ref:`bool` condition, :ref:`String` message="" **)** + +Asserts that the ``condition`` is ``true``. If the ``condition`` is ``false``, an error is generated. When running from the editor, the running project will also be paused until you resume it. This can be used as a stronger form of :ref:`push_error` for reporting errors to project developers or add-on users. + +**Note:** For performance reasons, the code inside :ref:`assert` is only executed in debug builds or when running the project from the editor. Don't include code that has side effects in an :ref:`assert` call. Otherwise, the project will behave differently when exported in release mode. + +The optional ``message`` argument, if given, is shown in addition to the generic "Assertion failed" message. You can use this to provide additional details about why the assertion failed. + +:: + + # Imagine we always want speed to be between 0 and 20. + var speed = -10 + assert(speed < 20) # True, the program will continue + assert(speed >= 0) # False, the program will stop + assert(speed >= 0 and speed < 20) # You can also combine the two conditional statements in one check + assert(speed < 20, "speed = %f, but the speed limit is 20" % speed) # Show a message with clarifying details + +---- + +.. _class_@GDScript_method_atan: + +- :ref:`float` **atan** **(** :ref:`float` s **)** + +Returns the arc tangent of ``s`` in radians. Use it to get the angle from an angle's tangent in trigonometry: ``atan(tan(angle)) == angle``. + +The method cannot know in which quadrant the angle should fall. See :ref:`atan2` if you have both ``y`` and ``x``. + +:: + + a = atan(0.5) # a is 0.463648 + +---- + +.. _class_@GDScript_method_atan2: + +- :ref:`float` **atan2** **(** :ref:`float` y, :ref:`float` x **)** + +Returns the arc tangent of ``y/x`` in radians. Use to get the angle of tangent ``y/x``. To compute the value, the method takes into account the sign of both arguments in order to determine the quadrant. + +Important note: The Y coordinate comes first, by convention. + +:: + + a = atan2(0, -1) # a is 3.141593 + +---- + +.. _class_@GDScript_method_bytes2var: + +- :ref:`Variant` **bytes2var** **(** :ref:`PoolByteArray` bytes, :ref:`bool` allow_objects=false **)** + +Decodes a byte array back to a value. When ``allow_objects`` is ``true`` decoding objects is allowed. + +**WARNING:** Deserialized object can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats (remote code execution). + +---- + +.. _class_@GDScript_method_cartesian2polar: + +- :ref:`Vector2` **cartesian2polar** **(** :ref:`float` x, :ref:`float` y **)** + +Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). + +---- + +.. _class_@GDScript_method_ceil: + +- :ref:`float` **ceil** **(** :ref:`float` s **)** + +Rounds ``s`` upward (towards positive infinity), returning the smallest whole number that is not less than ``s``. + +:: + + a = ceil(1.45) # a is 2.0 + a = ceil(1.001) # a is 2.0 + +See also :ref:`floor`, :ref:`round`, :ref:`stepify`, and :ref:`int`. + +---- + +.. _class_@GDScript_method_char: + +- :ref:`String` **char** **(** :ref:`int` code **)** + +Returns a character as a String of the given Unicode code point (which is compatible with ASCII code). + +:: + + a = char(65) # a is "A" + a = char(65 + 32) # a is "a" + a = char(8364) # a is "€" + +This is the inverse of :ref:`ord`. + +---- + +.. _class_@GDScript_method_clamp: + +- :ref:`float` **clamp** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** + +Clamps ``value`` and returns a value not less than ``min`` and not more than ``max``. + +:: + + a = clamp(1000, 1, 20) # a is 20 + a = clamp(-10, 1, 20) # a is 1 + a = clamp(15, 1, 20) # a is 15 + +---- + +.. _class_@GDScript_method_convert: + +- :ref:`Variant` **convert** **(** :ref:`Variant` what, :ref:`int` type **)** + +Converts from a type to another in the best way possible. The ``type`` parameter uses the :ref:`Variant.Type` values. + +:: + + a = Vector2(1, 0) + # Prints 1 + print(a.length()) + a = convert(a, TYPE_STRING) + # Prints 6 as "(1, 0)" is 6 characters + print(a.length()) + +---- + +.. _class_@GDScript_method_cos: + +- :ref:`float` **cos** **(** :ref:`float` s **)** + +Returns the cosine of angle ``s`` in radians. + +:: + + a = cos(TAU) # a is 1.0 + a = cos(PI) # a is -1.0 + +---- + +.. _class_@GDScript_method_cosh: + +- :ref:`float` **cosh** **(** :ref:`float` s **)** + +Returns the hyperbolic cosine of ``s`` in radians. + +:: + + print(cosh(1)) # Prints 1.543081 + +---- + +.. _class_@GDScript_method_db2linear: + +- :ref:`float` **db2linear** **(** :ref:`float` db **)** + +Converts from decibels to linear energy (audio). + +---- + +.. _class_@GDScript_method_decimals: + +- :ref:`int` **decimals** **(** :ref:`float` step **)** + +Deprecated alias for :ref:`step_decimals`. + +---- + +.. _class_@GDScript_method_dectime: + +- :ref:`float` **dectime** **(** :ref:`float` value, :ref:`float` amount, :ref:`float` step **)** + +**Note:** ``dectime`` has been deprecated and will be removed in Godot 4.0, please use :ref:`move_toward` instead. + +Returns the result of ``value`` decreased by ``step`` \* ``amount``. + +:: + + a = dectime(60, 10, 0.1)) # a is 59.0 + +---- + +.. _class_@GDScript_method_deg2rad: + +- :ref:`float` **deg2rad** **(** :ref:`float` deg **)** + +Converts an angle expressed in degrees to radians. + +:: + + r = deg2rad(180) # r is 3.141593 + +---- + +.. _class_@GDScript_method_dict2inst: + +- :ref:`Object` **dict2inst** **(** :ref:`Dictionary` dict **)** + +Converts a dictionary (previously created with :ref:`inst2dict`) back to an instance. Useful for deserializing. + +---- + +.. _class_@GDScript_method_ease: + +- :ref:`float` **ease** **(** :ref:`float` s, :ref:`float` curve **)** + +Returns an "eased" value of ``x`` based on an easing function defined with ``curve``. This easing function is based on an exponent. The ``curve`` can be any floating-point number, with specific values leading to the following behaviors: + +:: + + - Lower than -1.0 (exclusive): Ease in-out + - 1.0: Linear + - Between -1.0 and 0.0 (exclusive): Ease out-in + - 0.0: Constant + - Between 0.0 to 1.0 (exclusive): Ease out + - 1.0: Linear + - Greater than 1.0 (exclusive): Ease in + +`ease() curve values cheatsheet `__ + +See also :ref:`smoothstep`. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. + +---- + +.. _class_@GDScript_method_exp: + +- :ref:`float` **exp** **(** :ref:`float` s **)** + +The natural exponential function. It raises the mathematical constant **e** to the power of ``s`` and returns it. + +**e** has an approximate value of 2.71828, and can be obtained with ``exp(1)``. + +For exponents to other bases use the method :ref:`pow`. + +:: + + a = exp(2) # Approximately 7.39 + +---- + +.. _class_@GDScript_method_floor: + +- :ref:`float` **floor** **(** :ref:`float` s **)** + +Rounds ``s`` downward (towards negative infinity), returning the largest whole number that is not more than ``s``. + +:: + + a = floor(2.45) # a is 2.0 + a = floor(2.99) # a is 2.0 + a = floor(-2.99) # a is -3.0 + +See also :ref:`ceil`, :ref:`round`, :ref:`stepify`, and :ref:`int`. + +**Note:** This method returns a float. If you need an integer and ``s`` is a non-negative number, you can use ``int(s)`` directly. + +---- + +.. _class_@GDScript_method_fmod: + +- :ref:`float` **fmod** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the floating-point remainder of ``a/b``, keeping the sign of ``a``. + +:: + + r = fmod(7, 5.5) # r is 1.5 + +For the integer remainder operation, use the % operator. + +---- + +.. _class_@GDScript_method_fposmod: + +- :ref:`float` **fposmod** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the floating-point modulus of ``a/b`` that wraps equally in positive and negative. + +:: + + for i in 7: + var x = 0.5 * i - 1.5 + print("%4.1f %4.1f %4.1f" % [x, fmod(x, 1.5), fposmod(x, 1.5)]) + +Produces: + +:: + + -1.5 -0.0 0.0 + -1.0 -1.0 0.5 + -0.5 -0.5 1.0 + 0.0 0.0 0.0 + 0.5 0.5 0.5 + 1.0 1.0 1.0 + 1.5 0.0 0.0 + +---- + +.. _class_@GDScript_method_funcref: + +- :ref:`FuncRef` **funcref** **(** :ref:`Object` instance, :ref:`String` funcname **)** + +Returns a reference to the specified function ``funcname`` in the ``instance`` node. As functions aren't first-class objects in GDscript, use ``funcref`` to store a :ref:`FuncRef` in a variable and call it later. + +:: + + func foo(): + return("bar") + + a = funcref(self, "foo") + print(a.call_func()) # Prints bar + +---- + +.. _class_@GDScript_method_get_stack: + +- :ref:`Array` **get_stack** **(** **)** + +Returns an array of dictionaries representing the current call stack. + +:: + + func _ready(): + foo() + + func foo(): + bar() + + func bar(): + print(get_stack()) + +would print + +:: + + [{function:bar, line:12, source:res://script.gd}, {function:foo, line:9, source:res://script.gd}, {function:_ready, line:6, source:res://script.gd}] + +---- + +.. _class_@GDScript_method_hash: + +- :ref:`int` **hash** **(** :ref:`Variant` var **)** + +Returns the integer hash of the variable passed. + +:: + + print(hash("a")) # Prints 177670 + +---- + +.. _class_@GDScript_method_inst2dict: + +- :ref:`Dictionary` **inst2dict** **(** :ref:`Object` inst **)** + +Returns the passed instance converted to a dictionary (useful for serializing). + +:: + + var foo = "bar" + func _ready(): + var d = inst2dict(self) + print(d.keys()) + print(d.values()) + +Prints out: + +:: + + [@subpath, @path, foo] + [, res://test.gd, bar] + +---- + +.. _class_@GDScript_method_instance_from_id: + +- :ref:`Object` **instance_from_id** **(** :ref:`int` instance_id **)** + +Returns the Object that corresponds to ``instance_id``. All Objects have a unique instance ID. + +:: + + var foo = "bar" + func _ready(): + var id = get_instance_id() + var inst = instance_from_id(id) + print(inst.foo) # Prints bar + +---- + +.. _class_@GDScript_method_inverse_lerp: + +- :ref:`float` **inverse_lerp** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** + +Returns an interpolation or extrapolation factor considering the range specified in ``from`` and ``to``, and the interpolated value specified in ``weight``. The returned value will be between ``0.0`` and ``1.0`` if ``weight`` is between ``from`` and ``to`` (inclusive). If ``weight`` is located outside this range, then an extrapolation factor will be returned (return value lower than ``0.0`` or greater than ``1.0``). + +:: + + # The interpolation ratio in the `lerp()` call below is 0.75. + var middle = lerp(20, 30, 0.75) + # `middle` is now 27.5. + # Now, we pretend to have forgotten the original ratio and want to get it back. + var ratio = inverse_lerp(20, 30, 27.5) + # `ratio` is now 0.75. + +See also :ref:`lerp` which performs the reverse of this operation. + +---- + +.. _class_@GDScript_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`float` a, :ref:`float` b **)** + +Returns ``true`` if ``a`` and ``b`` are approximately equal to each other. + +Here, approximately equal means that ``a`` and ``b`` are within a small internal epsilon of each other, which scales with the magnitude of the numbers. + +Infinity values of the same sign are considered equal. + +---- + +.. _class_@GDScript_method_is_inf: + +- :ref:`bool` **is_inf** **(** :ref:`float` s **)** + +Returns whether ``s`` is an infinity value (either positive infinity or negative infinity). + +---- + +.. _class_@GDScript_method_is_instance_valid: + +- :ref:`bool` **is_instance_valid** **(** :ref:`Object` instance **)** + +Returns whether ``instance`` is a valid object (e.g. has not been deleted from memory). + +---- + +.. _class_@GDScript_method_is_nan: + +- :ref:`bool` **is_nan** **(** :ref:`float` s **)** + +Returns whether ``s`` is a NaN ("Not a Number" or invalid) value. + +---- + +.. _class_@GDScript_method_is_zero_approx: + +- :ref:`bool` **is_zero_approx** **(** :ref:`float` s **)** + +Returns ``true`` if ``s`` is zero or almost zero. + +This method is faster than using :ref:`is_equal_approx` with one value as zero. + +---- + +.. _class_@GDScript_method_len: + +- :ref:`int` **len** **(** :ref:`Variant` var **)** + +Returns length of Variant ``var``. Length is the character count of String, element count of Array, size of Dictionary, etc. + +**Note:** Generates a fatal error if Variant can not provide a length. + +:: + + a = [1, 2, 3, 4] + len(a) # Returns 4 + +---- + +.. _class_@GDScript_method_lerp: + +- :ref:`Variant` **lerp** **(** :ref:`Variant` from, :ref:`Variant` to, :ref:`float` weight **)** + +Linearly interpolates between two values by the factor defined in ``weight``. To perform interpolation, ``weight`` should be between ``0.0`` and ``1.0`` (inclusive). However, values outside this range are allowed and can be used to perform *extrapolation*. + +If the ``from`` and ``to`` arguments are of type :ref:`int` or :ref:`float`, the return value is a :ref:`float`. + +If both are of the same vector type (:ref:`Vector2`, :ref:`Vector3` or :ref:`Color`), the return value will be of the same type (``lerp`` then calls the vector type's ``linear_interpolate`` method). + +:: + + lerp(0, 4, 0.75) # Returns 3.0 + lerp(Vector2(1, 5), Vector2(3, 2), 0.5) # Returns Vector2(2, 3.5) + +See also :ref:`inverse_lerp` which performs the reverse of this operation. To perform eased interpolation with :ref:`lerp`, combine it with :ref:`ease` or :ref:`smoothstep`. + +---- + +.. _class_@GDScript_method_lerp_angle: + +- :ref:`float` **lerp_angle** **(** :ref:`float` from, :ref:`float` to, :ref:`float` weight **)** + +Linearly interpolates between two angles (in radians) by a normalized value. + +Similar to :ref:`lerp`, but interpolates correctly when the angles wrap around :ref:`TAU`. To perform eased interpolation with :ref:`lerp_angle`, combine it with :ref:`ease` or :ref:`smoothstep`. + +:: + + extends Sprite + var elapsed = 0.0 + func _process(delta): + var min_angle = deg2rad(0.0) + var max_angle = deg2rad(90.0) + rotation = lerp_angle(min_angle, max_angle, elapsed) + elapsed += delta + +---- + +.. _class_@GDScript_method_linear2db: + +- :ref:`float` **linear2db** **(** :ref:`float` nrg **)** + +Converts from linear energy to decibels (audio). This can be used to implement volume sliders that behave as expected (since volume isn't linear). Example: + +:: + + # "Slider" refers to a node that inherits Range such as HSlider or VSlider. + # Its range must be configured to go from 0 to 1. + # Change the bus name if you'd like to change the volume of a specific bus only. + AudioServer.set_bus_volume_db(AudioServer.get_bus_index("Master"), linear2db($Slider.value)) + +---- + +.. _class_@GDScript_method_load: + +- :ref:`Resource` **load** **(** :ref:`String` path **)** + +Loads a resource from the filesystem located at ``path``. The resource is loaded on the method call (unless it's referenced already elsewhere, e.g. in another script or in the scene), which might cause slight delay, especially when loading scenes. To avoid unnecessary delays when loading something multiple times, either store the resource in a variable or use :ref:`preload`. + +**Note:** Resource paths can be obtained by right-clicking on a resource in the FileSystem dock and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. + +:: + + # Load a scene called main located in the root of the project directory and cache it in a variable. + var main = load("res://main.tscn") # main will contain a PackedScene resource. + +**Important:** The path must be absolute, a local path will just return ``null``. + +This method is a simplified version of :ref:`ResourceLoader.load`, which can be used for more advanced scenarios. + +---- + +.. _class_@GDScript_method_log: + +- :ref:`float` **log** **(** :ref:`float` s **)** + +Natural logarithm. The amount of time needed to reach a certain level of continuous growth. + +**Note:** This is not the same as the "log" function on most calculators, which uses a base 10 logarithm. + +:: + + log(10) # Returns 2.302585 + +**Note:** The logarithm of ``0`` returns ``-inf``, while negative values return ``-nan``. + +---- + +.. _class_@GDScript_method_max: + +- :ref:`float` **max** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the maximum of two values. + +:: + + max(1, 2) # Returns 2 + max(-3.99, -4) # Returns -3.99 + +---- + +.. _class_@GDScript_method_min: + +- :ref:`float` **min** **(** :ref:`float` a, :ref:`float` b **)** + +Returns the minimum of two values. + +:: + + min(1, 2) # Returns 1 + min(-3.99, -4) # Returns -4 + +---- + +.. _class_@GDScript_method_move_toward: + +- :ref:`float` **move_toward** **(** :ref:`float` from, :ref:`float` to, :ref:`float` delta **)** + +Moves ``from`` toward ``to`` by the ``delta`` value. + +Use a negative ``delta`` value to move away. + +:: + + move_toward(5, 10, 4) # Returns 9 + move_toward(10, 5, 4) # Returns 6 + move_toward(10, 5, -1.5) # Returns 11.5 + +---- + +.. _class_@GDScript_method_nearest_po2: + +- :ref:`int` **nearest_po2** **(** :ref:`int` value **)** + +Returns the nearest equal or larger power of 2 for integer ``value``. + +In other words, returns the smallest value ``a`` where ``a = pow(2, n)`` such that ``value <= a`` for some non-negative integer ``n``. + +:: + + nearest_po2(3) # Returns 4 + nearest_po2(4) # Returns 4 + nearest_po2(5) # Returns 8 + + nearest_po2(0) # Returns 0 (this may not be what you expect) + nearest_po2(-1) # Returns 0 (this may not be what you expect) + +**WARNING:** Due to the way it is implemented, this function returns ``0`` rather than ``1`` for non-positive values of ``value`` (in reality, 1 is the smallest integer power of 2). + +---- + +.. _class_@GDScript_method_ord: + +- :ref:`int` **ord** **(** :ref:`String` char **)** + +Returns an integer representing the Unicode code point of the given Unicode character ``char``. + +:: + + a = ord("A") # a is 65 + a = ord("a") # a is 97 + a = ord("€") # a is 8364 + +This is the inverse of :ref:`char`. + +---- + +.. _class_@GDScript_method_parse_json: + +- :ref:`Variant` **parse_json** **(** :ref:`String` json **)** + +Parse JSON text to a Variant. (Use :ref:`typeof` to check if the Variant's type is what you expect.) + +**Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, parsing a JSON text will convert all numerical values to :ref:`float` types. + +**Note:** JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: + +:: + + var p = JSON.parse('["hello", "world", "!"]') + if typeof(p.result) == TYPE_ARRAY: + print(p.result[0]) # Prints "hello" + else: + push_error("Unexpected results.") + +See also :ref:`JSON` for an alternative way to parse JSON text. + +---- + +.. _class_@GDScript_method_polar2cartesian: + +- :ref:`Vector2` **polar2cartesian** **(** :ref:`float` r, :ref:`float` th **)** + +Converts a 2D point expressed in the polar coordinate system (a distance from the origin ``r`` and an angle ``th``) to the cartesian coordinate system (X and Y axis). + +---- + +.. _class_@GDScript_method_posmod: + +- :ref:`int` **posmod** **(** :ref:`int` a, :ref:`int` b **)** + +Returns the integer modulus of ``a/b`` that wraps equally in positive and negative. + +:: + + for i in range(-3, 4): + print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) + +Produces: + +:: + + -3 0 0 + -2 -2 1 + -1 -1 2 + 0 0 0 + 1 1 1 + 2 2 2 + 3 0 0 + +---- + +.. _class_@GDScript_method_pow: + +- :ref:`float` **pow** **(** :ref:`float` base, :ref:`float` exp **)** + +Returns the result of ``base`` raised to the power of ``exp``. + +:: + + pow(2, 5) # Returns 32.0 + +---- + +.. _class_@GDScript_method_preload: + +- :ref:`Resource` **preload** **(** :ref:`String` path **)** + +Returns a :ref:`Resource` from the filesystem located at ``path``. The resource is loaded during script parsing, i.e. is loaded with the script and :ref:`preload` effectively acts as a reference to that resource. Note that the method requires a constant path. If you want to load a resource from a dynamic/variable path, use :ref:`load`. + +**Note:** Resource paths can be obtained by right clicking on a resource in the Assets Panel and choosing "Copy Path" or by dragging the file from the FileSystem dock into the script. + +:: + + # Instance a scene. + var diamond = preload("res://diamond.tscn").instance() + +---- + +.. _class_@GDScript_method_print: + +- void **print** **(** ... **)** |vararg| + +Converts one or more arguments of any type to string in the best way possible and prints them to the console. + +:: + + a = [1, 2, 3] + print("a", "=", a) # Prints a=[1, 2, 3] + +**Note:** Consider using :ref:`push_error` and :ref:`push_warning` to print error and warning messages instead of :ref:`print`. This distinguishes them from print messages used for debugging purposes, while also displaying a stack trace when an error or warning is printed. + +---- + +.. _class_@GDScript_method_print_debug: + +- void **print_debug** **(** ... **)** |vararg| + +Like :ref:`print`, but prints only when used in debug mode. + +---- + +.. _class_@GDScript_method_print_stack: + +- void **print_stack** **(** **)** + +Prints a stack track at code location, only works when running with debugger turned on. + +Output in the console would look something like this: + +:: + + Frame 0 - res://test.gd:16 in function '_process' + +---- + +.. _class_@GDScript_method_printerr: + +- void **printerr** **(** ... **)** |vararg| + +Prints one or more arguments to strings in the best way possible to standard error line. + +:: + + printerr("prints to stderr") + +---- + +.. _class_@GDScript_method_printraw: + +- void **printraw** **(** ... **)** |vararg| + +Prints one or more arguments to strings in the best way possible to console. No newline is added at the end. + +:: + + printraw("A") + printraw("B") + # Prints AB + +**Note:** Due to limitations with Godot's built-in console, this only prints to the terminal. If you need to print in the editor, use another method, such as :ref:`print`. + +---- + +.. _class_@GDScript_method_prints: + +- void **prints** **(** ... **)** |vararg| + +Prints one or more arguments to the console with a space between each argument. + +:: + + prints("A", "B", "C") # Prints A B C + +---- + +.. _class_@GDScript_method_printt: + +- void **printt** **(** ... **)** |vararg| + +Prints one or more arguments to the console with a tab between each argument. + +:: + + printt("A", "B", "C") # Prints A B C + +---- + +.. _class_@GDScript_method_push_error: + +- void **push_error** **(** :ref:`String` message **)** + +Pushes an error message to Godot's built-in debugger and to the OS terminal. + +:: + + push_error("test error") # Prints "test error" to debugger and terminal as error call + +**Note:** Errors printed this way will not pause project execution. To print an error message and pause project execution in debug builds, use ``assert(false, "test error")`` instead. + +---- + +.. _class_@GDScript_method_push_warning: + +- void **push_warning** **(** :ref:`String` message **)** + +Pushes a warning message to Godot's built-in debugger and to the OS terminal. + +:: + + push_warning("test warning") # Prints "test warning" to debugger and terminal as warning call + +---- + +.. _class_@GDScript_method_rad2deg: + +- :ref:`float` **rad2deg** **(** :ref:`float` rad **)** + +Converts an angle expressed in radians to degrees. + +:: + + rad2deg(0.523599) # Returns 30.0 + +---- + +.. _class_@GDScript_method_rand_range: + +- :ref:`float` **rand_range** **(** :ref:`float` from, :ref:`float` to **)** + +Random range, any floating point value between ``from`` and ``to``. + +:: + + prints(rand_range(0, 1), rand_range(0, 1)) # Prints e.g. 0.135591 0.405263 + +---- + +.. _class_@GDScript_method_rand_seed: + +- :ref:`Array` **rand_seed** **(** :ref:`int` seed **)** + +Random from seed: pass a ``seed``, and an array with both number and new seed is returned. "Seed" here refers to the internal state of the pseudo random number generator. The internal state of the current implementation is 64 bits. + +---- + +.. _class_@GDScript_method_randf: + +- :ref:`float` **randf** **(** **)** + +Returns a random floating point value on the interval ``[0, 1]``. + +:: + + randf() # Returns e.g. 0.375671 + +---- + +.. _class_@GDScript_method_randi: + +- :ref:`int` **randi** **(** **)** + +Returns a random unsigned 32-bit integer. Use remainder to obtain a random value in the interval ``[0, N - 1]`` (where N is smaller than 2^32). + +:: + + randi() # Returns random integer between 0 and 2^32 - 1 + randi() % 20 # Returns random integer between 0 and 19 + randi() % 100 # Returns random integer between 0 and 99 + randi() % 100 + 1 # Returns random integer between 1 and 100 + +---- + +.. _class_@GDScript_method_randomize: + +- void **randomize** **(** **)** + +Randomizes the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. + +:: + + func _ready(): + randomize() + +---- + +.. _class_@GDScript_method_range: + +- :ref:`Array` **range** **(** ... **)** |vararg| + +Returns an array with the given range. Range can be 1 argument ``N`` (0 to ``N`` - 1), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). Returns an empty array if the range isn't valid (e.g. ``range(2, 5, -1)`` or ``range(5, 5, 1)``). + +Returns an array with the given range. ``range()`` can have 1 argument N (``0`` to ``N - 1``), two arguments (``initial``, ``final - 1``) or three arguments (``initial``, ``final - 1``, ``increment``). ``increment`` can be negative. If ``increment`` is negative, ``final - 1`` will become ``final + 1``. Also, the initial value must be greater than the final value for the loop to run. + +:: + + print(range(4)) + print(range(2, 5)) + print(range(0, 6, 2)) + +Output: + +:: + + [0, 1, 2, 3] + [2, 3, 4] + [0, 2, 4] + +To iterate over an :ref:`Array` backwards, use: + +:: + + var array = [3, 6, 9] + var i := array.size() - 1 + while i >= 0: + print(array[i]) + i -= 1 + +Output: + +:: + + 9 + 6 + 3 + +---- + +.. _class_@GDScript_method_range_lerp: + +- :ref:`float` **range_lerp** **(** :ref:`float` value, :ref:`float` istart, :ref:`float` istop, :ref:`float` ostart, :ref:`float` ostop **)** + +Maps a ``value`` from range ``[istart, istop]`` to ``[ostart, ostop]``. + +:: + + range_lerp(75, 0, 100, -1, 1) # Returns 0.5 + +---- + +.. _class_@GDScript_method_round: + +- :ref:`float` **round** **(** :ref:`float` s **)** + +Rounds ``s`` to the nearest whole number, with halfway cases rounded away from zero. + +:: + + a = round(2.49) # a is 2.0 + a = round(2.5) # a is 3.0 + a = round(2.51) # a is 3.0 + +See also :ref:`floor`, :ref:`ceil`, :ref:`stepify`, and :ref:`int`. + +---- + +.. _class_@GDScript_method_seed: + +- void **seed** **(** :ref:`int` seed **)** + +Sets seed for the random number generator. + +:: + + my_seed = "Godot Rocks" + seed(my_seed.hash()) + +---- + +.. _class_@GDScript_method_sign: + +- :ref:`float` **sign** **(** :ref:`float` s **)** + +Returns the sign of ``s``: -1 or 1. Returns 0 if ``s`` is 0. + +:: + + sign(-6) # Returns -1 + sign(0) # Returns 0 + sign(6) # Returns 1 + +---- + +.. _class_@GDScript_method_sin: + +- :ref:`float` **sin** **(** :ref:`float` s **)** + +Returns the sine of angle ``s`` in radians. + +:: + + sin(0.523599) # Returns 0.5 + +---- + +.. _class_@GDScript_method_sinh: + +- :ref:`float` **sinh** **(** :ref:`float` s **)** + +Returns the hyperbolic sine of ``s``. + +:: + + a = log(2.0) # Returns 0.693147 + sinh(a) # Returns 0.75 + +---- + +.. _class_@GDScript_method_smoothstep: + +- :ref:`float` **smoothstep** **(** :ref:`float` from, :ref:`float` to, :ref:`float` s **)** + +Returns the result of smoothly interpolating the value of ``s`` between ``0`` and ``1``, based on the where ``s`` lies with respect to the edges ``from`` and ``to``. + +The return value is ``0`` if ``s <= from``, and ``1`` if ``s >= to``. If ``s`` lies between ``from`` and ``to``, the returned value follows an S-shaped curve that maps ``s`` between ``0`` and ``1``. + +This S-shaped curve is the cubic Hermite interpolator, given by ``f(y) = 3*y^2 - 2*y^3`` where ``y = (x-from) / (to-from)``. + +:: + + smoothstep(0, 2, -5.0) # Returns 0.0 + smoothstep(0, 2, 0.5) # Returns 0.15625 + smoothstep(0, 2, 1.0) # Returns 0.5 + smoothstep(0, 2, 2.0) # Returns 1.0 + +Compared to :ref:`ease` with a curve value of ``-1.6521``, :ref:`smoothstep` returns the smoothest possible curve with no sudden changes in the derivative. If you need to perform more advanced transitions, use :ref:`Tween` or :ref:`AnimationPlayer`. + +`Comparison between smoothstep() and ease(x, -1.6521) return values `__ + +---- + +.. _class_@GDScript_method_sqrt: + +- :ref:`float` **sqrt** **(** :ref:`float` s **)** + +Returns the square root of ``s``, where ``s`` is a non-negative number. + +:: + + sqrt(9) # Returns 3 + +**Note:** Negative values of ``s`` return NaN. If you need negative inputs, use ``System.Numerics.Complex`` in C#. + +---- + +.. _class_@GDScript_method_step_decimals: + +- :ref:`int` **step_decimals** **(** :ref:`float` step **)** + +Returns the position of the first non-zero digit, after the decimal point. Note that the maximum return value is 10, which is a design decision in the implementation. + +:: + + n = step_decimals(5) # n is 0 + n = step_decimals(1.0005) # n is 4 + n = step_decimals(0.000000005) # n is 9 + +---- + +.. _class_@GDScript_method_stepify: + +- :ref:`float` **stepify** **(** :ref:`float` s, :ref:`float` step **)** + +Snaps float value ``s`` to a given ``step``. This can also be used to round a floating point number to an arbitrary number of decimals. + +:: + + stepify(100, 32) # Returns 96.0 + stepify(3.14159, 0.01) # Returns 3.14 + +See also :ref:`ceil`, :ref:`floor`, :ref:`round`, and :ref:`int`. + +---- + +.. _class_@GDScript_method_str: + +- :ref:`String` **str** **(** ... **)** |vararg| + +Converts one or more arguments of any type to string in the best way possible. + +:: + + var a = [10, 20, 30] + var b = str(a); + len(a) # Returns 3 + len(b) # Returns 12 + +---- + +.. _class_@GDScript_method_str2var: + +- :ref:`Variant` **str2var** **(** :ref:`String` string **)** + +Converts a formatted string that was returned by :ref:`var2str` to the original value. + +:: + + a = '{ "a": 1, "b": 2 }' + b = str2var(a) + print(b["a"]) # Prints 1 + +---- + +.. _class_@GDScript_method_tan: + +- :ref:`float` **tan** **(** :ref:`float` s **)** + +Returns the tangent of angle ``s`` in radians. + +:: + + tan(deg2rad(45)) # Returns 1 + +---- + +.. _class_@GDScript_method_tanh: + +- :ref:`float` **tanh** **(** :ref:`float` s **)** + +Returns the hyperbolic tangent of ``s``. + +:: + + a = log(2.0) # a is 0.693147 + b = tanh(a) # b is 0.6 + +---- + +.. _class_@GDScript_method_to_json: + +- :ref:`String` **to_json** **(** :ref:`Variant` var **)** + +Converts a :ref:`Variant` ``var`` to JSON text and return the result. Useful for serializing data to store or send over the network. + +:: + + # Both numbers below are integers. + a = { "a": 1, "b": 2 } + b = to_json(a) + print(b) # {"a":1, "b":2} + # Both numbers above are floats, even if they display without any decimal places. + +**Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a :ref:`Variant` to JSON text will convert all numerical values to :ref:`float` types. + +See also :ref:`JSON` for an alternative way to convert a :ref:`Variant` to JSON text. + +---- + +.. _class_@GDScript_method_type_exists: + +- :ref:`bool` **type_exists** **(** :ref:`String` type **)** + +Returns whether the given class exists in :ref:`ClassDB`. + +:: + + type_exists("Sprite") # Returns true + type_exists("Variant") # Returns false + +---- + +.. _class_@GDScript_method_typeof: + +- :ref:`int` **typeof** **(** :ref:`Variant` what **)** + +Returns the internal type of the given Variant object, using the :ref:`Variant.Type` values. + +:: + + p = parse_json('["a", "b", "c"]') + if typeof(p) == TYPE_ARRAY: + print(p[0]) # Prints a + else: + print("unexpected results") + +---- + +.. _class_@GDScript_method_validate_json: + +- :ref:`String` **validate_json** **(** :ref:`String` json **)** + +Checks that ``json`` is valid JSON data. Returns an empty string if valid, or an error message otherwise. + +:: + + j = to_json([1, 2, 3]) + v = validate_json(j) + if not v: + print("Valid JSON.") + else: + push_error("Invalid JSON: " + v) + +---- + +.. _class_@GDScript_method_var2bytes: + +- :ref:`PoolByteArray` **var2bytes** **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** + +Encodes a variable value to a byte array. When ``full_objects`` is ``true`` encoding objects is allowed (and can potentially include code). + +---- + +.. _class_@GDScript_method_var2str: + +- :ref:`String` **var2str** **(** :ref:`Variant` var **)** + +Converts a Variant ``var`` to a formatted string that can later be parsed using :ref:`str2var`. + +:: + + a = { "a": 1, "b": 2 } + print(var2str(a)) + +prints + +:: + + { + "a": 1, + "b": 2 + } + +---- + +.. _class_@GDScript_method_weakref: + +- :ref:`WeakRef` **weakref** **(** :ref:`Object` obj **)** + +Returns a weak reference to an object. + +A weak reference to an object is not enough to keep the object alive: when the only remaining references to a referent are weak references, garbage collection is free to destroy the referent and reuse its memory for something else. However, until the object is actually destroyed the weak reference may return the object even if there are no strong references to it. + +---- + +.. _class_@GDScript_method_wrapf: + +- :ref:`float` **wrapf** **(** :ref:`float` value, :ref:`float` min, :ref:`float` max **)** + +Wraps float ``value`` between ``min`` and ``max``. + +Usable for creating loop-alike behavior or infinite surfaces. + +:: + + # Infinite loop between 5.0 and 9.9 + value = wrapf(value + 0.1, 5.0, 10.0) + +:: + + # Infinite rotation (in radians) + angle = wrapf(angle + 0.1, 0.0, TAU) + +:: + + # Infinite rotation (in radians) + angle = wrapf(angle + 0.1, -PI, PI) + +**Note:** If ``min`` is ``0``, this is equivalent to :ref:`fposmod`, so prefer using that instead. + +``wrapf`` is more flexible than using the :ref:`fposmod` approach by giving the user control over the minimum value. + +---- + +.. _class_@GDScript_method_wrapi: + +- :ref:`int` **wrapi** **(** :ref:`int` value, :ref:`int` min, :ref:`int` max **)** + +Wraps integer ``value`` between ``min`` and ``max``. + +Usable for creating loop-alike behavior or infinite surfaces. + +:: + + # Infinite loop between 5 and 9 + frame = wrapi(frame + 1, 5, 10) + +:: + + # result is -2 + var result = wrapi(-6, -5, -1) + +**Note:** If ``min`` is ``0``, this is equivalent to :ref:`posmod`, so prefer using that instead. + +``wrapi`` is more flexible than using the :ref:`posmod` approach by giving the user control over the minimum value. + +---- + +.. _class_@GDScript_method_yield: + +- :ref:`GDScriptFunctionState` **yield** **(** :ref:`Object` object=null, :ref:`String` signal="" **)** + +Stops the function execution and returns the current suspended state to the calling function. + +From the caller, call :ref:`GDScriptFunctionState.resume` on the state to resume execution. This invalidates the state. Within the resumed function, ``yield()`` returns whatever was passed to the ``resume()`` function call. + +If passed an object and a signal, the execution is resumed when the object emits the given signal. In this case, ``yield()`` returns the argument passed to ``emit_signal()`` if the signal takes only one argument, or an array containing all the arguments passed to ``emit_signal()`` if the signal takes multiple arguments. + +You can also use ``yield`` to wait for a function to finish: + +:: + + func _ready(): + yield(countdown(), "completed") # waiting for the countdown() function to complete + print('Ready') + + func countdown(): + yield(get_tree(), "idle_frame") # returns a GDScriptFunctionState object to _ready() + print(3) + yield(get_tree().create_timer(1.0), "timeout") + print(2) + yield(get_tree().create_timer(1.0), "timeout") + print(1) + yield(get_tree().create_timer(1.0), "timeout") + + # prints: + # 3 + # 2 + # 1 + # Ready + +When yielding on a function, the ``completed`` signal will be emitted automatically when the function returns. It can, therefore, be used as the ``signal`` parameter of the ``yield`` method to resume. + +In order to yield on a function, the resulting function should also return a ``GDScriptFunctionState``. Notice ``yield(get_tree(), "idle_frame")`` from the above example. + +.. |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.)` diff --git a/classes/class_@globalscope.rst b/classes/class_@globalscope.rst new file mode 100644 index 0000000..93d578f --- /dev/null +++ b/classes/class_@globalscope.rst @@ -0,0 +1,2474 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the @GlobalScope.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_@GlobalScope: + +@GlobalScope +============ + +Global scope constants and variables. + +Description +----------- + +Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, scancodes, property hints, etc. + +Singletons are also documented here, since they can be accessed from anywhere. + +Properties +---------- + ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ARVRServer` | :ref:`ARVRServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`AudioServer` | :ref:`AudioServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`CameraServer` | :ref:`CameraServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ClassDB` | :ref:`ClassDB` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Engine` | :ref:`Engine` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Geometry` | :ref:`Geometry` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`IP` | :ref:`IP` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Input` | :ref:`Input` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`InputMap` | :ref:`InputMap` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`JSON` | :ref:`JSON` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`JavaClassWrapper` | :ref:`JavaClassWrapper` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`JavaScript` | :ref:`JavaScript` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Marshalls` | :ref:`Marshalls` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`EditorNavigationMeshGenerator` | :ref:`NavigationMeshGenerator` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`OS` | :ref:`OS` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Performance` | :ref:`Performance` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Physics2DServer` | :ref:`Physics2DServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`PhysicsServer` | :ref:`PhysicsServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ProjectSettings` | :ref:`ProjectSettings` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ResourceLoader` | :ref:`ResourceLoader` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`ResourceSaver` | :ref:`ResourceSaver` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`TranslationServer` | :ref:`TranslationServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`VisualScriptEditor` | :ref:`VisualScriptEditor` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`VisualServer` | :ref:`VisualServer` | ++---------------------------------------------------------------------------+-------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_@GlobalScope_Margin: + +.. _class_@GlobalScope_constant_MARGIN_LEFT: + +.. _class_@GlobalScope_constant_MARGIN_TOP: + +.. _class_@GlobalScope_constant_MARGIN_RIGHT: + +.. _class_@GlobalScope_constant_MARGIN_BOTTOM: + +enum **Margin**: + +- **MARGIN_LEFT** = **0** --- Left margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. + +- **MARGIN_TOP** = **1** --- Top margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. + +- **MARGIN_RIGHT** = **2** --- Right margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. + +- **MARGIN_BOTTOM** = **3** --- Bottom margin, usually used for :ref:`Control` or :ref:`StyleBox`-derived classes. + +---- + +.. _enum_@GlobalScope_Corner: + +.. _class_@GlobalScope_constant_CORNER_TOP_LEFT: + +.. _class_@GlobalScope_constant_CORNER_TOP_RIGHT: + +.. _class_@GlobalScope_constant_CORNER_BOTTOM_RIGHT: + +.. _class_@GlobalScope_constant_CORNER_BOTTOM_LEFT: + +enum **Corner**: + +- **CORNER_TOP_LEFT** = **0** --- Top-left corner. + +- **CORNER_TOP_RIGHT** = **1** --- Top-right corner. + +- **CORNER_BOTTOM_RIGHT** = **2** --- Bottom-right corner. + +- **CORNER_BOTTOM_LEFT** = **3** --- Bottom-left corner. + +---- + +.. _enum_@GlobalScope_Orientation: + +.. _class_@GlobalScope_constant_VERTICAL: + +.. _class_@GlobalScope_constant_HORIZONTAL: + +enum **Orientation**: + +- **VERTICAL** = **1** --- General vertical alignment, usually used for :ref:`Separator`, :ref:`ScrollBar`, :ref:`Slider`, etc. + +- **HORIZONTAL** = **0** --- General horizontal alignment, usually used for :ref:`Separator`, :ref:`ScrollBar`, :ref:`Slider`, etc. + +---- + +.. _enum_@GlobalScope_HAlign: + +.. _class_@GlobalScope_constant_HALIGN_LEFT: + +.. _class_@GlobalScope_constant_HALIGN_CENTER: + +.. _class_@GlobalScope_constant_HALIGN_RIGHT: + +enum **HAlign**: + +- **HALIGN_LEFT** = **0** --- Horizontal left alignment, usually for text-derived classes. + +- **HALIGN_CENTER** = **1** --- Horizontal center alignment, usually for text-derived classes. + +- **HALIGN_RIGHT** = **2** --- Horizontal right alignment, usually for text-derived classes. + +---- + +.. _enum_@GlobalScope_VAlign: + +.. _class_@GlobalScope_constant_VALIGN_TOP: + +.. _class_@GlobalScope_constant_VALIGN_CENTER: + +.. _class_@GlobalScope_constant_VALIGN_BOTTOM: + +enum **VAlign**: + +- **VALIGN_TOP** = **0** --- Vertical top alignment, usually for text-derived classes. + +- **VALIGN_CENTER** = **1** --- Vertical center alignment, usually for text-derived classes. + +- **VALIGN_BOTTOM** = **2** --- Vertical bottom alignment, usually for text-derived classes. + +---- + +.. _enum_@GlobalScope_KeyList: + +.. _class_@GlobalScope_constant_KEY_ESCAPE: + +.. _class_@GlobalScope_constant_KEY_TAB: + +.. _class_@GlobalScope_constant_KEY_BACKTAB: + +.. _class_@GlobalScope_constant_KEY_BACKSPACE: + +.. _class_@GlobalScope_constant_KEY_ENTER: + +.. _class_@GlobalScope_constant_KEY_KP_ENTER: + +.. _class_@GlobalScope_constant_KEY_INSERT: + +.. _class_@GlobalScope_constant_KEY_DELETE: + +.. _class_@GlobalScope_constant_KEY_PAUSE: + +.. _class_@GlobalScope_constant_KEY_PRINT: + +.. _class_@GlobalScope_constant_KEY_SYSREQ: + +.. _class_@GlobalScope_constant_KEY_CLEAR: + +.. _class_@GlobalScope_constant_KEY_HOME: + +.. _class_@GlobalScope_constant_KEY_END: + +.. _class_@GlobalScope_constant_KEY_LEFT: + +.. _class_@GlobalScope_constant_KEY_UP: + +.. _class_@GlobalScope_constant_KEY_RIGHT: + +.. _class_@GlobalScope_constant_KEY_DOWN: + +.. _class_@GlobalScope_constant_KEY_PAGEUP: + +.. _class_@GlobalScope_constant_KEY_PAGEDOWN: + +.. _class_@GlobalScope_constant_KEY_SHIFT: + +.. _class_@GlobalScope_constant_KEY_CONTROL: + +.. _class_@GlobalScope_constant_KEY_META: + +.. _class_@GlobalScope_constant_KEY_ALT: + +.. _class_@GlobalScope_constant_KEY_CAPSLOCK: + +.. _class_@GlobalScope_constant_KEY_NUMLOCK: + +.. _class_@GlobalScope_constant_KEY_SCROLLLOCK: + +.. _class_@GlobalScope_constant_KEY_F1: + +.. _class_@GlobalScope_constant_KEY_F2: + +.. _class_@GlobalScope_constant_KEY_F3: + +.. _class_@GlobalScope_constant_KEY_F4: + +.. _class_@GlobalScope_constant_KEY_F5: + +.. _class_@GlobalScope_constant_KEY_F6: + +.. _class_@GlobalScope_constant_KEY_F7: + +.. _class_@GlobalScope_constant_KEY_F8: + +.. _class_@GlobalScope_constant_KEY_F9: + +.. _class_@GlobalScope_constant_KEY_F10: + +.. _class_@GlobalScope_constant_KEY_F11: + +.. _class_@GlobalScope_constant_KEY_F12: + +.. _class_@GlobalScope_constant_KEY_F13: + +.. _class_@GlobalScope_constant_KEY_F14: + +.. _class_@GlobalScope_constant_KEY_F15: + +.. _class_@GlobalScope_constant_KEY_F16: + +.. _class_@GlobalScope_constant_KEY_KP_MULTIPLY: + +.. _class_@GlobalScope_constant_KEY_KP_DIVIDE: + +.. _class_@GlobalScope_constant_KEY_KP_SUBTRACT: + +.. _class_@GlobalScope_constant_KEY_KP_PERIOD: + +.. _class_@GlobalScope_constant_KEY_KP_ADD: + +.. _class_@GlobalScope_constant_KEY_KP_0: + +.. _class_@GlobalScope_constant_KEY_KP_1: + +.. _class_@GlobalScope_constant_KEY_KP_2: + +.. _class_@GlobalScope_constant_KEY_KP_3: + +.. _class_@GlobalScope_constant_KEY_KP_4: + +.. _class_@GlobalScope_constant_KEY_KP_5: + +.. _class_@GlobalScope_constant_KEY_KP_6: + +.. _class_@GlobalScope_constant_KEY_KP_7: + +.. _class_@GlobalScope_constant_KEY_KP_8: + +.. _class_@GlobalScope_constant_KEY_KP_9: + +.. _class_@GlobalScope_constant_KEY_SUPER_L: + +.. _class_@GlobalScope_constant_KEY_SUPER_R: + +.. _class_@GlobalScope_constant_KEY_MENU: + +.. _class_@GlobalScope_constant_KEY_HYPER_L: + +.. _class_@GlobalScope_constant_KEY_HYPER_R: + +.. _class_@GlobalScope_constant_KEY_HELP: + +.. _class_@GlobalScope_constant_KEY_DIRECTION_L: + +.. _class_@GlobalScope_constant_KEY_DIRECTION_R: + +.. _class_@GlobalScope_constant_KEY_BACK: + +.. _class_@GlobalScope_constant_KEY_FORWARD: + +.. _class_@GlobalScope_constant_KEY_STOP: + +.. _class_@GlobalScope_constant_KEY_REFRESH: + +.. _class_@GlobalScope_constant_KEY_VOLUMEDOWN: + +.. _class_@GlobalScope_constant_KEY_VOLUMEMUTE: + +.. _class_@GlobalScope_constant_KEY_VOLUMEUP: + +.. _class_@GlobalScope_constant_KEY_BASSBOOST: + +.. _class_@GlobalScope_constant_KEY_BASSUP: + +.. _class_@GlobalScope_constant_KEY_BASSDOWN: + +.. _class_@GlobalScope_constant_KEY_TREBLEUP: + +.. _class_@GlobalScope_constant_KEY_TREBLEDOWN: + +.. _class_@GlobalScope_constant_KEY_MEDIAPLAY: + +.. _class_@GlobalScope_constant_KEY_MEDIASTOP: + +.. _class_@GlobalScope_constant_KEY_MEDIAPREVIOUS: + +.. _class_@GlobalScope_constant_KEY_MEDIANEXT: + +.. _class_@GlobalScope_constant_KEY_MEDIARECORD: + +.. _class_@GlobalScope_constant_KEY_HOMEPAGE: + +.. _class_@GlobalScope_constant_KEY_FAVORITES: + +.. _class_@GlobalScope_constant_KEY_SEARCH: + +.. _class_@GlobalScope_constant_KEY_STANDBY: + +.. _class_@GlobalScope_constant_KEY_OPENURL: + +.. _class_@GlobalScope_constant_KEY_LAUNCHMAIL: + +.. _class_@GlobalScope_constant_KEY_LAUNCHMEDIA: + +.. _class_@GlobalScope_constant_KEY_LAUNCH0: + +.. _class_@GlobalScope_constant_KEY_LAUNCH1: + +.. _class_@GlobalScope_constant_KEY_LAUNCH2: + +.. _class_@GlobalScope_constant_KEY_LAUNCH3: + +.. _class_@GlobalScope_constant_KEY_LAUNCH4: + +.. _class_@GlobalScope_constant_KEY_LAUNCH5: + +.. _class_@GlobalScope_constant_KEY_LAUNCH6: + +.. _class_@GlobalScope_constant_KEY_LAUNCH7: + +.. _class_@GlobalScope_constant_KEY_LAUNCH8: + +.. _class_@GlobalScope_constant_KEY_LAUNCH9: + +.. _class_@GlobalScope_constant_KEY_LAUNCHA: + +.. _class_@GlobalScope_constant_KEY_LAUNCHB: + +.. _class_@GlobalScope_constant_KEY_LAUNCHC: + +.. _class_@GlobalScope_constant_KEY_LAUNCHD: + +.. _class_@GlobalScope_constant_KEY_LAUNCHE: + +.. _class_@GlobalScope_constant_KEY_LAUNCHF: + +.. _class_@GlobalScope_constant_KEY_UNKNOWN: + +.. _class_@GlobalScope_constant_KEY_SPACE: + +.. _class_@GlobalScope_constant_KEY_EXCLAM: + +.. _class_@GlobalScope_constant_KEY_QUOTEDBL: + +.. _class_@GlobalScope_constant_KEY_NUMBERSIGN: + +.. _class_@GlobalScope_constant_KEY_DOLLAR: + +.. _class_@GlobalScope_constant_KEY_PERCENT: + +.. _class_@GlobalScope_constant_KEY_AMPERSAND: + +.. _class_@GlobalScope_constant_KEY_APOSTROPHE: + +.. _class_@GlobalScope_constant_KEY_PARENLEFT: + +.. _class_@GlobalScope_constant_KEY_PARENRIGHT: + +.. _class_@GlobalScope_constant_KEY_ASTERISK: + +.. _class_@GlobalScope_constant_KEY_PLUS: + +.. _class_@GlobalScope_constant_KEY_COMMA: + +.. _class_@GlobalScope_constant_KEY_MINUS: + +.. _class_@GlobalScope_constant_KEY_PERIOD: + +.. _class_@GlobalScope_constant_KEY_SLASH: + +.. _class_@GlobalScope_constant_KEY_0: + +.. _class_@GlobalScope_constant_KEY_1: + +.. _class_@GlobalScope_constant_KEY_2: + +.. _class_@GlobalScope_constant_KEY_3: + +.. _class_@GlobalScope_constant_KEY_4: + +.. _class_@GlobalScope_constant_KEY_5: + +.. _class_@GlobalScope_constant_KEY_6: + +.. _class_@GlobalScope_constant_KEY_7: + +.. _class_@GlobalScope_constant_KEY_8: + +.. _class_@GlobalScope_constant_KEY_9: + +.. _class_@GlobalScope_constant_KEY_COLON: + +.. _class_@GlobalScope_constant_KEY_SEMICOLON: + +.. _class_@GlobalScope_constant_KEY_LESS: + +.. _class_@GlobalScope_constant_KEY_EQUAL: + +.. _class_@GlobalScope_constant_KEY_GREATER: + +.. _class_@GlobalScope_constant_KEY_QUESTION: + +.. _class_@GlobalScope_constant_KEY_AT: + +.. _class_@GlobalScope_constant_KEY_A: + +.. _class_@GlobalScope_constant_KEY_B: + +.. _class_@GlobalScope_constant_KEY_C: + +.. _class_@GlobalScope_constant_KEY_D: + +.. _class_@GlobalScope_constant_KEY_E: + +.. _class_@GlobalScope_constant_KEY_F: + +.. _class_@GlobalScope_constant_KEY_G: + +.. _class_@GlobalScope_constant_KEY_H: + +.. _class_@GlobalScope_constant_KEY_I: + +.. _class_@GlobalScope_constant_KEY_J: + +.. _class_@GlobalScope_constant_KEY_K: + +.. _class_@GlobalScope_constant_KEY_L: + +.. _class_@GlobalScope_constant_KEY_M: + +.. _class_@GlobalScope_constant_KEY_N: + +.. _class_@GlobalScope_constant_KEY_O: + +.. _class_@GlobalScope_constant_KEY_P: + +.. _class_@GlobalScope_constant_KEY_Q: + +.. _class_@GlobalScope_constant_KEY_R: + +.. _class_@GlobalScope_constant_KEY_S: + +.. _class_@GlobalScope_constant_KEY_T: + +.. _class_@GlobalScope_constant_KEY_U: + +.. _class_@GlobalScope_constant_KEY_V: + +.. _class_@GlobalScope_constant_KEY_W: + +.. _class_@GlobalScope_constant_KEY_X: + +.. _class_@GlobalScope_constant_KEY_Y: + +.. _class_@GlobalScope_constant_KEY_Z: + +.. _class_@GlobalScope_constant_KEY_BRACKETLEFT: + +.. _class_@GlobalScope_constant_KEY_BACKSLASH: + +.. _class_@GlobalScope_constant_KEY_BRACKETRIGHT: + +.. _class_@GlobalScope_constant_KEY_ASCIICIRCUM: + +.. _class_@GlobalScope_constant_KEY_UNDERSCORE: + +.. _class_@GlobalScope_constant_KEY_QUOTELEFT: + +.. _class_@GlobalScope_constant_KEY_BRACELEFT: + +.. _class_@GlobalScope_constant_KEY_BAR: + +.. _class_@GlobalScope_constant_KEY_BRACERIGHT: + +.. _class_@GlobalScope_constant_KEY_ASCIITILDE: + +.. _class_@GlobalScope_constant_KEY_NOBREAKSPACE: + +.. _class_@GlobalScope_constant_KEY_EXCLAMDOWN: + +.. _class_@GlobalScope_constant_KEY_CENT: + +.. _class_@GlobalScope_constant_KEY_STERLING: + +.. _class_@GlobalScope_constant_KEY_CURRENCY: + +.. _class_@GlobalScope_constant_KEY_YEN: + +.. _class_@GlobalScope_constant_KEY_BROKENBAR: + +.. _class_@GlobalScope_constant_KEY_SECTION: + +.. _class_@GlobalScope_constant_KEY_DIAERESIS: + +.. _class_@GlobalScope_constant_KEY_COPYRIGHT: + +.. _class_@GlobalScope_constant_KEY_ORDFEMININE: + +.. _class_@GlobalScope_constant_KEY_GUILLEMOTLEFT: + +.. _class_@GlobalScope_constant_KEY_NOTSIGN: + +.. _class_@GlobalScope_constant_KEY_HYPHEN: + +.. _class_@GlobalScope_constant_KEY_REGISTERED: + +.. _class_@GlobalScope_constant_KEY_MACRON: + +.. _class_@GlobalScope_constant_KEY_DEGREE: + +.. _class_@GlobalScope_constant_KEY_PLUSMINUS: + +.. _class_@GlobalScope_constant_KEY_TWOSUPERIOR: + +.. _class_@GlobalScope_constant_KEY_THREESUPERIOR: + +.. _class_@GlobalScope_constant_KEY_ACUTE: + +.. _class_@GlobalScope_constant_KEY_MU: + +.. _class_@GlobalScope_constant_KEY_PARAGRAPH: + +.. _class_@GlobalScope_constant_KEY_PERIODCENTERED: + +.. _class_@GlobalScope_constant_KEY_CEDILLA: + +.. _class_@GlobalScope_constant_KEY_ONESUPERIOR: + +.. _class_@GlobalScope_constant_KEY_MASCULINE: + +.. _class_@GlobalScope_constant_KEY_GUILLEMOTRIGHT: + +.. _class_@GlobalScope_constant_KEY_ONEQUARTER: + +.. _class_@GlobalScope_constant_KEY_ONEHALF: + +.. _class_@GlobalScope_constant_KEY_THREEQUARTERS: + +.. _class_@GlobalScope_constant_KEY_QUESTIONDOWN: + +.. _class_@GlobalScope_constant_KEY_AGRAVE: + +.. _class_@GlobalScope_constant_KEY_AACUTE: + +.. _class_@GlobalScope_constant_KEY_ACIRCUMFLEX: + +.. _class_@GlobalScope_constant_KEY_ATILDE: + +.. _class_@GlobalScope_constant_KEY_ADIAERESIS: + +.. _class_@GlobalScope_constant_KEY_ARING: + +.. _class_@GlobalScope_constant_KEY_AE: + +.. _class_@GlobalScope_constant_KEY_CCEDILLA: + +.. _class_@GlobalScope_constant_KEY_EGRAVE: + +.. _class_@GlobalScope_constant_KEY_EACUTE: + +.. _class_@GlobalScope_constant_KEY_ECIRCUMFLEX: + +.. _class_@GlobalScope_constant_KEY_EDIAERESIS: + +.. _class_@GlobalScope_constant_KEY_IGRAVE: + +.. _class_@GlobalScope_constant_KEY_IACUTE: + +.. _class_@GlobalScope_constant_KEY_ICIRCUMFLEX: + +.. _class_@GlobalScope_constant_KEY_IDIAERESIS: + +.. _class_@GlobalScope_constant_KEY_ETH: + +.. _class_@GlobalScope_constant_KEY_NTILDE: + +.. _class_@GlobalScope_constant_KEY_OGRAVE: + +.. _class_@GlobalScope_constant_KEY_OACUTE: + +.. _class_@GlobalScope_constant_KEY_OCIRCUMFLEX: + +.. _class_@GlobalScope_constant_KEY_OTILDE: + +.. _class_@GlobalScope_constant_KEY_ODIAERESIS: + +.. _class_@GlobalScope_constant_KEY_MULTIPLY: + +.. _class_@GlobalScope_constant_KEY_OOBLIQUE: + +.. _class_@GlobalScope_constant_KEY_UGRAVE: + +.. _class_@GlobalScope_constant_KEY_UACUTE: + +.. _class_@GlobalScope_constant_KEY_UCIRCUMFLEX: + +.. _class_@GlobalScope_constant_KEY_UDIAERESIS: + +.. _class_@GlobalScope_constant_KEY_YACUTE: + +.. _class_@GlobalScope_constant_KEY_THORN: + +.. _class_@GlobalScope_constant_KEY_SSHARP: + +.. _class_@GlobalScope_constant_KEY_DIVISION: + +.. _class_@GlobalScope_constant_KEY_YDIAERESIS: + +enum **KeyList**: + +- **KEY_ESCAPE** = **16777217** --- Escape key. + +- **KEY_TAB** = **16777218** --- Tab key. + +- **KEY_BACKTAB** = **16777219** --- Shift+Tab key. + +- **KEY_BACKSPACE** = **16777220** --- Backspace key. + +- **KEY_ENTER** = **16777221** --- Return key (on the main keyboard). + +- **KEY_KP_ENTER** = **16777222** --- Enter key on the numeric keypad. + +- **KEY_INSERT** = **16777223** --- Insert key. + +- **KEY_DELETE** = **16777224** --- Delete key. + +- **KEY_PAUSE** = **16777225** --- Pause key. + +- **KEY_PRINT** = **16777226** --- Print Screen key. + +- **KEY_SYSREQ** = **16777227** --- System Request key. + +- **KEY_CLEAR** = **16777228** --- Clear key. + +- **KEY_HOME** = **16777229** --- Home key. + +- **KEY_END** = **16777230** --- End key. + +- **KEY_LEFT** = **16777231** --- Left arrow key. + +- **KEY_UP** = **16777232** --- Up arrow key. + +- **KEY_RIGHT** = **16777233** --- Right arrow key. + +- **KEY_DOWN** = **16777234** --- Down arrow key. + +- **KEY_PAGEUP** = **16777235** --- Page Up key. + +- **KEY_PAGEDOWN** = **16777236** --- Page Down key. + +- **KEY_SHIFT** = **16777237** --- Shift key. + +- **KEY_CONTROL** = **16777238** --- Control key. + +- **KEY_META** = **16777239** --- Meta key. + +- **KEY_ALT** = **16777240** --- Alt key. + +- **KEY_CAPSLOCK** = **16777241** --- Caps Lock key. + +- **KEY_NUMLOCK** = **16777242** --- Num Lock key. + +- **KEY_SCROLLLOCK** = **16777243** --- Scroll Lock key. + +- **KEY_F1** = **16777244** --- F1 key. + +- **KEY_F2** = **16777245** --- F2 key. + +- **KEY_F3** = **16777246** --- F3 key. + +- **KEY_F4** = **16777247** --- F4 key. + +- **KEY_F5** = **16777248** --- F5 key. + +- **KEY_F6** = **16777249** --- F6 key. + +- **KEY_F7** = **16777250** --- F7 key. + +- **KEY_F8** = **16777251** --- F8 key. + +- **KEY_F9** = **16777252** --- F9 key. + +- **KEY_F10** = **16777253** --- F10 key. + +- **KEY_F11** = **16777254** --- F11 key. + +- **KEY_F12** = **16777255** --- F12 key. + +- **KEY_F13** = **16777256** --- F13 key. + +- **KEY_F14** = **16777257** --- F14 key. + +- **KEY_F15** = **16777258** --- F15 key. + +- **KEY_F16** = **16777259** --- F16 key. + +- **KEY_KP_MULTIPLY** = **16777345** --- Multiply (\*) key on the numeric keypad. + +- **KEY_KP_DIVIDE** = **16777346** --- Divide (/) key on the numeric keypad. + +- **KEY_KP_SUBTRACT** = **16777347** --- Subtract (-) key on the numeric keypad. + +- **KEY_KP_PERIOD** = **16777348** --- Period (.) key on the numeric keypad. + +- **KEY_KP_ADD** = **16777349** --- Add (+) key on the numeric keypad. + +- **KEY_KP_0** = **16777350** --- Number 0 on the numeric keypad. + +- **KEY_KP_1** = **16777351** --- Number 1 on the numeric keypad. + +- **KEY_KP_2** = **16777352** --- Number 2 on the numeric keypad. + +- **KEY_KP_3** = **16777353** --- Number 3 on the numeric keypad. + +- **KEY_KP_4** = **16777354** --- Number 4 on the numeric keypad. + +- **KEY_KP_5** = **16777355** --- Number 5 on the numeric keypad. + +- **KEY_KP_6** = **16777356** --- Number 6 on the numeric keypad. + +- **KEY_KP_7** = **16777357** --- Number 7 on the numeric keypad. + +- **KEY_KP_8** = **16777358** --- Number 8 on the numeric keypad. + +- **KEY_KP_9** = **16777359** --- Number 9 on the numeric keypad. + +- **KEY_SUPER_L** = **16777260** --- Left Super key (Windows key). + +- **KEY_SUPER_R** = **16777261** --- Right Super key (Windows key). + +- **KEY_MENU** = **16777262** --- Context menu key. + +- **KEY_HYPER_L** = **16777263** --- Left Hyper key. + +- **KEY_HYPER_R** = **16777264** --- Right Hyper key. + +- **KEY_HELP** = **16777265** --- Help key. + +- **KEY_DIRECTION_L** = **16777266** --- Left Direction key. + +- **KEY_DIRECTION_R** = **16777267** --- Right Direction key. + +- **KEY_BACK** = **16777280** --- Media back key. Not to be confused with the Back button on an Android device. + +- **KEY_FORWARD** = **16777281** --- Media forward key. + +- **KEY_STOP** = **16777282** --- Media stop key. + +- **KEY_REFRESH** = **16777283** --- Media refresh key. + +- **KEY_VOLUMEDOWN** = **16777284** --- Volume down key. + +- **KEY_VOLUMEMUTE** = **16777285** --- Mute volume key. + +- **KEY_VOLUMEUP** = **16777286** --- Volume up key. + +- **KEY_BASSBOOST** = **16777287** --- Bass Boost key. + +- **KEY_BASSUP** = **16777288** --- Bass up key. + +- **KEY_BASSDOWN** = **16777289** --- Bass down key. + +- **KEY_TREBLEUP** = **16777290** --- Treble up key. + +- **KEY_TREBLEDOWN** = **16777291** --- Treble down key. + +- **KEY_MEDIAPLAY** = **16777292** --- Media play key. + +- **KEY_MEDIASTOP** = **16777293** --- Media stop key. + +- **KEY_MEDIAPREVIOUS** = **16777294** --- Previous song key. + +- **KEY_MEDIANEXT** = **16777295** --- Next song key. + +- **KEY_MEDIARECORD** = **16777296** --- Media record key. + +- **KEY_HOMEPAGE** = **16777297** --- Home page key. + +- **KEY_FAVORITES** = **16777298** --- Favorites key. + +- **KEY_SEARCH** = **16777299** --- Search key. + +- **KEY_STANDBY** = **16777300** --- Standby key. + +- **KEY_OPENURL** = **16777301** --- Open URL / Launch Browser key. + +- **KEY_LAUNCHMAIL** = **16777302** --- Launch Mail key. + +- **KEY_LAUNCHMEDIA** = **16777303** --- Launch Media key. + +- **KEY_LAUNCH0** = **16777304** --- Launch Shortcut 0 key. + +- **KEY_LAUNCH1** = **16777305** --- Launch Shortcut 1 key. + +- **KEY_LAUNCH2** = **16777306** --- Launch Shortcut 2 key. + +- **KEY_LAUNCH3** = **16777307** --- Launch Shortcut 3 key. + +- **KEY_LAUNCH4** = **16777308** --- Launch Shortcut 4 key. + +- **KEY_LAUNCH5** = **16777309** --- Launch Shortcut 5 key. + +- **KEY_LAUNCH6** = **16777310** --- Launch Shortcut 6 key. + +- **KEY_LAUNCH7** = **16777311** --- Launch Shortcut 7 key. + +- **KEY_LAUNCH8** = **16777312** --- Launch Shortcut 8 key. + +- **KEY_LAUNCH9** = **16777313** --- Launch Shortcut 9 key. + +- **KEY_LAUNCHA** = **16777314** --- Launch Shortcut A key. + +- **KEY_LAUNCHB** = **16777315** --- Launch Shortcut B key. + +- **KEY_LAUNCHC** = **16777316** --- Launch Shortcut C key. + +- **KEY_LAUNCHD** = **16777317** --- Launch Shortcut D key. + +- **KEY_LAUNCHE** = **16777318** --- Launch Shortcut E key. + +- **KEY_LAUNCHF** = **16777319** --- Launch Shortcut F key. + +- **KEY_UNKNOWN** = **33554431** --- Unknown key. + +- **KEY_SPACE** = **32** --- Space key. + +- **KEY_EXCLAM** = **33** --- ! key. + +- **KEY_QUOTEDBL** = **34** --- " key. + +- **KEY_NUMBERSIGN** = **35** --- # key. + +- **KEY_DOLLAR** = **36** --- $ key. + +- **KEY_PERCENT** = **37** --- % key. + +- **KEY_AMPERSAND** = **38** --- & key. + +- **KEY_APOSTROPHE** = **39** --- ' key. + +- **KEY_PARENLEFT** = **40** --- ( key. + +- **KEY_PARENRIGHT** = **41** --- ) key. + +- **KEY_ASTERISK** = **42** --- \* key. + +- **KEY_PLUS** = **43** --- + key. + +- **KEY_COMMA** = **44** --- , key. + +- **KEY_MINUS** = **45** --- - key. + +- **KEY_PERIOD** = **46** --- . key. + +- **KEY_SLASH** = **47** --- / key. + +- **KEY_0** = **48** --- Number 0. + +- **KEY_1** = **49** --- Number 1. + +- **KEY_2** = **50** --- Number 2. + +- **KEY_3** = **51** --- Number 3. + +- **KEY_4** = **52** --- Number 4. + +- **KEY_5** = **53** --- Number 5. + +- **KEY_6** = **54** --- Number 6. + +- **KEY_7** = **55** --- Number 7. + +- **KEY_8** = **56** --- Number 8. + +- **KEY_9** = **57** --- Number 9. + +- **KEY_COLON** = **58** --- : key. + +- **KEY_SEMICOLON** = **59** --- ; key. + +- **KEY_LESS** = **60** --- < key. + +- **KEY_EQUAL** = **61** --- = key. + +- **KEY_GREATER** = **62** --- > key. + +- **KEY_QUESTION** = **63** --- ? key. + +- **KEY_AT** = **64** --- @ key. + +- **KEY_A** = **65** --- A key. + +- **KEY_B** = **66** --- B key. + +- **KEY_C** = **67** --- C key. + +- **KEY_D** = **68** --- D key. + +- **KEY_E** = **69** --- E key. + +- **KEY_F** = **70** --- F key. + +- **KEY_G** = **71** --- G key. + +- **KEY_H** = **72** --- H key. + +- **KEY_I** = **73** --- I key. + +- **KEY_J** = **74** --- J key. + +- **KEY_K** = **75** --- K key. + +- **KEY_L** = **76** --- L key. + +- **KEY_M** = **77** --- M key. + +- **KEY_N** = **78** --- N key. + +- **KEY_O** = **79** --- O key. + +- **KEY_P** = **80** --- P key. + +- **KEY_Q** = **81** --- Q key. + +- **KEY_R** = **82** --- R key. + +- **KEY_S** = **83** --- S key. + +- **KEY_T** = **84** --- T key. + +- **KEY_U** = **85** --- U key. + +- **KEY_V** = **86** --- V key. + +- **KEY_W** = **87** --- W key. + +- **KEY_X** = **88** --- X key. + +- **KEY_Y** = **89** --- Y key. + +- **KEY_Z** = **90** --- Z key. + +- **KEY_BRACKETLEFT** = **91** --- [ key. + +- **KEY_BACKSLASH** = **92** --- \\ key. + +- **KEY_BRACKETRIGHT** = **93** --- ] key. + +- **KEY_ASCIICIRCUM** = **94** --- ^ key. + +- **KEY_UNDERSCORE** = **95** --- \_ key. + +- **KEY_QUOTELEFT** = **96** --- ` key. + +- **KEY_BRACELEFT** = **123** --- { key. + +- **KEY_BAR** = **124** --- | key. + +- **KEY_BRACERIGHT** = **125** --- } key. + +- **KEY_ASCIITILDE** = **126** --- ~ key. + +- **KEY_NOBREAKSPACE** = **160** --- Non-breakable space key. + +- **KEY_EXCLAMDOWN** = **161** --- ¡ key. + +- **KEY_CENT** = **162** --- ¢ key. + +- **KEY_STERLING** = **163** --- £ key. + +- **KEY_CURRENCY** = **164** --- ¤ key. + +- **KEY_YEN** = **165** --- ¥ key. + +- **KEY_BROKENBAR** = **166** --- ¦ key. + +- **KEY_SECTION** = **167** --- § key. + +- **KEY_DIAERESIS** = **168** --- ¨ key. + +- **KEY_COPYRIGHT** = **169** --- © key. + +- **KEY_ORDFEMININE** = **170** --- ª key. + +- **KEY_GUILLEMOTLEFT** = **171** --- « key. + +- **KEY_NOTSIGN** = **172** --- ¬ key. + +- **KEY_HYPHEN** = **173** --- Soft hyphen key. + +- **KEY_REGISTERED** = **174** --- ® key. + +- **KEY_MACRON** = **175** --- ¯ key. + +- **KEY_DEGREE** = **176** --- ° key. + +- **KEY_PLUSMINUS** = **177** --- ± key. + +- **KEY_TWOSUPERIOR** = **178** --- ² key. + +- **KEY_THREESUPERIOR** = **179** --- ³ key. + +- **KEY_ACUTE** = **180** --- ´ key. + +- **KEY_MU** = **181** --- µ key. + +- **KEY_PARAGRAPH** = **182** --- ¶ key. + +- **KEY_PERIODCENTERED** = **183** --- · key. + +- **KEY_CEDILLA** = **184** --- ¸ key. + +- **KEY_ONESUPERIOR** = **185** --- ¹ key. + +- **KEY_MASCULINE** = **186** --- º key. + +- **KEY_GUILLEMOTRIGHT** = **187** --- » key. + +- **KEY_ONEQUARTER** = **188** --- ¼ key. + +- **KEY_ONEHALF** = **189** --- ½ key. + +- **KEY_THREEQUARTERS** = **190** --- ¾ key. + +- **KEY_QUESTIONDOWN** = **191** --- ¿ key. + +- **KEY_AGRAVE** = **192** --- À key. + +- **KEY_AACUTE** = **193** --- Á key. + +- **KEY_ACIRCUMFLEX** = **194** --- Â key. + +- **KEY_ATILDE** = **195** --- Ã key. + +- **KEY_ADIAERESIS** = **196** --- Ä key. + +- **KEY_ARING** = **197** --- Å key. + +- **KEY_AE** = **198** --- Æ key. + +- **KEY_CCEDILLA** = **199** --- Ç key. + +- **KEY_EGRAVE** = **200** --- È key. + +- **KEY_EACUTE** = **201** --- É key. + +- **KEY_ECIRCUMFLEX** = **202** --- Ê key. + +- **KEY_EDIAERESIS** = **203** --- Ë key. + +- **KEY_IGRAVE** = **204** --- Ì key. + +- **KEY_IACUTE** = **205** --- Í key. + +- **KEY_ICIRCUMFLEX** = **206** --- Î key. + +- **KEY_IDIAERESIS** = **207** --- Ï key. + +- **KEY_ETH** = **208** --- Ð key. + +- **KEY_NTILDE** = **209** --- Ñ key. + +- **KEY_OGRAVE** = **210** --- Ò key. + +- **KEY_OACUTE** = **211** --- Ó key. + +- **KEY_OCIRCUMFLEX** = **212** --- Ô key. + +- **KEY_OTILDE** = **213** --- Õ key. + +- **KEY_ODIAERESIS** = **214** --- Ö key. + +- **KEY_MULTIPLY** = **215** --- × key. + +- **KEY_OOBLIQUE** = **216** --- Ø key. + +- **KEY_UGRAVE** = **217** --- Ù key. + +- **KEY_UACUTE** = **218** --- Ú key. + +- **KEY_UCIRCUMFLEX** = **219** --- Û key. + +- **KEY_UDIAERESIS** = **220** --- Ü key. + +- **KEY_YACUTE** = **221** --- Ý key. + +- **KEY_THORN** = **222** --- Þ key. + +- **KEY_SSHARP** = **223** --- ß key. + +- **KEY_DIVISION** = **247** --- ÷ key. + +- **KEY_YDIAERESIS** = **255** --- ÿ key. + +---- + +.. _enum_@GlobalScope_KeyModifierMask: + +.. _class_@GlobalScope_constant_KEY_CODE_MASK: + +.. _class_@GlobalScope_constant_KEY_MODIFIER_MASK: + +.. _class_@GlobalScope_constant_KEY_MASK_SHIFT: + +.. _class_@GlobalScope_constant_KEY_MASK_ALT: + +.. _class_@GlobalScope_constant_KEY_MASK_META: + +.. _class_@GlobalScope_constant_KEY_MASK_CTRL: + +.. _class_@GlobalScope_constant_KEY_MASK_CMD: + +.. _class_@GlobalScope_constant_KEY_MASK_KPAD: + +.. _class_@GlobalScope_constant_KEY_MASK_GROUP_SWITCH: + +enum **KeyModifierMask**: + +- **KEY_CODE_MASK** = **33554431** --- Key Code mask. + +- **KEY_MODIFIER_MASK** = **-16777216** --- Modifier key mask. + +- **KEY_MASK_SHIFT** = **33554432** --- Shift key mask. + +- **KEY_MASK_ALT** = **67108864** --- Alt key mask. + +- **KEY_MASK_META** = **134217728** --- Meta key mask. + +- **KEY_MASK_CTRL** = **268435456** --- Ctrl key mask. + +- **KEY_MASK_CMD** = **platform-dependent** --- Command key mask. On macOS, this is equivalent to :ref:`KEY_MASK_META`. On other platforms, this is equivalent to :ref:`KEY_MASK_CTRL`. This mask should be preferred to :ref:`KEY_MASK_META` or :ref:`KEY_MASK_CTRL` for system shortcuts as it handles all platforms correctly. + +- **KEY_MASK_KPAD** = **536870912** --- Keypad key mask. + +- **KEY_MASK_GROUP_SWITCH** = **1073741824** --- Group Switch key mask. + +---- + +.. _enum_@GlobalScope_ButtonList: + +.. _class_@GlobalScope_constant_BUTTON_LEFT: + +.. _class_@GlobalScope_constant_BUTTON_RIGHT: + +.. _class_@GlobalScope_constant_BUTTON_MIDDLE: + +.. _class_@GlobalScope_constant_BUTTON_XBUTTON1: + +.. _class_@GlobalScope_constant_BUTTON_XBUTTON2: + +.. _class_@GlobalScope_constant_BUTTON_WHEEL_UP: + +.. _class_@GlobalScope_constant_BUTTON_WHEEL_DOWN: + +.. _class_@GlobalScope_constant_BUTTON_WHEEL_LEFT: + +.. _class_@GlobalScope_constant_BUTTON_WHEEL_RIGHT: + +.. _class_@GlobalScope_constant_BUTTON_MASK_LEFT: + +.. _class_@GlobalScope_constant_BUTTON_MASK_RIGHT: + +.. _class_@GlobalScope_constant_BUTTON_MASK_MIDDLE: + +.. _class_@GlobalScope_constant_BUTTON_MASK_XBUTTON1: + +.. _class_@GlobalScope_constant_BUTTON_MASK_XBUTTON2: + +enum **ButtonList**: + +- **BUTTON_LEFT** = **1** --- Left mouse button. + +- **BUTTON_RIGHT** = **2** --- Right mouse button. + +- **BUTTON_MIDDLE** = **3** --- Middle mouse button. + +- **BUTTON_XBUTTON1** = **8** --- Extra mouse button 1 (only present on some mice). + +- **BUTTON_XBUTTON2** = **9** --- Extra mouse button 2 (only present on some mice). + +- **BUTTON_WHEEL_UP** = **4** --- Mouse wheel up. + +- **BUTTON_WHEEL_DOWN** = **5** --- Mouse wheel down. + +- **BUTTON_WHEEL_LEFT** = **6** --- Mouse wheel left button (only present on some mice). + +- **BUTTON_WHEEL_RIGHT** = **7** --- Mouse wheel right button (only present on some mice). + +- **BUTTON_MASK_LEFT** = **1** --- Left mouse button mask. + +- **BUTTON_MASK_RIGHT** = **2** --- Right mouse button mask. + +- **BUTTON_MASK_MIDDLE** = **4** --- Middle mouse button mask. + +- **BUTTON_MASK_XBUTTON1** = **128** --- Extra mouse button 1 mask. + +- **BUTTON_MASK_XBUTTON2** = **256** --- Extra mouse button 2 mask. + +---- + +.. _enum_@GlobalScope_JoystickList: + +.. _class_@GlobalScope_constant_JOY_INVALID_OPTION: + +.. _class_@GlobalScope_constant_JOY_BUTTON_0: + +.. _class_@GlobalScope_constant_JOY_BUTTON_1: + +.. _class_@GlobalScope_constant_JOY_BUTTON_2: + +.. _class_@GlobalScope_constant_JOY_BUTTON_3: + +.. _class_@GlobalScope_constant_JOY_BUTTON_4: + +.. _class_@GlobalScope_constant_JOY_BUTTON_5: + +.. _class_@GlobalScope_constant_JOY_BUTTON_6: + +.. _class_@GlobalScope_constant_JOY_BUTTON_7: + +.. _class_@GlobalScope_constant_JOY_BUTTON_8: + +.. _class_@GlobalScope_constant_JOY_BUTTON_9: + +.. _class_@GlobalScope_constant_JOY_BUTTON_10: + +.. _class_@GlobalScope_constant_JOY_BUTTON_11: + +.. _class_@GlobalScope_constant_JOY_BUTTON_12: + +.. _class_@GlobalScope_constant_JOY_BUTTON_13: + +.. _class_@GlobalScope_constant_JOY_BUTTON_14: + +.. _class_@GlobalScope_constant_JOY_BUTTON_15: + +.. _class_@GlobalScope_constant_JOY_BUTTON_16: + +.. _class_@GlobalScope_constant_JOY_BUTTON_17: + +.. _class_@GlobalScope_constant_JOY_BUTTON_18: + +.. _class_@GlobalScope_constant_JOY_BUTTON_19: + +.. _class_@GlobalScope_constant_JOY_BUTTON_20: + +.. _class_@GlobalScope_constant_JOY_BUTTON_21: + +.. _class_@GlobalScope_constant_JOY_BUTTON_22: + +.. _class_@GlobalScope_constant_JOY_BUTTON_MAX: + +.. _class_@GlobalScope_constant_JOY_SONY_CIRCLE: + +.. _class_@GlobalScope_constant_JOY_SONY_X: + +.. _class_@GlobalScope_constant_JOY_SONY_SQUARE: + +.. _class_@GlobalScope_constant_JOY_SONY_TRIANGLE: + +.. _class_@GlobalScope_constant_JOY_XBOX_B: + +.. _class_@GlobalScope_constant_JOY_XBOX_A: + +.. _class_@GlobalScope_constant_JOY_XBOX_X: + +.. _class_@GlobalScope_constant_JOY_XBOX_Y: + +.. _class_@GlobalScope_constant_JOY_DS_A: + +.. _class_@GlobalScope_constant_JOY_DS_B: + +.. _class_@GlobalScope_constant_JOY_DS_X: + +.. _class_@GlobalScope_constant_JOY_DS_Y: + +.. _class_@GlobalScope_constant_JOY_VR_GRIP: + +.. _class_@GlobalScope_constant_JOY_VR_PAD: + +.. _class_@GlobalScope_constant_JOY_VR_TRIGGER: + +.. _class_@GlobalScope_constant_JOY_OCULUS_AX: + +.. _class_@GlobalScope_constant_JOY_OCULUS_BY: + +.. _class_@GlobalScope_constant_JOY_OCULUS_MENU: + +.. _class_@GlobalScope_constant_JOY_OPENVR_MENU: + +.. _class_@GlobalScope_constant_JOY_SELECT: + +.. _class_@GlobalScope_constant_JOY_START: + +.. _class_@GlobalScope_constant_JOY_DPAD_UP: + +.. _class_@GlobalScope_constant_JOY_DPAD_DOWN: + +.. _class_@GlobalScope_constant_JOY_DPAD_LEFT: + +.. _class_@GlobalScope_constant_JOY_DPAD_RIGHT: + +.. _class_@GlobalScope_constant_JOY_GUIDE: + +.. _class_@GlobalScope_constant_JOY_MISC1: + +.. _class_@GlobalScope_constant_JOY_PADDLE1: + +.. _class_@GlobalScope_constant_JOY_PADDLE2: + +.. _class_@GlobalScope_constant_JOY_PADDLE3: + +.. _class_@GlobalScope_constant_JOY_PADDLE4: + +.. _class_@GlobalScope_constant_JOY_TOUCHPAD: + +.. _class_@GlobalScope_constant_JOY_L: + +.. _class_@GlobalScope_constant_JOY_L2: + +.. _class_@GlobalScope_constant_JOY_L3: + +.. _class_@GlobalScope_constant_JOY_R: + +.. _class_@GlobalScope_constant_JOY_R2: + +.. _class_@GlobalScope_constant_JOY_R3: + +.. _class_@GlobalScope_constant_JOY_AXIS_0: + +.. _class_@GlobalScope_constant_JOY_AXIS_1: + +.. _class_@GlobalScope_constant_JOY_AXIS_2: + +.. _class_@GlobalScope_constant_JOY_AXIS_3: + +.. _class_@GlobalScope_constant_JOY_AXIS_4: + +.. _class_@GlobalScope_constant_JOY_AXIS_5: + +.. _class_@GlobalScope_constant_JOY_AXIS_6: + +.. _class_@GlobalScope_constant_JOY_AXIS_7: + +.. _class_@GlobalScope_constant_JOY_AXIS_8: + +.. _class_@GlobalScope_constant_JOY_AXIS_9: + +.. _class_@GlobalScope_constant_JOY_AXIS_MAX: + +.. _class_@GlobalScope_constant_JOY_ANALOG_LX: + +.. _class_@GlobalScope_constant_JOY_ANALOG_LY: + +.. _class_@GlobalScope_constant_JOY_ANALOG_RX: + +.. _class_@GlobalScope_constant_JOY_ANALOG_RY: + +.. _class_@GlobalScope_constant_JOY_ANALOG_L2: + +.. _class_@GlobalScope_constant_JOY_ANALOG_R2: + +.. _class_@GlobalScope_constant_JOY_VR_ANALOG_TRIGGER: + +.. _class_@GlobalScope_constant_JOY_VR_ANALOG_GRIP: + +.. _class_@GlobalScope_constant_JOY_OPENVR_TOUCHPADX: + +.. _class_@GlobalScope_constant_JOY_OPENVR_TOUCHPADY: + +enum **JoystickList**: + +- **JOY_INVALID_OPTION** = **-1** --- Invalid button or axis. + +- **JOY_BUTTON_0** = **0** --- Gamepad button 0. + +- **JOY_BUTTON_1** = **1** --- Gamepad button 1. + +- **JOY_BUTTON_2** = **2** --- Gamepad button 2. + +- **JOY_BUTTON_3** = **3** --- Gamepad button 3. + +- **JOY_BUTTON_4** = **4** --- Gamepad button 4. + +- **JOY_BUTTON_5** = **5** --- Gamepad button 5. + +- **JOY_BUTTON_6** = **6** --- Gamepad button 6. + +- **JOY_BUTTON_7** = **7** --- Gamepad button 7. + +- **JOY_BUTTON_8** = **8** --- Gamepad button 8. + +- **JOY_BUTTON_9** = **9** --- Gamepad button 9. + +- **JOY_BUTTON_10** = **10** --- Gamepad button 10. + +- **JOY_BUTTON_11** = **11** --- Gamepad button 11. + +- **JOY_BUTTON_12** = **12** --- Gamepad button 12. + +- **JOY_BUTTON_13** = **13** --- Gamepad button 13. + +- **JOY_BUTTON_14** = **14** --- Gamepad button 14. + +- **JOY_BUTTON_15** = **15** --- Gamepad button 15. + +- **JOY_BUTTON_16** = **16** --- Gamepad button 16. + +- **JOY_BUTTON_17** = **17** --- Gamepad button 17. + +- **JOY_BUTTON_18** = **18** --- Gamepad button 18. + +- **JOY_BUTTON_19** = **19** --- Gamepad button 19. + +- **JOY_BUTTON_20** = **20** --- Gamepad button 20. + +- **JOY_BUTTON_21** = **21** --- Gamepad button 21. + +- **JOY_BUTTON_22** = **22** --- Gamepad button 22. + +- **JOY_BUTTON_MAX** = **128** --- The maximum number of game controller buttons supported by the engine. The actual limit may be lower on specific platforms: + +- Android: Up to 36 buttons. + +- Linux: Up to 80 buttons. + +- Windows and macOS: Up to 128 buttons. + +- **JOY_SONY_CIRCLE** = **1** --- DualShock circle button. + +- **JOY_SONY_X** = **0** --- DualShock X button. + +- **JOY_SONY_SQUARE** = **2** --- DualShock square button. + +- **JOY_SONY_TRIANGLE** = **3** --- DualShock triangle button. + +- **JOY_XBOX_B** = **1** --- Xbox controller B button. + +- **JOY_XBOX_A** = **0** --- Xbox controller A button. + +- **JOY_XBOX_X** = **2** --- Xbox controller X button. + +- **JOY_XBOX_Y** = **3** --- Xbox controller Y button. + +- **JOY_DS_A** = **1** --- Nintendo controller A button. + +- **JOY_DS_B** = **0** --- Nintendo controller B button. + +- **JOY_DS_X** = **3** --- Nintendo controller X button. + +- **JOY_DS_Y** = **2** --- Nintendo controller Y button. + +- **JOY_VR_GRIP** = **2** --- Grip (side) buttons on a VR controller. + +- **JOY_VR_PAD** = **14** --- Push down on the touchpad or main joystick on a VR controller. + +- **JOY_VR_TRIGGER** = **15** --- Trigger on a VR controller. + +- **JOY_OCULUS_AX** = **7** --- A button on the right Oculus Touch controller, X button on the left controller (also when used in OpenVR). + +- **JOY_OCULUS_BY** = **1** --- B button on the right Oculus Touch controller, Y button on the left controller (also when used in OpenVR). + +- **JOY_OCULUS_MENU** = **3** --- Menu button on either Oculus Touch controller. + +- **JOY_OPENVR_MENU** = **1** --- Menu button in OpenVR (Except when Oculus Touch controllers are used). + +- **JOY_SELECT** = **10** --- Gamepad button Select. + +- **JOY_START** = **11** --- Gamepad button Start. + +- **JOY_DPAD_UP** = **12** --- Gamepad DPad up. + +- **JOY_DPAD_DOWN** = **13** --- Gamepad DPad down. + +- **JOY_DPAD_LEFT** = **14** --- Gamepad DPad left. + +- **JOY_DPAD_RIGHT** = **15** --- Gamepad DPad right. + +- **JOY_GUIDE** = **16** --- Gamepad SDL guide button. + +- **JOY_MISC1** = **17** --- Gamepad SDL miscellaneous button. + +- **JOY_PADDLE1** = **18** --- Gamepad SDL paddle 1 button. + +- **JOY_PADDLE2** = **19** --- Gamepad SDL paddle 2 button. + +- **JOY_PADDLE3** = **20** --- Gamepad SDL paddle 3 button. + +- **JOY_PADDLE4** = **21** --- Gamepad SDL paddle 4 button. + +- **JOY_TOUCHPAD** = **22** --- Gamepad SDL touchpad button. + +- **JOY_L** = **4** --- Gamepad left Shoulder button. + +- **JOY_L2** = **6** --- Gamepad left trigger. + +- **JOY_L3** = **8** --- Gamepad left stick click. + +- **JOY_R** = **5** --- Gamepad right Shoulder button. + +- **JOY_R2** = **7** --- Gamepad right trigger. + +- **JOY_R3** = **9** --- Gamepad right stick click. + +- **JOY_AXIS_0** = **0** --- Gamepad left stick horizontal axis. + +- **JOY_AXIS_1** = **1** --- Gamepad left stick vertical axis. + +- **JOY_AXIS_2** = **2** --- Gamepad right stick horizontal axis. + +- **JOY_AXIS_3** = **3** --- Gamepad right stick vertical axis. + +- **JOY_AXIS_4** = **4** --- Generic gamepad axis 4. + +- **JOY_AXIS_5** = **5** --- Generic gamepad axis 5. + +- **JOY_AXIS_6** = **6** --- Gamepad left trigger analog axis. + +- **JOY_AXIS_7** = **7** --- Gamepad right trigger analog axis. + +- **JOY_AXIS_8** = **8** --- Generic gamepad axis 8. + +- **JOY_AXIS_9** = **9** --- Generic gamepad axis 9. + +- **JOY_AXIS_MAX** = **10** --- Represents the maximum number of joystick axes supported. + +- **JOY_ANALOG_LX** = **0** --- Gamepad left stick horizontal axis. + +- **JOY_ANALOG_LY** = **1** --- Gamepad left stick vertical axis. + +- **JOY_ANALOG_RX** = **2** --- Gamepad right stick horizontal axis. + +- **JOY_ANALOG_RY** = **3** --- Gamepad right stick vertical axis. + +- **JOY_ANALOG_L2** = **6** --- Gamepad left analog trigger. + +- **JOY_ANALOG_R2** = **7** --- Gamepad right analog trigger. + +- **JOY_VR_ANALOG_TRIGGER** = **2** --- VR Controller analog trigger. + +- **JOY_VR_ANALOG_GRIP** = **4** --- VR Controller analog grip (side buttons). + +- **JOY_OPENVR_TOUCHPADX** = **0** --- OpenVR touchpad X axis (Joystick axis on Oculus Touch and Windows MR controllers). + +- **JOY_OPENVR_TOUCHPADY** = **1** --- OpenVR touchpad Y axis (Joystick axis on Oculus Touch and Windows MR controllers). + +---- + +.. _enum_@GlobalScope_MidiMessageList: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_OFF: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_NOTE_ON: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_AFTERTOUCH: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_CONTROL_CHANGE: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_PROGRAM_CHANGE: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_CHANNEL_PRESSURE: + +.. _class_@GlobalScope_constant_MIDI_MESSAGE_PITCH_BEND: + +enum **MidiMessageList**: + +- **MIDI_MESSAGE_NOTE_OFF** = **8** --- MIDI note OFF message. + +- **MIDI_MESSAGE_NOTE_ON** = **9** --- MIDI note ON message. + +- **MIDI_MESSAGE_AFTERTOUCH** = **10** --- MIDI aftertouch message. + +- **MIDI_MESSAGE_CONTROL_CHANGE** = **11** --- MIDI control change message. + +- **MIDI_MESSAGE_PROGRAM_CHANGE** = **12** --- MIDI program change message. + +- **MIDI_MESSAGE_CHANNEL_PRESSURE** = **13** --- MIDI channel pressure message. + +- **MIDI_MESSAGE_PITCH_BEND** = **14** --- MIDI pitch bend message. + +---- + +.. _enum_@GlobalScope_Error: + +.. _class_@GlobalScope_constant_OK: + +.. _class_@GlobalScope_constant_FAILED: + +.. _class_@GlobalScope_constant_ERR_UNAVAILABLE: + +.. _class_@GlobalScope_constant_ERR_UNCONFIGURED: + +.. _class_@GlobalScope_constant_ERR_UNAUTHORIZED: + +.. _class_@GlobalScope_constant_ERR_PARAMETER_RANGE_ERROR: + +.. _class_@GlobalScope_constant_ERR_OUT_OF_MEMORY: + +.. _class_@GlobalScope_constant_ERR_FILE_NOT_FOUND: + +.. _class_@GlobalScope_constant_ERR_FILE_BAD_DRIVE: + +.. _class_@GlobalScope_constant_ERR_FILE_BAD_PATH: + +.. _class_@GlobalScope_constant_ERR_FILE_NO_PERMISSION: + +.. _class_@GlobalScope_constant_ERR_FILE_ALREADY_IN_USE: + +.. _class_@GlobalScope_constant_ERR_FILE_CANT_OPEN: + +.. _class_@GlobalScope_constant_ERR_FILE_CANT_WRITE: + +.. _class_@GlobalScope_constant_ERR_FILE_CANT_READ: + +.. _class_@GlobalScope_constant_ERR_FILE_UNRECOGNIZED: + +.. _class_@GlobalScope_constant_ERR_FILE_CORRUPT: + +.. _class_@GlobalScope_constant_ERR_FILE_MISSING_DEPENDENCIES: + +.. _class_@GlobalScope_constant_ERR_FILE_EOF: + +.. _class_@GlobalScope_constant_ERR_CANT_OPEN: + +.. _class_@GlobalScope_constant_ERR_CANT_CREATE: + +.. _class_@GlobalScope_constant_ERR_QUERY_FAILED: + +.. _class_@GlobalScope_constant_ERR_ALREADY_IN_USE: + +.. _class_@GlobalScope_constant_ERR_LOCKED: + +.. _class_@GlobalScope_constant_ERR_TIMEOUT: + +.. _class_@GlobalScope_constant_ERR_CANT_CONNECT: + +.. _class_@GlobalScope_constant_ERR_CANT_RESOLVE: + +.. _class_@GlobalScope_constant_ERR_CONNECTION_ERROR: + +.. _class_@GlobalScope_constant_ERR_CANT_ACQUIRE_RESOURCE: + +.. _class_@GlobalScope_constant_ERR_CANT_FORK: + +.. _class_@GlobalScope_constant_ERR_INVALID_DATA: + +.. _class_@GlobalScope_constant_ERR_INVALID_PARAMETER: + +.. _class_@GlobalScope_constant_ERR_ALREADY_EXISTS: + +.. _class_@GlobalScope_constant_ERR_DOES_NOT_EXIST: + +.. _class_@GlobalScope_constant_ERR_DATABASE_CANT_READ: + +.. _class_@GlobalScope_constant_ERR_DATABASE_CANT_WRITE: + +.. _class_@GlobalScope_constant_ERR_COMPILATION_FAILED: + +.. _class_@GlobalScope_constant_ERR_METHOD_NOT_FOUND: + +.. _class_@GlobalScope_constant_ERR_LINK_FAILED: + +.. _class_@GlobalScope_constant_ERR_SCRIPT_FAILED: + +.. _class_@GlobalScope_constant_ERR_CYCLIC_LINK: + +.. _class_@GlobalScope_constant_ERR_INVALID_DECLARATION: + +.. _class_@GlobalScope_constant_ERR_DUPLICATE_SYMBOL: + +.. _class_@GlobalScope_constant_ERR_PARSE_ERROR: + +.. _class_@GlobalScope_constant_ERR_BUSY: + +.. _class_@GlobalScope_constant_ERR_SKIP: + +.. _class_@GlobalScope_constant_ERR_HELP: + +.. _class_@GlobalScope_constant_ERR_BUG: + +.. _class_@GlobalScope_constant_ERR_PRINTER_ON_FIRE: + +enum **Error**: + +- **OK** = **0** --- Methods that return :ref:`Error` return :ref:`OK` when no error occurred. Note that many functions don't return an error code but will print error messages to standard output. + +Since :ref:`OK` has value 0, and all other failure codes are positive integers, it can also be used in boolean checks, e.g.: + +:: + + var err = method_that_returns_error() + if err != OK: + print("Failure!") + # Or, equivalent: + if err: + print("Still failing!") + +- **FAILED** = **1** --- Generic error. + +- **ERR_UNAVAILABLE** = **2** --- Unavailable error. + +- **ERR_UNCONFIGURED** = **3** --- Unconfigured error. + +- **ERR_UNAUTHORIZED** = **4** --- Unauthorized error. + +- **ERR_PARAMETER_RANGE_ERROR** = **5** --- Parameter range error. + +- **ERR_OUT_OF_MEMORY** = **6** --- Out of memory (OOM) error. + +- **ERR_FILE_NOT_FOUND** = **7** --- File: Not found error. + +- **ERR_FILE_BAD_DRIVE** = **8** --- File: Bad drive error. + +- **ERR_FILE_BAD_PATH** = **9** --- File: Bad path error. + +- **ERR_FILE_NO_PERMISSION** = **10** --- File: No permission error. + +- **ERR_FILE_ALREADY_IN_USE** = **11** --- File: Already in use error. + +- **ERR_FILE_CANT_OPEN** = **12** --- File: Can't open error. + +- **ERR_FILE_CANT_WRITE** = **13** --- File: Can't write error. + +- **ERR_FILE_CANT_READ** = **14** --- File: Can't read error. + +- **ERR_FILE_UNRECOGNIZED** = **15** --- File: Unrecognized error. + +- **ERR_FILE_CORRUPT** = **16** --- File: Corrupt error. + +- **ERR_FILE_MISSING_DEPENDENCIES** = **17** --- File: Missing dependencies error. + +- **ERR_FILE_EOF** = **18** --- File: End of file (EOF) error. + +- **ERR_CANT_OPEN** = **19** --- Can't open error. + +- **ERR_CANT_CREATE** = **20** --- Can't create error. + +- **ERR_QUERY_FAILED** = **21** --- Query failed error. + +- **ERR_ALREADY_IN_USE** = **22** --- Already in use error. + +- **ERR_LOCKED** = **23** --- Locked error. + +- **ERR_TIMEOUT** = **24** --- Timeout error. + +- **ERR_CANT_CONNECT** = **25** --- Can't connect error. + +- **ERR_CANT_RESOLVE** = **26** --- Can't resolve error. + +- **ERR_CONNECTION_ERROR** = **27** --- Connection error. + +- **ERR_CANT_ACQUIRE_RESOURCE** = **28** --- Can't acquire resource error. + +- **ERR_CANT_FORK** = **29** --- Can't fork process error. + +- **ERR_INVALID_DATA** = **30** --- Invalid data error. + +- **ERR_INVALID_PARAMETER** = **31** --- Invalid parameter error. + +- **ERR_ALREADY_EXISTS** = **32** --- Already exists error. + +- **ERR_DOES_NOT_EXIST** = **33** --- Does not exist error. + +- **ERR_DATABASE_CANT_READ** = **34** --- Database: Read error. + +- **ERR_DATABASE_CANT_WRITE** = **35** --- Database: Write error. + +- **ERR_COMPILATION_FAILED** = **36** --- Compilation failed error. + +- **ERR_METHOD_NOT_FOUND** = **37** --- Method not found error. + +- **ERR_LINK_FAILED** = **38** --- Linking failed error. + +- **ERR_SCRIPT_FAILED** = **39** --- Script failed error. + +- **ERR_CYCLIC_LINK** = **40** --- Cycling link (import cycle) error. + +- **ERR_INVALID_DECLARATION** = **41** --- Invalid declaration error. + +- **ERR_DUPLICATE_SYMBOL** = **42** --- Duplicate symbol error. + +- **ERR_PARSE_ERROR** = **43** --- Parse error. + +- **ERR_BUSY** = **44** --- Busy error. + +- **ERR_SKIP** = **45** --- Skip error. + +- **ERR_HELP** = **46** --- Help error. + +- **ERR_BUG** = **47** --- Bug error. + +- **ERR_PRINTER_ON_FIRE** = **48** --- Printer on fire error. (This is an easter egg, no engine methods return this error code.) + +---- + +.. _enum_@GlobalScope_PropertyHint: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_NONE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_RANGE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_EXP_RANGE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_ENUM: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_EXP_EASING: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_LENGTH: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_KEY_ACCEL: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_FLAGS: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_RENDER: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_2D_PHYSICS: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_RENDER: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_LAYERS_3D_PHYSICS: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_FILE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_DIR: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_FILE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_GLOBAL_DIR: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_RESOURCE_TYPE: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_MULTILINE_TEXT: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_PLACEHOLDER_TEXT: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_COLOR_NO_ALPHA: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_IMAGE_COMPRESS_LOSSY: + +.. _class_@GlobalScope_constant_PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS: + +enum **PropertyHint**: + +- **PROPERTY_HINT_NONE** = **0** --- No hint for the edited property. + +- **PROPERTY_HINT_RANGE** = **1** --- Hints that an integer or float property should be within a range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_lesser"`` to allow manual input going respectively above the max or below the min values. Example: ``"-360,360,1,or_greater,or_lesser"``. + +- **PROPERTY_HINT_EXP_RANGE** = **2** --- Hints that a float property should be within an exponential range specified via the hint string ``"min,max"`` or ``"min,max,step"``. The hint string can optionally include ``"or_greater"`` and/or ``"or_lesser"`` to allow manual input going respectively above the max or below the min values. Example: ``"0.01,100,0.01,or_greater"``. + +- **PROPERTY_HINT_ENUM** = **3** --- Hints that an integer, float or string property is an enumerated value to pick in a list specified via a hint string such as ``"Hello,Something,Else"``. + +- **PROPERTY_HINT_EXP_EASING** = **4** --- Hints that a float property should be edited via an exponential easing function. The hint string can include ``"attenuation"`` to flip the curve horizontally and/or ``"inout"`` to also include in/out easing. + +- **PROPERTY_HINT_LENGTH** = **5** --- Deprecated hint, unused. + +- **PROPERTY_HINT_KEY_ACCEL** = **7** --- Deprecated hint, unused. + +- **PROPERTY_HINT_FLAGS** = **8** --- Hints that an integer property is a bitmask with named bit flags. For example, to allow toggling bits 0, 1, 2 and 4, the hint could be something like ``"Bit0,Bit1,Bit2,,Bit4"``. + +- **PROPERTY_HINT_LAYERS_2D_RENDER** = **9** --- Hints that an integer property is a bitmask using the optionally named 2D render layers. + +- **PROPERTY_HINT_LAYERS_2D_PHYSICS** = **10** --- Hints that an integer property is a bitmask using the optionally named 2D physics layers. + +- **PROPERTY_HINT_LAYERS_3D_RENDER** = **11** --- Hints that an integer property is a bitmask using the optionally named 3D render layers. + +- **PROPERTY_HINT_LAYERS_3D_PHYSICS** = **12** --- Hints that an integer property is a bitmask using the optionally named 3D physics layers. + +- **PROPERTY_HINT_FILE** = **13** --- Hints that a string property is a path to a file. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. + +- **PROPERTY_HINT_DIR** = **14** --- Hints that a string property is a path to a directory. Editing it will show a file dialog for picking the path. + +- **PROPERTY_HINT_GLOBAL_FILE** = **15** --- Hints that a string property is an absolute path to a file outside the project folder. Editing it will show a file dialog for picking the path. The hint string can be a set of filters with wildcards like ``"*.png,*.jpg"``. + +- **PROPERTY_HINT_GLOBAL_DIR** = **16** --- Hints that a string property is an absolute path to a directory outside the project folder. Editing it will show a file dialog for picking the path. + +- **PROPERTY_HINT_RESOURCE_TYPE** = **17** --- Hints that a property is an instance of a :ref:`Resource`-derived type, optionally specified via the hint string (e.g. ``"Texture"``). Editing it will show a popup menu of valid resource types to instantiate. + +- **PROPERTY_HINT_MULTILINE_TEXT** = **18** --- Hints that a string property is text with line breaks. Editing it will show a text input field where line breaks can be typed. + +- **PROPERTY_HINT_PLACEHOLDER_TEXT** = **19** --- Hints that a string property should have a placeholder text visible on its input field, whenever the property is empty. The hint string is the placeholder text to use. + +- **PROPERTY_HINT_COLOR_NO_ALPHA** = **20** --- Hints that a color property should be edited without changing its alpha component, i.e. only R, G and B channels are edited. + +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSY** = **21** --- Hints that an image is compressed using lossy compression. + +- **PROPERTY_HINT_IMAGE_COMPRESS_LOSSLESS** = **22** --- Hints that an image is compressed using lossless compression. + +---- + +.. _enum_@GlobalScope_PropertyUsageFlags: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_STORAGE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NETWORK: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_EDITOR_HELPER: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_CHECKABLE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_CHECKED: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_INTERNATIONALIZED: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_GROUP: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_CATEGORY: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NO_INSTANCE_STATE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_RESTART_IF_CHANGED: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_SCRIPT_VARIABLE: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_DEFAULT_INTL: + +.. _class_@GlobalScope_constant_PROPERTY_USAGE_NOEDITOR: + +enum **PropertyUsageFlags**: + +- **PROPERTY_USAGE_STORAGE** = **1** --- The property is serialized and saved in the scene file (default). + +- **PROPERTY_USAGE_EDITOR** = **2** --- The property is shown in the editor inspector (default). + +- **PROPERTY_USAGE_NETWORK** = **4** --- Deprecated usage flag, unused. + +- **PROPERTY_USAGE_EDITOR_HELPER** = **8** --- Deprecated usage flag, unused. + +- **PROPERTY_USAGE_CHECKABLE** = **16** --- The property can be checked in the editor inspector. + +- **PROPERTY_USAGE_CHECKED** = **32** --- The property is checked in the editor inspector. + +- **PROPERTY_USAGE_INTERNATIONALIZED** = **64** --- The property is a translatable string. + +- **PROPERTY_USAGE_GROUP** = **128** --- Used to group properties together in the editor. + +- **PROPERTY_USAGE_CATEGORY** = **256** --- Used to categorize properties together in the editor. + +- **PROPERTY_USAGE_NO_INSTANCE_STATE** = **2048** --- The property does not save its state in :ref:`PackedScene`. + +- **PROPERTY_USAGE_RESTART_IF_CHANGED** = **4096** --- Editing the property prompts the user for restarting the editor. + +- **PROPERTY_USAGE_SCRIPT_VARIABLE** = **8192** --- The property is a script variable which should be serialized and saved in the scene file. + +- **PROPERTY_USAGE_DEFAULT** = **7** --- Default usage (storage, editor and network). + +- **PROPERTY_USAGE_DEFAULT_INTL** = **71** --- Default usage for translatable strings (storage, editor, network and internationalized). + +- **PROPERTY_USAGE_NOEDITOR** = **5** --- Default usage but without showing the property in the editor (storage, network). + +---- + +.. _enum_@GlobalScope_MethodFlags: + +.. _class_@GlobalScope_constant_METHOD_FLAG_NORMAL: + +.. _class_@GlobalScope_constant_METHOD_FLAG_EDITOR: + +.. _class_@GlobalScope_constant_METHOD_FLAG_NOSCRIPT: + +.. _class_@GlobalScope_constant_METHOD_FLAG_CONST: + +.. _class_@GlobalScope_constant_METHOD_FLAG_REVERSE: + +.. _class_@GlobalScope_constant_METHOD_FLAG_VIRTUAL: + +.. _class_@GlobalScope_constant_METHOD_FLAG_FROM_SCRIPT: + +.. _class_@GlobalScope_constant_METHOD_FLAGS_DEFAULT: + +enum **MethodFlags**: + +- **METHOD_FLAG_NORMAL** = **1** --- Flag for a normal method. + +- **METHOD_FLAG_EDITOR** = **2** --- Flag for an editor method. + +- **METHOD_FLAG_NOSCRIPT** = **4** --- Deprecated method flag, unused. + +- **METHOD_FLAG_CONST** = **8** --- Flag for a constant method. + +- **METHOD_FLAG_REVERSE** = **16** --- Deprecated method flag, unused. + +- **METHOD_FLAG_VIRTUAL** = **32** --- Flag for a virtual method. + +- **METHOD_FLAG_FROM_SCRIPT** = **64** --- Deprecated method flag, unused. + +- **METHOD_FLAGS_DEFAULT** = **1** --- Default method flags. + +---- + +.. _enum_@GlobalScope_Variant.Type: + +.. _class_@GlobalScope_constant_TYPE_NIL: + +.. _class_@GlobalScope_constant_TYPE_BOOL: + +.. _class_@GlobalScope_constant_TYPE_INT: + +.. _class_@GlobalScope_constant_TYPE_REAL: + +.. _class_@GlobalScope_constant_TYPE_STRING: + +.. _class_@GlobalScope_constant_TYPE_VECTOR2: + +.. _class_@GlobalScope_constant_TYPE_RECT2: + +.. _class_@GlobalScope_constant_TYPE_VECTOR3: + +.. _class_@GlobalScope_constant_TYPE_TRANSFORM2D: + +.. _class_@GlobalScope_constant_TYPE_PLANE: + +.. _class_@GlobalScope_constant_TYPE_QUAT: + +.. _class_@GlobalScope_constant_TYPE_AABB: + +.. _class_@GlobalScope_constant_TYPE_BASIS: + +.. _class_@GlobalScope_constant_TYPE_TRANSFORM: + +.. _class_@GlobalScope_constant_TYPE_COLOR: + +.. _class_@GlobalScope_constant_TYPE_NODE_PATH: + +.. _class_@GlobalScope_constant_TYPE_RID: + +.. _class_@GlobalScope_constant_TYPE_OBJECT: + +.. _class_@GlobalScope_constant_TYPE_DICTIONARY: + +.. _class_@GlobalScope_constant_TYPE_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_RAW_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_INT_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_REAL_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_STRING_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_VECTOR2_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_VECTOR3_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_COLOR_ARRAY: + +.. _class_@GlobalScope_constant_TYPE_MAX: + +enum **Variant.Type**: + +- **TYPE_NIL** = **0** --- Variable is ``null``. + +- **TYPE_BOOL** = **1** --- Variable is of type :ref:`bool`. + +- **TYPE_INT** = **2** --- Variable is of type :ref:`int`. + +- **TYPE_REAL** = **3** --- Variable is of type :ref:`float` (real). + +- **TYPE_STRING** = **4** --- Variable is of type :ref:`String`. + +- **TYPE_VECTOR2** = **5** --- Variable is of type :ref:`Vector2`. + +- **TYPE_RECT2** = **6** --- Variable is of type :ref:`Rect2`. + +- **TYPE_VECTOR3** = **7** --- Variable is of type :ref:`Vector3`. + +- **TYPE_TRANSFORM2D** = **8** --- Variable is of type :ref:`Transform2D`. + +- **TYPE_PLANE** = **9** --- Variable is of type :ref:`Plane`. + +- **TYPE_QUAT** = **10** --- Variable is of type :ref:`Quat`. + +- **TYPE_AABB** = **11** --- Variable is of type :ref:`AABB`. + +- **TYPE_BASIS** = **12** --- Variable is of type :ref:`Basis`. + +- **TYPE_TRANSFORM** = **13** --- Variable is of type :ref:`Transform`. + +- **TYPE_COLOR** = **14** --- Variable is of type :ref:`Color`. + +- **TYPE_NODE_PATH** = **15** --- Variable is of type :ref:`NodePath`. + +- **TYPE_RID** = **16** --- Variable is of type :ref:`RID`. + +- **TYPE_OBJECT** = **17** --- Variable is of type :ref:`Object`. + +- **TYPE_DICTIONARY** = **18** --- Variable is of type :ref:`Dictionary`. + +- **TYPE_ARRAY** = **19** --- Variable is of type :ref:`Array`. + +- **TYPE_RAW_ARRAY** = **20** --- Variable is of type :ref:`PoolByteArray`. + +- **TYPE_INT_ARRAY** = **21** --- Variable is of type :ref:`PoolIntArray`. + +- **TYPE_REAL_ARRAY** = **22** --- Variable is of type :ref:`PoolRealArray`. + +- **TYPE_STRING_ARRAY** = **23** --- Variable is of type :ref:`PoolStringArray`. + +- **TYPE_VECTOR2_ARRAY** = **24** --- Variable is of type :ref:`PoolVector2Array`. + +- **TYPE_VECTOR3_ARRAY** = **25** --- Variable is of type :ref:`PoolVector3Array`. + +- **TYPE_COLOR_ARRAY** = **26** --- Variable is of type :ref:`PoolColorArray`. + +- **TYPE_MAX** = **27** --- Represents the size of the :ref:`Variant.Type` enum. + +---- + +.. _enum_@GlobalScope_Variant.Operator: + +.. _class_@GlobalScope_constant_OP_EQUAL: + +.. _class_@GlobalScope_constant_OP_NOT_EQUAL: + +.. _class_@GlobalScope_constant_OP_LESS: + +.. _class_@GlobalScope_constant_OP_LESS_EQUAL: + +.. _class_@GlobalScope_constant_OP_GREATER: + +.. _class_@GlobalScope_constant_OP_GREATER_EQUAL: + +.. _class_@GlobalScope_constant_OP_ADD: + +.. _class_@GlobalScope_constant_OP_SUBTRACT: + +.. _class_@GlobalScope_constant_OP_MULTIPLY: + +.. _class_@GlobalScope_constant_OP_DIVIDE: + +.. _class_@GlobalScope_constant_OP_NEGATE: + +.. _class_@GlobalScope_constant_OP_POSITIVE: + +.. _class_@GlobalScope_constant_OP_MODULE: + +.. _class_@GlobalScope_constant_OP_STRING_CONCAT: + +.. _class_@GlobalScope_constant_OP_SHIFT_LEFT: + +.. _class_@GlobalScope_constant_OP_SHIFT_RIGHT: + +.. _class_@GlobalScope_constant_OP_BIT_AND: + +.. _class_@GlobalScope_constant_OP_BIT_OR: + +.. _class_@GlobalScope_constant_OP_BIT_XOR: + +.. _class_@GlobalScope_constant_OP_BIT_NEGATE: + +.. _class_@GlobalScope_constant_OP_AND: + +.. _class_@GlobalScope_constant_OP_OR: + +.. _class_@GlobalScope_constant_OP_XOR: + +.. _class_@GlobalScope_constant_OP_NOT: + +.. _class_@GlobalScope_constant_OP_IN: + +.. _class_@GlobalScope_constant_OP_MAX: + +enum **Variant.Operator**: + +- **OP_EQUAL** = **0** --- Equality operator (``==``). + +- **OP_NOT_EQUAL** = **1** --- Inequality operator (``!=``). + +- **OP_LESS** = **2** --- Less than operator (``<``). + +- **OP_LESS_EQUAL** = **3** --- Less than or equal operator (``<=``). + +- **OP_GREATER** = **4** --- Greater than operator (``>``). + +- **OP_GREATER_EQUAL** = **5** --- Greater than or equal operator (``>=``). + +- **OP_ADD** = **6** --- Addition operator (``+``). + +- **OP_SUBTRACT** = **7** --- Subtraction operator (``-``). + +- **OP_MULTIPLY** = **8** --- Multiplication operator (``*``). + +- **OP_DIVIDE** = **9** --- Division operator (``/``). + +- **OP_NEGATE** = **10** --- Unary negation operator (``-``). + +- **OP_POSITIVE** = **11** --- Unary plus operator (``+``). + +- **OP_MODULE** = **12** --- Remainder/modulo operator (``%``). + +- **OP_STRING_CONCAT** = **13** --- String concatenation operator (``+``). + +- **OP_SHIFT_LEFT** = **14** --- Left shift operator (``<<``). + +- **OP_SHIFT_RIGHT** = **15** --- Right shift operator (``>>``). + +- **OP_BIT_AND** = **16** --- Bitwise AND operator (``&``). + +- **OP_BIT_OR** = **17** --- Bitwise OR operator (``|``). + +- **OP_BIT_XOR** = **18** --- Bitwise XOR operator (``^``). + +- **OP_BIT_NEGATE** = **19** --- Bitwise NOT operator (``~``). + +- **OP_AND** = **20** --- Logical AND operator (``and`` or ``&&``). + +- **OP_OR** = **21** --- Logical OR operator (``or`` or ``||``). + +- **OP_XOR** = **22** --- Logical XOR operator (not implemented in GDScript). + +- **OP_NOT** = **23** --- Logical NOT operator (``not`` or ``!``). + +- **OP_IN** = **24** --- Logical IN operator (``in``). + +- **OP_MAX** = **25** --- Represents the size of the :ref:`Variant.Operator` enum. + +Constants +--------- + +.. _class_@GlobalScope_constant_SPKEY: + +- **SPKEY** = **16777216** --- Scancodes with this bit applied are non-printable. + +Property Descriptions +--------------------- + +.. _class_@GlobalScope_property_ARVRServer: + +- :ref:`ARVRServer` **ARVRServer** + +The :ref:`ARVRServer` singleton. + +---- + +.. _class_@GlobalScope_property_AudioServer: + +- :ref:`AudioServer` **AudioServer** + +The :ref:`AudioServer` singleton. + +---- + +.. _class_@GlobalScope_property_CameraServer: + +- :ref:`CameraServer` **CameraServer** + +The :ref:`CameraServer` singleton. + +---- + +.. _class_@GlobalScope_property_ClassDB: + +- :ref:`ClassDB` **ClassDB** + +The :ref:`ClassDB` singleton. + +---- + +.. _class_@GlobalScope_property_Engine: + +- :ref:`Engine` **Engine** + +The :ref:`Engine` singleton. + +---- + +.. _class_@GlobalScope_property_Geometry: + +- :ref:`Geometry` **Geometry** + +The :ref:`Geometry` singleton. + +---- + +.. _class_@GlobalScope_property_IP: + +- :ref:`IP` **IP** + +The :ref:`IP` singleton. + +---- + +.. _class_@GlobalScope_property_Input: + +- :ref:`Input` **Input** + +The :ref:`Input` singleton. + +---- + +.. _class_@GlobalScope_property_InputMap: + +- :ref:`InputMap` **InputMap** + +The :ref:`InputMap` singleton. + +---- + +.. _class_@GlobalScope_property_JSON: + +- :ref:`JSON` **JSON** + +The :ref:`JSON` singleton. + +---- + +.. _class_@GlobalScope_property_JavaClassWrapper: + +- :ref:`JavaClassWrapper` **JavaClassWrapper** + +The :ref:`JavaClassWrapper` singleton. + +**Note:** Only implemented on Android. + +---- + +.. _class_@GlobalScope_property_JavaScript: + +- :ref:`JavaScript` **JavaScript** + +The :ref:`JavaScript` singleton. + +**Note:** Only implemented on HTML5. + +---- + +.. _class_@GlobalScope_property_Marshalls: + +- :ref:`Marshalls` **Marshalls** + +The :ref:`Marshalls` singleton. + +---- + +.. _class_@GlobalScope_property_NavigationMeshGenerator: + +- :ref:`EditorNavigationMeshGenerator` **NavigationMeshGenerator** + +The :ref:`EditorNavigationMeshGenerator` singleton. + +---- + +.. _class_@GlobalScope_property_OS: + +- :ref:`OS` **OS** + +The :ref:`OS` singleton. + +---- + +.. _class_@GlobalScope_property_Performance: + +- :ref:`Performance` **Performance** + +The :ref:`Performance` singleton. + +---- + +.. _class_@GlobalScope_property_Physics2DServer: + +- :ref:`Physics2DServer` **Physics2DServer** + +The :ref:`Physics2DServer` singleton. + +---- + +.. _class_@GlobalScope_property_PhysicsServer: + +- :ref:`PhysicsServer` **PhysicsServer** + +The :ref:`PhysicsServer` singleton. + +---- + +.. _class_@GlobalScope_property_ProjectSettings: + +- :ref:`ProjectSettings` **ProjectSettings** + +The :ref:`ProjectSettings` singleton. + +---- + +.. _class_@GlobalScope_property_ResourceLoader: + +- :ref:`ResourceLoader` **ResourceLoader** + +The :ref:`ResourceLoader` singleton. + +---- + +.. _class_@GlobalScope_property_ResourceSaver: + +- :ref:`ResourceSaver` **ResourceSaver** + +The :ref:`ResourceSaver` singleton. + +---- + +.. _class_@GlobalScope_property_TranslationServer: + +- :ref:`TranslationServer` **TranslationServer** + +The :ref:`TranslationServer` singleton. + +---- + +.. _class_@GlobalScope_property_VisualScriptEditor: + +- :ref:`VisualScriptEditor` **VisualScriptEditor** + +The :ref:`VisualScriptEditor` singleton. + +---- + +.. _class_@GlobalScope_property_VisualServer: + +- :ref:`VisualServer` **VisualServer** + +The :ref:`VisualServer` singleton. + +.. |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.)` diff --git a/classes/class_aabb.rst b/classes/class_aabb.rst new file mode 100644 index 0000000..13eea1f --- /dev/null +++ b/classes/class_aabb.rst @@ -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//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`. + +**Note:** Unlike :ref:`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` | :ref:`end` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-----------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`position` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-----------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`size` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-----------------------------------------------+------------------------+ + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`AABB` **(** :ref:`Vector3` position, :ref:`Vector3` size **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`abs` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`encloses` **(** :ref:`AABB` with **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`expand` **(** :ref:`Vector3` to_point **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_area` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_endpoint` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_longest_axis` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_longest_axis_index` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_longest_axis_size` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_shortest_axis` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_shortest_axis_index` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_shortest_axis_size` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_support` **(** :ref:`Vector3` dir **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`grow` **(** :ref:`float` by **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_no_area` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_no_surface` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`intersection` **(** :ref:`AABB` with **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects` **(** :ref:`AABB` with **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects_plane` **(** :ref:`Plane` plane **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects_segment` **(** :ref:`Vector3` from, :ref:`Vector3` to **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`AABB` aabb **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`merge` **(** :ref:`AABB` with **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AABB_property_end: + +- :ref:`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` **position** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ + +Beginning corner. Typically has values lower than :ref:`end`. + +---- + +.. _class_AABB_property_size: + +- :ref:`Vector3` **size** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ + +Size from :ref:`position` to :ref:`end`. Typically, all components are positive. + +If the size is negative, you can use :ref:`abs` to fix it. + +Method Descriptions +------------------- + +.. _class_AABB_method_AABB: + +- :ref:`AABB` **AABB** **(** :ref:`Vector3` position, :ref:`Vector3` size **)** + +Constructs an ``AABB`` from a position and size. + +---- + +.. _class_AABB_method_abs: + +- :ref:`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` **encloses** **(** :ref:`AABB` with **)** + +Returns ``true`` if this ``AABB`` completely encloses another one. + +---- + +.. _class_AABB_method_expand: + +- :ref:`AABB` **expand** **(** :ref:`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` **get_area** **(** **)** + +Returns the volume of the ``AABB``. + +---- + +.. _class_AABB_method_get_endpoint: + +- :ref:`Vector3` **get_endpoint** **(** :ref:`int` idx **)** + +Gets the position of the 8 endpoints of the ``AABB`` in space. + +---- + +.. _class_AABB_method_get_longest_axis: + +- :ref:`Vector3` **get_longest_axis** **(** **)** + +Returns the normalized longest axis of the ``AABB``. + +---- + +.. _class_AABB_method_get_longest_axis_index: + +- :ref:`int` **get_longest_axis_index** **(** **)** + +Returns the index of the longest axis of the ``AABB`` (according to :ref:`Vector3`'s ``AXIS_*`` constants). + +---- + +.. _class_AABB_method_get_longest_axis_size: + +- :ref:`float` **get_longest_axis_size** **(** **)** + +Returns the scalar length of the longest axis of the ``AABB``. + +---- + +.. _class_AABB_method_get_shortest_axis: + +- :ref:`Vector3` **get_shortest_axis** **(** **)** + +Returns the normalized shortest axis of the ``AABB``. + +---- + +.. _class_AABB_method_get_shortest_axis_index: + +- :ref:`int` **get_shortest_axis_index** **(** **)** + +Returns the index of the shortest axis of the ``AABB`` (according to :ref:`Vector3`::AXIS\* enum). + +---- + +.. _class_AABB_method_get_shortest_axis_size: + +- :ref:`float` **get_shortest_axis_size** **(** **)** + +Returns the scalar length of the shortest axis of the ``AABB``. + +---- + +.. _class_AABB_method_get_support: + +- :ref:`Vector3` **get_support** **(** :ref:`Vector3` dir **)** + +Returns the support point in a given direction. This is useful for collision detection algorithms. + +---- + +.. _class_AABB_method_grow: + +- :ref:`AABB` **grow** **(** :ref:`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` **has_no_area** **(** **)** + +Returns ``true`` if the ``AABB`` is flat or empty. + +---- + +.. _class_AABB_method_has_no_surface: + +- :ref:`bool` **has_no_surface** **(** **)** + +Returns ``true`` if the ``AABB`` is empty. + +---- + +.. _class_AABB_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`Vector3` point **)** + +Returns ``true`` if the ``AABB`` contains a point. + +---- + +.. _class_AABB_method_intersection: + +- :ref:`AABB` **intersection** **(** :ref:`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` **intersects** **(** :ref:`AABB` with **)** + +Returns ``true`` if the ``AABB`` overlaps with another. + +---- + +.. _class_AABB_method_intersects_plane: + +- :ref:`bool` **intersects_plane** **(** :ref:`Plane` plane **)** + +Returns ``true`` if the ``AABB`` is on both sides of a plane. + +---- + +.. _class_AABB_method_intersects_segment: + +- :ref:`bool` **intersects_segment** **(** :ref:`Vector3` from, :ref:`Vector3` to **)** + +Returns ``true`` if the ``AABB`` intersects the line segment between ``from`` and ``to``. + +---- + +.. _class_AABB_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`AABB` aabb **)** + +Returns ``true`` if this ``AABB`` and ``aabb`` are approximately equal, by calling :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_AABB_method_merge: + +- :ref:`AABB` **merge** **(** :ref:`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.)` diff --git a/classes/class_acceptdialog.rst b/classes/class_acceptdialog.rst new file mode 100644 index 0000000..37a7aed --- /dev/null +++ b/classes/class_acceptdialog.rst @@ -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//doc_classes. + +.. _class_AcceptDialog: + +AcceptDialog +============ + +**Inherits:** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`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` | :ref:`dialog_autowrap` | ``false`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`bool` | :ref:`dialog_hide_on_ok` | ``true`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`String` | :ref:`dialog_text` | ``""`` | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ +| :ref:`String` | window_title | ``"Alert!"`` *(parent override)* | ++-----------------------------+-------------------------------------------------------------------------+----------------------------------+ + +Methods +------- + ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Button` | :ref:`add_button` **(** :ref:`String` text, :ref:`bool` right=false, :ref:`String` action="" **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Button` | :ref:`add_cancel` **(** :ref:`String` name **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Label` | :ref:`get_label` **(** **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Button` | :ref:`get_ok` **(** **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`register_text_enter` **(** :ref:`Node` line_edit **)** | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_button` **(** :ref:`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` action **)** + +Emitted when a custom button is pressed. See :ref:`add_button`. + +Property Descriptions +--------------------- + +.. _class_AcceptDialog_property_dialog_autowrap: + +- :ref:`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` **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` 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` 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` to disable hiding the dialog when pressing OK. + +---- + +.. _class_AcceptDialog_property_dialog_text: + +- :ref:`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` **add_button** **(** :ref:`String` text, :ref:`bool` right=false, :ref:`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` signal when pressed. + +If ``true``, ``right`` will place the button to the right of any sibling buttons. + +You can use :ref:`remove_button` method to remove a button created with this method from the dialog. + +---- + +.. _class_AcceptDialog_method_add_cancel: + +- :ref:`Button` **add_cancel** **(** :ref:`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` method to remove a button created with this method from the dialog. + +---- + +.. _class_AcceptDialog_method_get_label: + +- :ref:`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` property. + +---- + +.. _class_AcceptDialog_method_get_ok: + +- :ref:`Button` **get_ok** **(** **)** + +Returns the OK :ref:`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` property. + +---- + +.. _class_AcceptDialog_method_register_text_enter: + +- void **register_text_enter** **(** :ref:`Node` line_edit **)** + +Registers a :ref:`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` button **)** + +Removes the ``button`` from the dialog. Does NOT free the ``button``. The ``button`` must be a :ref:`Button` added with :ref:`add_button` or :ref:`add_cancel` method. After removal, pressing the ``button`` will no longer emit this dialog's :ref:`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.)` diff --git a/classes/class_aescontext.rst b/classes/class_aescontext.rst new file mode 100644 index 0000000..68cfc67 --- /dev/null +++ b/classes/class_aescontext.rst @@ -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//doc_classes. + +.. _class_AESContext: + +AESContext +========== + +**Inherits:** :ref:`Reference` **<** :ref:`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` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`get_iv_state` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start` **(** :ref:`Mode` mode, :ref:`PoolByteArray` key, :ref:`PoolByteArray` iv=PoolByteArray( ) **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`update` **(** :ref:`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_get_iv_state: + +- :ref:`PoolByteArray` **get_iv_state** **(** **)** + +Get the current IV state for this context (IV gets updated when calling :ref:`update`). You normally don't need this function. + +**Note:** This function only makes sense when the context is started with :ref:`MODE_CBC_ENCRYPT` or :ref:`MODE_CBC_DECRYPT`. + +---- + +.. _class_AESContext_method_start: + +- :ref:`Error` **start** **(** :ref:`Mode` mode, :ref:`PoolByteArray` key, :ref:`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` or :ref:`MODE_CBC_DECRYPT`. + +---- + +.. _class_AESContext_method_update: + +- :ref:`PoolByteArray` **update** **(** :ref:`PoolByteArray` src **)** + +Run the desired operation for this AES context. Will return a :ref:`PoolByteArray` containing the result of encrypting (or decrypting) the given ``src``. See :ref:`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.)` diff --git a/classes/class_animatedsprite.rst b/classes/class_animatedsprite.rst new file mode 100644 index 0000000..332860e --- /dev/null +++ b/classes/class_animatedsprite.rst @@ -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//doc_classes. + +.. _class_AnimatedSprite: + +AnimatedSprite +============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Sprite node that can use multiple textures for animation. + +Description +----------- + +Animations are created using a :ref:`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` resources with a ``_normal`` suffix. For example, having 2 :ref:`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 `__ + +Properties +---------- + ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`animation` | ``"default"`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`centered` | ``true`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`frame` | ``0`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`SpriteFrames` | :ref:`frames` | | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++-----------------------------------------+---------------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`String` anim="", :ref:`bool` backwards=false **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`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` changed. + +Property Descriptions +--------------------- + +.. _class_AnimatedSprite_property_animation: + +- :ref:`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` **centered** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_centered(value) | ++-----------+---------------------+ +| *Getter* | is_centered() | ++-----------+---------------------+ + +If ``true``, texture will be centered. + +---- + +.. _class_AnimatedSprite_property_flip_h: + +- :ref:`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` **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` **frame** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_frame(value) | ++-----------+------------------+ +| *Getter* | get_frame() | ++-----------+------------------+ + +The displayed animation frame's index. + +---- + +.. _class_AnimatedSprite_property_frames: + +- :ref:`SpriteFrames` **frames** + ++----------+--------------------------+ +| *Setter* | set_sprite_frames(value) | ++----------+--------------------------+ +| *Getter* | get_sprite_frames() | ++----------+--------------------------+ + +The :ref:`SpriteFrames` resource containing the animation(s). + +---- + +.. _class_AnimatedSprite_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The texture's drawing offset. + +---- + +.. _class_AnimatedSprite_property_playing: + +- :ref:`bool` **playing** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the :ref:`animation` is currently playing. + +---- + +.. _class_AnimatedSprite_property_speed_scale: + +- :ref:`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` **is_playing** **(** **)** |const| + +Returns ``true`` if an animation is currently being played. + +---- + +.. _class_AnimatedSprite_method_play: + +- void **play** **(** :ref:`String` anim="", :ref:`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.)` diff --git a/classes/class_animatedsprite3d.rst b/classes/class_animatedsprite3d.rst new file mode 100644 index 0000000..66829a7 --- /dev/null +++ b/classes/class_animatedsprite3d.rst @@ -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//doc_classes. + +.. _class_AnimatedSprite3D: + +AnimatedSprite3D +================ + +**Inherits:** :ref:`SpriteBase3D` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +2D sprite node in 3D world, that can use multiple 2D textures for animation. + +Description +----------- + +Animations are created using a :ref:`SpriteFrames` resource, which can be configured in the editor via the SpriteFrames panel. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_sprite_animation` + +Properties +---------- + ++-----------------------------------------+-------------------------------------------------------------+---------------+ +| :ref:`String` | :ref:`animation` | ``"default"`` | ++-----------------------------------------+-------------------------------------------------------------+---------------+ +| :ref:`int` | :ref:`frame` | ``0`` | ++-----------------------------------------+-------------------------------------------------------------+---------------+ +| :ref:`SpriteFrames` | :ref:`frames` | | ++-----------------------------------------+-------------------------------------------------------------+---------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++-----------------------------------------+-------------------------------------------------------------+---------------+ + +Methods +------- + ++-------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-------------------------+-------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`String` anim="" **)** | ++-------------------------+-------------------------------------------------------------------------------------------------+ +| void | :ref:`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` changed. + +Property Descriptions +--------------------- + +.. _class_AnimatedSprite3D_property_animation: + +- :ref:`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` **frame** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_frame(value) | ++-----------+------------------+ +| *Getter* | get_frame() | ++-----------+------------------+ + +The displayed animation frame's index. + +---- + +.. _class_AnimatedSprite3D_property_frames: + +- :ref:`SpriteFrames` **frames** + ++----------+--------------------------+ +| *Setter* | set_sprite_frames(value) | ++----------+--------------------------+ +| *Getter* | get_sprite_frames() | ++----------+--------------------------+ + +The :ref:`SpriteFrames` resource containing the animation(s). + +---- + +.. _class_AnimatedSprite3D_property_playing: + +- :ref:`bool` **playing** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the :ref:`animation` is currently playing. + +Method Descriptions +------------------- + +.. _class_AnimatedSprite3D_method_is_playing: + +- :ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if an animation is currently being played. + +---- + +.. _class_AnimatedSprite3D_method_play: + +- void **play** **(** :ref:`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.)` diff --git a/classes/class_animatedtexture.rst b/classes/class_animatedtexture.rst new file mode 100644 index 0000000..3ebb846 --- /dev/null +++ b/classes/class_animatedtexture.rst @@ -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//doc_classes. + +.. _class_AnimatedTexture: + +AnimatedTexture +=============== + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` or :ref:`AnimatedSprite`, it isn't a :ref:`Node`, but has the advantage of being usable anywhere a :ref:`Texture` resource can be used, e.g. in a :ref:`TileSet`. + +The playback of the animation is controlled by the :ref:`fps` property as well as each frame's optional delay (see :ref:`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`\ s. Each frame needs to be a separate :ref:`Texture`. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`current_frame` | | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`fps` | ``4.0`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`frames` | ``1`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`oneshot` | ``false`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`pause` | ``false`` | ++---------------------------+--------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_frame_delay` **(** :ref:`int` frame **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_frame_texture` **(** :ref:`int` frame **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_frame_delay` **(** :ref:`int` frame, :ref:`float` delay **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_frame_texture` **(** :ref:`int` frame, :ref:`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` or :ref:`AnimatedSprite`. + +Property Descriptions +--------------------- + +.. _class_AnimatedTexture_property_current_frame: + +- :ref:`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` **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` 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`). + +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` **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`, 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_property_oneshot: + +- :ref:`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` to ``true``. + +---- + +.. _class_AnimatedTexture_property_pause: + +- :ref:`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`). 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` **get_frame_delay** **(** :ref:`int` frame **)** |const| + +Returns the given frame's delay value. + +---- + +.. _class_AnimatedTexture_method_get_frame_texture: + +- :ref:`Texture` **get_frame_texture** **(** :ref:`int` frame **)** |const| + +Returns the given frame's :ref:`Texture`. + +---- + +.. _class_AnimatedTexture_method_set_frame_delay: + +- void **set_frame_delay** **(** :ref:`int` frame, :ref:`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`. 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` frame, :ref:`Texture` texture **)** + +Assigns a :ref:`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` - 1. + +You can define any number of textures up to :ref:`MAX_FRAMES`, but keep in mind that only frames from 0 to :ref:`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.)` diff --git a/classes/class_animation.rst b/classes/class_animation.rst new file mode 100644 index 0000000..47b6e2d --- /dev/null +++ b/classes/class_animation.rst @@ -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//doc_classes. + +.. _class_Animation: + +Animation +========= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` or :ref:`AnimationTreePlayer` to be played back. Animation tracks have different types, each with its own set of dedicated methods. Check :ref:`TrackType` to see available types. + +Tutorials +--------- + +- :doc:`../tutorials/animation/index` + +Properties +---------- + ++---------------------------+------------------------------------------------+-----------+ +| :ref:`float` | :ref:`length` | ``1.0`` | ++---------------------------+------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`loop` | ``false`` | ++---------------------------+------------------------------------------------+-----------+ +| :ref:`float` | :ref:`step` | ``0.1`` | ++---------------------------+------------------------------------------------+-----------+ + +Methods +------- + ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_track` **(** :ref:`TrackType` type, :ref:`int` at_position=-1 **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`animation_track_get_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`animation_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`String` animation **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_track_set_key_animation` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`String` animation **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio_track_get_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio_track_get_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`audio_track_get_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Resource` stream, :ref:`float` start_offset=0, :ref:`float` end_offset=0 **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_end_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_start_offset` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` offset **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`audio_track_set_key_stream` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Resource` stream **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bezier_track_get_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bezier_track_get_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`bezier_track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bezier_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2( 0, 0 ), :ref:`Vector2` out_handle=Vector2( 0, 0 ) **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`bezier_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_in_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` in_handle **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_out_handle` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`Vector2` out_handle **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bezier_track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` value **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_track` **(** :ref:`int` track_idx, :ref:`Animation` to_animation **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_track` **(** :ref:`NodePath` path **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_track_count` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`method_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`method_track_get_name` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`method_track_get_params` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_track` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`track_find_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`bool` exact=false **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_get_interpolation_loop_wrap` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`InterpolationType` | :ref:`track_get_interpolation_type` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`track_get_key_count` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`track_get_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`track_get_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`track_get_key_value` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`track_get_path` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TrackType` | :ref:`track_get_type` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Variant` key, :ref:`float` transition=1 **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_is_enabled` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`track_is_imported` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_down` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_to` **(** :ref:`int` track_idx, :ref:`int` to_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_move_up` **(** :ref:`int` track_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_remove_key` **(** :ref:`int` track_idx, :ref:`int` key_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_remove_key_at_position` **(** :ref:`int` track_idx, :ref:`float` position **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_enabled` **(** :ref:`int` track_idx, :ref:`bool` enabled **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_imported` **(** :ref:`int` track_idx, :ref:`bool` imported **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_interpolation_loop_wrap` **(** :ref:`int` track_idx, :ref:`bool` interpolation **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_interpolation_type` **(** :ref:`int` track_idx, :ref:`InterpolationType` interpolation **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_time` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` time **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_transition` **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` transition **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_key_value` **(** :ref:`int` track_idx, :ref:`int` key, :ref:`Variant` value **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_set_path` **(** :ref:`int` track_idx, :ref:`NodePath` path **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`track_swap` **(** :ref:`int` track_idx, :ref:`int` with_idx **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`transform_track_insert_key` **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quat` rotation, :ref:`Vector3` scale **)** | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`transform_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`value_track_get_key_indices` **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`float` delta **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UpdateMode` | :ref:`value_track_get_update_mode` **(** :ref:`int` track_idx **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`value_track_interpolate` **(** :ref:`int` track_idx, :ref:`float` time_sec **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`value_track_set_update_mode` **(** :ref:`int` track_idx, :ref:`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`). + +- **TYPE_AUDIO** = **4** --- Audio tracks are used to play an audio stream with either type of :ref:`AudioStreamPlayer`. The stream can be trimmed and previewed in the animation. + +- **TYPE_ANIMATION** = **5** --- Animation tracks play animations in other :ref:`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` **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` **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` **step** + ++-----------+-----------------+ +| *Default* | ``0.1`` | ++-----------+-----------------+ +| *Setter* | set_step(value) | ++-----------+-----------------+ +| *Getter* | get_step() | ++-----------+-----------------+ + +The animation step value. + +Method Descriptions +------------------- + +.. _class_Animation_method_add_track: + +- :ref:`int` **add_track** **(** :ref:`TrackType` type, :ref:`int` at_position=-1 **)** + +Adds a track to the Animation. + +---- + +.. _class_Animation_method_animation_track_get_key_animation: + +- :ref:`String` **animation_track_get_key_animation** **(** :ref:`int` track_idx, :ref:`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` **animation_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` **audio_track_get_key_end_offset** **(** :ref:`int` track_idx, :ref:`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` **audio_track_get_key_start_offset** **(** :ref:`int` track_idx, :ref:`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` **audio_track_get_key_stream** **(** :ref:`int` track_idx, :ref:`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` **audio_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Resource` stream, :ref:`float` start_offset=0, :ref:`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` 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` track_idx, :ref:`int` key_idx, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` **bezier_track_get_key_in_handle** **(** :ref:`int` track_idx, :ref:`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` **bezier_track_get_key_out_handle** **(** :ref:`int` track_idx, :ref:`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` **bezier_track_get_key_value** **(** :ref:`int` track_idx, :ref:`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` **bezier_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`float` value, :ref:`Vector2` in_handle=Vector2( 0, 0 ), :ref:`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` **bezier_track_interpolate** **(** :ref:`int` track_idx, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` track_idx, :ref:`int` key_idx, :ref:`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` track_idx, :ref:`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` **find_track** **(** :ref:`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` **get_track_count** **(** **)** |const| + +Returns the amount of tracks in the animation. + +---- + +.. _class_Animation_method_method_track_get_key_indices: + +- :ref:`PoolIntArray` **method_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`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` **method_track_get_name** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| + +Returns the method name of a method track. + +---- + +.. _class_Animation_method_method_track_get_params: + +- :ref:`Array` **method_track_get_params** **(** :ref:`int` track_idx, :ref:`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` track_idx **)** + +Removes a track by specifying the track index. + +---- + +.. _class_Animation_method_track_find_key: + +- :ref:`int` **track_find_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`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` **track_get_interpolation_loop_wrap** **(** :ref:`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` **track_get_interpolation_type** **(** :ref:`int` track_idx **)** |const| + +Returns the interpolation type of a given track. + +---- + +.. _class_Animation_method_track_get_key_count: + +- :ref:`int` **track_get_key_count** **(** :ref:`int` track_idx **)** |const| + +Returns the amount of keys in a given track. + +---- + +.. _class_Animation_method_track_get_key_time: + +- :ref:`float` **track_get_key_time** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| + +Returns the time at which the key is located. + +---- + +.. _class_Animation_method_track_get_key_transition: + +- :ref:`float` **track_get_key_transition** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| + +Returns the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease`). + +---- + +.. _class_Animation_method_track_get_key_value: + +- :ref:`Variant` **track_get_key_value** **(** :ref:`int` track_idx, :ref:`int` key_idx **)** |const| + +Returns the value of a given key in a given track. + +---- + +.. _class_Animation_method_track_get_path: + +- :ref:`NodePath` **track_get_path** **(** :ref:`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_get_type: + +- :ref:`TrackType` **track_get_type** **(** :ref:`int` track_idx **)** |const| + +Gets the type of a track. + +---- + +.. _class_Animation_method_track_insert_key: + +- void **track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Variant` key, :ref:`float` transition=1 **)** + +Insert a generic key in a given track. + +---- + +.. _class_Animation_method_track_is_enabled: + +- :ref:`bool` **track_is_enabled** **(** :ref:`int` track_idx **)** |const| + +Returns ``true`` if the track at index ``idx`` is enabled. + +---- + +.. _class_Animation_method_track_is_imported: + +- :ref:`bool` **track_is_imported** **(** :ref:`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` track_idx **)** + +Moves a track down. + +---- + +.. _class_Animation_method_track_move_to: + +- void **track_move_to** **(** :ref:`int` track_idx, :ref:`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` track_idx **)** + +Moves a track up. + +---- + +.. _class_Animation_method_track_remove_key: + +- void **track_remove_key** **(** :ref:`int` track_idx, :ref:`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` track_idx, :ref:`float` position **)** + +Removes a key by position (seconds) in a given track. + +---- + +.. _class_Animation_method_track_set_enabled: + +- void **track_set_enabled** **(** :ref:`int` track_idx, :ref:`bool` enabled **)** + +Enables/disables the given track. Tracks are enabled by default. + +---- + +.. _class_Animation_method_track_set_imported: + +- void **track_set_imported** **(** :ref:`int` track_idx, :ref:`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` track_idx, :ref:`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` track_idx, :ref:`InterpolationType` interpolation **)** + +Sets the interpolation type of a given track. + +---- + +.. _class_Animation_method_track_set_key_time: + +- void **track_set_key_time** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` time **)** + +Sets the time of an existing key. + +---- + +.. _class_Animation_method_track_set_key_transition: + +- void **track_set_key_transition** **(** :ref:`int` track_idx, :ref:`int` key_idx, :ref:`float` transition **)** + +Sets the transition curve (easing) for a specific key (see the built-in math function :ref:`@GDScript.ease`). + +---- + +.. _class_Animation_method_track_set_key_value: + +- void **track_set_key_value** **(** :ref:`int` track_idx, :ref:`int` key, :ref:`Variant` value **)** + +Sets the value of an existing key. + +---- + +.. _class_Animation_method_track_set_path: + +- void **track_set_path** **(** :ref:`int` track_idx, :ref:`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` track_idx, :ref:`int` with_idx **)** + +Swaps the track ``idx``'s index position with the track ``with_idx``. + +---- + +.. _class_Animation_method_transform_track_insert_key: + +- :ref:`int` **transform_track_insert_key** **(** :ref:`int` track_idx, :ref:`float` time, :ref:`Vector3` location, :ref:`Quat` rotation, :ref:`Vector3` scale **)** + +Insert a transform key for a transform track. + +---- + +.. _class_Animation_method_transform_track_interpolate: + +- :ref:`Array` **transform_track_interpolate** **(** :ref:`int` track_idx, :ref:`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`), rotation (:ref:`Quat`) and scale (:ref:`Vector3`). + +---- + +.. _class_Animation_method_value_track_get_key_indices: + +- :ref:`PoolIntArray` **value_track_get_key_indices** **(** :ref:`int` track_idx, :ref:`float` time_sec, :ref:`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` **value_track_get_update_mode** **(** :ref:`int` track_idx **)** |const| + +Returns the update mode of a value track. + +---- + +.. _class_Animation_method_value_track_interpolate: + +- :ref:`Variant` **value_track_interpolate** **(** :ref:`int` track_idx, :ref:`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` track_idx, :ref:`UpdateMode` mode **)** + +Sets the update mode (see :ref:`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.)` diff --git a/classes/class_animationnode.rst b/classes/class_animationnode.rst new file mode 100644 index 0000000..b2396f6 --- /dev/null +++ b/classes/class_animationnode.rst @@ -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//doc_classes. + +.. _class_AnimationNode: + +AnimationNode +============= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AnimationNodeAdd2`, :ref:`AnimationNodeAdd3`, :ref:`AnimationNodeBlend2`, :ref:`AnimationNodeBlend3`, :ref:`AnimationNodeOneShot`, :ref:`AnimationNodeOutput`, :ref:`AnimationNodeTimeScale`, :ref:`AnimationNodeTimeSeek`, :ref:`AnimationNodeTransition`, :ref:`AnimationRootNode` + +Base resource for :ref:`AnimationTree` nodes. + +Description +----------- + +Base resource for :ref:`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`, otherwise :ref:`AnimationRootNode` should be used instead. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +Properties +---------- + ++-------------------------+--------------------------------------------------------------------+ +| :ref:`bool` | :ref:`filter_enabled` | ++-------------------------+--------------------------------------------------------------------+ + +Methods +------- + ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_input` **(** :ref:`String` name **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_animation` **(** :ref:`String` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend_input` **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend_node` **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_caption` **(** **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_child_by_name` **(** :ref:`String` name **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_child_nodes` **(** **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_input_count` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_input_name` **(** :ref:`int` input **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_parameter` **(** :ref:`String` name **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_parameter_default_value` **(** :ref:`String` name **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_parameter_list` **(** **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`has_filter` **(** **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_path_filtered` **(** :ref:`NodePath` path **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`process` **(** :ref:`float` time, :ref:`bool` seek **)** |virtual| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_input` **(** :ref:`int` index **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_filter_path` **(** :ref:`NodePath` path, :ref:`bool` enable **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_parameter` **(** :ref:`String` name, :ref:`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`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeStateMachine`, and :ref:`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` **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` name **)** + +Adds an input to the node. This is only useful for nodes created for use in an :ref:`AnimationNodeBlendTree`. + +---- + +.. _class_AnimationNode_method_blend_animation: + +- void **blend_animation** **(** :ref:`String` animation, :ref:`float` time, :ref:`float` delta, :ref:`bool` seeked, :ref:`float` blend **)** + +Blend an animation by ``blend`` amount (name must be valid in the linked :ref:`AnimationPlayer`). A ``time`` and ``delta`` may be passed, as well as whether ``seek`` happened. + +---- + +.. _class_AnimationNode_method_blend_input: + +- :ref:`float` **blend_input** **(** :ref:`int` input_index, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`bool` optimize=true **)** + +Blend an input. This is only useful for nodes created for an :ref:`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` for options). + +---- + +.. _class_AnimationNode_method_blend_node: + +- :ref:`float` **blend_node** **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`float` time, :ref:`bool` seek, :ref:`float` blend, :ref:`FilterAction` filter=0, :ref:`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` instead, else editors will not display your node for addition. + +---- + +.. _class_AnimationNode_method_get_caption: + +- :ref:`String` **get_caption** **(** **)** |virtual| + +Gets the text caption for this node (used by some editors). + +---- + +.. _class_AnimationNode_method_get_child_by_name: + +- :ref:`Object` **get_child_by_name** **(** :ref:`String` name **)** |virtual| + +Gets a child node by index (used by editors inheriting from :ref:`AnimationRootNode`). + +---- + +.. _class_AnimationNode_method_get_child_nodes: + +- :ref:`Dictionary` **get_child_nodes** **(** **)** |virtual| + +Gets all children nodes in order as a ``name: node`` dictionary. Only useful when inheriting :ref:`AnimationRootNode`. + +---- + +.. _class_AnimationNode_method_get_input_count: + +- :ref:`int` **get_input_count** **(** **)** |const| + +Amount of inputs in this node, only useful for nodes that go into :ref:`AnimationNodeBlendTree`. + +---- + +.. _class_AnimationNode_method_get_input_name: + +- :ref:`String` **get_input_name** **(** :ref:`int` input **)** + +Gets the name of an input by index. + +---- + +.. _class_AnimationNode_method_get_parameter: + +- :ref:`Variant` **get_parameter** **(** :ref:`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` **get_parameter_default_value** **(** :ref:`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` **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_AnimationNode_method_has_filter: + +- :ref:`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` **is_path_filtered** **(** :ref:`NodePath` path **)** |const| + +Returns ``true`` whether a given path is filtered. + +---- + +.. _class_AnimationNode_method_process: + +- void **process** **(** :ref:`float` time, :ref:`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`, :ref:`blend_node` or :ref:`blend_animation` functions. You can also use :ref:`get_parameter` and :ref:`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` index **)** + +Removes an input, call this only when inactive. + +---- + +.. _class_AnimationNode_method_set_filter_path: + +- void **set_filter_path** **(** :ref:`NodePath` path, :ref:`bool` enable **)** + +Adds or removes a path for the filter. + +---- + +.. _class_AnimationNode_method_set_parameter: + +- void **set_parameter** **(** :ref:`String` name, :ref:`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.)` diff --git a/classes/class_animationnodeadd2.rst b/classes/class_animationnodeadd2.rst new file mode 100644 index 0000000..26fa7f5 --- /dev/null +++ b/classes/class_animationnodeadd2.rst @@ -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//doc_classes. + +.. _class_AnimationNodeAdd2: + +AnimationNodeAdd2 +================= + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends two animations additively inside of an :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`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` | :ref:`sync` | ``false`` | ++-------------------------+----------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeAdd2_property_sync: + +- :ref:`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`, 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.)` diff --git a/classes/class_animationnodeadd3.rst b/classes/class_animationnodeadd3.rst new file mode 100644 index 0000000..414f579 --- /dev/null +++ b/classes/class_animationnodeadd3.rst @@ -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//doc_classes. + +.. _class_AnimationNodeAdd3: + +AnimationNodeAdd3 +================= + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends two of three animations additively inside of an :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`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 `__ + +Properties +---------- + ++-------------------------+----------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`sync` | ``false`` | ++-------------------------+----------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeAdd3_property_sync: + +- :ref:`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`, 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.)` diff --git a/classes/class_animationnodeanimation.rst b/classes/class_animationnodeanimation.rst new file mode 100644 index 0000000..02ac688 --- /dev/null +++ b/classes/class_animationnodeanimation.rst @@ -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//doc_classes. + +.. _class_AnimationNodeAnimation: + +AnimationNodeAnimation +====================== + +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input animation to use in an :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`AnimationNodeBlendTree`. Only features one output set using the :ref:`animation` property. Use it as an input for :ref:`AnimationNode` that blend animations together. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++-----------------------------+-------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`animation` | ``""`` | ++-----------------------------+-------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeAnimation_property_animation: + +- :ref:`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`. + +.. |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.)` diff --git a/classes/class_animationnodeblend2.rst b/classes/class_animationnodeblend2.rst new file mode 100644 index 0000000..4596215 --- /dev/null +++ b/classes/class_animationnodeblend2.rst @@ -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//doc_classes. + +.. _class_AnimationNodeBlend2: + +AnimationNodeBlend2 +=================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends two animations linearly inside of an :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`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 `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++-------------------------+------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`sync` | ``false`` | ++-------------------------+------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeBlend2_property_sync: + +- :ref:`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`, 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.)` diff --git a/classes/class_animationnodeblend3.rst b/classes/class_animationnodeblend3.rst new file mode 100644 index 0000000..80115ad --- /dev/null +++ b/classes/class_animationnodeblend3.rst @@ -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//doc_classes. + +.. _class_AnimationNodeBlend3: + +AnimationNodeBlend3 +=================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends two of three animations linearly inside of an :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`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` | :ref:`sync` | ``false`` | ++-------------------------+------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeBlend3_property_sync: + +- :ref:`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`, 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.)` diff --git a/classes/class_animationnodeblendspace1d.rst b/classes/class_animationnodeblendspace1d.rst new file mode 100644 index 0000000..e6471f0 --- /dev/null +++ b/classes/class_animationnodeblendspace1d.rst @@ -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//doc_classes. + +.. _class_AnimationNodeBlendSpace1D: + +AnimationNodeBlendSpace1D +========================= + +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends linearly between two of any number of :ref:`AnimationNode` of any type placed on a virtual axis. + +Description +----------- + +A resource to add to an :ref:`AnimationNodeBlendTree`. + +This is a virtual axis on which you can add any type of :ref:`AnimationNode` using :ref:`add_blend_point`. + +Outputs the linear blend of the two :ref:`AnimationNode`\ s closest to the node's current value. + +You can set the extents of the axis using the :ref:`min_space` and :ref:`max_space`. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +Properties +---------- + ++-----------------------------+--------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`max_space` | ``1.0`` | ++-----------------------------+--------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`min_space` | ``-1.0`` | ++-----------------------------+--------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`snap` | ``0.1`` | ++-----------------------------+--------------------------------------------------------------------------+-------------+ +| :ref:`String` | :ref:`value_label` | ``"value"`` | ++-----------------------------+--------------------------------------------------------------------------+-------------+ + +Methods +------- + ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_blend_point` **(** :ref:`AnimationRootNode` node, :ref:`float` pos, :ref:`int` at_index=-1 **)** | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_blend_point_count` **(** **)** |const| | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** |const| | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** |const| | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_blend_point` **(** :ref:`int` point **)** | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_point_node` **(** :ref:`int` point, :ref:`AnimationRootNode` node **)** | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_point_position` **(** :ref:`int` point, :ref:`float` pos **)** | ++---------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeBlendSpace1D_property_max_space: + +- :ref:`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_property_min_space: + +- :ref:`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_property_snap: + +- :ref:`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` **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` node, :ref:`float` pos, :ref:`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` **get_blend_point_count** **(** **)** |const| + +Returns the number of points on the blend axis. + +---- + +.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_node: + +- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** |const| + +Returns the :ref:`AnimationNode` referenced by the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace1D_method_get_blend_point_position: + +- :ref:`float` **get_blend_point_position** **(** :ref:`int` point **)** |const| + +Returns the position of the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace1D_method_remove_blend_point: + +- void **remove_blend_point** **(** :ref:`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` point, :ref:`AnimationRootNode` node **)** + +Changes the :ref:`AnimationNode` referenced by the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace1D_method_set_blend_point_position: + +- void **set_blend_point_position** **(** :ref:`int` point, :ref:`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.)` diff --git a/classes/class_animationnodeblendspace2d.rst b/classes/class_animationnodeblendspace2d.rst new file mode 100644 index 0000000..3c7cfa6 --- /dev/null +++ b/classes/class_animationnodeblendspace2d.rst @@ -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//doc_classes. + +.. _class_AnimationNodeBlendSpace2D: + +AnimationNodeBlendSpace2D +========================= + +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Blends linearly between three :ref:`AnimationNode` of any type placed in a 2D space. + +Description +----------- + +A resource to add to an :ref:`AnimationNodeBlendTree`. + +This node allows you to blend linearly between three animations using a :ref:`Vector2` weight. + +You can add vertices to the blend space with :ref:`add_blend_point` and automatically triangulate it by setting :ref:`auto_triangles` to ``true``. Otherwise, use :ref:`add_triangle` and :ref:`remove_triangle` to create up the blend space by hand. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`auto_triangles` | ``true`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`BlendMode` | :ref:`blend_mode` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`max_space` | ``Vector2( 1, 1 )`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`min_space` | ``Vector2( -1, -1 )`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`snap` | ``Vector2( 0.1, 0.1 )`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`x_label` | ``"x"`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`y_label` | ``"y"`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_blend_point` **(** :ref:`AnimationRootNode` node, :ref:`Vector2` pos, :ref:`int` at_index=-1 **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_triangle` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z, :ref:`int` at_index=-1 **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_blend_point_count` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationRootNode` | :ref:`get_blend_point_node` **(** :ref:`int` point **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_blend_point_position` **(** :ref:`int` point **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_triangle_count` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_triangle_point` **(** :ref:`int` triangle, :ref:`int` point **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_blend_point` **(** :ref:`int` point **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_triangle` **(** :ref:`int` triangle **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_point_node` **(** :ref:`int` point, :ref:`AnimationRootNode` node **)** | ++---------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_point_position` **(** :ref:`int` point, :ref:`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`, but starts the new animation at the last animation's playback position. + +Property Descriptions +--------------------- + +.. _class_AnimationNodeBlendSpace2D_property_auto_triangles: + +- :ref:`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` and :ref:`remove_blend_point`. + +---- + +.. _class_AnimationNodeBlendSpace2D_property_blend_mode: + +- :ref:`BlendMode` **blend_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_blend_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_blend_mode() | ++-----------+-----------------------+ + +Controls the interpolation between animations. See :ref:`BlendMode` constants. + +---- + +.. _class_AnimationNodeBlendSpace2D_property_max_space: + +- :ref:`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_property_min_space: + +- :ref:`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_property_snap: + +- :ref:`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` **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` **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` node, :ref:`Vector2` pos, :ref:`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` x, :ref:`int` y, :ref:`int` z, :ref:`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` **get_blend_point_count** **(** **)** |const| + +Returns the number of points in the blend space. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_node: + +- :ref:`AnimationRootNode` **get_blend_point_node** **(** :ref:`int` point **)** |const| + +Returns the :ref:`AnimationRootNode` referenced by the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_get_blend_point_position: + +- :ref:`Vector2` **get_blend_point_position** **(** :ref:`int` point **)** |const| + +Returns the position of the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_get_triangle_count: + +- :ref:`int` **get_triangle_count** **(** **)** |const| + +Returns the number of triangles in the blend space. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_get_triangle_point: + +- :ref:`int` **get_triangle_point** **(** :ref:`int` triangle, :ref:`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` point **)** + +Removes the point at index ``point`` from the blend space. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_remove_triangle: + +- void **remove_triangle** **(** :ref:`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` point, :ref:`AnimationRootNode` node **)** + +Changes the :ref:`AnimationNode` referenced by the point at index ``point``. + +---- + +.. _class_AnimationNodeBlendSpace2D_method_set_blend_point_position: + +- void **set_blend_point_position** **(** :ref:`int` point, :ref:`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.)` diff --git a/classes/class_animationnodeblendtree.rst b/classes/class_animationnodeblendtree.rst new file mode 100644 index 0000000..557d9c7 --- /dev/null +++ b/classes/class_animationnodeblendtree.rst @@ -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//doc_classes. + +.. _class_AnimationNodeBlendTree: + +AnimationNodeBlendTree +====================== + +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`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` | :ref:`graph_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_node` **(** :ref:`String` input_node, :ref:`int` input_index, :ref:`String` output_node **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_node` **(** :ref:`String` input_node, :ref:`int` input_index **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`String` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`String` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node` **(** :ref:`String` name **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`String` name **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_node` **(** :ref:`String` name, :ref:`String` new_name **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_node_position` **(** :ref:`String` name, :ref:`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` **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` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** + +Adds an :ref:`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` input_node, :ref:`int` input_index, :ref:`String` output_node **)** + +Connects the output of an :ref:`AnimationNode` as input for another :ref:`AnimationNode`, at the input port specified by ``input_index``. + +---- + +.. _class_AnimationNodeBlendTree_method_disconnect_node: + +- void **disconnect_node** **(** :ref:`String` input_node, :ref:`int` input_index **)** + +Disconnects the node connected to the specified input. + +---- + +.. _class_AnimationNodeBlendTree_method_get_node: + +- :ref:`AnimationNode` **get_node** **(** :ref:`String` name **)** |const| + +Returns the sub-node with the specified ``name``. + +---- + +.. _class_AnimationNodeBlendTree_method_get_node_position: + +- :ref:`Vector2` **get_node_position** **(** :ref:`String` name **)** |const| + +Returns the position of the sub-node with the specified ``name``. + +---- + +.. _class_AnimationNodeBlendTree_method_has_node: + +- :ref:`bool` **has_node** **(** :ref:`String` name **)** |const| + +Returns ``true`` if a sub-node with specified ``name`` exists. + +---- + +.. _class_AnimationNodeBlendTree_method_remove_node: + +- void **remove_node** **(** :ref:`String` name **)** + +Removes a sub-node. + +---- + +.. _class_AnimationNodeBlendTree_method_rename_node: + +- void **rename_node** **(** :ref:`String` name, :ref:`String` new_name **)** + +Changes the name of a sub-node. + +---- + +.. _class_AnimationNodeBlendTree_method_set_node_position: + +- void **set_node_position** **(** :ref:`String` name, :ref:`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.)` diff --git a/classes/class_animationnodeoneshot.rst b/classes/class_animationnodeoneshot.rst new file mode 100644 index 0000000..c5b39f4 --- /dev/null +++ b/classes/class_animationnodeoneshot.rst @@ -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//doc_classes. + +.. _class_AnimationNodeOneShot: + +AnimationNodeOneShot +==================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Plays an animation once in :ref:`AnimationNodeBlendTree`. + +Description +----------- + +A resource to add to an :ref:`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 `__ + +Properties +---------- + ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`autorestart` | ``false`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`autorestart_delay` | ``1.0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`autorestart_random_delay` | ``0.0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`fadein_time` | ``0.1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`fadeout_time` | ``0.1`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`MixMode` | :ref:`mix_mode` | ``0`` | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`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` **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` **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` **autorestart_random_delay** + ++-----------+-------------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_autorestart_random_delay(value) | ++-----------+-------------------------------------+ +| *Getter* | get_autorestart_random_delay() | ++-----------+-------------------------------------+ + +If :ref:`autorestart` is ``true``, a random additional delay (in seconds) between 0 and this value will be added to :ref:`autorestart_delay`. + +---- + +.. _class_AnimationNodeOneShot_property_fadein_time: + +- :ref:`float` **fadein_time** + ++-----------+------------------------+ +| *Default* | ``0.1`` | ++-----------+------------------------+ +| *Setter* | set_fadein_time(value) | ++-----------+------------------------+ +| *Getter* | get_fadein_time() | ++-----------+------------------------+ + +---- + +.. _class_AnimationNodeOneShot_property_fadeout_time: + +- :ref:`float` **fadeout_time** + ++-----------+-------------------------+ +| *Default* | ``0.1`` | ++-----------+-------------------------+ +| *Setter* | set_fadeout_time(value) | ++-----------+-------------------------+ +| *Getter* | get_fadeout_time() | ++-----------+-------------------------+ + +---- + +.. _class_AnimationNodeOneShot_property_mix_mode: + +- :ref:`MixMode` **mix_mode** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_mix_mode(value) | ++-----------+---------------------+ +| *Getter* | get_mix_mode() | ++-----------+---------------------+ + +---- + +.. _class_AnimationNodeOneShot_property_sync: + +- :ref:`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.)` diff --git a/classes/class_animationnodeoutput.rst b/classes/class_animationnodeoutput.rst new file mode 100644 index 0000000..31eedc3 --- /dev/null +++ b/classes/class_animationnodeoutput.rst @@ -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//doc_classes. + +.. _class_AnimationNodeOutput: + +AnimationNodeOutput +=================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Generic output node to be added to :ref:`AnimationNodeBlendTree`. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +.. |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.)` diff --git a/classes/class_animationnodestatemachine.rst b/classes/class_animationnodestatemachine.rst new file mode 100644 index 0000000..54ce3cd --- /dev/null +++ b/classes/class_animationnodestatemachine.rst @@ -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//doc_classes. + +.. _class_AnimationNodeStateMachine: + +AnimationNodeStateMachine +========================= + +**Inherits:** :ref:`AnimationRootNode` **<** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` object from the :ref:`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` **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_transition` **(** :ref:`String` from, :ref:`String` to, :ref:`AnimationNodeStateMachineTransition` transition **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_end_node` **(** **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_graph_offset` **(** **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationNode` | :ref:`get_node` **(** :ref:`String` name **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_name` **(** :ref:`AnimationNode` node **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`String` name **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_start_node` **(** **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationNodeStateMachineTransition` | :ref:`get_transition` **(** :ref:`int` idx **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_transition_count` **(** **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_transition_from` **(** :ref:`int` idx **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_transition_to` **(** :ref:`int` idx **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node` **(** :ref:`String` name **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_transition` **(** :ref:`String` from, :ref:`String` to **)** |const| | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`String` name **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_transition` **(** :ref:`String` from, :ref:`String` to **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_transition_by_index` **(** :ref:`int` idx **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_node` **(** :ref:`String` name, :ref:`String` new_name **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`replace_node` **(** :ref:`String` name, :ref:`AnimationNode` node **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_end_node` **(** :ref:`String` name **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_graph_offset` **(** :ref:`Vector2` offset **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_node_position` **(** :ref:`String` name, :ref:`Vector2` position **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_start_node` **(** :ref:`String` name **)** | ++---------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AnimationNodeStateMachine_method_add_node: + +- void **add_node** **(** :ref:`String` name, :ref:`AnimationNode` node, :ref:`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` from, :ref:`String` to, :ref:`AnimationNodeStateMachineTransition` transition **)** + +Adds a transition between the given nodes. + +---- + +.. _class_AnimationNodeStateMachine_method_get_end_node: + +- :ref:`String` **get_end_node** **(** **)** |const| + +Returns the graph's end node. + +---- + +.. _class_AnimationNodeStateMachine_method_get_graph_offset: + +- :ref:`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` **get_node** **(** :ref:`String` name **)** |const| + +Returns the animation node with the given name. + +---- + +.. _class_AnimationNodeStateMachine_method_get_node_name: + +- :ref:`String` **get_node_name** **(** :ref:`AnimationNode` node **)** |const| + +Returns the given animation node's name. + +---- + +.. _class_AnimationNodeStateMachine_method_get_node_position: + +- :ref:`Vector2` **get_node_position** **(** :ref:`String` name **)** |const| + +Returns the given node's coordinates. Used for display in the editor. + +---- + +.. _class_AnimationNodeStateMachine_method_get_start_node: + +- :ref:`String` **get_start_node** **(** **)** |const| + +Returns the graph's end node. + +---- + +.. _class_AnimationNodeStateMachine_method_get_transition: + +- :ref:`AnimationNodeStateMachineTransition` **get_transition** **(** :ref:`int` idx **)** |const| + +Returns the given transition. + +---- + +.. _class_AnimationNodeStateMachine_method_get_transition_count: + +- :ref:`int` **get_transition_count** **(** **)** |const| + +Returns the number of connections in the graph. + +---- + +.. _class_AnimationNodeStateMachine_method_get_transition_from: + +- :ref:`String` **get_transition_from** **(** :ref:`int` idx **)** |const| + +Returns the given transition's start node. + +---- + +.. _class_AnimationNodeStateMachine_method_get_transition_to: + +- :ref:`String` **get_transition_to** **(** :ref:`int` idx **)** |const| + +Returns the given transition's end node. + +---- + +.. _class_AnimationNodeStateMachine_method_has_node: + +- :ref:`bool` **has_node** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the graph contains the given node. + +---- + +.. _class_AnimationNodeStateMachine_method_has_transition: + +- :ref:`bool` **has_transition** **(** :ref:`String` from, :ref:`String` to **)** |const| + +Returns ``true`` if there is a transition between the given nodes. + +---- + +.. _class_AnimationNodeStateMachine_method_remove_node: + +- void **remove_node** **(** :ref:`String` name **)** + +Deletes the given node from the graph. + +---- + +.. _class_AnimationNodeStateMachine_method_remove_transition: + +- void **remove_transition** **(** :ref:`String` from, :ref:`String` to **)** + +Deletes the transition between the two specified nodes. + +---- + +.. _class_AnimationNodeStateMachine_method_remove_transition_by_index: + +- void **remove_transition_by_index** **(** :ref:`int` idx **)** + +Deletes the given transition by index. + +---- + +.. _class_AnimationNodeStateMachine_method_rename_node: + +- void **rename_node** **(** :ref:`String` name, :ref:`String` new_name **)** + +Renames the given node. + +---- + +.. _class_AnimationNodeStateMachine_method_replace_node: + +- void **replace_node** **(** :ref:`String` name, :ref:`AnimationNode` node **)** + +Replaces the node and keeps its transitions unchanged. + +---- + +.. _class_AnimationNodeStateMachine_method_set_end_node: + +- void **set_end_node** **(** :ref:`String` name **)** + +Sets the given node as the graph end point. + +---- + +.. _class_AnimationNodeStateMachine_method_set_graph_offset: + +- void **set_graph_offset** **(** :ref:`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` name, :ref:`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` 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.)` diff --git a/classes/class_animationnodestatemachineplayback.rst b/classes/class_animationnodestatemachineplayback.rst new file mode 100644 index 0000000..10bf93e --- /dev/null +++ b/classes/class_animationnodestatemachineplayback.rst @@ -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//doc_classes. + +.. _class_AnimationNodeStateMachinePlayback: + +AnimationNodeStateMachinePlayback +================================= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Playback control for :ref:`AnimationNodeStateMachine`. + +Description +----------- + +Allows control of :ref:`AnimationTree` state machines created with :ref:`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` | resource_local_to_scene | ``true`` *(parent override)* | ++-------------------------+-------------------------+------------------------------+ + +Methods +------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_length` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_node` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_current_play_position` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_travel_path` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`start` **(** :ref:`String` node **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`travel` **(** :ref:`String` to_node **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AnimationNodeStateMachinePlayback_method_get_current_length: + +- :ref:`float` **get_current_length** **(** **)** |const| + +---- + +.. _class_AnimationNodeStateMachinePlayback_method_get_current_node: + +- :ref:`String` **get_current_node** **(** **)** |const| + +Returns the currently playing animation state. + +---- + +.. _class_AnimationNodeStateMachinePlayback_method_get_current_play_position: + +- :ref:`float` **get_current_play_position** **(** **)** |const| + +Returns the playback position within the current animation state. + +---- + +.. _class_AnimationNodeStateMachinePlayback_method_get_travel_path: + +- :ref:`PoolStringArray` **get_travel_path** **(** **)** |const| + +Returns the current travel path as computed internally by the A\* algorithm. + +---- + +.. _class_AnimationNodeStateMachinePlayback_method_is_playing: + +- :ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if an animation is playing. + +---- + +.. _class_AnimationNodeStateMachinePlayback_method_start: + +- void **start** **(** :ref:`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` 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.)` diff --git a/classes/class_animationnodestatemachinetransition.rst b/classes/class_animationnodestatemachinetransition.rst new file mode 100644 index 0000000..c1498de --- /dev/null +++ b/classes/class_animationnodestatemachinetransition.rst @@ -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//doc_classes. + +.. _class_AnimationNodeStateMachineTransition: + +AnimationNodeStateMachineTransition +=================================== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +Properties +---------- + ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`advance_condition` | ``""`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`auto_advance` | ``false`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`priority` | ``1`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`SwitchMode` | :ref:`switch_mode` | ``0`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`xfade_time` | ``0.0`` | ++------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ + +Signals +------- + +.. _class_AnimationNodeStateMachineTransition_signal_advance_condition_changed: + +- **advance_condition_changed** **(** **)** + +Emitted when :ref:`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` **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` that can be controlled from code (see `https://docs.godotengine.org/en/3.4/tutorials/animation/animation_tree.html#controlling-from-code `__). For example, if :ref:`AnimationTree.tree_root` is an :ref:`AnimationNodeStateMachine` and :ref:`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` **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_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +Don't use this transition during :ref:`AnimationNodeStateMachinePlayback.travel` or :ref:`auto_advance`. + +---- + +.. _class_AnimationNodeStateMachineTransition_property_priority: + +- :ref:`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` or :ref:`auto_advance`. + +---- + +.. _class_AnimationNodeStateMachineTransition_property_switch_mode: + +- :ref:`SwitchMode` **switch_mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_switch_mode(value) | ++-----------+------------------------+ +| *Getter* | get_switch_mode() | ++-----------+------------------------+ + +The transition type. + +---- + +.. _class_AnimationNodeStateMachineTransition_property_xfade_time: + +- :ref:`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.)` diff --git a/classes/class_animationnodetimescale.rst b/classes/class_animationnodetimescale.rst new file mode 100644 index 0000000..8602719 --- /dev/null +++ b/classes/class_animationnodetimescale.rst @@ -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//doc_classes. + +.. _class_AnimationNodeTimeScale: + +AnimationNodeTimeScale +====================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A time-scaling animation node to be used with :ref:`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 `__ + +.. |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.)` diff --git a/classes/class_animationnodetimeseek.rst b/classes/class_animationnodetimeseek.rst new file mode 100644 index 0000000..6f02acd --- /dev/null +++ b/classes/class_animationnodetimeseek.rst @@ -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//doc_classes. + +.. _class_AnimationNodeTimeSeek: + +AnimationNodeTimeSeek +===================== + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A time-seeking animation node to be used with :ref:`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` from the start or a certain playback position inside the :ref:`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.)` diff --git a/classes/class_animationnodetransition.rst b/classes/class_animationnodetransition.rst new file mode 100644 index 0000000..2744b13 --- /dev/null +++ b/classes/class_animationnodetransition.rst @@ -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//doc_classes. + +.. _class_AnimationNodeTransition: + +AnimationNodeTransition +======================= + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A generic animation transition node for :ref:`AnimationTree`. + +Description +----------- + +Simple state machine for cases which don't require a more advanced :ref:`AnimationNodeStateMachine`. Animations can be connected to the inputs and transition times can be specified. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`input_count` | ``0`` | ++---------------------------+------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`xfade_time` | ``0.0`` | ++---------------------------+------------------------------------------------------------------------+---------+ + +Methods +------- + ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_input_caption` **(** :ref:`int` input **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_input_set_as_auto_advance` **(** :ref:`int` input **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_as_auto_advance` **(** :ref:`int` input, :ref:`bool` enable **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_caption` **(** :ref:`int` input, :ref:`String` caption **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AnimationNodeTransition_property_input_count: + +- :ref:`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` **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` **get_input_caption** **(** :ref:`int` input **)** |const| + +---- + +.. _class_AnimationNodeTransition_method_is_input_set_as_auto_advance: + +- :ref:`bool` **is_input_set_as_auto_advance** **(** :ref:`int` input **)** |const| + +---- + +.. _class_AnimationNodeTransition_method_set_input_as_auto_advance: + +- void **set_input_as_auto_advance** **(** :ref:`int` input, :ref:`bool` enable **)** + +---- + +.. _class_AnimationNodeTransition_method_set_input_caption: + +- void **set_input_caption** **(** :ref:`int` input, :ref:`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.)` diff --git a/classes/class_animationplayer.rst b/classes/class_animationplayer.rst new file mode 100644 index 0000000..55e0505 --- /dev/null +++ b/classes/class_animationplayer.rst @@ -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//doc_classes. + +.. _class_AnimationPlayer: + +AnimationPlayer +=============== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Container and player of :ref:`Animation` resources. + +Description +----------- + +An animation player is used for general-purpose playback of :ref:`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` 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` 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 `__ + +Properties +---------- + ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`assigned_animation` | | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`autoplay` | ``""`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`String` | :ref:`current_animation` | ``""`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`current_animation_length` | | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`current_animation_position` | | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`AnimationMethodCallMode` | :ref:`method_call_mode` | ``0`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`playback_active` | | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`playback_default_blend_time` | ``0.0`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`AnimationProcessMode` | :ref:`playback_process_mode` | ``1`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`float` | :ref:`playback_speed` | ``1.0`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`reset_on_save` | ``true`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`root_node` | ``NodePath("..")`` | ++------------------------------------------------------------------------------+------------------------------------------------------------------------------------------------+--------------------+ + +Methods +------- + ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`add_animation` **(** :ref:`String` name, :ref:`Animation` animation **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`advance` **(** :ref:`float` delta **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`animation_get_next` **(** :ref:`String` anim_from **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_set_next` **(** :ref:`String` anim_from, :ref:`String` anim_to **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_caches` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_queue` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`find_animation` **(** :ref:`Animation` animation **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Animation` | :ref:`get_animation` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_animation_list` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_blend_time` **(** :ref:`String` anim_from, :ref:`String` anim_to **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_playing_speed` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_queue` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_animation` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`String` name="", :ref:`float` custom_blend=-1, :ref:`float` custom_speed=1.0, :ref:`bool` from_end=false **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_backwards` **(** :ref:`String` name="", :ref:`float` custom_blend=-1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue` **(** :ref:`String` name **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_animation` **(** :ref:`String` name **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_animation` **(** :ref:`String` name, :ref:`String` newname **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`float` seconds, :ref:`bool` update=false **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_time` **(** :ref:`String` anim_from, :ref:`String` anim_to, :ref:`float` sec **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** :ref:`bool` reset=true **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_AnimationPlayer_signal_animation_changed: + +- **animation_changed** **(** :ref:`String` old_name, :ref:`String` new_name **)** + +Emitted when a queued animation plays after the previous animation was finished. See :ref:`queue`. + +**Note:** The signal is not emitted when the animation is changed via :ref:`play` or from :ref:`AnimationTree`. + +---- + +.. _class_AnimationPlayer_signal_animation_finished: + +- **animation_finished** **(** :ref:`String` anim_name **)** + +Notifies when an animation finished playing. + +---- + +.. _class_AnimationPlayer_signal_animation_started: + +- **animation_started** **(** :ref:`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`. + +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` 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` **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_autoplay: + +- :ref:`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` **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` 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_AnimationPlayer_property_current_animation_length: + +- :ref:`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` **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` **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` **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` **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` **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` **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` **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` **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` **add_animation** **(** :ref:`String` name, :ref:`Animation` animation **)** + +Adds ``animation`` to the player accessible with the key ``name``. + +---- + +.. _class_AnimationPlayer_method_advance: + +- void **advance** **(** :ref:`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` **animation_get_next** **(** :ref:`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` anim_from, :ref:`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` 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` **find_animation** **(** :ref:`Animation` animation **)** |const| + +Returns the name of ``animation`` or an empty string if not found. + +---- + +.. _class_AnimationPlayer_method_get_animation: + +- :ref:`Animation` **get_animation** **(** :ref:`String` name **)** |const| + +Returns the :ref:`Animation` with key ``name`` or ``null`` if not found. + +---- + +.. _class_AnimationPlayer_method_get_animation_list: + +- :ref:`PoolStringArray` **get_animation_list** **(** **)** |const| + +Returns the list of stored animation names. + +---- + +.. _class_AnimationPlayer_method_get_blend_time: + +- :ref:`float` **get_blend_time** **(** :ref:`String` anim_from, :ref:`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` **get_playing_speed** **(** **)** |const| + +Gets the actual playing speed of current animation or 0 if not playing. This speed is the :ref:`playback_speed` property multiplied by ``custom_speed`` argument specified when calling the :ref:`play` method. + +---- + +.. _class_AnimationPlayer_method_get_queue: + +- :ref:`PoolStringArray` **get_queue** **(** **)** + +Returns a list of the animation names that are currently queued to play. + +---- + +.. _class_AnimationPlayer_method_has_animation: + +- :ref:`bool` **has_animation** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the ``AnimationPlayer`` stores an :ref:`Animation` with key ``name``. + +---- + +.. _class_AnimationPlayer_method_is_playing: + +- :ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if playing an animation. + +---- + +.. _class_AnimationPlayer_method_play: + +- void **play** **(** :ref:`String` name="", :ref:`float` custom_blend=-1, :ref:`float` custom_speed=1.0, :ref:`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`). + +The ``AnimationPlayer`` keeps track of its current or last played animation with :ref:`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` 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` name="", :ref:`float` custom_blend=-1 **)** + +Plays the animation with key ``name`` in reverse. + +This method is a shorthand for :ref:`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` 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` name **)** + +Removes the animation with key ``name``. + +---- + +.. _class_AnimationPlayer_method_rename_animation: + +- void **rename_animation** **(** :ref:`String` name, :ref:`String` newname **)** + +Renames an existing animation with key ``name`` to ``newname``. + +---- + +.. _class_AnimationPlayer_method_seek: + +- void **seek** **(** :ref:`float` seconds, :ref:`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` anim_from, :ref:`String` anim_to, :ref:`float` sec **)** + +Specifies a blend time (in seconds) between two animations, referenced by their names. + +---- + +.. _class_AnimationPlayer_method_stop: + +- void **stop** **(** :ref:`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` will be kept and calling :ref:`play` or :ref:`play_backwards` without arguments or with the same animation name as :ref:`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.)` diff --git a/classes/class_animationrootnode.rst b/classes/class_animationrootnode.rst new file mode 100644 index 0000000..0c09ee7 --- /dev/null +++ b/classes/class_animationrootnode.rst @@ -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//doc_classes. + +.. _class_AnimationRootNode: + +AnimationRootNode +================= + +**Inherits:** :ref:`AnimationNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AnimationNodeAnimation`, :ref:`AnimationNodeBlendSpace1D`, :ref:`AnimationNodeBlendSpace2D`, :ref:`AnimationNodeBlendTree`, :ref:`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.)` diff --git a/classes/class_animationtrackeditplugin.rst b/classes/class_animationtrackeditplugin.rst new file mode 100644 index 0000000..cbeb17c --- /dev/null +++ b/classes/class_animationtrackeditplugin.rst @@ -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//doc_classes. + +.. _class_AnimationTrackEditPlugin: + +AnimationTrackEditPlugin +======================== + +**Inherits:** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_animationtree.rst b/classes/class_animationtree.rst new file mode 100644 index 0000000..437a5cc --- /dev/null +++ b/classes/class_animationtree.rst @@ -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//doc_classes. + +.. _class_AnimationTree: + +AnimationTree +============= + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +A node to be used for advanced animation transitions in an :ref:`AnimationPlayer`. + +Description +----------- + +A node to be used for advanced animation transitions in an :ref:`AnimationPlayer`. + +**Note:** When linked with an :ref:`AnimationPlayer`, several properties and methods of the corresponding :ref:`AnimationPlayer` will not function as expected. Playback and transitions should be handled using only the ``AnimationTree`` and its constituent :ref:`AnimationNode`\ (s). The :ref:`AnimationPlayer` node should be used solely for adding, deleting, and editing animations. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`active` | ``false`` | ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`anim_player` | ``NodePath("")`` | ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`AnimationProcessMode` | :ref:`process_mode` | ``1`` | ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`root_motion_track` | ``NodePath("")`` | ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ +| :ref:`AnimationNode` | :ref:`tree_root` | | ++----------------------------------------------------------------------+--------------------------------------------------------------------------+------------------+ + +Methods +------- + ++-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`advance` **(** :ref:`float` delta **)** | ++-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_root_motion_transform` **(** **)** |const| | ++-----------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_parameter` **(** :ref:`String` old_name, :ref:`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`). + +- **ANIMATION_PROCESS_IDLE** = **1** --- The animations will progress during the idle frame (i.e. :ref:`Node._process`). + +- **ANIMATION_PROCESS_MANUAL** = **2** --- The animations will only progress manually (see :ref:`advance`). + +Property Descriptions +--------------------- + +.. _class_AnimationTree_property_active: + +- :ref:`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` **anim_player** + ++-----------+-----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-----------------------------+ +| *Setter* | set_animation_player(value) | ++-----------+-----------------------------+ +| *Getter* | get_animation_player() | ++-----------+-----------------------------+ + +The path to the :ref:`AnimationPlayer` used for animating. + +---- + +.. _class_AnimationTree_property_process_mode: + +- :ref:`AnimationProcessMode` **process_mode** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_process_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_process_mode() | ++-----------+-------------------------+ + +The process mode of this ``AnimationTree``. See :ref:`AnimationProcessMode` for available modes. + +---- + +.. _class_AnimationTree_property_root_motion_track: + +- :ref:`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`, the transformation will be cancelled visually, and the animation will appear to stay in place. See also :ref:`get_root_motion_transform` and :ref:`RootMotionView`. + +---- + +.. _class_AnimationTree_property_tree_root: + +- :ref:`AnimationNode` **tree_root** + ++----------+----------------------+ +| *Setter* | set_tree_root(value) | ++----------+----------------------+ +| *Getter* | get_tree_root() | ++----------+----------------------+ + +The root animation node of this ``AnimationTree``. See :ref:`AnimationNode`. + +Method Descriptions +------------------- + +.. _class_AnimationTree_method_advance: + +- void **advance** **(** :ref:`float` delta **)** + +Manually advance the animations by the specified time (in seconds). + +---- + +.. _class_AnimationTree_method_get_root_motion_transform: + +- :ref:`Transform` **get_root_motion_transform** **(** **)** |const| + +Retrieve the motion of the :ref:`root_motion_track` as a :ref:`Transform` that can be used elsewhere. If :ref:`root_motion_track` is not a path to a track of type :ref:`Animation.TYPE_TRANSFORM`, returns an identity transformation. See also :ref:`root_motion_track` and :ref:`RootMotionView`. + +---- + +.. _class_AnimationTree_method_rename_parameter: + +- void **rename_parameter** **(** :ref:`String` old_name, :ref:`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.)` diff --git a/classes/class_animationtreeplayer.rst b/classes/class_animationtreeplayer.rst new file mode 100644 index 0000000..6d13274 --- /dev/null +++ b/classes/class_animationtreeplayer.rst @@ -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//doc_classes. + +.. _class_AnimationTreePlayer: + +AnimationTreePlayer +=================== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +*Deprecated.* Animation player that uses a node graph for blending animations. Superseded by :ref:`AnimationTree`. + +Description +----------- + +*Deprecated.* A node graph tool for blending multiple animations bound to an :ref:`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`\ s from an :ref:`AnimationPlayer` node and mixes them depending on the graph. + +See :ref:`AnimationTree` for a more full-featured replacement of this node. + +Tutorials +--------- + +- :doc:`../tutorials/animation/animation_tree` + +Properties +---------- + ++----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`active` | ``false`` | ++----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`base_path` | ``NodePath("..")`` | ++----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`master_player` | ``NodePath("")`` | ++----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+ +| :ref:`AnimationProcessMode` | :ref:`playback_process_mode` | ``1`` | ++----------------------------------------------------------------------------+----------------------------------------------------------------------------------------+--------------------+ + +Methods +------- + ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`NodeType` type, :ref:`String` id **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`advance` **(** :ref:`float` delta **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Animation` | :ref:`animation_node_get_animation` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`animation_node_get_master_animation` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`animation_node_get_position` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_node_set_animation` **(** :ref:`String` id, :ref:`Animation` animation **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_node_set_filter_path` **(** :ref:`String` id, :ref:`NodePath` path, :ref:`bool` enable **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`animation_node_set_master_animation` **(** :ref:`String` id, :ref:`String` source **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_nodes_connected` **(** :ref:`String` id, :ref:`String` dst_id, :ref:`int` dst_input_idx **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend2_node_get_amount` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend2_node_set_amount` **(** :ref:`String` id, :ref:`float` blend **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend2_node_set_filter_path` **(** :ref:`String` id, :ref:`NodePath` path, :ref:`bool` enable **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`blend3_node_get_amount` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend3_node_set_amount` **(** :ref:`String` id, :ref:`float` blend **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`blend4_node_get_amount` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend4_node_set_amount` **(** :ref:`String` id, :ref:`Vector2` blend **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_nodes` **(** :ref:`String` id, :ref:`String` dst_id, :ref:`int` dst_input_idx **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_nodes` **(** :ref:`String` id, :ref:`int` dst_input_idx **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_node_list` **(** **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`mix_node_get_amount` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mix_node_set_amount` **(** :ref:`String` id, :ref:`float` ratio **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`node_exists` **(** :ref:`String` node **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`node_get_input_count` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`node_get_input_source` **(** :ref:`String` id, :ref:`int` idx **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`node_get_position` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodeType` | :ref:`node_get_type` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`node_rename` **(** :ref:`String` node, :ref:`String` new_name **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`node_set_position` **(** :ref:`String` id, :ref:`Vector2` screen_position **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`oneshot_node_get_autorestart_delay` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`oneshot_node_get_autorestart_random_delay` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`oneshot_node_get_fadein_time` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`oneshot_node_get_fadeout_time` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`oneshot_node_has_autorestart` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`oneshot_node_is_active` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_autorestart` **(** :ref:`String` id, :ref:`bool` enable **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_autorestart_delay` **(** :ref:`String` id, :ref:`float` delay_sec **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_autorestart_random_delay` **(** :ref:`String` id, :ref:`float` rand_sec **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_fadein_time` **(** :ref:`String` id, :ref:`float` time_sec **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_fadeout_time` **(** :ref:`String` id, :ref:`float` time_sec **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_set_filter_path` **(** :ref:`String` id, :ref:`NodePath` path, :ref:`bool` enable **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_start` **(** :ref:`String` id **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`oneshot_node_stop` **(** :ref:`String` id **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`recompute_caches` **(** **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`String` id **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reset` **(** **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`timescale_node_get_scale` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`timescale_node_set_scale` **(** :ref:`String` id, :ref:`float` scale **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`timeseek_node_seek` **(** :ref:`String` id, :ref:`float` seconds **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`transition_node_delete_input` **(** :ref:`String` id, :ref:`int` input_idx **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`transition_node_get_current` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`transition_node_get_input_count` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`transition_node_get_xfade_time` **(** :ref:`String` id **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`transition_node_has_input_auto_advance` **(** :ref:`String` id, :ref:`int` input_idx **)** |const| | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`transition_node_set_current` **(** :ref:`String` id, :ref:`int` input_idx **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`transition_node_set_input_auto_advance` **(** :ref:`String` id, :ref:`int` input_idx, :ref:`bool` enable **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`transition_node_set_input_count` **(** :ref:`String` id, :ref:`int` count **)** | ++----------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`transition_node_set_xfade_time` **(** :ref:`String` id, :ref:`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` **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` **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` would point its Root Node at. + +---- + +.. _class_AnimationTreePlayer_property_master_player: + +- :ref:`NodePath` **master_player** + ++-----------+--------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+--------------------------+ +| *Setter* | set_master_player(value) | ++-----------+--------------------------+ +| *Getter* | get_master_player() | ++-----------+--------------------------+ + +The path to the :ref:`AnimationPlayer` from which this ``AnimationTreePlayer`` binds animations to animation nodes. + +Once set, :ref:`Animation` nodes can be added to the ``AnimationTreePlayer``. + +---- + +.. _class_AnimationTreePlayer_property_playback_process_mode: + +- :ref:`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` type, :ref:`String` id **)** + +Adds a ``type`` node to the graph with name ``id``. + +---- + +.. _class_AnimationTreePlayer_method_advance: + +- void **advance** **(** :ref:`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` **animation_node_get_animation** **(** :ref:`String` id **)** |const| + +Returns the :ref:`AnimationPlayer`'s :ref:`Animation` bound to the ``AnimationTreePlayer``'s animation node with name ``id``. + +---- + +.. _class_AnimationTreePlayer_method_animation_node_get_master_animation: + +- :ref:`String` **animation_node_get_master_animation** **(** :ref:`String` id **)** |const| + +Returns the name of the :ref:`master_player`'s :ref:`Animation` bound to this animation node. + +---- + +.. _class_AnimationTreePlayer_method_animation_node_get_position: + +- :ref:`float` **animation_node_get_position** **(** :ref:`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` id, :ref:`Animation` animation **)** + +Binds a new :ref:`Animation` from the :ref:`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` id, :ref:`NodePath` path, :ref:`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` id, :ref:`String` source **)** + +Binds the :ref:`Animation` named ``source`` from :ref:`master_player` to the animation node ``id``. Recalculates caches. + +---- + +.. _class_AnimationTreePlayer_method_are_nodes_connected: + +- :ref:`bool` **are_nodes_connected** **(** :ref:`String` id, :ref:`String` dst_id, :ref:`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` **blend2_node_get_amount** **(** :ref:`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` id, :ref:`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` id, :ref:`NodePath` path, :ref:`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` **blend3_node_get_amount** **(** :ref:`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` id, :ref:`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` **blend4_node_get_amount** **(** :ref:`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` id, :ref:`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` **connect_nodes** **(** :ref:`String` id, :ref:`String` dst_id, :ref:`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` id, :ref:`int` dst_input_idx **)** + +Disconnects nodes connected to ``id`` at the specified input slot. + +---- + +.. _class_AnimationTreePlayer_method_get_node_list: + +- :ref:`PoolStringArray` **get_node_list** **(** **)** + +Returns a :ref:`PoolStringArray` containing the name of all nodes. + +---- + +.. _class_AnimationTreePlayer_method_mix_node_get_amount: + +- :ref:`float` **mix_node_get_amount** **(** :ref:`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` id, :ref:`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` **node_exists** **(** :ref:`String` node **)** |const| + +Check if a node exists (by name). + +---- + +.. _class_AnimationTreePlayer_method_node_get_input_count: + +- :ref:`int` **node_get_input_count** **(** :ref:`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` **node_get_input_source** **(** :ref:`String` id, :ref:`int` idx **)** |const| + +Returns the input source for a given node input. + +---- + +.. _class_AnimationTreePlayer_method_node_get_position: + +- :ref:`Vector2` **node_get_position** **(** :ref:`String` id **)** |const| + +Returns position of a node in the graph given its name. + +---- + +.. _class_AnimationTreePlayer_method_node_get_type: + +- :ref:`NodeType` **node_get_type** **(** :ref:`String` id **)** |const| + +Gets the node type, will return from :ref:`NodeType` enum. + +---- + +.. _class_AnimationTreePlayer_method_node_rename: + +- :ref:`Error` **node_rename** **(** :ref:`String` node, :ref:`String` new_name **)** + +Renames a node in the graph. + +---- + +.. _class_AnimationTreePlayer_method_node_set_position: + +- void **node_set_position** **(** :ref:`String` id, :ref:`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` **oneshot_node_get_autorestart_delay** **(** :ref:`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` **oneshot_node_get_autorestart_random_delay** **(** :ref:`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` **oneshot_node_get_fadein_time** **(** :ref:`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` **oneshot_node_get_fadeout_time** **(** :ref:`String` id **)** |const| + +Returns the fade out time of a OneShot node given its name. + +---- + +.. _class_AnimationTreePlayer_method_oneshot_node_has_autorestart: + +- :ref:`bool` **oneshot_node_has_autorestart** **(** :ref:`String` id **)** |const| + +Returns whether a OneShot node will auto restart given its name. + +---- + +.. _class_AnimationTreePlayer_method_oneshot_node_is_active: + +- :ref:`bool` **oneshot_node_is_active** **(** :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`NodePath` path, :ref:`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` id **)** + +Starts a OneShot node given its name. + +---- + +.. _class_AnimationTreePlayer_method_oneshot_node_stop: + +- void **oneshot_node_stop** **(** :ref:`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` 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` **timescale_node_get_scale** **(** :ref:`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` id, :ref:`float` scale **)** + +Sets the time scale of the TimeScale node with name ``id`` to ``scale``. + +The TimeScale node is used to speed :ref:`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` id, :ref:`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` or the blend or mix of :ref:`Animation`\ s input in it. + +---- + +.. _class_AnimationTreePlayer_method_transition_node_delete_input: + +- void **transition_node_delete_input** **(** :ref:`String` id, :ref:`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` **transition_node_get_current** **(** :ref:`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` **transition_node_get_input_count** **(** :ref:`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` **transition_node_get_xfade_time** **(** :ref:`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` **transition_node_has_input_auto_advance** **(** :ref:`String` id, :ref:`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` id, :ref:`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` id, :ref:`int` input_idx, :ref:`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` id, :ref:`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` id, :ref:`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.)` diff --git a/classes/class_area.rst b/classes/class_area.rst new file mode 100644 index 0000000..e530b8a --- /dev/null +++ b/classes/class_area.rst @@ -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//doc_classes. + +.. _class_Area: + +Area +==== + +**Inherits:** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +3D area for detection and physics and audio influence. + +Description +----------- + +3D area that detects :ref:`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 `__ + +- `GUI in 3D Demo `__ + +Properties +---------- + ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`angular_damp` | ``0.1`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`audio_bus_name` | ``"Master"`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`gravity` | ``9.8`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`gravity_point` | ``false`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`gravity_vec` | ``Vector3( 0, -1, 0 )`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`linear_damp` | ``0.1`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`monitorable` | ``true`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`monitoring` | ``true`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`priority` | ``0.0`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`reverb_bus_amount` | ``0.0`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`reverb_bus_enable` | ``false`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`reverb_bus_name` | ``"Master"`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`reverb_bus_uniformity` | ``0.0`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | ++-----------------------------------------------+---------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_overlapping_areas` **(** **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_overlapping_bodies` **(** **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Area_signal_area_entered: + +- **area_entered** **(** :ref:`Area` area **)** + +Emitted when another Area enters this Area. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area. + +---- + +.. _class_Area_signal_area_exited: + +- **area_exited** **(** :ref:`Area` area **)** + +Emitted when another Area exits this Area. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area. + +---- + +.. _class_Area_signal_area_shape_entered: + +- **area_shape_entered** **(** :ref:`RID` area_rid, :ref:`Area` area, :ref:`int` area_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of another Area's :ref:`Shape`\ s enters one of this Area's :ref:`Shape`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_rid`` the :ref:`RID` of the other Area's :ref:`CollisionObject` used by the :ref:`PhysicsServer`. + +``area`` the other Area. + +``area_shape_index`` the index of the :ref:`Shape` of the other Area used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``area.shape_owner_get_owner(area_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this Area used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area_signal_area_shape_exited: + +- **area_shape_exited** **(** :ref:`RID` area_rid, :ref:`Area` area, :ref:`int` area_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of another Area's :ref:`Shape`\ s enters one of this Area's :ref:`Shape`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_rid`` the :ref:`RID` of the other Area's :ref:`CollisionObject` used by the :ref:`PhysicsServer`. + +``area`` the other Area. + +``area_shape_index`` the index of the :ref:`Shape` of the other Area used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``area.shape_owner_get_owner(area_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this Area used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area_signal_body_entered: + +- **body_entered** **(** :ref:`Node` body **)** + +Emitted when a :ref:`PhysicsBody` or :ref:`GridMap` enters this Area. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +---- + +.. _class_Area_signal_body_exited: + +- **body_exited** **(** :ref:`Node` body **)** + +Emitted when a :ref:`PhysicsBody` or :ref:`GridMap` exits this Area. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +---- + +.. _class_Area_signal_body_shape_entered: + +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of a :ref:`PhysicsBody` or :ref:`GridMap`'s :ref:`Shape`\ s enters one of this Area's :ref:`Shape`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody` or :ref:`MeshLibrary`'s :ref:`CollisionObject` used by the :ref:`PhysicsServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody` or :ref:`GridMap`. + +``body_shape_index`` the index of the :ref:`Shape` of the :ref:`PhysicsBody` or :ref:`GridMap` used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this Area used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area_signal_body_shape_exited: + +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of a :ref:`PhysicsBody` or :ref:`GridMap`'s :ref:`Shape`\ s enters one of this Area's :ref:`Shape`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody` or :ref:`MeshLibrary`'s :ref:`CollisionObject` used by the :ref:`PhysicsServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody` or :ref:`GridMap`. + +``body_shape_index`` the index of the :ref:`Shape` of the :ref:`PhysicsBody` or :ref:`GridMap` used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this Area used by the :ref:`PhysicsServer`. Get the :ref:`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` order). + +- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`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` order), but keeps calculating the rest of the areas. + +Property Descriptions +--------------------- + +.. _class_Area_property_angular_damp: + +- :ref:`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` for more details about damping. + +---- + +.. _class_Area_property_audio_bus_name: + +- :ref:`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` **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` **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` **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` **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`). See also :ref:`space_override`. + +---- + +.. _class_Area_property_gravity_vec: + +- :ref:`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`), this will be the point of attraction. + +---- + +.. _class_Area_property_linear_damp: + +- :ref:`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` for more details about damping. + +---- + +.. _class_Area_property_monitorable: + +- :ref:`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` **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` **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` **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` **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` **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` **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` **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` for possible values. + +Method Descriptions +------------------- + +.. _class_Area_method_get_overlapping_areas: + +- :ref:`Array` **get_overlapping_areas** **(** **)** |const| + +Returns a list of intersecting ``Area``\ s. The overlapping area's :ref:`CollisionObject.collision_layer` must be part of this area's :ref:`CollisionObject.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` **get_overlapping_bodies** **(** **)** |const| + +Returns a list of intersecting :ref:`PhysicsBody`\ s. The overlapping body's :ref:`CollisionObject.collision_layer` must be part of this area's :ref:`CollisionObject.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` **overlaps_area** **(** :ref:`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` **overlaps_body** **(** :ref:`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` or a :ref:`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.)` diff --git a/classes/class_area2d.rst b/classes/class_area2d.rst new file mode 100644 index 0000000..b9d9bbb --- /dev/null +++ b/classes/class_area2d.rst @@ -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//doc_classes. + +.. _class_Area2D: + +Area2D +====== + +**Inherits:** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +2D area for detection and physics and audio influence. + +Description +----------- + +2D area that detects :ref:`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 `__ + +- `2D Pong Demo `__ + +- `2D Platformer Demo `__ + +Properties +---------- + ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`angular_damp` | ``1.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`audio_bus_name` | ``"Master"`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`audio_bus_override` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`gravity` | ``98.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`gravity_distance_scale` | ``0.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`gravity_point` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`gravity_vec` | ``Vector2( 0, 1 )`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`linear_damp` | ``0.1`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`monitorable` | ``true`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`monitoring` | ``true`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`priority` | ``0.0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ +| :ref:`SpaceOverride` | :ref:`space_override` | ``0`` | ++-------------------------------------------------+-----------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_overlapping_areas` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_overlapping_bodies` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_area` **(** :ref:`Node` area **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`overlaps_body` **(** :ref:`Node` body **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Area2D_signal_area_entered: + +- **area_entered** **(** :ref:`Area2D` area **)** + +Emitted when another Area2D enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area2D. + +---- + +.. _class_Area2D_signal_area_exited: + +- **area_exited** **(** :ref:`Area2D` area **)** + +Emitted when another Area2D exits this Area2D. Requires :ref:`monitoring` to be set to ``true``. + +``area`` the other Area2D. + +---- + +.. _class_Area2D_signal_area_shape_entered: + +- **area_shape_entered** **(** :ref:`RID` area_rid, :ref:`Area2D` area, :ref:`int` area_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of another Area2D's :ref:`Shape2D`\ s enters one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``area`` the other Area2D. + +``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area2D_signal_area_shape_exited: + +- **area_shape_exited** **(** :ref:`RID` area_rid, :ref:`Area2D` area, :ref:`int` area_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of another Area2D's :ref:`Shape2D`\ s exits one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. + +``area_rid`` the :ref:`RID` of the other Area2D's :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``area`` the other Area2D. + +``area_shape_index`` the index of the :ref:`Shape2D` of the other Area2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``area.shape_owner_get_owner(area_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area2D_signal_body_entered: + +- **body_entered** **(** :ref:`Node` body **)** + +Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` enters this Area2D. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +---- + +.. _class_Area2D_signal_body_exited: + +- **body_exited** **(** :ref:`Node` body **)** + +Emitted when a :ref:`PhysicsBody2D` or :ref:`TileMap` exits this Area2D. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +---- + +.. _class_Area2D_signal_body_shape_entered: + +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of a :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s enters one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_Area2D_signal_body_shape_exited: + +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of a :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s exits one of this Area2D's :ref:`Shape2D`\ s. Requires :ref:`monitoring` to be set to ``true``. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body_rid`` the :ref:`RID` of the :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape_index`` the index of the :ref:`Shape2D` of the :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this Area2D used by the :ref:`Physics2DServer`. Get the :ref:`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` order). + +- **SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damping values to whatever has been calculated so far (in :ref:`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` order), but keeps calculating the rest of the areas. + +Property Descriptions +--------------------- + +.. _class_Area2D_property_angular_damp: + +- :ref:`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` for more details about damping. + +---- + +.. _class_Area2D_property_audio_bus_name: + +- :ref:`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` **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` **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` **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` **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`). See also :ref:`space_override`. + +---- + +.. _class_Area2D_property_gravity_vec: + +- :ref:`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`), this will be the point of attraction. + +---- + +.. _class_Area2D_property_linear_damp: + +- :ref:`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` for more details about damping. + +---- + +.. _class_Area2D_property_monitorable: + +- :ref:`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` **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` **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` **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` for possible values. + +Method Descriptions +------------------- + +.. _class_Area2D_method_get_overlapping_areas: + +- :ref:`Array` **get_overlapping_areas** **(** **)** |const| + +Returns a list of intersecting ``Area2D``\ s. The overlapping area's :ref:`CollisionObject2D.collision_layer` must be part of this area's :ref:`CollisionObject2D.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` **get_overlapping_bodies** **(** **)** |const| + +Returns a list of intersecting :ref:`PhysicsBody2D`\ s. The overlapping body's :ref:`CollisionObject2D.collision_layer` must be part of this area's :ref:`CollisionObject2D.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` **overlaps_area** **(** :ref:`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` **overlaps_body** **(** :ref:`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` or a :ref:`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.)` diff --git a/classes/class_array.rst b/classes/class_array.rst new file mode 100644 index 0000000..ae49e91 --- /dev/null +++ b/classes/class_array.rst @@ -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//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` 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`. + +**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` | :ref:`Array` **(** :ref:`PoolColorArray` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolVector3Array` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolVector2Array` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolStringArray` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolRealArray` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolIntArray` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`Array` **(** :ref:`PoolByteArray` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`Array` array **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`back` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bsearch` **(** :ref:`Variant` value, :ref:`bool` before=true **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`bsearch_custom` **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`bool` before=true **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`Variant` what, :ref:`int` from=0 **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_last` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`front` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`insert` **(** :ref:`int` position, :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`max` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`min` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_at` **(** :ref:`int` position **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_back` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`pop_front` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_front` **(** :ref:`Variant` value **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` position **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` size **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`Variant` what, :ref:`int` from=-1 **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shuffle` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`slice` **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`bool` deep=false **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort_custom` **(** :ref:`Object` obj, :ref:`String` func **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Array_method_Array: + +- :ref:`Array` **Array** **(** :ref:`PoolColorArray` from **)** + +Constructs an array from a :ref:`PoolColorArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolVector3Array` from **)** + +Constructs an array from a :ref:`PoolVector3Array`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolVector2Array` from **)** + +Constructs an array from a :ref:`PoolVector2Array`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolStringArray` from **)** + +Constructs an array from a :ref:`PoolStringArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolRealArray` from **)** + +Constructs an array from a :ref:`PoolRealArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolIntArray` from **)** + +Constructs an array from a :ref:`PoolIntArray`. + +---- + +- :ref:`Array` **Array** **(** :ref:`PoolByteArray` from **)** + +Constructs an array from a :ref:`PoolByteArray`. + +---- + +.. _class_Array_method_append: + +- void **append** **(** :ref:`Variant` value **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_Array_method_append_array: + +- void **append_array** **(** :ref:`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` **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` **bsearch** **(** :ref:`Variant` value, :ref:`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` on an unsorted array results in unexpected behavior. + +---- + +.. _class_Array_method_bsearch_custom: + +- :ref:`int` **bsearch_custom** **(** :ref:`Variant` value, :ref:`Object` obj, :ref:`String` func, :ref:`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` on an unsorted array results in unexpected behavior. + +---- + +.. _class_Array_method_clear: + +- void **clear** **(** **)** + +Clears the array. This is equivalent to using :ref:`resize` with a size of ``0``. + +---- + +.. _class_Array_method_count: + +- :ref:`int` **count** **(** :ref:`Variant` value **)** + +Returns the number of times an element is in the array. + +---- + +.. _class_Array_method_duplicate: + +- :ref:`Array` **duplicate** **(** :ref:`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` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_Array_method_erase: + +- void **erase** **(** :ref:`Variant` value **)** + +Removes the first occurrence of a value from the array. To remove an element by index, use :ref:`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` **find** **(** :ref:`Variant` what, :ref:`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` **find_last** **(** :ref:`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` **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` **has** **(** :ref:`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` **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` position, :ref:`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` **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` **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` **pop_at** **(** :ref:`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` 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` will be. + +---- + +.. _class_Array_method_pop_back: + +- :ref:`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: + +- :ref:`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`. + +**Note:** On large arrays, this method is much slower than :ref:`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` will be. + +---- + +.. _class_Array_method_push_back: + +- void **push_back** **(** :ref:`Variant` value **)** + +Appends an element at the end of the array. See also :ref:`push_front`. + +---- + +.. _class_Array_method_push_front: + +- void **push_front** **(** :ref:`Variant` value **)** + +Adds an element at the beginning of the array. See also :ref:`push_back`. + +**Note:** On large arrays, this method is much slower than :ref:`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` will be. + +---- + +.. _class_Array_method_remove: + +- void **remove** **(** :ref:`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` 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` 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` **rfind** **(** :ref:`Variant` what, :ref:`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`. Call :ref:`@GDScript.randomize` to ensure that a new seed will be used each time if you want non-reproducible shuffling. + +---- + +.. _class_Array_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the number of elements in the array. + +---- + +.. _class_Array_method_slice: + +- :ref:`Array` **slice** **(** :ref:`int` begin, :ref:`int` end, :ref:`int` step=1, :ref:`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` obj, :ref:`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.)` diff --git a/classes/class_arraymesh.rst b/classes/class_arraymesh.rst new file mode 100644 index 0000000..a4cb937 --- /dev/null +++ b/classes/class_arraymesh.rst @@ -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//doc_classes. + +.. _class_ArrayMesh: + +ArrayMesh +========= + +**Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`Mesh` type that provides utility for constructing a surface from arrays. + +Description +----------- + +The ``ArrayMesh`` is used to construct a :ref:`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` is ready to be added to the :ref:`SceneTree` to be shown. + +See also :ref:`ImmediateGeometry`, :ref:`MeshDataTool` and :ref:`SurfaceTool` for procedural geometry generation. + +**Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. + +Tutorials +--------- + +- :doc:`../tutorials/3d/procedural_geometry/arraymesh` + +Properties +---------- + ++-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`BlendShapeMode` | :ref:`blend_shape_mode` | ``1`` | ++-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`AABB` | :ref:`custom_aabb` | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++-------------------------------------------------+--------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_blend_shape` **(** :ref:`String` name **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_surface_from_arrays` **(** :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`int` compress_flags=2194432 **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_blend_shapes` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_surfaces` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_blend_shape_count` **(** **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_blend_shape_name` **(** :ref:`int` index **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`lightmap_unwrap` **(** :ref:`Transform` transform, :ref:`float` texel_size **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`regen_normalmaps` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_blend_shape_name` **(** :ref:`int` index, :ref:`String` name **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_find_by_name` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_array_index_len` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_array_len` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`surface_get_format` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`surface_get_name` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PrimitiveType` | :ref:`surface_get_primitive_type` **(** :ref:`int` surf_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_remove` **(** :ref:`int` surf_idx **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_set_name` **(** :ref:`int` surf_idx, :ref:`String` name **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_update_region` **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`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`, :ref:`PoolVector2Array`, or :ref:`Array` of vertex positions. + +- **ARRAY_NORMAL** = **1** --- :ref:`PoolVector3Array` of vertex normals. + +- **ARRAY_TANGENT** = **2** --- :ref:`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` of vertex colors. + +- **ARRAY_TEX_UV** = **4** --- :ref:`PoolVector2Array` for UV coordinates. + +- **ARRAY_TEX_UV2** = **5** --- :ref:`PoolVector2Array` for second UV coordinates. + +- **ARRAY_BONES** = **6** --- :ref:`PoolRealArray` or :ref:`PoolIntArray` of bone indices. Each element in groups of 4 floats. + +- **ARRAY_WEIGHTS** = **7** --- :ref:`PoolRealArray` of bone weights. Each element in groups of 4 floats. + +- **ARRAY_INDEX** = **8** --- :ref:`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. + +---- + +.. _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` **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`. + +---- + +.. _class_ArrayMesh_property_custom_aabb: + +- :ref:`AABB` **custom_aabb** + ++-----------+------------------------------+ +| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++-----------+------------------------------+ +| *Setter* | set_custom_aabb(value) | ++-----------+------------------------------+ +| *Getter* | get_custom_aabb() | ++-----------+------------------------------+ + +Overrides the :ref:`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` name **)** + +Adds name for a blend shape that will be added with :ref:`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` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`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`. (As a note, when using indices, it is recommended to only use points, lines, or triangles.) :ref:`Mesh.get_surface_count` will become the ``surf_idx`` for this new surface. + +The ``arrays`` argument is an array of arrays. See :ref:`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` 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` **get_blend_shape_count** **(** **)** |const| + +Returns the number of blend shapes that the ``ArrayMesh`` holds. + +---- + +.. _class_ArrayMesh_method_get_blend_shape_name: + +- :ref:`String` **get_blend_shape_name** **(** :ref:`int` index **)** |const| + +Returns the name of the blend shape at this index. + +---- + +.. _class_ArrayMesh_method_lightmap_unwrap: + +- :ref:`Error` **lightmap_unwrap** **(** :ref:`Transform` transform, :ref:`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` index, :ref:`String` name **)** + +---- + +.. _class_ArrayMesh_method_surface_find_by_name: + +- :ref:`int` **surface_find_by_name** **(** :ref:`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` **surface_get_array_index_len** **(** :ref:`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_surface_get_array_len: + +- :ref:`int` **surface_get_array_len** **(** :ref:`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_surface_get_format: + +- :ref:`int` **surface_get_format** **(** :ref:`int` surf_idx **)** |const| + +Returns the format mask of the requested surface (see :ref:`add_surface_from_arrays`). + +---- + +.. _class_ArrayMesh_method_surface_get_name: + +- :ref:`String` **surface_get_name** **(** :ref:`int` surf_idx **)** |const| + +Gets the name assigned to this surface. + +---- + +.. _class_ArrayMesh_method_surface_get_primitive_type: + +- :ref:`PrimitiveType` **surface_get_primitive_type** **(** :ref:`int` surf_idx **)** |const| + +Returns the primitive type of the requested surface (see :ref:`add_surface_from_arrays`). + +---- + +.. _class_ArrayMesh_method_surface_remove: + +- void **surface_remove** **(** :ref:`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` surf_idx, :ref:`String` name **)** + +Sets a name for a given surface. + +---- + +.. _class_ArrayMesh_method_surface_update_region: + +- void **surface_update_region** **(** :ref:`int` surf_idx, :ref:`int` offset, :ref:`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.)` diff --git a/classes/class_arvranchor.rst b/classes/class_arvranchor.rst new file mode 100644 index 0000000..e575afc --- /dev/null +++ b/classes/class_arvranchor.rst @@ -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//doc_classes. + +.. _class_ARVRAnchor: + +ARVRAnchor +========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`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` | :ref:`anchor_id` | ``1`` | ++-----------------------+-------------------------------------------------------+-------+ + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_anchor_name` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_is_active` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`get_mesh` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`get_plane` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_size` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ARVRAnchor_signal_mesh_updated: + +- **mesh_updated** **(** :ref:`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` **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` **get_anchor_name** **(** **)** |const| + +Returns the name given to this anchor. + +---- + +.. _class_ARVRAnchor_method_get_is_active: + +- :ref:`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` **get_mesh** **(** **)** |const| + +If provided by the :ref:`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` **get_plane** **(** **)** |const| + +Returns a plane aligned with our anchor; handy for intersection testing. + +---- + +.. _class_ARVRAnchor_method_get_size: + +- :ref:`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.)` diff --git a/classes/class_arvrcamera.rst b/classes/class_arvrcamera.rst new file mode 100644 index 0000000..24d070e --- /dev/null +++ b/classes/class_arvrcamera.rst @@ -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//doc_classes. + +.. _class_ARVRCamera: + +ARVRCamera +========== + +**Inherits:** :ref:`Camera` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`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.)` diff --git a/classes/class_arvrcontroller.rst b/classes/class_arvrcontroller.rst new file mode 100644 index 0000000..6f8bb32 --- /dev/null +++ b/classes/class_arvrcontroller.rst @@ -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//doc_classes. + +.. _class_ARVRController: + +ARVRController +============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`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`. This makes this node ideal to add child nodes to visualize the controller. + +Tutorials +--------- + +- :doc:`../tutorials/vr/index` + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`controller_id` | ``1`` | ++---------------------------+-------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`rumble` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------+---------+ + +Methods +------- + ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_controller_name` **(** **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TrackerHand` | :ref:`get_hand` **(** **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_is_active` **(** **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_joystick_axis` **(** :ref:`int` axis **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_joystick_id` **(** **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`get_mesh` **(** **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`is_button_pressed` **(** :ref:`int` button **)** |const| | ++------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ARVRController_signal_button_pressed: + +- **button_pressed** **(** :ref:`int` button **)** + +Emitted when a button on this controller is pressed. + +---- + +.. _class_ARVRController_signal_button_release: + +- **button_release** **(** :ref:`int` button **)** + +Emitted when a button on this controller is released. + +---- + +.. _class_ARVRController_signal_mesh_updated: + +- **mesh_updated** **(** :ref:`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` **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` 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` **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` 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` **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` **get_hand** **(** **)** |const| + +Returns the hand holding this controller, if known. See :ref:`TrackerHand`. + +---- + +.. _class_ARVRController_method_get_is_active: + +- :ref:`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` **get_joystick_axis** **(** :ref:`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` **get_joystick_id** **(** **)** |const| + +Returns the ID of the joystick object bound to this. Every controller tracked by the :ref:`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` **get_mesh** **(** **)** |const| + +If provided by the :ref:`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` **is_button_pressed** **(** :ref:`int` button **)** |const| + +Returns ``true`` if the button at index ``button`` is pressed. See :ref:`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.)` diff --git a/classes/class_arvrinterface.rst b/classes/class_arvrinterface.rst new file mode 100644 index 0000000..1daacb6 --- /dev/null +++ b/classes/class_arvrinterface.rst @@ -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//doc_classes. + +.. _class_ARVRInterface: + +ARVRInterface +============= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`ARVRInterfaceGDNative`, :ref:`MobileVRInterface`, :ref:`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`. + +Tutorials +--------- + +- :doc:`../tutorials/vr/index` + +Properties +---------- + ++-------------------------+----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`ar_is_anchor_detection_enabled` | ``false`` | ++-------------------------+----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`interface_is_initialized` | ``false`` | ++-------------------------+----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`interface_is_primary` | ``false`` | ++-------------------------+----------------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_camera_feed_id` **(** **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_capabilities` **(** **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_render_targetsize` **(** **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`Tracking_status` | :ref:`get_tracking_status` **(** **)** |const| | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`initialize` **(** **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_stereo` **(** **)** | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+ +| void | :ref:`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`). 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` **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` **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` **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` **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` for this interface. + +---- + +.. _class_ARVRInterface_method_get_capabilities: + +- :ref:`int` **get_capabilities** **(** **)** |const| + +Returns a combination of :ref:`Capabilities` flags providing information about the capabilities of this interface. + +---- + +.. _class_ARVRInterface_method_get_name: + +- :ref:`String` **get_name** **(** **)** |const| + +Returns the name of this interface (OpenVR, OpenHMD, ARKit, etc). + +---- + +.. _class_ARVRInterface_method_get_render_targetsize: + +- :ref:`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` **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` **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` **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.)` diff --git a/classes/class_arvrinterfacegdnative.rst b/classes/class_arvrinterfacegdnative.rst new file mode 100644 index 0000000..244ec18 --- /dev/null +++ b/classes/class_arvrinterfacegdnative.rst @@ -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//doc_classes. + +.. _class_ARVRInterfaceGDNative: + +ARVRInterfaceGDNative +===================== + +**Inherits:** :ref:`ARVRInterface` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_arvrorigin.rst b/classes/class_arvrorigin.rst new file mode 100644 index 0000000..0d61ed0 --- /dev/null +++ b/classes/class_arvrorigin.rst @@ -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//doc_classes. + +.. _class_ARVROrigin: + +ARVROrigin +========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`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` | :ref:`world_scale` | ``1.0`` | ++---------------------------+-----------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_ARVROrigin_property_world_scale: + +- :ref:`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` 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.)` diff --git a/classes/class_arvrpositionaltracker.rst b/classes/class_arvrpositionaltracker.rst new file mode 100644 index 0000000..dc1443b --- /dev/null +++ b/classes/class_arvrpositionaltracker.rst @@ -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//doc_classes. + +.. _class_ARVRPositionalTracker: + +ARVRPositionalTracker +===================== + +**Inherits:** :ref:`Reference` **<** :ref:`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`. + +The :ref:`ARVRController` and :ref:`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` | :ref:`rumble` | ``0.0`` | ++---------------------------+------------------------------------------------------------+---------+ + +Methods +------- + ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TrackerHand` | :ref:`get_hand` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_joy_id` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`get_mesh` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`get_orientation` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_position` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tracker_id` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_tracks_orientation` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_tracks_position` **(** **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_transform` **(** :ref:`bool` adjust_by_reference_frame **)** |const| | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TrackerType` | :ref:`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` **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` **get_hand** **(** **)** |const| + +Returns the hand holding this tracker, if known. See :ref:`TrackerHand` constants. + +---- + +.. _class_ARVRPositionalTracker_method_get_joy_id: + +- :ref:`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` **get_mesh** **(** **)** |const| + +Returns the mesh related to a controller or anchor point if one is available. + +---- + +.. _class_ARVRPositionalTracker_method_get_name: + +- :ref:`String` **get_name** **(** **)** |const| + +Returns the controller or anchor point's name if available. + +---- + +.. _class_ARVRPositionalTracker_method_get_orientation: + +- :ref:`Basis` **get_orientation** **(** **)** |const| + +Returns the controller's orientation matrix. + +---- + +.. _class_ARVRPositionalTracker_method_get_position: + +- :ref:`Vector3` **get_position** **(** **)** |const| + +Returns the world-space controller position. + +---- + +.. _class_ARVRPositionalTracker_method_get_tracker_id: + +- :ref:`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` and :ref:`ARVRAnchor` nodes. + +---- + +.. _class_ARVRPositionalTracker_method_get_tracks_orientation: + +- :ref:`bool` **get_tracks_orientation** **(** **)** |const| + +Returns ``true`` if this device tracks orientation. + +---- + +.. _class_ARVRPositionalTracker_method_get_tracks_position: + +- :ref:`bool` **get_tracks_position** **(** **)** |const| + +Returns ``true`` if this device tracks position. + +---- + +.. _class_ARVRPositionalTracker_method_get_transform: + +- :ref:`Transform` **get_transform** **(** :ref:`bool` adjust_by_reference_frame **)** |const| + +Returns the transform combining this device's orientation and position. + +---- + +.. _class_ARVRPositionalTracker_method_get_type: + +- :ref:`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.)` diff --git a/classes/class_arvrserver.rst b/classes/class_arvrserver.rst new file mode 100644 index 0000000..9d5b857 --- /dev/null +++ b/classes/class_arvrserver.rst @@ -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//doc_classes. + +.. _class_ARVRServer: + +ARVRServer +========== + +**Inherits:** :ref:`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` | :ref:`primary_interface` | | ++-------------------------------------------+-----------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`world_scale` | ``1.0`` | ++-------------------------------------------+-----------------------------------------------------------------------+---------+ + +Methods +------- + ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_interface` **(** :ref:`ARVRInterface` interface **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_tracker` **(** :ref:`ARVRPositionalTracker` tracker **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`center_on_hmd` **(** :ref:`RotationMode` rotation_mode, :ref:`bool` keep_height **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_primary_interface_if` **(** :ref:`ARVRInterface` interface **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ARVRInterface` | :ref:`find_interface` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_hmd_transform` **(** **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ARVRInterface` | :ref:`get_interface` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_interface_count` **(** **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_interfaces` **(** **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_commit_usec` **(** **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_frame_usec` **(** **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_process_usec` **(** **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_reference_frame` **(** **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ARVRPositionalTracker` | :ref:`get_tracker` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tracker_count` **(** **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_interface` **(** :ref:`ARVRInterface` interface **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_tracker` **(** :ref:`ARVRPositionalTracker` tracker **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ARVRServer_signal_interface_added: + +- **interface_added** **(** :ref:`String` interface_name **)** + +Emitted when a new interface has been added. + +---- + +.. _class_ARVRServer_signal_interface_removed: + +- **interface_removed** **(** :ref:`String` interface_name **)** + +Emitted when an interface is removed. + +---- + +.. _class_ARVRServer_signal_tracker_added: + +- **tracker_added** **(** :ref:`String` tracker_name, :ref:`int` type, :ref:`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`\ s for an AR solution, it is important to react to this signal to add the appropriate :ref:`ARVRController` or :ref:`ARVRAnchor` nodes related to this new tracker. + +---- + +.. _class_ARVRServer_signal_tracker_removed: + +- **tracker_removed** **(** :ref:`String` tracker_name, :ref:`int` type, :ref:`int` id **)** + +Emitted when a tracker is removed. You should remove any :ref:`ARVRController` or :ref:`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` **primary_interface** + ++----------+------------------------------+ +| *Setter* | set_primary_interface(value) | ++----------+------------------------------+ +| *Getter* | get_primary_interface() | ++----------+------------------------------+ + +The primary :ref:`ARVRInterface` currently bound to the ``ARVRServer``. + +---- + +.. _class_ARVRServer_property_world_scale: + +- :ref:`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` interface **)** + +Registers an :ref:`ARVRInterface` object. + +---- + +.. _class_ARVRServer_method_add_tracker: + +- void **add_tracker** **(** :ref:`ARVRPositionalTracker` tracker **)** + +Registers a new :ref:`ARVRPositionalTracker` that tracks a spatial location in real space. + +---- + +.. _class_ARVRServer_method_center_on_hmd: + +- void **center_on_hmd** **(** :ref:`RotationMode` rotation_mode, :ref:`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` interface **)** + +Clears our current primary interface if it is set to the provided interface. + +---- + +.. _class_ARVRServer_method_find_interface: + +- :ref:`ARVRInterface` **find_interface** **(** :ref:`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` **get_hmd_transform** **(** **)** + +Returns the primary interface's transformation. + +---- + +.. _class_ARVRServer_method_get_interface: + +- :ref:`ARVRInterface` **get_interface** **(** :ref:`int` idx **)** |const| + +Returns the interface registered at a given index in our list of interfaces. + +---- + +.. _class_ARVRServer_method_get_interface_count: + +- :ref:`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` **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` **get_last_commit_usec** **(** **)** + +Returns the absolute timestamp (in μs) of the last ``ARVRServer`` commit of the AR/VR eyes to :ref:`VisualServer`. The value comes from an internal call to :ref:`OS.get_ticks_usec`. + +---- + +.. _class_ARVRServer_method_get_last_frame_usec: + +- :ref:`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` and :ref:`get_last_process_usec` when committing. + +---- + +.. _class_ARVRServer_method_get_last_process_usec: + +- :ref:`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_ARVRServer_method_get_reference_frame: + +- :ref:`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` **get_tracker** **(** :ref:`int` idx **)** |const| + +Returns the positional tracker at the given ID. + +---- + +.. _class_ARVRServer_method_get_tracker_count: + +- :ref:`int` **get_tracker_count** **(** **)** |const| + +Returns the number of trackers currently registered. + +---- + +.. _class_ARVRServer_method_remove_interface: + +- void **remove_interface** **(** :ref:`ARVRInterface` interface **)** + +Removes this interface. + +---- + +.. _class_ARVRServer_method_remove_tracker: + +- void **remove_tracker** **(** :ref:`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.)` diff --git a/classes/class_aspectratiocontainer.rst b/classes/class_aspectratiocontainer.rst new file mode 100644 index 0000000..9a676d6 --- /dev/null +++ b/classes/class_aspectratiocontainer.rst @@ -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//doc_classes. + +.. _class_AspectRatioContainer: + +AspectRatioContainer +==================== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`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` | :ref:`alignment_horizontal` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`AlignMode` | :ref:`alignment_vertical` | ``1`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`ratio` | ``1.0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------+---------+ +| :ref:`StretchMode` | :ref:`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` 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` **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` **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` **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: + +- :ref:`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.)` diff --git a/classes/class_astar.rst b/classes/class_astar.rst new file mode 100644 index 0000000..ec8acbd --- /dev/null +++ b/classes/class_astar.rst @@ -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//doc_classes. + +.. _class_AStar: + +AStar +===== + +**Inherits:** :ref:`Reference` **<** :ref:`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` and create segments manually with :ref:`connect_points`. Then you can test if there is a path between two points with the :ref:`are_points_connected` function, get a path containing indices by :ref:`get_id_path`, or one containing actual coordinates with :ref:`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` and :ref:`_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` 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` return the same value as :ref:`_compute_cost` to provide the algorithm with the most accurate information. + +If the default :ref:`_estimate_cost` and :ref:`_compute_cost` methods are used, or if the supplied :ref:`_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` 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` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector3` position, :ref:`float` weight_scale=1.0 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_point_id` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector3` to_position, :ref:`bool` include_disabled=false **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector3` to_position **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_capacity` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_point_connections` **(** :ref:`int` id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_position` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_points` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector3` position **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AStar_method__compute_cost: + +- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`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` **_estimate_cost** **(** :ref:`int` from_id, :ref:`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` id, :ref:`Vector3` position, :ref:`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` 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` **are_points_connected** **(** :ref:`int` id, :ref:`int` to_id, :ref:`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` id, :ref:`int` to_id, :ref:`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` id, :ref:`int` to_id, :ref:`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` **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` **get_closest_point** **(** :ref:`Vector3` to_position, :ref:`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` **get_closest_position_in_segment** **(** :ref:`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` **get_id_path** **(** :ref:`int` from_id, :ref:`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` **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` **get_point_connections** **(** :ref:`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` **get_point_count** **(** **)** |const| + +Returns the number of points currently in the points pool. + +---- + +.. _class_AStar_method_get_point_path: + +- :ref:`PoolVector3Array` **get_point_path** **(** :ref:`int` from_id, :ref:`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`, it will return an empty :ref:`PoolVector3Array` and will print an error message. + +---- + +.. _class_AStar_method_get_point_position: + +- :ref:`Vector3` **get_point_position** **(** :ref:`int` id **)** |const| + +Returns the position of the point associated with the given ``id``. + +---- + +.. _class_AStar_method_get_point_weight_scale: + +- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** |const| + +Returns the weight scale of the point associated with the given ``id``. + +---- + +.. _class_AStar_method_get_points: + +- :ref:`Array` **get_points** **(** **)** + +Returns an array of all points. + +---- + +.. _class_AStar_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| + +Returns whether a point associated with the given ``id`` exists. + +---- + +.. _class_AStar_method_is_point_disabled: + +- :ref:`bool` **is_point_disabled** **(** :ref:`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` id **)** + +Removes the point associated with the given ``id`` from the points pool. + +---- + +.. _class_AStar_method_reserve_space: + +- void **reserve_space** **(** :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`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` 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.)` diff --git a/classes/class_astar2d.rst b/classes/class_astar2d.rst new file mode 100644 index 0000000..0fce626 --- /dev/null +++ b/classes/class_astar2d.rst @@ -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//doc_classes. + +.. _class_AStar2D: + +AStar2D +======= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +AStar class representation that uses 2D vectors as edges. + +Description +----------- + +This is a wrapper for the :ref:`AStar` class which uses 2D vectors instead of 3D vectors. + +Methods +------- + ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_compute_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`_estimate_cost` **(** :ref:`int` from_id, :ref:`int` to_id **)** |virtual| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`int` id, :ref:`Vector2` position, :ref:`float` weight_scale=1.0 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_points_connected` **(** :ref:`int` id, :ref:`int` to_id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_points` **(** :ref:`int` id, :ref:`int` to_id, :ref:`bool` bidirectional=true **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_points` **(** :ref:`int` id, :ref:`int` to_id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_point_id` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_closest_point` **(** :ref:`Vector2` to_position, :ref:`bool` include_disabled=false **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_position_in_segment` **(** :ref:`Vector2` to_position **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_id_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_capacity` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_point_connections` **(** :ref:`int` id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_point_path` **(** :ref:`int` from_id, :ref:`int` to_id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_weight_scale` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_points` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_disabled` **(** :ref:`int` id **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` id **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reserve_space` **(** :ref:`int` num_nodes **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_disabled` **(** :ref:`int` id, :ref:`bool` disabled=true **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` id, :ref:`Vector2` position **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_weight_scale` **(** :ref:`int` id, :ref:`float` weight_scale **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AStar2D_method__compute_cost: + +- :ref:`float` **_compute_cost** **(** :ref:`int` from_id, :ref:`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` **_estimate_cost** **(** :ref:`int` from_id, :ref:`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` id, :ref:`Vector2` position, :ref:`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` 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` **are_points_connected** **(** :ref:`int` id, :ref:`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` id, :ref:`int` to_id, :ref:`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` id, :ref:`int` to_id **)** + +Deletes the segment between the given points. + +---- + +.. _class_AStar2D_method_get_available_point_id: + +- :ref:`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` **get_closest_point** **(** :ref:`Vector2` to_position, :ref:`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` **get_closest_position_in_segment** **(** :ref:`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` **get_id_path** **(** :ref:`int` from_id, :ref:`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` **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` **get_point_connections** **(** :ref:`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` **get_point_count** **(** **)** |const| + +Returns the number of points currently in the points pool. + +---- + +.. _class_AStar2D_method_get_point_path: + +- :ref:`PoolVector2Array` **get_point_path** **(** :ref:`int` from_id, :ref:`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`, it will return an empty :ref:`PoolVector2Array` and will print an error message. + +---- + +.. _class_AStar2D_method_get_point_position: + +- :ref:`Vector2` **get_point_position** **(** :ref:`int` id **)** |const| + +Returns the position of the point associated with the given ``id``. + +---- + +.. _class_AStar2D_method_get_point_weight_scale: + +- :ref:`float` **get_point_weight_scale** **(** :ref:`int` id **)** |const| + +Returns the weight scale of the point associated with the given ``id``. + +---- + +.. _class_AStar2D_method_get_points: + +- :ref:`Array` **get_points** **(** **)** + +Returns an array of all points. + +---- + +.. _class_AStar2D_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`int` id **)** |const| + +Returns whether a point associated with the given ``id`` exists. + +---- + +.. _class_AStar2D_method_is_point_disabled: + +- :ref:`bool` **is_point_disabled** **(** :ref:`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` id **)** + +Removes the point associated with the given ``id`` from the points pool. + +---- + +.. _class_AStar2D_method_reserve_space: + +- void **reserve_space** **(** :ref:`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` id, :ref:`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` id, :ref:`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` id, :ref:`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` 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.)` diff --git a/classes/class_atlastexture.rst b/classes/class_atlastexture.rst new file mode 100644 index 0000000..9061f5d --- /dev/null +++ b/classes/class_atlastexture.rst @@ -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//doc_classes. + +.. _class_AtlasTexture: + +AtlasTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Crops out one part of a texture, such as a texture from a texture atlas. + +Description +----------- + +:ref:`Texture` resource that crops out one part of the :ref:`atlas` texture, defined by :ref:`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` for the :ref:`atlas`, a :ref:`region` that defines the area of :ref:`atlas` to use, and a :ref:`margin` that defines the border width. + +``AtlasTexture`` cannot be used in an :ref:`AnimatedTexture`, cannot be tiled in nodes such as :ref:`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` and :ref:`Texture.FLAG_MIRRORED_REPEAT` flags are ignored when using an AtlasTexture. + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`atlas` | | ++-------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`filter_clip` | ``false`` | ++-------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`Rect2` | :ref:`margin` | ``Rect2( 0, 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`Rect2` | :ref:`region` | ``Rect2( 0, 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_AtlasTexture_property_atlas: + +- :ref:`Texture` **atlas** + ++----------+------------------+ +| *Setter* | set_atlas(value) | ++----------+------------------+ +| *Getter* | get_atlas() | ++----------+------------------+ + +The texture that contains the atlas. Can be any :ref:`Texture` subtype. + +---- + +.. _class_AtlasTexture_property_filter_clip: + +- :ref:`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` **margin** + ++-----------+-------------------------+ +| *Default* | ``Rect2( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------------+ +| *Getter* | get_margin() | ++-----------+-------------------------+ + +The margin around the region. The :ref:`Rect2`'s :ref:`Rect2.size` parameter ("w" and "h" in the editor) resizes the texture so it fits within the margin. + +---- + +.. _class_AtlasTexture_property_region: + +- :ref:`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.)` diff --git a/classes/class_audiobuslayout.rst b/classes/class_audiobuslayout.rst new file mode 100644 index 0000000..30d2152 --- /dev/null +++ b/classes/class_audiobuslayout.rst @@ -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//doc_classes. + +.. _class_AudioBusLayout: + +AudioBusLayout +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` 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.)` diff --git a/classes/class_audioeffect.rst b/classes/class_audioeffect.rst new file mode 100644 index 0000000..3f16d86 --- /dev/null +++ b/classes/class_audioeffect.rst @@ -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//doc_classes. + +.. _class_AudioEffect: + +AudioEffect +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioEffectAmplify`, :ref:`AudioEffectCapture`, :ref:`AudioEffectChorus`, :ref:`AudioEffectCompressor`, :ref:`AudioEffectDelay`, :ref:`AudioEffectDistortion`, :ref:`AudioEffectEQ`, :ref:`AudioEffectFilter`, :ref:`AudioEffectLimiter`, :ref:`AudioEffectPanner`, :ref:`AudioEffectPhaser`, :ref:`AudioEffectPitchShift`, :ref:`AudioEffectRecord`, :ref:`AudioEffectReverb`, :ref:`AudioEffectSpectrumAnalyzer`, :ref:`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 `__ + +.. |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.)` diff --git a/classes/class_audioeffectamplify.rst b/classes/class_audioeffectamplify.rst new file mode 100644 index 0000000..24730d7 --- /dev/null +++ b/classes/class_audioeffectamplify.rst @@ -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//doc_classes. + +.. _class_AudioEffectAmplify: + +AudioEffectAmplify +================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` | :ref:`volume_db` | ``0.0`` | ++---------------------------+---------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectAmplify_property_volume_db: + +- :ref:`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.)` diff --git a/classes/class_audioeffectbandlimitfilter.rst b/classes/class_audioeffectbandlimitfilter.rst new file mode 100644 index 0000000..4002e1e --- /dev/null +++ b/classes/class_audioeffectbandlimitfilter.rst @@ -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//doc_classes. + +.. _class_AudioEffectBandLimitFilter: + +AudioEffectBandLimitFilter +========================== + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a band limit filter to the audio bus. + +Description +----------- + +Limits the frequencies in a range around the :ref:`AudioEffectFilter.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.)` diff --git a/classes/class_audioeffectbandpassfilter.rst b/classes/class_audioeffectbandpassfilter.rst new file mode 100644 index 0000000..8ddf80b --- /dev/null +++ b/classes/class_audioeffectbandpassfilter.rst @@ -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//doc_classes. + +.. _class_AudioEffectBandPassFilter: + +AudioEffectBandPassFilter +========================= + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a band pass filter to the audio bus. + +Description +----------- + +Attenuates the frequencies inside of a range around the :ref:`AudioEffectFilter.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.)` diff --git a/classes/class_audioeffectcapture.rst b/classes/class_audioeffectcapture.rst new file mode 100644 index 0000000..0385fd0 --- /dev/null +++ b/classes/class_audioeffectcapture.rst @@ -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//doc_classes. + +.. _class_AudioEffectCapture: + +AudioEffectCapture +================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` 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` | :ref:`buffer_length` | ``0.1`` | ++---------------------------+-----------------------------------------------------------------------+---------+ + +Methods +------- + ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_get_buffer` **(** :ref:`int` frames **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_buffer` **(** **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_buffer` **(** :ref:`int` frames **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_buffer_length_frames` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_discarded_frames` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frames_available` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_pushed_frames` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectCapture_property_buffer_length: + +- :ref:`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` **can_get_buffer** **(** :ref:`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` **get_buffer** **(** :ref:`int` frames **)** + +Gets the next ``frames`` audio samples from the internal ring buffer. + +Returns a :ref:`PoolVector2Array` containing exactly ``frames`` audio samples if available, or an empty :ref:`PoolVector2Array` if insufficient data was available. + +---- + +.. _class_AudioEffectCapture_method_get_buffer_length_frames: + +- :ref:`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` **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` **get_frames_available** **(** **)** |const| + +Returns the number of frames available to read using :ref:`get_buffer`. + +---- + +.. _class_AudioEffectCapture_method_get_pushed_frames: + +- :ref:`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.)` diff --git a/classes/class_audioeffectchorus.rst b/classes/class_audioeffectchorus.rst new file mode 100644 index 0000000..4bbc926 --- /dev/null +++ b/classes/class_audioeffectchorus.rst @@ -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//doc_classes. + +.. _class_AudioEffectChorus: + +AudioEffectChorus +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` | :ref:`dry` | ``1.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/cutoff_hz` | ``8000.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/delay_ms` | ``15.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/depth_ms` | ``2.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/level_db` | ``0.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/pan` | ``-0.5`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/1/rate_hz` | ``0.8`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/cutoff_hz` | ``8000.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/delay_ms` | ``20.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/depth_ms` | ``3.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/level_db` | ``0.0`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/pan` | ``0.5`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/2/rate_hz` | ``1.2`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/cutoff_hz` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/delay_ms` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/depth_ms` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/level_db` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/pan` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/3/rate_hz` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/cutoff_hz` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/delay_ms` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/depth_ms` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/level_db` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/pan` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`voice/4/rate_hz` | | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`int` | :ref:`voice_count` | ``2`` | ++---------------------------+------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`wet` | ``0.5`` | ++---------------------------+------------------------------------------------------------------------------+------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_cutoff_hz` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_delay_ms` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_depth_ms` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_level_db` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_pan` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_voice_rate_hz` **(** :ref:`int` voice_idx **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_cutoff_hz` **(** :ref:`int` voice_idx, :ref:`float` cutoff_hz **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_delay_ms` **(** :ref:`int` voice_idx, :ref:`float` delay_ms **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_depth_ms` **(** :ref:`int` voice_idx, :ref:`float` depth_ms **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_level_db` **(** :ref:`int` voice_idx, :ref:`float` level_db **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_pan` **(** :ref:`int` voice_idx, :ref:`float` pan **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_voice_rate_hz` **(** :ref:`int` voice_idx, :ref:`float` rate_hz **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectChorus_property_dry: + +- :ref:`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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **get_voice_cutoff_hz** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_get_voice_delay_ms: + +- :ref:`float` **get_voice_delay_ms** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_get_voice_depth_ms: + +- :ref:`float` **get_voice_depth_ms** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_get_voice_level_db: + +- :ref:`float` **get_voice_level_db** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_get_voice_pan: + +- :ref:`float` **get_voice_pan** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_get_voice_rate_hz: + +- :ref:`float` **get_voice_rate_hz** **(** :ref:`int` voice_idx **)** |const| + +---- + +.. _class_AudioEffectChorus_method_set_voice_cutoff_hz: + +- void **set_voice_cutoff_hz** **(** :ref:`int` voice_idx, :ref:`float` cutoff_hz **)** + +---- + +.. _class_AudioEffectChorus_method_set_voice_delay_ms: + +- void **set_voice_delay_ms** **(** :ref:`int` voice_idx, :ref:`float` delay_ms **)** + +---- + +.. _class_AudioEffectChorus_method_set_voice_depth_ms: + +- void **set_voice_depth_ms** **(** :ref:`int` voice_idx, :ref:`float` depth_ms **)** + +---- + +.. _class_AudioEffectChorus_method_set_voice_level_db: + +- void **set_voice_level_db** **(** :ref:`int` voice_idx, :ref:`float` level_db **)** + +---- + +.. _class_AudioEffectChorus_method_set_voice_pan: + +- void **set_voice_pan** **(** :ref:`int` voice_idx, :ref:`float` pan **)** + +---- + +.. _class_AudioEffectChorus_method_set_voice_rate_hz: + +- void **set_voice_rate_hz** **(** :ref:`int` voice_idx, :ref:`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.)` diff --git a/classes/class_audioeffectcompressor.rst b/classes/class_audioeffectcompressor.rst new file mode 100644 index 0000000..86617bb --- /dev/null +++ b/classes/class_audioeffectcompressor.rst @@ -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//doc_classes. + +.. _class_AudioEffectCompressor: + +AudioEffectCompressor +===================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` 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` | :ref:`attack_us` | ``20.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`gain` | ``0.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`mix` | ``1.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`ratio` | ``4.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`release_ms` | ``250.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`sidechain` | ``""`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`threshold` | ``0.0`` | ++-----------------------------+--------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectCompressor_property_attack_us: + +- :ref:`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` **gain** + ++-----------+-----------------+ +| *Default* | ``0.0`` | ++-----------+-----------------+ +| *Setter* | set_gain(value) | ++-----------+-----------------+ +| *Getter* | get_gain() | ++-----------+-----------------+ + +Gain applied to the output signal. + +---- + +.. _class_AudioEffectCompressor_property_mix: + +- :ref:`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` **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` **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` **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` **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.)` diff --git a/classes/class_audioeffectdelay.rst b/classes/class_audioeffectdelay.rst new file mode 100644 index 0000000..2f8fa3b --- /dev/null +++ b/classes/class_audioeffectdelay.rst @@ -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//doc_classes. + +.. _class_AudioEffectDelay: + +AudioEffectDelay +================ + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` | :ref:`dry` | ``1.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`bool` | :ref:`feedback/active` | ``false`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`feedback/delay_ms` | ``340.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`feedback/level_db` | ``-6.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`feedback/lowpass` | ``16000.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`bool` | :ref:`tap1/active` | ``true`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap1/delay_ms` | ``250.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap1/level_db` | ``-6.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap1/pan` | ``0.2`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`bool` | :ref:`tap2/active` | ``true`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap2/delay_ms` | ``500.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap2/level_db` | ``-12.0`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`tap2/pan` | ``-0.4`` | ++---------------------------+-----------------------------------------------------------------------------+-------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectDelay_property_dry: + +- :ref:`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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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` **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.)` diff --git a/classes/class_audioeffectdistortion.rst b/classes/class_audioeffectdistortion.rst new file mode 100644 index 0000000..27be5b9 --- /dev/null +++ b/classes/class_audioeffectdistortion.rst @@ -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//doc_classes. + +.. _class_AudioEffectDistortion: + +AudioEffectDistortion +===================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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` | :ref:`drive` | ``0.0`` | ++----------------------------------------------+--------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`keep_hf_hz` | ``16000.0`` | ++----------------------------------------------+--------------------------------------------------------------------+-------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++----------------------------------------------+--------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`post_gain` | ``0.0`` | ++----------------------------------------------+--------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`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` **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` **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` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +Distortion type. + +---- + +.. _class_AudioEffectDistortion_property_post_gain: + +- :ref:`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` **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.)` diff --git a/classes/class_audioeffecteq.rst b/classes/class_audioeffecteq.rst new file mode 100644 index 0000000..c748e93 --- /dev/null +++ b/classes/class_audioeffecteq.rst @@ -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//doc_classes. + +.. _class_AudioEffectEQ: + +AudioEffectEQ +============= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioEffectEQ10`, :ref:`AudioEffectEQ21`, :ref:`AudioEffectEQ6` + +Base class for audio equalizers. Gives you control over frequencies. + +Use it to create a custom equalizer if :ref:`AudioEffectEQ6`, :ref:`AudioEffectEQ10` or :ref:`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` | :ref:`get_band_count` **(** **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_band_gain_db` **(** :ref:`int` band_idx **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_band_gain_db` **(** :ref:`int` band_idx, :ref:`float` volume_db **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AudioEffectEQ_method_get_band_count: + +- :ref:`int` **get_band_count** **(** **)** |const| + +Returns the number of bands of the equalizer. + +---- + +.. _class_AudioEffectEQ_method_get_band_gain_db: + +- :ref:`float` **get_band_gain_db** **(** :ref:`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` band_idx, :ref:`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.)` diff --git a/classes/class_audioeffecteq10.rst b/classes/class_audioeffecteq10.rst new file mode 100644 index 0000000..34783e8 --- /dev/null +++ b/classes/class_audioeffecteq10.rst @@ -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//doc_classes. + +.. _class_AudioEffectEQ10: + +AudioEffectEQ10 +=============== + +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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`, :ref:`AudioEffectEQ6`, :ref:`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.)` diff --git a/classes/class_audioeffecteq21.rst b/classes/class_audioeffecteq21.rst new file mode 100644 index 0000000..3798a2b --- /dev/null +++ b/classes/class_audioeffecteq21.rst @@ -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//doc_classes. + +.. _class_AudioEffectEQ21: + +AudioEffectEQ21 +=============== + +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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`, :ref:`AudioEffectEQ6`, :ref:`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.)` diff --git a/classes/class_audioeffecteq6.rst b/classes/class_audioeffecteq6.rst new file mode 100644 index 0000000..19dcf08 --- /dev/null +++ b/classes/class_audioeffecteq6.rst @@ -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//doc_classes. + +.. _class_AudioEffectEQ6: + +AudioEffectEQ6 +============== + +**Inherits:** :ref:`AudioEffectEQ` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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`, :ref:`AudioEffectEQ10`, :ref:`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.)` diff --git a/classes/class_audioeffectfilter.rst b/classes/class_audioeffectfilter.rst new file mode 100644 index 0000000..f3bbe25 --- /dev/null +++ b/classes/class_audioeffectfilter.rst @@ -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//doc_classes. + +.. _class_AudioEffectFilter: + +AudioEffectFilter +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioEffectBandLimitFilter`, :ref:`AudioEffectBandPassFilter`, :ref:`AudioEffectHighPassFilter`, :ref:`AudioEffectHighShelfFilter`, :ref:`AudioEffectLowPassFilter`, :ref:`AudioEffectLowShelfFilter`, :ref:`AudioEffectNotchFilter` + +Adds a filter to the audio bus. + +Description +----------- + +Allows frequencies other than the :ref:`cutoff_hz` to pass. + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` + +Properties +---------- + ++--------------------------------------------------+--------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`cutoff_hz` | ``2000.0`` | ++--------------------------------------------------+--------------------------------------------------------------+------------+ +| :ref:`FilterDB` | :ref:`db` | ``0`` | ++--------------------------------------------------+--------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`gain` | ``1.0`` | ++--------------------------------------------------+--------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`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` **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` **db** + ++-----------+---------------+ +| *Default* | ``0`` | ++-----------+---------------+ +| *Setter* | set_db(value) | ++-----------+---------------+ +| *Getter* | get_db() | ++-----------+---------------+ + +---- + +.. _class_AudioEffectFilter_property_gain: + +- :ref:`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` **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.)` diff --git a/classes/class_audioeffecthighpassfilter.rst b/classes/class_audioeffecthighpassfilter.rst new file mode 100644 index 0000000..1898015 --- /dev/null +++ b/classes/class_audioeffecthighpassfilter.rst @@ -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//doc_classes. + +.. _class_AudioEffectHighPassFilter: + +AudioEffectHighPassFilter +========================= + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a high-pass filter to the Audio Bus. + +Description +----------- + +Cuts frequencies lower than the :ref:`AudioEffectFilter.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.)` diff --git a/classes/class_audioeffecthighshelffilter.rst b/classes/class_audioeffecthighshelffilter.rst new file mode 100644 index 0000000..7f4f61b --- /dev/null +++ b/classes/class_audioeffecthighshelffilter.rst @@ -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//doc_classes. + +.. _class_AudioEffectHighShelfFilter: + +AudioEffectHighShelfFilter +========================== + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Reduces all frequencies above the :ref:`AudioEffectFilter.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.)` diff --git a/classes/class_audioeffectinstance.rst b/classes/class_audioeffectinstance.rst new file mode 100644 index 0000000..e5e4018 --- /dev/null +++ b/classes/class_audioeffectinstance.rst @@ -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 AudioEffectInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectInstance: + +AudioEffectInstance +=================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioEffectSpectrumAnalyzerInstance` + + + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectlimiter.rst b/classes/class_audioeffectlimiter.rst new file mode 100644 index 0000000..408c546 --- /dev/null +++ b/classes/class_audioeffectlimiter.rst @@ -0,0 +1,101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectLimiter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectLimiter: + +AudioEffectLimiter +================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a soft-clip limiter audio effect to an Audio bus. + +Description +----------- + +A limiter is similar to a compressor, but it's less flexible and designed to disallow sound going over a given dB threshold. Adding one in the Master bus is always recommended to reduce the effects of clipping. + +Soft clipping starts to reduce the peaks a little below the threshold level and progressively increases its effect as the input level increases such that the threshold is never exceeded. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`ceiling_db` | ``-0.1`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`soft_clip_db` | ``2.0`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`soft_clip_ratio` | ``10.0`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`threshold_db` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectLimiter_property_ceiling_db: + +- :ref:`float` **ceiling_db** + ++-----------+-----------------------+ +| *Default* | ``-0.1`` | ++-----------+-----------------------+ +| *Setter* | set_ceiling_db(value) | ++-----------+-----------------------+ +| *Getter* | get_ceiling_db() | ++-----------+-----------------------+ + +The waveform's maximum allowed value, in decibels. Value can range from -20 to -0.1. + +---- + +.. _class_AudioEffectLimiter_property_soft_clip_db: + +- :ref:`float` **soft_clip_db** + ++-----------+-------------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------------+ +| *Setter* | set_soft_clip_db(value) | ++-----------+-------------------------+ +| *Getter* | get_soft_clip_db() | ++-----------+-------------------------+ + +Applies a gain to the limited waves, in decibels. Value can range from 0 to 6. + +---- + +.. _class_AudioEffectLimiter_property_soft_clip_ratio: + +- :ref:`float` **soft_clip_ratio** + ++-----------+----------------------------+ +| *Default* | ``10.0`` | ++-----------+----------------------------+ +| *Setter* | set_soft_clip_ratio(value) | ++-----------+----------------------------+ +| *Getter* | get_soft_clip_ratio() | ++-----------+----------------------------+ + +---- + +.. _class_AudioEffectLimiter_property_threshold_db: + +- :ref:`float` **threshold_db** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_threshold_db(value) | ++-----------+-------------------------+ +| *Getter* | get_threshold_db() | ++-----------+-------------------------+ + +Threshold from which the limiter begins to be active, in decibels. Value can range from -30 to 0. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectlowpassfilter.rst b/classes/class_audioeffectlowpassfilter.rst new file mode 100644 index 0000000..24a7cb8 --- /dev/null +++ b/classes/class_audioeffectlowpassfilter.rst @@ -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 AudioEffectLowPassFilter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectLowPassFilter: + +AudioEffectLowPassFilter +======================== + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a low-pass filter to the Audio bus. + +Description +----------- + +Cuts frequencies higher than the :ref:`AudioEffectFilter.cutoff_hz` and allows lower frequencies to pass. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectlowshelffilter.rst b/classes/class_audioeffectlowshelffilter.rst new file mode 100644 index 0000000..f2af5d5 --- /dev/null +++ b/classes/class_audioeffectlowshelffilter.rst @@ -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 AudioEffectLowShelfFilter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectLowShelfFilter: + +AudioEffectLowShelfFilter +========================= + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Reduces all frequencies below the :ref:`AudioEffectFilter.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.)` diff --git a/classes/class_audioeffectnotchfilter.rst b/classes/class_audioeffectnotchfilter.rst new file mode 100644 index 0000000..2c2af2b --- /dev/null +++ b/classes/class_audioeffectnotchfilter.rst @@ -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 AudioEffectNotchFilter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectNotchFilter: + +AudioEffectNotchFilter +====================== + +**Inherits:** :ref:`AudioEffectFilter` **<** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a notch filter to the Audio bus. + +Description +----------- + +Attenuates frequencies in a narrow band around the :ref:`AudioEffectFilter.cutoff_hz` and cuts frequencies outside of this range. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectpanner.rst b/classes/class_audioeffectpanner.rst new file mode 100644 index 0000000..a9f1fb9 --- /dev/null +++ b/classes/class_audioeffectpanner.rst @@ -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 AudioEffectPanner.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectPanner: + +AudioEffectPanner +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a panner audio effect to an Audio bus. Pans sound left or right. + +Description +----------- + +Determines how much of an audio signal is sent to the left and right buses. + +Properties +---------- + ++---------------------------+--------------------------------------------------+---------+ +| :ref:`float` | :ref:`pan` | ``0.0`` | ++---------------------------+--------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectPanner_property_pan: + +- :ref:`float` **pan** + ++-----------+----------------+ +| *Default* | ``0.0`` | ++-----------+----------------+ +| *Setter* | set_pan(value) | ++-----------+----------------+ +| *Getter* | get_pan() | ++-----------+----------------+ + +Pan position. Value can range from -1 (fully left) to 1 (fully right). + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectphaser.rst b/classes/class_audioeffectphaser.rst new file mode 100644 index 0000000..081aaf1 --- /dev/null +++ b/classes/class_audioeffectphaser.rst @@ -0,0 +1,121 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectPhaser.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectPhaser: + +AudioEffectPhaser +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a phaser audio effect to an Audio bus. + +Combines the original signal with a copy that is slightly out of phase with the original. + +Description +----------- + +Combines phase-shifted signals with the original signal. The movement of the phase-shifted signals is controlled using a low-frequency oscillator. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`depth` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`feedback` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`range_max_hz` | ``1600.0`` | ++---------------------------+--------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`range_min_hz` | ``440.0`` | ++---------------------------+--------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`rate_hz` | ``0.5`` | ++---------------------------+--------------------------------------------------------------------+------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectPhaser_property_depth: + +- :ref:`float` **depth** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_depth(value) | ++-----------+------------------+ +| *Getter* | get_depth() | ++-----------+------------------+ + +Governs how high the filter frequencies sweep. Low value will primarily affect bass frequencies. High value can sweep high into the treble. Value can range from 0.1 to 4. + +---- + +.. _class_AudioEffectPhaser_property_feedback: + +- :ref:`float` **feedback** + ++-----------+---------------------+ +| *Default* | ``0.7`` | ++-----------+---------------------+ +| *Setter* | set_feedback(value) | ++-----------+---------------------+ +| *Getter* | get_feedback() | ++-----------+---------------------+ + +Output percent of modified sound. Value can range from 0.1 to 0.9. + +---- + +.. _class_AudioEffectPhaser_property_range_max_hz: + +- :ref:`float` **range_max_hz** + ++-----------+-------------------------+ +| *Default* | ``1600.0`` | ++-----------+-------------------------+ +| *Setter* | set_range_max_hz(value) | ++-----------+-------------------------+ +| *Getter* | get_range_max_hz() | ++-----------+-------------------------+ + +Determines the maximum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. + +---- + +.. _class_AudioEffectPhaser_property_range_min_hz: + +- :ref:`float` **range_min_hz** + ++-----------+-------------------------+ +| *Default* | ``440.0`` | ++-----------+-------------------------+ +| *Setter* | set_range_min_hz(value) | ++-----------+-------------------------+ +| *Getter* | get_range_min_hz() | ++-----------+-------------------------+ + +Determines the minimum frequency affected by the LFO modulations, in Hz. Value can range from 10 to 10000. + +---- + +.. _class_AudioEffectPhaser_property_rate_hz: + +- :ref:`float` **rate_hz** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_rate_hz(value) | ++-----------+--------------------+ +| *Getter* | get_rate_hz() | ++-----------+--------------------+ + +Adjusts the rate in Hz at which the effect sweeps up and down across the frequency range. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectpitchshift.rst b/classes/class_audioeffectpitchshift.rst new file mode 100644 index 0000000..67cb02d --- /dev/null +++ b/classes/class_audioeffectpitchshift.rst @@ -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 AudioEffectPitchShift.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectPitchShift: + +AudioEffectPitchShift +===================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a pitch-shifting audio effect to an Audio bus. + +Raises or lowers the pitch of original sound. + +Description +----------- + +Allows modulation of pitch independently of tempo. All frequencies can be increased/decreased with minimal effect on transients. + +Properties +---------- + ++------------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`FFT_Size` | :ref:`fft_size` | ``3`` | ++------------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`oversampling` | ``4`` | ++------------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | ++------------------------------------------------------+------------------------------------------------------------------------+---------+ + +Enumerations +------------ + +.. _enum_AudioEffectPitchShift_FFT_Size: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_256: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_512: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_1024: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_2048: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_4096: + +.. _class_AudioEffectPitchShift_constant_FFT_SIZE_MAX: + +enum **FFT_Size**: + +- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. + +- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. + +- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. + +- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. + +- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. + +- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size` enum. + +Property Descriptions +--------------------- + +.. _class_AudioEffectPitchShift_property_fft_size: + +- :ref:`FFT_Size` **fft_size** + ++-----------+---------------------+ +| *Default* | ``3`` | ++-----------+---------------------+ +| *Setter* | set_fft_size(value) | ++-----------+---------------------+ +| *Getter* | get_fft_size() | ++-----------+---------------------+ + +The size of the `Fast Fourier transform `__ buffer. Higher values smooth out the effect over time, but have greater latency. The effects of this higher latency are especially noticeable on sounds that have sudden amplitude changes. + +---- + +.. _class_AudioEffectPitchShift_property_oversampling: + +- :ref:`int` **oversampling** + ++-----------+-------------------------+ +| *Default* | ``4`` | ++-----------+-------------------------+ +| *Setter* | set_oversampling(value) | ++-----------+-------------------------+ +| *Getter* | get_oversampling() | ++-----------+-------------------------+ + +The oversampling factor to use. Higher values result in better quality, but are more demanding on the CPU and may cause audio cracking if the CPU can't keep up. + +---- + +.. _class_AudioEffectPitchShift_property_pitch_scale: + +- :ref:`float` **pitch_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_pitch_scale(value) | ++-----------+------------------------+ +| *Getter* | get_pitch_scale() | ++-----------+------------------------+ + +The pitch scale to use. ``1.0`` is the default pitch and plays sounds unaltered. :ref:`pitch_scale` can range from ``0.0`` (infinitely low pitch, inaudible) to ``16`` (16 times higher than the initial pitch). + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectrecord.rst b/classes/class_audioeffectrecord.rst new file mode 100644 index 0000000..d38f985 --- /dev/null +++ b/classes/class_audioeffectrecord.rst @@ -0,0 +1,94 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectRecord.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectRecord: + +AudioEffectRecord +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Audio effect used for recording the sound from an audio bus. + +Description +----------- + +Allows the user to record the sound from an audio bus. This can include all audio output by Godot when used on the "Master" audio bus. + +Can be used (with an :ref:`AudioStreamMicrophone`) to record from a microphone. + +It sets and gets the format in which the audio file will be recorded (8-bit, 16-bit, or compressed). It checks whether or not the recording is active, and if it is, records the sound. It then returns the recorded sample. + +Tutorials +--------- + +- :doc:`../tutorials/audio/recording_with_microphone` + +- `Audio Mic Record Demo `__ + +Properties +---------- + ++----------------------------------------------+--------------------------------------------------------+-------+ +| :ref:`Format` | :ref:`format` | ``1`` | ++----------------------------------------------+--------------------------------------------------------+-------+ + +Methods +------- + ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioStreamSample` | :ref:`get_recording` **(** **)** |const| | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_recording_active` **(** **)** |const| | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_recording_active` **(** :ref:`bool` record **)** | ++---------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectRecord_property_format: + +- :ref:`Format` **format** + ++-----------+-------------------+ +| *Default* | ``1`` | ++-----------+-------------------+ +| *Setter* | set_format(value) | ++-----------+-------------------+ +| *Getter* | get_format() | ++-----------+-------------------+ + +Specifies the format in which the sample will be recorded. See :ref:`Format` for available formats. + +Method Descriptions +------------------- + +.. _class_AudioEffectRecord_method_get_recording: + +- :ref:`AudioStreamSample` **get_recording** **(** **)** |const| + +Returns the recorded sample. + +---- + +.. _class_AudioEffectRecord_method_is_recording_active: + +- :ref:`bool` **is_recording_active** **(** **)** |const| + +Returns whether the recording is active or not. + +---- + +.. _class_AudioEffectRecord_method_set_recording_active: + +- void **set_recording_active** **(** :ref:`bool` record **)** + +If ``true``, the sound will be recorded. Note that restarting the recording will remove the previously recorded sample. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectreverb.rst b/classes/class_audioeffectreverb.rst new file mode 100644 index 0000000..17e27cc --- /dev/null +++ b/classes/class_audioeffectreverb.rst @@ -0,0 +1,180 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectReverb.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectReverb: + +AudioEffectReverb +================= + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Adds a reverberation audio effect to an Audio bus. + +Simulates the sound of acoustic environments such as rooms, concert halls, caverns, or an open spaces. + +Description +----------- + +Simulates rooms of different sizes. Its parameters can be adjusted to simulate the sound of a specific room. + +Tutorials +--------- + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`damping` | ``0.5`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`dry` | ``1.0`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`hipass` | ``0.0`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`predelay_feedback` | ``0.4`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`predelay_msec` | ``150.0`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`room_size` | ``0.8`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`spread` | ``1.0`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`wet` | ``0.5`` | ++---------------------------+------------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectReverb_property_damping: + +- :ref:`float` **damping** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_damping(value) | ++-----------+--------------------+ +| *Getter* | get_damping() | ++-----------+--------------------+ + +Defines how reflective the imaginary room's walls are. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_dry: + +- :ref:`float` **dry** + ++-----------+----------------+ +| *Default* | ``1.0`` | ++-----------+----------------+ +| *Setter* | set_dry(value) | ++-----------+----------------+ +| *Getter* | get_dry() | ++-----------+----------------+ + +Output percent of original sound. At 0, only modified sound is outputted. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_hipass: + +- :ref:`float` **hipass** + ++-----------+----------------+ +| *Default* | ``0.0`` | ++-----------+----------------+ +| *Setter* | set_hpf(value) | ++-----------+----------------+ +| *Getter* | get_hpf() | ++-----------+----------------+ + +High-pass filter passes signals with a frequency higher than a certain cutoff frequency and attenuates signals with frequencies lower than the cutoff frequency. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_predelay_feedback: + +- :ref:`float` **predelay_feedback** + ++-----------+------------------------------+ +| *Default* | ``0.4`` | ++-----------+------------------------------+ +| *Setter* | set_predelay_feedback(value) | ++-----------+------------------------------+ +| *Getter* | get_predelay_feedback() | ++-----------+------------------------------+ + +Output percent of predelay. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_predelay_msec: + +- :ref:`float` **predelay_msec** + ++-----------+--------------------------+ +| *Default* | ``150.0`` | ++-----------+--------------------------+ +| *Setter* | set_predelay_msec(value) | ++-----------+--------------------------+ +| *Getter* | get_predelay_msec() | ++-----------+--------------------------+ + +Time between the original signal and the early reflections of the reverb signal, in milliseconds. + +---- + +.. _class_AudioEffectReverb_property_room_size: + +- :ref:`float` **room_size** + ++-----------+----------------------+ +| *Default* | ``0.8`` | ++-----------+----------------------+ +| *Setter* | set_room_size(value) | ++-----------+----------------------+ +| *Getter* | get_room_size() | ++-----------+----------------------+ + +Dimensions of simulated room. Bigger means more echoes. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_spread: + +- :ref:`float` **spread** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_spread(value) | ++-----------+-------------------+ +| *Getter* | get_spread() | ++-----------+-------------------+ + +Widens or narrows the stereo image of the reverb tail. 1 means fully widens. Value can range from 0 to 1. + +---- + +.. _class_AudioEffectReverb_property_wet: + +- :ref:`float` **wet** + ++-----------+----------------+ +| *Default* | ``0.5`` | ++-----------+----------------+ +| *Setter* | set_wet(value) | ++-----------+----------------+ +| *Getter* | get_wet() | ++-----------+----------------+ + +Output percent of modified sound. At 0, only original sound is outputted. Value can range from 0 to 1. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectspectrumanalyzer.rst b/classes/class_audioeffectspectrumanalyzer.rst new file mode 100644 index 0000000..9f89277 --- /dev/null +++ b/classes/class_audioeffectspectrumanalyzer.rst @@ -0,0 +1,121 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectSpectrumAnalyzer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectSpectrumAnalyzer: + +AudioEffectSpectrumAnalyzer +=========================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Audio effect that can be used for real-time audio visualizations. + +Description +----------- + +This audio effect does not affect sound output, but can be used for real-time audio visualizations. + +See also :ref:`AudioStreamGenerator` for procedurally generating sounds. + +Tutorials +--------- + +- `Audio Spectrum Demo `__ + +- `Godot 3.2 will get new audio features `__ + +Properties +---------- + ++------------------------------------------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`buffer_length` | ``2.0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`FFT_Size` | :ref:`fft_size` | ``2`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`tap_back_pos` | ``0.01`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------+----------+ + +Enumerations +------------ + +.. _enum_AudioEffectSpectrumAnalyzer_FFT_Size: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_256: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_512: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_1024: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_2048: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_4096: + +.. _class_AudioEffectSpectrumAnalyzer_constant_FFT_SIZE_MAX: + +enum **FFT_Size**: + +- **FFT_SIZE_256** = **0** --- Use a buffer of 256 samples for the Fast Fourier transform. Lowest latency, but least stable over time. + +- **FFT_SIZE_512** = **1** --- Use a buffer of 512 samples for the Fast Fourier transform. Low latency, but less stable over time. + +- **FFT_SIZE_1024** = **2** --- Use a buffer of 1024 samples for the Fast Fourier transform. This is a compromise between latency and stability over time. + +- **FFT_SIZE_2048** = **3** --- Use a buffer of 2048 samples for the Fast Fourier transform. High latency, but stable over time. + +- **FFT_SIZE_4096** = **4** --- Use a buffer of 4096 samples for the Fast Fourier transform. Highest latency, but most stable over time. + +- **FFT_SIZE_MAX** = **5** --- Represents the size of the :ref:`FFT_Size` enum. + +Property Descriptions +--------------------- + +.. _class_AudioEffectSpectrumAnalyzer_property_buffer_length: + +- :ref:`float` **buffer_length** + ++-----------+--------------------------+ +| *Default* | ``2.0`` | ++-----------+--------------------------+ +| *Setter* | set_buffer_length(value) | ++-----------+--------------------------+ +| *Getter* | get_buffer_length() | ++-----------+--------------------------+ + +The length of the buffer to keep (in seconds). Higher values keep data around for longer, but require more memory. + +---- + +.. _class_AudioEffectSpectrumAnalyzer_property_fft_size: + +- :ref:`FFT_Size` **fft_size** + ++-----------+---------------------+ +| *Default* | ``2`` | ++-----------+---------------------+ +| *Setter* | set_fft_size(value) | ++-----------+---------------------+ +| *Getter* | get_fft_size() | ++-----------+---------------------+ + +The size of the `Fast Fourier transform `__ buffer. Higher values smooth out the spectrum analysis over time, but have greater latency. The effects of this higher latency are especially noticeable with sudden amplitude changes. + +---- + +.. _class_AudioEffectSpectrumAnalyzer_property_tap_back_pos: + +- :ref:`float` **tap_back_pos** + ++-----------+-------------------------+ +| *Default* | ``0.01`` | ++-----------+-------------------------+ +| *Setter* | set_tap_back_pos(value) | ++-----------+-------------------------+ +| *Getter* | get_tap_back_pos() | ++-----------+-------------------------+ + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectspectrumanalyzerinstance.rst b/classes/class_audioeffectspectrumanalyzerinstance.rst new file mode 100644 index 0000000..cf9b746 --- /dev/null +++ b/classes/class_audioeffectspectrumanalyzerinstance.rst @@ -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 AudioEffectSpectrumAnalyzerInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectSpectrumAnalyzerInstance: + +AudioEffectSpectrumAnalyzerInstance +=================================== + +**Inherits:** :ref:`AudioEffectInstance` **<** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_magnitude_for_frequency_range` **(** :ref:`float` from_hz, :ref:`float` to_hz, :ref:`MagnitudeMode` mode=1 **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_AudioEffectSpectrumAnalyzerInstance_MagnitudeMode: + +.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_AVERAGE: + +.. _class_AudioEffectSpectrumAnalyzerInstance_constant_MAGNITUDE_MAX: + +enum **MagnitudeMode**: + +- **MAGNITUDE_AVERAGE** = **0** --- Use the average value as magnitude. + +- **MAGNITUDE_MAX** = **1** --- Use the maximum value as magnitude. + +Method Descriptions +------------------- + +.. _class_AudioEffectSpectrumAnalyzerInstance_method_get_magnitude_for_frequency_range: + +- :ref:`Vector2` **get_magnitude_for_frequency_range** **(** :ref:`float` from_hz, :ref:`float` to_hz, :ref:`MagnitudeMode` mode=1 **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioeffectstereoenhance.rst b/classes/class_audioeffectstereoenhance.rst new file mode 100644 index 0000000..6dc0a28 --- /dev/null +++ b/classes/class_audioeffectstereoenhance.rst @@ -0,0 +1,72 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioEffectStereoEnhance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioEffectStereoEnhance: + +AudioEffectStereoEnhance +======================== + +**Inherits:** :ref:`AudioEffect` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`pan_pullout` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`surround` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`time_pullout_ms` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_AudioEffectStereoEnhance_property_pan_pullout: + +- :ref:`float` **pan_pullout** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_pan_pullout(value) | ++-----------+------------------------+ +| *Getter* | get_pan_pullout() | ++-----------+------------------------+ + +---- + +.. _class_AudioEffectStereoEnhance_property_surround: + +- :ref:`float` **surround** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_surround(value) | ++-----------+---------------------+ +| *Getter* | get_surround() | ++-----------+---------------------+ + +---- + +.. _class_AudioEffectStereoEnhance_property_time_pullout_ms: + +- :ref:`float` **time_pullout_ms** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_time_pullout(value) | ++-----------+-------------------------+ +| *Getter* | get_time_pullout() | ++-----------+-------------------------+ + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audioserver.rst b/classes/class_audioserver.rst new file mode 100644 index 0000000..ed62bef --- /dev/null +++ b/classes/class_audioserver.rst @@ -0,0 +1,534 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioServer: + +AudioServer +=========== + +**Inherits:** :ref:`Object` + +Server interface for low-level audio access. + +Description +----------- + +``AudioServer`` is a low-level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface. + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_buses` + +- `Audio Device Changer Demo `__ + +- `Audio Mic Record Demo `__ + +- `Audio Spectrum Demo `__ + +Properties +---------- + ++-----------------------------+------------------------------------------------------------------------+---------------+ +| :ref:`int` | :ref:`bus_count` | ``1`` | ++-----------------------------+------------------------------------------------------------------------+---------------+ +| :ref:`String` | :ref:`device` | ``"Default"`` | ++-----------------------------+------------------------------------------------------------------------+---------------+ +| :ref:`float` | :ref:`global_rate_scale` | ``1.0`` | ++-----------------------------+------------------------------------------------------------------------+---------------+ + +Methods +------- + ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bus` **(** :ref:`int` at_position=-1 **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bus_effect` **(** :ref:`int` bus_idx, :ref:`AudioEffect` effect, :ref:`int` at_position=-1 **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`capture_get_device` **(** **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`capture_get_device_list` **(** **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`capture_set_device` **(** :ref:`String` name **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioBusLayout` | :ref:`generate_bus_layout` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bus_channels` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioEffect` | :ref:`get_bus_effect` **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bus_effect_count` **(** :ref:`int` bus_idx **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioEffectInstance` | :ref:`get_bus_effect_instance` **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`int` channel=0 **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bus_index` **(** :ref:`String` bus_name **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_bus_name` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_bus_peak_volume_left_db` **(** :ref:`int` bus_idx, :ref:`int` channel **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_bus_peak_volume_right_db` **(** :ref:`int` bus_idx, :ref:`int` channel **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_bus_send` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_bus_volume_db` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_device_list` **(** **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_mix_rate` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_output_latency` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SpeakerMode` | :ref:`get_speaker_mode` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_time_since_last_mix` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_time_to_next_mix` **(** **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_bus_bypassing_effects` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_bus_effect_enabled` **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_bus_mute` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_bus_solo` **(** :ref:`int` bus_idx **)** |const| | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lock` **(** **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_bus` **(** :ref:`int` index, :ref:`int` to_index **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_bus` **(** :ref:`int` index **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_bus_effect` **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_bypass_effects` **(** :ref:`int` bus_idx, :ref:`bool` enable **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_effect_enabled` **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`bool` enabled **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_layout` **(** :ref:`AudioBusLayout` bus_layout **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_mute` **(** :ref:`int` bus_idx, :ref:`bool` enable **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_name` **(** :ref:`int` bus_idx, :ref:`String` name **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_send` **(** :ref:`int` bus_idx, :ref:`String` send **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_solo` **(** :ref:`int` bus_idx, :ref:`bool` enable **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bus_volume_db` **(** :ref:`int` bus_idx, :ref:`float` volume_db **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`swap_bus_effects` **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`int` by_effect_idx **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unlock` **(** **)** | ++-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_AudioServer_signal_bus_layout_changed: + +- **bus_layout_changed** **(** **)** + +Emitted when the :ref:`AudioBusLayout` changes. + +Enumerations +------------ + +.. _enum_AudioServer_SpeakerMode: + +.. _class_AudioServer_constant_SPEAKER_MODE_STEREO: + +.. _class_AudioServer_constant_SPEAKER_SURROUND_31: + +.. _class_AudioServer_constant_SPEAKER_SURROUND_51: + +.. _class_AudioServer_constant_SPEAKER_SURROUND_71: + +enum **SpeakerMode**: + +- **SPEAKER_MODE_STEREO** = **0** --- Two or fewer speakers were detected. + +- **SPEAKER_SURROUND_31** = **1** --- A 3.1 channel surround setup was detected. + +- **SPEAKER_SURROUND_51** = **2** --- A 5.1 channel surround setup was detected. + +- **SPEAKER_SURROUND_71** = **3** --- A 7.1 channel surround setup was detected. + +Property Descriptions +--------------------- + +.. _class_AudioServer_property_bus_count: + +- :ref:`int` **bus_count** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_bus_count(value) | ++-----------+----------------------+ +| *Getter* | get_bus_count() | ++-----------+----------------------+ + +Number of available audio buses. + +---- + +.. _class_AudioServer_property_device: + +- :ref:`String` **device** + ++-----------+-------------------+ +| *Default* | ``"Default"`` | ++-----------+-------------------+ +| *Setter* | set_device(value) | ++-----------+-------------------+ +| *Getter* | get_device() | ++-----------+-------------------+ + +Name of the current device for audio output (see :ref:`get_device_list`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``. + +---- + +.. _class_AudioServer_property_global_rate_scale: + +- :ref:`float` **global_rate_scale** + ++-----------+------------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------------+ +| *Setter* | set_global_rate_scale(value) | ++-----------+------------------------------+ +| *Getter* | get_global_rate_scale() | ++-----------+------------------------------+ + +Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played twice as fast). + +Method Descriptions +------------------- + +.. _class_AudioServer_method_add_bus: + +- void **add_bus** **(** :ref:`int` at_position=-1 **)** + +Adds a bus at ``at_position``. + +---- + +.. _class_AudioServer_method_add_bus_effect: + +- void **add_bus_effect** **(** :ref:`int` bus_idx, :ref:`AudioEffect` effect, :ref:`int` at_position=-1 **)** + +Adds an :ref:`AudioEffect` effect to the bus ``bus_idx`` at ``at_position``. + +---- + +.. _class_AudioServer_method_capture_get_device: + +- :ref:`String` **capture_get_device** **(** **)** + +Name of the current device for audio input (see :ref:`capture_get_device_list`). The value ``"Default"`` means that the system-wide default audio input is currently used. + +---- + +.. _class_AudioServer_method_capture_get_device_list: + +- :ref:`Array` **capture_get_device_list** **(** **)** + +Returns the names of all audio input devices detected on the system. + +---- + +.. _class_AudioServer_method_capture_set_device: + +- void **capture_set_device** **(** :ref:`String` name **)** + +Sets which audio input device is used for audio capture. On systems with multiple audio inputs (such as analog and USB), this can be used to select the audio input device. Setting the value ``"Default"`` will record audio from the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``. + +---- + +.. _class_AudioServer_method_generate_bus_layout: + +- :ref:`AudioBusLayout` **generate_bus_layout** **(** **)** |const| + +Generates an :ref:`AudioBusLayout` using the available buses and effects. + +---- + +.. _class_AudioServer_method_get_bus_channels: + +- :ref:`int` **get_bus_channels** **(** :ref:`int` bus_idx **)** |const| + +Returns the amount of channels of the bus at index ``bus_idx``. + +---- + +.. _class_AudioServer_method_get_bus_effect: + +- :ref:`AudioEffect` **get_bus_effect** **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** + +Returns the :ref:`AudioEffect` at position ``effect_idx`` in bus ``bus_idx``. + +---- + +.. _class_AudioServer_method_get_bus_effect_count: + +- :ref:`int` **get_bus_effect_count** **(** :ref:`int` bus_idx **)** + +Returns the number of effects on the bus at ``bus_idx``. + +---- + +.. _class_AudioServer_method_get_bus_effect_instance: + +- :ref:`AudioEffectInstance` **get_bus_effect_instance** **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`int` channel=0 **)** + +Returns the :ref:`AudioEffectInstance` assigned to the given bus and effect indices (and optionally channel). + +---- + +.. _class_AudioServer_method_get_bus_index: + +- :ref:`int` **get_bus_index** **(** :ref:`String` bus_name **)** |const| + +Returns the index of the bus with the name ``bus_name``. + +---- + +.. _class_AudioServer_method_get_bus_name: + +- :ref:`String` **get_bus_name** **(** :ref:`int` bus_idx **)** |const| + +Returns the name of the bus with the index ``bus_idx``. + +---- + +.. _class_AudioServer_method_get_bus_peak_volume_left_db: + +- :ref:`float` **get_bus_peak_volume_left_db** **(** :ref:`int` bus_idx, :ref:`int` channel **)** |const| + +Returns the peak volume of the left speaker at bus index ``bus_idx`` and channel index ``channel``. + +---- + +.. _class_AudioServer_method_get_bus_peak_volume_right_db: + +- :ref:`float` **get_bus_peak_volume_right_db** **(** :ref:`int` bus_idx, :ref:`int` channel **)** |const| + +Returns the peak volume of the right speaker at bus index ``bus_idx`` and channel index ``channel``. + +---- + +.. _class_AudioServer_method_get_bus_send: + +- :ref:`String` **get_bus_send** **(** :ref:`int` bus_idx **)** |const| + +Returns the name of the bus that the bus at index ``bus_idx`` sends to. + +---- + +.. _class_AudioServer_method_get_bus_volume_db: + +- :ref:`float` **get_bus_volume_db** **(** :ref:`int` bus_idx **)** |const| + +Returns the volume of the bus at index ``bus_idx`` in dB. + +---- + +.. _class_AudioServer_method_get_device_list: + +- :ref:`Array` **get_device_list** **(** **)** + +Returns the names of all audio devices detected on the system. + +---- + +.. _class_AudioServer_method_get_mix_rate: + +- :ref:`float` **get_mix_rate** **(** **)** |const| + +Returns the sample rate at the output of the ``AudioServer``. + +---- + +.. _class_AudioServer_method_get_output_latency: + +- :ref:`float` **get_output_latency** **(** **)** |const| + +Returns the audio driver's output latency. + +---- + +.. _class_AudioServer_method_get_speaker_mode: + +- :ref:`SpeakerMode` **get_speaker_mode** **(** **)** |const| + +Returns the speaker configuration. + +---- + +.. _class_AudioServer_method_get_time_since_last_mix: + +- :ref:`float` **get_time_since_last_mix** **(** **)** |const| + +Returns the relative time since the last mix occurred. + +---- + +.. _class_AudioServer_method_get_time_to_next_mix: + +- :ref:`float` **get_time_to_next_mix** **(** **)** |const| + +Returns the relative time until the next mix occurs. + +---- + +.. _class_AudioServer_method_is_bus_bypassing_effects: + +- :ref:`bool` **is_bus_bypassing_effects** **(** :ref:`int` bus_idx **)** |const| + +If ``true``, the bus at index ``bus_idx`` is bypassing effects. + +---- + +.. _class_AudioServer_method_is_bus_effect_enabled: + +- :ref:`bool` **is_bus_effect_enabled** **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** |const| + +If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled. + +---- + +.. _class_AudioServer_method_is_bus_mute: + +- :ref:`bool` **is_bus_mute** **(** :ref:`int` bus_idx **)** |const| + +If ``true``, the bus at index ``bus_idx`` is muted. + +---- + +.. _class_AudioServer_method_is_bus_solo: + +- :ref:`bool` **is_bus_solo** **(** :ref:`int` bus_idx **)** |const| + +If ``true``, the bus at index ``bus_idx`` is in solo mode. + +---- + +.. _class_AudioServer_method_lock: + +- void **lock** **(** **)** + +Locks the audio driver's main loop. + +**Note:** Remember to unlock it afterwards. + +---- + +.. _class_AudioServer_method_move_bus: + +- void **move_bus** **(** :ref:`int` index, :ref:`int` to_index **)** + +Moves the bus from index ``index`` to index ``to_index``. + +---- + +.. _class_AudioServer_method_remove_bus: + +- void **remove_bus** **(** :ref:`int` index **)** + +Removes the bus at index ``index``. + +---- + +.. _class_AudioServer_method_remove_bus_effect: + +- void **remove_bus_effect** **(** :ref:`int` bus_idx, :ref:`int` effect_idx **)** + +Removes the effect at index ``effect_idx`` from the bus at index ``bus_idx``. + +---- + +.. _class_AudioServer_method_set_bus_bypass_effects: + +- void **set_bus_bypass_effects** **(** :ref:`int` bus_idx, :ref:`bool` enable **)** + +If ``true``, the bus at index ``bus_idx`` is bypassing effects. + +---- + +.. _class_AudioServer_method_set_bus_effect_enabled: + +- void **set_bus_effect_enabled** **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`bool` enabled **)** + +If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled. + +---- + +.. _class_AudioServer_method_set_bus_layout: + +- void **set_bus_layout** **(** :ref:`AudioBusLayout` bus_layout **)** + +Overwrites the currently used :ref:`AudioBusLayout`. + +---- + +.. _class_AudioServer_method_set_bus_mute: + +- void **set_bus_mute** **(** :ref:`int` bus_idx, :ref:`bool` enable **)** + +If ``true``, the bus at index ``bus_idx`` is muted. + +---- + +.. _class_AudioServer_method_set_bus_name: + +- void **set_bus_name** **(** :ref:`int` bus_idx, :ref:`String` name **)** + +Sets the name of the bus at index ``bus_idx`` to ``name``. + +---- + +.. _class_AudioServer_method_set_bus_send: + +- void **set_bus_send** **(** :ref:`int` bus_idx, :ref:`String` send **)** + +Connects the output of the bus at ``bus_idx`` to the bus named ``send``. + +---- + +.. _class_AudioServer_method_set_bus_solo: + +- void **set_bus_solo** **(** :ref:`int` bus_idx, :ref:`bool` enable **)** + +If ``true``, the bus at index ``bus_idx`` is in solo mode. + +---- + +.. _class_AudioServer_method_set_bus_volume_db: + +- void **set_bus_volume_db** **(** :ref:`int` bus_idx, :ref:`float` volume_db **)** + +Sets the volume of the bus at index ``bus_idx`` to ``volume_db``. + +---- + +.. _class_AudioServer_method_swap_bus_effects: + +- void **swap_bus_effects** **(** :ref:`int` bus_idx, :ref:`int` effect_idx, :ref:`int` by_effect_idx **)** + +Swaps the position of two effects in bus ``bus_idx``. + +---- + +.. _class_AudioServer_method_unlock: + +- void **unlock** **(** **)** + +Unlocks the audio driver's main loop. (After locking it, you should always unlock it.) + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostream.rst b/classes/class_audiostream.rst new file mode 100644 index 0000000..abbab52 --- /dev/null +++ b/classes/class_audiostream.rst @@ -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 AudioStream.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStream: + +AudioStream +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioStreamGenerator`, :ref:`AudioStreamMP3`, :ref:`AudioStreamMicrophone`, :ref:`AudioStreamOGGVorbis`, :ref:`AudioStreamRandomPitch`, :ref:`AudioStreamSample` + +Base class for audio streams. + +Description +----------- + +Base class for audio streams. Audio streams are used for sound effects and music playback, and support WAV (via :ref:`AudioStreamSample`) and OGG (via :ref:`AudioStreamOGGVorbis`) file formats. + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_streams` + +- `Audio Generator Demo `__ + +- `Audio Mic Record Demo `__ + +- `Audio Spectrum Demo `__ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_length` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AudioStream_method_get_length: + +- :ref:`float` **get_length** **(** **)** |const| + +Returns the length of the audio stream in seconds. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamgenerator.rst b/classes/class_audiostreamgenerator.rst new file mode 100644 index 0000000..4bf6a28 --- /dev/null +++ b/classes/class_audiostreamgenerator.rst @@ -0,0 +1,80 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamGenerator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamGenerator: + +AudioStreamGenerator +==================== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Audio stream that generates sounds procedurally. + +Description +----------- + +This audio stream does not play back sounds, but expects a script to generate audio data for it instead. See also :ref:`AudioStreamGeneratorPlayback`. + +See also :ref:`AudioEffectSpectrumAnalyzer` for performing real-time audio spectrum analysis. + +**Note:** Due to performance constraints, this class is best used from C# or from a compiled language via GDNative. If you still want to use this class from GDScript, consider using a lower :ref:`mix_rate` such as 11,025 Hz or 22,050 Hz. + +Tutorials +--------- + +- `Audio Generator Demo `__ + +- `Godot 3.2 will get new audio features `__ + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`buffer_length` | ``0.5`` | ++---------------------------+-------------------------------------------------------------------------+-------------+ +| :ref:`float` | :ref:`mix_rate` | ``44100.0`` | ++---------------------------+-------------------------------------------------------------------------+-------------+ + +Property Descriptions +--------------------- + +.. _class_AudioStreamGenerator_property_buffer_length: + +- :ref:`float` **buffer_length** + ++-----------+--------------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------------+ +| *Setter* | set_buffer_length(value) | ++-----------+--------------------------+ +| *Getter* | get_buffer_length() | ++-----------+--------------------------+ + +The length of the buffer to generate (in seconds). Lower values result in less latency, but require the script to generate audio data faster, resulting in increased CPU usage and more risk for audio cracking if the CPU can't keep up. + +---- + +.. _class_AudioStreamGenerator_property_mix_rate: + +- :ref:`float` **mix_rate** + ++-----------+---------------------+ +| *Default* | ``44100.0`` | ++-----------+---------------------+ +| *Setter* | set_mix_rate(value) | ++-----------+---------------------+ +| *Getter* | get_mix_rate() | ++-----------+---------------------+ + +The sample rate to use (in Hz). Higher values are more demanding for the CPU to generate, but result in better quality. + +In games, common sample rates in use are ``11025``, ``16000``, ``22050``, ``32000``, ``44100``, and ``48000``. + +According to the `Nyquist-Shannon sampling theorem `__, there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are generating lower-pitched sounds such as voices, lower sample rates such as ``32000`` or ``22050`` may be usable with no loss in quality. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamgeneratorplayback.rst b/classes/class_audiostreamgeneratorplayback.rst new file mode 100644 index 0000000..23c3258 --- /dev/null +++ b/classes/class_audiostreamgeneratorplayback.rst @@ -0,0 +1,94 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamGeneratorPlayback.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamGeneratorPlayback: + +AudioStreamGeneratorPlayback +============================ + +**Inherits:** :ref:`AudioStreamPlaybackResampled` **<** :ref:`AudioStreamPlayback` **<** :ref:`Reference` **<** :ref:`Object` + +Plays back audio generated using :ref:`AudioStreamGenerator`. + +Description +----------- + +This class is meant to be used with :ref:`AudioStreamGenerator` to play back the generated audio in real-time. + +Tutorials +--------- + +- `Audio Generator Demo `__ + +- `Godot 3.2 will get new audio features `__ + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_push_buffer` **(** :ref:`int` amount **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_buffer` **(** **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frames_available` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_skips` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`push_buffer` **(** :ref:`PoolVector2Array` frames **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`push_frame` **(** :ref:`Vector2` frame **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_AudioStreamGeneratorPlayback_method_can_push_buffer: + +- :ref:`bool` **can_push_buffer** **(** :ref:`int` amount **)** |const| + +Returns ``true`` if a buffer of the size ``amount`` can be pushed to the audio sample data buffer without overflowing it, ``false`` otherwise. + +---- + +.. _class_AudioStreamGeneratorPlayback_method_clear_buffer: + +- void **clear_buffer** **(** **)** + +Clears the audio sample data buffer. + +---- + +.. _class_AudioStreamGeneratorPlayback_method_get_frames_available: + +- :ref:`int` **get_frames_available** **(** **)** |const| + +Returns the number of audio data frames left to play. If this returned number reaches ``0``, the audio will stop playing until frames are added again. Therefore, make sure your script can always generate and push new audio frames fast enough to avoid audio cracking. + +---- + +.. _class_AudioStreamGeneratorPlayback_method_get_skips: + +- :ref:`int` **get_skips** **(** **)** |const| + +---- + +.. _class_AudioStreamGeneratorPlayback_method_push_buffer: + +- :ref:`bool` **push_buffer** **(** :ref:`PoolVector2Array` frames **)** + +Pushes several audio data frames to the buffer. This is usually more efficient than :ref:`push_frame` in C# and compiled languages via GDNative, but :ref:`push_buffer` may be *less* efficient in GDScript. + +---- + +.. _class_AudioStreamGeneratorPlayback_method_push_frame: + +- :ref:`bool` **push_frame** **(** :ref:`Vector2` frame **)** + +Pushes a single audio data frame to the buffer. This is usually less efficient than :ref:`push_buffer` in C# and compiled languages via GDNative, but :ref:`push_frame` may be *more* efficient in GDScript. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreammicrophone.rst b/classes/class_audiostreammicrophone.rst new file mode 100644 index 0000000..05a78bd --- /dev/null +++ b/classes/class_audiostreammicrophone.rst @@ -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 AudioStreamMicrophone.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamMicrophone: + +AudioStreamMicrophone +===================== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_audiostreammp3.rst b/classes/class_audiostreammp3.rst new file mode 100644 index 0000000..37b04ca --- /dev/null +++ b/classes/class_audiostreammp3.rst @@ -0,0 +1,83 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamMP3.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamMP3: + +AudioStreamMP3 +============== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +MP3 audio stream driver. + +Description +----------- + +MP3 audio stream driver. + +Properties +---------- + ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`data` | ``PoolByteArray( )`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`loop` | ``false`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`loop_offset` | ``0.0`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioStreamMP3_property_data: + +- :ref:`PoolByteArray` **data** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_data(value) | ++-----------+-----------------------+ +| *Getter* | get_data() | ++-----------+-----------------------+ + +Contains the audio data in bytes. + +---- + +.. _class_AudioStreamMP3_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | has_loop() | ++-----------+-----------------+ + +If ``true``, the stream will automatically loop when it reaches the end. + +---- + +.. _class_AudioStreamMP3_property_loop_offset: + +- :ref:`float` **loop_offset** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_loop_offset(value) | ++-----------+------------------------+ +| *Getter* | get_loop_offset() | ++-----------+------------------------+ + +Time in seconds at which the stream starts after being looped. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamoggvorbis.rst b/classes/class_audiostreamoggvorbis.rst new file mode 100644 index 0000000..abcacec --- /dev/null +++ b/classes/class_audiostreamoggvorbis.rst @@ -0,0 +1,83 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamOGGVorbis.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamOGGVorbis: + +AudioStreamOGGVorbis +==================== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +OGG Vorbis audio stream driver. + +Description +----------- + +OGG Vorbis audio stream driver. + +Properties +---------- + ++-------------------------------------------+---------------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`data` | ``PoolByteArray( )`` | ++-------------------------------------------+---------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`loop` | ``false`` | ++-------------------------------------------+---------------------------------------------------------------------+-----------------------+ +| :ref:`float` | :ref:`loop_offset` | ``0.0`` | ++-------------------------------------------+---------------------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_AudioStreamOGGVorbis_property_data: + +- :ref:`PoolByteArray` **data** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_data(value) | ++-----------+-----------------------+ +| *Getter* | get_data() | ++-----------+-----------------------+ + +Contains the audio data in bytes. + +---- + +.. _class_AudioStreamOGGVorbis_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | has_loop() | ++-----------+-----------------+ + +If ``true``, the stream will automatically loop when it reaches the end. + +---- + +.. _class_AudioStreamOGGVorbis_property_loop_offset: + +- :ref:`float` **loop_offset** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_loop_offset(value) | ++-----------+------------------------+ +| *Getter* | get_loop_offset() | ++-----------+------------------------+ + +Time in seconds at which the stream starts after being looped. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamplayback.rst b/classes/class_audiostreamplayback.rst new file mode 100644 index 0000000..b331ee1 --- /dev/null +++ b/classes/class_audiostreamplayback.rst @@ -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 AudioStreamPlayback.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamPlayback: + +AudioStreamPlayback +=================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioStreamPlaybackResampled` + +Meta class for playing back audio. + +Description +----------- + +Can play, loop, pause a scroll through audio. See :ref:`AudioStream` and :ref:`AudioStreamOGGVorbis` for usage. + +Tutorials +--------- + +- `Audio Generator Demo `__ + +.. |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.)` diff --git a/classes/class_audiostreamplaybackresampled.rst b/classes/class_audiostreamplaybackresampled.rst new file mode 100644 index 0000000..92eca90 --- /dev/null +++ b/classes/class_audiostreamplaybackresampled.rst @@ -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 AudioStreamPlaybackResampled.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamPlaybackResampled: + +AudioStreamPlaybackResampled +============================ + +**Inherits:** :ref:`AudioStreamPlayback` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AudioStreamGeneratorPlayback` + + + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamplayer.rst b/classes/class_audiostreamplayer.rst new file mode 100644 index 0000000..0ae482d --- /dev/null +++ b/classes/class_audiostreamplayer.rst @@ -0,0 +1,270 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamPlayer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamPlayer: + +AudioStreamPlayer +================= + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Plays back audio non-positionally. + +Description +----------- + +Plays an audio stream non-positionally. + +To play audio positionally, use :ref:`AudioStreamPlayer2D` or :ref:`AudioStreamPlayer3D` instead of ``AudioStreamPlayer``. + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_streams` + +- `2D Dodge The Creeps Demo `__ + +- `Audio Device Changer Demo `__ + +- `Audio Generator Demo `__ + +- `Audio Mic Record Demo `__ + +- `Audio Spectrum Demo `__ + +Properties +---------- + ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`autoplay` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`bus` | ``"Master"`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`MixTarget` | :ref:`mix_target` | ``0`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`AudioStream` | :ref:`stream` | | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`stream_paused` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`volume_db` | ``0.0`` | ++----------------------------------------------------+----------------------------------------------------------------------+--------------+ + +Methods +------- + ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_playback_position` **(** **)** | ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ +| :ref:`AudioStreamPlayback` | :ref:`get_stream_playback` **(** **)** | ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`float` from_position=0.0 **)** | ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`float` to_position **)** | ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------------------+----------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_AudioStreamPlayer_signal_finished: + +- **finished** **(** **)** + +Emitted when the audio stops playing. + +Enumerations +------------ + +.. _enum_AudioStreamPlayer_MixTarget: + +.. _class_AudioStreamPlayer_constant_MIX_TARGET_STEREO: + +.. _class_AudioStreamPlayer_constant_MIX_TARGET_SURROUND: + +.. _class_AudioStreamPlayer_constant_MIX_TARGET_CENTER: + +enum **MixTarget**: + +- **MIX_TARGET_STEREO** = **0** --- The audio will be played only on the first channel. + +- **MIX_TARGET_SURROUND** = **1** --- The audio will be played on all surround channels. + +- **MIX_TARGET_CENTER** = **2** --- The audio will be played on the second channel, which is usually the center. + +Property Descriptions +--------------------- + +.. _class_AudioStreamPlayer_property_autoplay: + +- :ref:`bool` **autoplay** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_autoplay(value) | ++-----------+-----------------------+ +| *Getter* | is_autoplay_enabled() | ++-----------+-----------------------+ + +If ``true``, audio plays when added to scene tree. + +---- + +.. _class_AudioStreamPlayer_property_bus: + +- :ref:`String` **bus** + ++-----------+----------------+ +| *Default* | ``"Master"`` | ++-----------+----------------+ +| *Setter* | set_bus(value) | ++-----------+----------------+ +| *Getter* | get_bus() | ++-----------+----------------+ + +Bus on which this audio is playing. + +---- + +.. _class_AudioStreamPlayer_property_mix_target: + +- :ref:`MixTarget` **mix_target** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_mix_target(value) | ++-----------+-----------------------+ +| *Getter* | get_mix_target() | ++-----------+-----------------------+ + +If the audio configuration has more than two speakers, this sets the target channels. See :ref:`MixTarget` constants. + +---- + +.. _class_AudioStreamPlayer_property_pitch_scale: + +- :ref:`float` **pitch_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_pitch_scale(value) | ++-----------+------------------------+ +| *Getter* | get_pitch_scale() | ++-----------+------------------------+ + +The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. + +---- + +.. _class_AudioStreamPlayer_property_playing: + +- :ref:`bool` **playing** + ++-----------+--------------+ +| *Default* | ``false`` | ++-----------+--------------+ +| *Getter* | is_playing() | ++-----------+--------------+ + +If ``true``, audio is playing. + +---- + +.. _class_AudioStreamPlayer_property_stream: + +- :ref:`AudioStream` **stream** + ++----------+-------------------+ +| *Setter* | set_stream(value) | ++----------+-------------------+ +| *Getter* | get_stream() | ++----------+-------------------+ + +The :ref:`AudioStream` object to be played. + +---- + +.. _class_AudioStreamPlayer_property_stream_paused: + +- :ref:`bool` **stream_paused** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_stream_paused(value) | ++-----------+--------------------------+ +| *Getter* | get_stream_paused() | ++-----------+--------------------------+ + +If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``. + +---- + +.. _class_AudioStreamPlayer_property_volume_db: + +- :ref:`float` **volume_db** + ++-----------+----------------------+ +| *Default* | ``0.0`` | ++-----------+----------------------+ +| *Setter* | set_volume_db(value) | ++-----------+----------------------+ +| *Getter* | get_volume_db() | ++-----------+----------------------+ + +Volume of sound, in dB. + +Method Descriptions +------------------- + +.. _class_AudioStreamPlayer_method_get_playback_position: + +- :ref:`float` **get_playback_position** **(** **)** + +Returns the position in the :ref:`AudioStream` in seconds. + +---- + +.. _class_AudioStreamPlayer_method_get_stream_playback: + +- :ref:`AudioStreamPlayback` **get_stream_playback** **(** **)** + +Returns the :ref:`AudioStreamPlayback` object associated with this ``AudioStreamPlayer``. + +---- + +.. _class_AudioStreamPlayer_method_play: + +- void **play** **(** :ref:`float` from_position=0.0 **)** + +Plays the audio from the given ``from_position``, in seconds. + +---- + +.. _class_AudioStreamPlayer_method_seek: + +- void **seek** **(** :ref:`float` to_position **)** + +Sets the position from which audio will be played, in seconds. + +---- + +.. _class_AudioStreamPlayer_method_stop: + +- void **stop** **(** **)** + +Stops the audio. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamplayer2d.rst b/classes/class_audiostreamplayer2d.rst new file mode 100644 index 0000000..c6e2c1c --- /dev/null +++ b/classes/class_audiostreamplayer2d.rst @@ -0,0 +1,279 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamPlayer2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamPlayer2D: + +AudioStreamPlayer2D +=================== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Plays positional sound in 2D space. + +Description +----------- + +Plays audio that dampens with distance from screen center. + +See also :ref:`AudioStreamPlayer` to play a sound non-positionally. + +**Note:** Hiding an ``AudioStreamPlayer2D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer2D``'s audio output, set :ref:`volume_db` to a very low value like ``-100`` (which isn't audible to human hearing). + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_streams` + +Properties +---------- + ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`int` | :ref:`area_mask` | ``1`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`attenuation` | ``1.0`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`autoplay` | ``false`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`bus` | ``"Master"`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`max_distance` | ``2000.0`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`AudioStream` | :ref:`stream` | | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`stream_paused` | ``false`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`volume_db` | ``0.0`` | ++---------------------------------------+------------------------------------------------------------------------+--------------+ + +Methods +------- + ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_playback_position` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioStreamPlayback` | :ref:`get_stream_playback` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`float` from_position=0.0 **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`float` to_position **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_AudioStreamPlayer2D_signal_finished: + +- **finished** **(** **)** + +Emitted when the audio stops playing. + +Property Descriptions +--------------------- + +.. _class_AudioStreamPlayer2D_property_area_mask: + +- :ref:`int` **area_mask** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_area_mask(value) | ++-----------+----------------------+ +| *Getter* | get_area_mask() | ++-----------+----------------------+ + +Determines which :ref:`Area2D` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. + +---- + +.. _class_AudioStreamPlayer2D_property_attenuation: + +- :ref:`float` **attenuation** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_attenuation(value) | ++-----------+------------------------+ +| *Getter* | get_attenuation() | ++-----------+------------------------+ + +Dampens audio over distance with this as an exponent. + +---- + +.. _class_AudioStreamPlayer2D_property_autoplay: + +- :ref:`bool` **autoplay** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_autoplay(value) | ++-----------+-----------------------+ +| *Getter* | is_autoplay_enabled() | ++-----------+-----------------------+ + +If ``true``, audio plays when added to scene tree. + +---- + +.. _class_AudioStreamPlayer2D_property_bus: + +- :ref:`String` **bus** + ++-----------+----------------+ +| *Default* | ``"Master"`` | ++-----------+----------------+ +| *Setter* | set_bus(value) | ++-----------+----------------+ +| *Getter* | get_bus() | ++-----------+----------------+ + +Bus on which this audio is playing. + +---- + +.. _class_AudioStreamPlayer2D_property_max_distance: + +- :ref:`float` **max_distance** + ++-----------+-------------------------+ +| *Default* | ``2000.0`` | ++-----------+-------------------------+ +| *Setter* | set_max_distance(value) | ++-----------+-------------------------+ +| *Getter* | get_max_distance() | ++-----------+-------------------------+ + +Maximum distance from which audio is still hearable. + +---- + +.. _class_AudioStreamPlayer2D_property_pitch_scale: + +- :ref:`float` **pitch_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_pitch_scale(value) | ++-----------+------------------------+ +| *Getter* | get_pitch_scale() | ++-----------+------------------------+ + +The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. + +---- + +.. _class_AudioStreamPlayer2D_property_playing: + +- :ref:`bool` **playing** + ++-----------+--------------+ +| *Default* | ``false`` | ++-----------+--------------+ +| *Getter* | is_playing() | ++-----------+--------------+ + +If ``true``, audio is playing. + +---- + +.. _class_AudioStreamPlayer2D_property_stream: + +- :ref:`AudioStream` **stream** + ++----------+-------------------+ +| *Setter* | set_stream(value) | ++----------+-------------------+ +| *Getter* | get_stream() | ++----------+-------------------+ + +The :ref:`AudioStream` object to be played. + +---- + +.. _class_AudioStreamPlayer2D_property_stream_paused: + +- :ref:`bool` **stream_paused** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_stream_paused(value) | ++-----------+--------------------------+ +| *Getter* | get_stream_paused() | ++-----------+--------------------------+ + +If ``true``, the playback is paused. You can resume it by setting ``stream_paused`` to ``false``. + +---- + +.. _class_AudioStreamPlayer2D_property_volume_db: + +- :ref:`float` **volume_db** + ++-----------+----------------------+ +| *Default* | ``0.0`` | ++-----------+----------------------+ +| *Setter* | set_volume_db(value) | ++-----------+----------------------+ +| *Getter* | get_volume_db() | ++-----------+----------------------+ + +Base volume without dampening. + +Method Descriptions +------------------- + +.. _class_AudioStreamPlayer2D_method_get_playback_position: + +- :ref:`float` **get_playback_position** **(** **)** + +Returns the position in the :ref:`AudioStream`. + +---- + +.. _class_AudioStreamPlayer2D_method_get_stream_playback: + +- :ref:`AudioStreamPlayback` **get_stream_playback** **(** **)** + +Returns the :ref:`AudioStreamPlayback` object associated with this ``AudioStreamPlayer2D``. + +---- + +.. _class_AudioStreamPlayer2D_method_play: + +- void **play** **(** :ref:`float` from_position=0.0 **)** + +Plays the audio from the given position ``from_position``, in seconds. + +---- + +.. _class_AudioStreamPlayer2D_method_seek: + +- void **seek** **(** :ref:`float` to_position **)** + +Sets the position from which audio will be played, in seconds. + +---- + +.. _class_AudioStreamPlayer2D_method_stop: + +- void **stop** **(** **)** + +Stops the audio. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamplayer3d.rst b/classes/class_audiostreamplayer3d.rst new file mode 100644 index 0000000..fcfb50f --- /dev/null +++ b/classes/class_audiostreamplayer3d.rst @@ -0,0 +1,500 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamPlayer3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamPlayer3D: + +AudioStreamPlayer3D +=================== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Plays positional sound in 3D space. + +Description +----------- + +Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically applied to distant sounds. This can be disabled by setting :ref:`attenuation_filter_cutoff_hz` to ``20500``. + +By default, audio is heard from the camera position. This can be changed by adding a :ref:`Listener` node to the scene and enabling it by calling :ref:`Listener.make_current` on it. + +See also :ref:`AudioStreamPlayer` to play a sound non-positionally. + +**Note:** Hiding an ``AudioStreamPlayer3D`` node does not disable its audio output. To temporarily disable an ``AudioStreamPlayer3D``'s audio output, set :ref:`unit_db` to a very low value like ``-100`` (which isn't audible to human hearing). + +Tutorials +--------- + +- :doc:`../tutorials/audio/audio_streams` + +Properties +---------- + ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`int` | :ref:`area_mask` | ``1`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`attenuation_filter_cutoff_hz` | ``5000.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`attenuation_filter_db` | ``-24.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`AttenuationModel` | :ref:`attenuation_model` | ``0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`autoplay` | ``false`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`bus` | ``"Master"`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`DopplerTracking` | :ref:`doppler_tracking` | ``0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`emission_angle_degrees` | ``45.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`emission_angle_enabled` | ``false`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`emission_angle_filter_attenuation_db` | ``-12.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`max_db` | ``3.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`max_distance` | ``0.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`OutOfRangeMode` | :ref:`out_of_range_mode` | ``0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`pitch_scale` | ``1.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`playing` | ``false`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`AudioStream` | :ref:`stream` | | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`stream_paused` | ``false`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`unit_db` | ``0.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`unit_size` | ``1.0`` | ++--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+ + +Methods +------- + ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_playback_position` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`AudioStreamPlayback` | :ref:`get_stream_playback` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** :ref:`float` from_position=0.0 **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`float` to_position **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_AudioStreamPlayer3D_signal_finished: + +- **finished** **(** **)** + +Emitted when the audio stops playing. + +Enumerations +------------ + +.. _enum_AudioStreamPlayer3D_AttenuationModel: + +.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE: + +.. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE: + +.. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC: + +.. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED: + +enum **AttenuationModel**: + +- **ATTENUATION_INVERSE_DISTANCE** = **0** --- Linear dampening of loudness according to distance. + +- **ATTENUATION_INVERSE_SQUARE_DISTANCE** = **1** --- Squared dampening of loudness according to distance. + +- **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance. + +- **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer`. :ref:`ATTENUATION_DISABLED` can be combined with a :ref:`max_distance` value greater than ``0.0`` to achieve linear attenuation clamped to a sphere of a defined size. + +---- + +.. _enum_AudioStreamPlayer3D_OutOfRangeMode: + +.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX: + +.. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE: + +enum **OutOfRangeMode**: + +- **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance` radius. + +- **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the ``AudioStreamPlayer3D``'s :ref:`max_distance` radius. + +---- + +.. _enum_AudioStreamPlayer3D_DopplerTracking: + +.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED: + +.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP: + +.. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP: + +enum **DopplerTracking**: + +- **DOPPLER_TRACKING_DISABLED** = **0** --- Disables doppler tracking. + +- **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Executes doppler tracking in idle step (every rendered frame). + +- **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step (every simulated physics frame). + +Property Descriptions +--------------------- + +.. _class_AudioStreamPlayer3D_property_area_mask: + +- :ref:`int` **area_mask** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_area_mask(value) | ++-----------+----------------------+ +| *Getter* | get_area_mask() | ++-----------+----------------------+ + +Determines which :ref:`Area` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater. + +---- + +.. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz: + +- :ref:`float` **attenuation_filter_cutoff_hz** + ++-----------+-----------------------------------------+ +| *Default* | ``5000.0`` | ++-----------+-----------------------------------------+ +| *Setter* | set_attenuation_filter_cutoff_hz(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_attenuation_filter_cutoff_hz() | ++-----------+-----------------------------------------+ + +Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to ``20500`` as this frequency is above the human hearing limit. + +---- + +.. _class_AudioStreamPlayer3D_property_attenuation_filter_db: + +- :ref:`float` **attenuation_filter_db** + ++-----------+----------------------------------+ +| *Default* | ``-24.0`` | ++-----------+----------------------------------+ +| *Setter* | set_attenuation_filter_db(value) | ++-----------+----------------------------------+ +| *Getter* | get_attenuation_filter_db() | ++-----------+----------------------------------+ + +Amount how much the filter affects the loudness, in decibels. + +---- + +.. _class_AudioStreamPlayer3D_property_attenuation_model: + +- :ref:`AttenuationModel` **attenuation_model** + ++-----------+------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------+ +| *Setter* | set_attenuation_model(value) | ++-----------+------------------------------+ +| *Getter* | get_attenuation_model() | ++-----------+------------------------------+ + +Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation. + +---- + +.. _class_AudioStreamPlayer3D_property_autoplay: + +- :ref:`bool` **autoplay** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_autoplay(value) | ++-----------+-----------------------+ +| *Getter* | is_autoplay_enabled() | ++-----------+-----------------------+ + +If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree. + +---- + +.. _class_AudioStreamPlayer3D_property_bus: + +- :ref:`String` **bus** + ++-----------+----------------+ +| *Default* | ``"Master"`` | ++-----------+----------------+ +| *Setter* | set_bus(value) | ++-----------+----------------+ +| *Getter* | get_bus() | ++-----------+----------------+ + +The bus on which this audio is playing. + +---- + +.. _class_AudioStreamPlayer3D_property_doppler_tracking: + +- :ref:`DopplerTracking` **doppler_tracking** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_doppler_tracking(value) | ++-----------+-----------------------------+ +| *Getter* | get_doppler_tracking() | ++-----------+-----------------------------+ + +Decides in which step the `Doppler effect `__ should be calculated. + +**Note:** Only effective if the current :ref:`Camera`'s :ref:`Camera.doppler_tracking` property is set to a value other than :ref:`Camera.DOPPLER_TRACKING_DISABLED`. + +---- + +.. _class_AudioStreamPlayer3D_property_emission_angle_degrees: + +- :ref:`float` **emission_angle_degrees** + ++-----------+---------------------------+ +| *Default* | ``45.0`` | ++-----------+---------------------------+ +| *Setter* | set_emission_angle(value) | ++-----------+---------------------------+ +| *Getter* | get_emission_angle() | ++-----------+---------------------------+ + +The angle in which the audio reaches cameras undampened. + +---- + +.. _class_AudioStreamPlayer3D_property_emission_angle_enabled: + +- :ref:`bool` **emission_angle_enabled** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_emission_angle_enabled(value) | ++-----------+-----------------------------------+ +| *Getter* | is_emission_angle_enabled() | ++-----------+-----------------------------------+ + +If ``true``, the audio should be dampened according to the direction of the sound. + +---- + +.. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db: + +- :ref:`float` **emission_angle_filter_attenuation_db** + ++-----------+-------------------------------------------------+ +| *Default* | ``-12.0`` | ++-----------+-------------------------------------------------+ +| *Setter* | set_emission_angle_filter_attenuation_db(value) | ++-----------+-------------------------------------------------+ +| *Getter* | get_emission_angle_filter_attenuation_db() | ++-----------+-------------------------------------------------+ + +Dampens audio if camera is outside of :ref:`emission_angle_degrees` and :ref:`emission_angle_enabled` is set by this factor, in decibels. + +---- + +.. _class_AudioStreamPlayer3D_property_max_db: + +- :ref:`float` **max_db** + ++-----------+-------------------+ +| *Default* | ``3.0`` | ++-----------+-------------------+ +| *Setter* | set_max_db(value) | ++-----------+-------------------+ +| *Getter* | get_max_db() | ++-----------+-------------------+ + +Sets the absolute maximum of the soundlevel, in decibels. + +---- + +.. _class_AudioStreamPlayer3D_property_max_distance: + +- :ref:`float` **max_distance** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_max_distance(value) | ++-----------+-------------------------+ +| *Getter* | get_max_distance() | ++-----------+-------------------------+ + +Sets the distance from which the :ref:`out_of_range_mode` takes effect. Has no effect if set to 0. + +---- + +.. _class_AudioStreamPlayer3D_property_out_of_range_mode: + +- :ref:`OutOfRangeMode` **out_of_range_mode** + ++-----------+------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------+ +| *Setter* | set_out_of_range_mode(value) | ++-----------+------------------------------+ +| *Getter* | get_out_of_range_mode() | ++-----------+------------------------------+ + +Decides if audio should pause when source is outside of :ref:`max_distance` range. + +---- + +.. _class_AudioStreamPlayer3D_property_pitch_scale: + +- :ref:`float` **pitch_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_pitch_scale(value) | ++-----------+------------------------+ +| *Getter* | get_pitch_scale() | ++-----------+------------------------+ + +The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate. + +---- + +.. _class_AudioStreamPlayer3D_property_playing: + +- :ref:`bool` **playing** + ++-----------+--------------+ +| *Default* | ``false`` | ++-----------+--------------+ +| *Getter* | is_playing() | ++-----------+--------------+ + +If ``true``, audio is playing. + +---- + +.. _class_AudioStreamPlayer3D_property_stream: + +- :ref:`AudioStream` **stream** + ++----------+-------------------+ +| *Setter* | set_stream(value) | ++----------+-------------------+ +| *Getter* | get_stream() | ++----------+-------------------+ + +The :ref:`AudioStream` resource to be played. + +---- + +.. _class_AudioStreamPlayer3D_property_stream_paused: + +- :ref:`bool` **stream_paused** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_stream_paused(value) | ++-----------+--------------------------+ +| *Getter* | get_stream_paused() | ++-----------+--------------------------+ + +If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused` to ``false``. + +---- + +.. _class_AudioStreamPlayer3D_property_unit_db: + +- :ref:`float` **unit_db** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_unit_db(value) | ++-----------+--------------------+ +| *Getter* | get_unit_db() | ++-----------+--------------------+ + +The base sound level unaffected by dampening, in decibels. + +---- + +.. _class_AudioStreamPlayer3D_property_unit_size: + +- :ref:`float` **unit_size** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_unit_size(value) | ++-----------+----------------------+ +| *Getter* | get_unit_size() | ++-----------+----------------------+ + +The factor for the attenuation effect. Higher values make the sound audible over a larger distance. + +Method Descriptions +------------------- + +.. _class_AudioStreamPlayer3D_method_get_playback_position: + +- :ref:`float` **get_playback_position** **(** **)** + +Returns the position in the :ref:`AudioStream`. + +---- + +.. _class_AudioStreamPlayer3D_method_get_stream_playback: + +- :ref:`AudioStreamPlayback` **get_stream_playback** **(** **)** + +Returns the :ref:`AudioStreamPlayback` object associated with this ``AudioStreamPlayer3D``. + +---- + +.. _class_AudioStreamPlayer3D_method_play: + +- void **play** **(** :ref:`float` from_position=0.0 **)** + +Plays the audio from the given position ``from_position``, in seconds. + +---- + +.. _class_AudioStreamPlayer3D_method_seek: + +- void **seek** **(** :ref:`float` to_position **)** + +Sets the position from which audio will be played, in seconds. + +---- + +.. _class_AudioStreamPlayer3D_method_stop: + +- void **stop** **(** **)** + +Stops the audio. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamrandompitch.rst b/classes/class_audiostreamrandompitch.rst new file mode 100644 index 0000000..ae6473b --- /dev/null +++ b/classes/class_audiostreamrandompitch.rst @@ -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 AudioStreamRandomPitch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamRandomPitch: + +AudioStreamRandomPitch +====================== + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Plays audio with random pitch shifting. + +Description +----------- + +Randomly varies pitch on each start. + +Properties +---------- + ++---------------------------------------+-------------------------------------------------------------------------+---------+ +| :ref:`AudioStream` | :ref:`audio_stream` | | ++---------------------------------------+-------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`random_pitch` | ``1.1`` | ++---------------------------------------+-------------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_AudioStreamRandomPitch_property_audio_stream: + +- :ref:`AudioStream` **audio_stream** + ++----------+-------------------------+ +| *Setter* | set_audio_stream(value) | ++----------+-------------------------+ +| *Getter* | get_audio_stream() | ++----------+-------------------------+ + +The current :ref:`AudioStream`. + +---- + +.. _class_AudioStreamRandomPitch_property_random_pitch: + +- :ref:`float` **random_pitch** + ++-----------+-------------------------+ +| *Default* | ``1.1`` | ++-----------+-------------------------+ +| *Setter* | set_random_pitch(value) | ++-----------+-------------------------+ +| *Getter* | get_random_pitch() | ++-----------+-------------------------+ + +The intensity of random pitch variation. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_audiostreamsample.rst b/classes/class_audiostreamsample.rst new file mode 100644 index 0000000..4028d5b --- /dev/null +++ b/classes/class_audiostreamsample.rst @@ -0,0 +1,222 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the AudioStreamSample.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_AudioStreamSample: + +AudioStreamSample +================= + +**Inherits:** :ref:`AudioStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Stores audio data loaded from WAV files. + +Description +----------- + +AudioStreamSample stores sound samples loaded from WAV files. To play the stored sound, use an :ref:`AudioStreamPlayer` (for non-positional audio) or :ref:`AudioStreamPlayer2D`/:ref:`AudioStreamPlayer3D` (for positional audio). The sound can be looped. + +This class can also be used to store dynamically-generated PCM audio data. See also :ref:`AudioStreamGenerator` for procedural audio generation. + +Properties +---------- + ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`data` | ``PoolByteArray( )`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`Format` | :ref:`format` | ``0`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`loop_begin` | ``0`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`loop_end` | ``0`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`LoopMode` | :ref:`loop_mode` | ``0`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`mix_rate` | ``44100`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`stereo` | ``false`` | ++--------------------------------------------------+----------------------------------------------------------------+-----------------------+ + +Methods +------- + ++---------------------------------------+-------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_to_wav` **(** :ref:`String` path **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_AudioStreamSample_Format: + +.. _class_AudioStreamSample_constant_FORMAT_8_BITS: + +.. _class_AudioStreamSample_constant_FORMAT_16_BITS: + +.. _class_AudioStreamSample_constant_FORMAT_IMA_ADPCM: + +enum **Format**: + +- **FORMAT_8_BITS** = **0** --- 8-bit audio codec. + +- **FORMAT_16_BITS** = **1** --- 16-bit audio codec. + +- **FORMAT_IMA_ADPCM** = **2** --- Audio is compressed using IMA ADPCM. + +---- + +.. _enum_AudioStreamSample_LoopMode: + +.. _class_AudioStreamSample_constant_LOOP_DISABLED: + +.. _class_AudioStreamSample_constant_LOOP_FORWARD: + +.. _class_AudioStreamSample_constant_LOOP_PING_PONG: + +.. _class_AudioStreamSample_constant_LOOP_BACKWARD: + +enum **LoopMode**: + +- **LOOP_DISABLED** = **0** --- Audio does not loop. + +- **LOOP_FORWARD** = **1** --- Audio loops the data between :ref:`loop_begin` and :ref:`loop_end`, playing forward only. + +- **LOOP_PING_PONG** = **2** --- Audio loops the data between :ref:`loop_begin` and :ref:`loop_end`, playing back and forth. + +- **LOOP_BACKWARD** = **3** --- Audio loops the data between :ref:`loop_begin` and :ref:`loop_end`, playing backward only. + +Property Descriptions +--------------------- + +.. _class_AudioStreamSample_property_data: + +- :ref:`PoolByteArray` **data** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_data(value) | ++-----------+-----------------------+ +| *Getter* | get_data() | ++-----------+-----------------------+ + +Contains the audio data in bytes. + +**Note:** This property expects signed PCM8 data. To convert unsigned PCM8 to signed PCM8, subtract 128 from each byte. + +---- + +.. _class_AudioStreamSample_property_format: + +- :ref:`Format` **format** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_format(value) | ++-----------+-------------------+ +| *Getter* | get_format() | ++-----------+-------------------+ + +Audio format. See :ref:`Format` constants for values. + +---- + +.. _class_AudioStreamSample_property_loop_begin: + +- :ref:`int` **loop_begin** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_loop_begin(value) | ++-----------+-----------------------+ +| *Getter* | get_loop_begin() | ++-----------+-----------------------+ + +The loop start point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. + +---- + +.. _class_AudioStreamSample_property_loop_end: + +- :ref:`int` **loop_end** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_loop_end(value) | ++-----------+---------------------+ +| *Getter* | get_loop_end() | ++-----------+---------------------+ + +The loop end point (in number of samples, relative to the beginning of the sample). This information will be imported automatically from the WAV file if present. + +---- + +.. _class_AudioStreamSample_property_loop_mode: + +- :ref:`LoopMode` **loop_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_loop_mode(value) | ++-----------+----------------------+ +| *Getter* | get_loop_mode() | ++-----------+----------------------+ + +The loop mode. This information will be imported automatically from the WAV file if present. See :ref:`LoopMode` constants for values. + +---- + +.. _class_AudioStreamSample_property_mix_rate: + +- :ref:`int` **mix_rate** + ++-----------+---------------------+ +| *Default* | ``44100`` | ++-----------+---------------------+ +| *Setter* | set_mix_rate(value) | ++-----------+---------------------+ +| *Getter* | get_mix_rate() | ++-----------+---------------------+ + +The sample rate for mixing this audio. Higher values require more storage space, but result in better quality. + +In games, common sample rates in use are ``11025``, ``16000``, ``22050``, ``32000``, ``44100``, and ``48000``. + +According to the `Nyquist-Shannon sampling theorem `__, there is no quality difference to human hearing when going past 40,000 Hz (since most humans can only hear up to ~20,000 Hz, often less). If you are using lower-pitched sounds such as voices, lower sample rates such as ``32000`` or ``22050`` may be usable with no loss in quality. + +---- + +.. _class_AudioStreamSample_property_stereo: + +- :ref:`bool` **stereo** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_stereo(value) | ++-----------+-------------------+ +| *Getter* | is_stereo() | ++-----------+-------------------+ + +If ``true``, audio is stereo. + +Method Descriptions +------------------- + +.. _class_AudioStreamSample_method_save_to_wav: + +- :ref:`Error` **save_to_wav** **(** :ref:`String` path **)** + +Saves the AudioStreamSample as a WAV file to ``path``. Samples with IMA ADPCM format can't be saved. + +**Note:** A ``.wav`` extension is automatically appended to ``path`` if it is missing. + +.. |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.)` diff --git a/classes/class_backbuffercopy.rst b/classes/class_backbuffercopy.rst new file mode 100644 index 0000000..b4ef54f --- /dev/null +++ b/classes/class_backbuffercopy.rst @@ -0,0 +1,86 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BackBufferCopy.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BackBufferCopy: + +BackBufferCopy +============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Copies a region of the screen (or the whole screen) to a buffer so it can be accessed in your shader scripts through the ``texture(SCREEN_TEXTURE, ...)`` function. + +Description +----------- + +Node for back-buffering the currently-displayed screen. The region defined in the BackBufferCopy node is buffered with the content of the screen it covers, or the entire screen according to the copy mode set. Use the ``texture(SCREEN_TEXTURE, ...)`` function in your shader scripts to access the buffer. + +**Note:** Since this node inherits from :ref:`Node2D` (and not :ref:`Control`), anchors and margins won't apply to child :ref:`Control`-derived nodes. This can be problematic when resizing the window. To avoid this, add :ref:`Control`-derived nodes as *siblings* to the BackBufferCopy node instead of adding them as children. + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+ +| :ref:`CopyMode` | :ref:`copy_mode` | ``1`` | ++-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+ +| :ref:`Rect2` | :ref:`rect` | ``Rect2( -100, -100, 200, 200 )`` | ++-----------------------------------------------+-----------------------------------------------------------+-----------------------------------+ + +Enumerations +------------ + +.. _enum_BackBufferCopy_CopyMode: + +.. _class_BackBufferCopy_constant_COPY_MODE_DISABLED: + +.. _class_BackBufferCopy_constant_COPY_MODE_RECT: + +.. _class_BackBufferCopy_constant_COPY_MODE_VIEWPORT: + +enum **CopyMode**: + +- **COPY_MODE_DISABLED** = **0** --- Disables the buffering mode. This means the BackBufferCopy node will directly use the portion of screen it covers. + +- **COPY_MODE_RECT** = **1** --- BackBufferCopy buffers a rectangular region. + +- **COPY_MODE_VIEWPORT** = **2** --- BackBufferCopy buffers the entire screen. + +Property Descriptions +--------------------- + +.. _class_BackBufferCopy_property_copy_mode: + +- :ref:`CopyMode` **copy_mode** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_copy_mode(value) | ++-----------+----------------------+ +| *Getter* | get_copy_mode() | ++-----------+----------------------+ + +Buffer mode. See :ref:`CopyMode` constants. + +---- + +.. _class_BackBufferCopy_property_rect: + +- :ref:`Rect2` **rect** + ++-----------+-----------------------------------+ +| *Default* | ``Rect2( -100, -100, 200, 200 )`` | ++-----------+-----------------------------------+ +| *Setter* | set_rect(value) | ++-----------+-----------------------------------+ +| *Getter* | get_rect() | ++-----------+-----------------------------------+ + +The area covered by the BackBufferCopy. Only used if :ref:`copy_mode` is :ref:`COPY_MODE_RECT`. + +.. |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.)` diff --git a/classes/class_bakedlightmap.rst b/classes/class_bakedlightmap.rst new file mode 100644 index 0000000..2ed7766 --- /dev/null +++ b/classes/class_bakedlightmap.rst @@ -0,0 +1,547 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BakedLightmap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BakedLightmap: + +BakedLightmap +============= + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Prerendered indirect light map for a scene. + +Description +----------- + +Baked lightmaps are an alternative workflow for adding indirect (or baked) lighting to a scene. Unlike the :ref:`GIProbe` approach, baked lightmaps work fine on low-end PCs and mobile devices as they consume almost no resources in run-time. + +**Procedural generation:** Lightmap baking functionality is only available in the editor. This means ``BakedLightmap`` is not suited to procedurally generated or user-built levels. For procedurally generated or user-built levels, use :ref:`GIProbe` instead. + +**Note:** Due to how lightmaps work, most properties only have a visible effect once lightmaps are baked again. + +Tutorials +--------- + +- :doc:`../tutorials/3d/baked_lightmaps` + +Properties +---------- + ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`atlas_generate` | ``true`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`atlas_max_size` | ``4096`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`bias` | ``0.005`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`bounce_indirect_energy` | ``1.0`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`bounces` | ``3`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`capture_cell_size` | ``0.5`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`capture_enabled` | ``true`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`capture_propagation` | ``1.0`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`BakeQuality` | :ref:`capture_quality` | ``1`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`default_texels_per_unit` | ``16.0`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`environment_custom_color` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`environment_custom_energy` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Sky` | :ref:`environment_custom_sky` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`environment_custom_sky_rotation_degrees` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`environment_min_light` | ``Color( 0, 0, 0, 1 )`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`EnvironmentMode` | :ref:`environment_mode` | ``0`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`extents` | ``Vector3( 10, 10, 10 )`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`image_path` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`BakedLightmapData` | :ref:`light_data` | | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`BakeQuality` | :ref:`quality` | ``1`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`use_color` | ``true`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`use_denoiser` | ``true`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`use_hdr` | ``true`` | ++------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BakeError` | :ref:`bake` **(** :ref:`Node` from_node=null, :ref:`String` data_save_path="" **)** | ++------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_BakedLightmap_BakeQuality: + +.. _class_BakedLightmap_constant_BAKE_QUALITY_LOW: + +.. _class_BakedLightmap_constant_BAKE_QUALITY_MEDIUM: + +.. _class_BakedLightmap_constant_BAKE_QUALITY_HIGH: + +.. _class_BakedLightmap_constant_BAKE_QUALITY_ULTRA: + +enum **BakeQuality**: + +- **BAKE_QUALITY_LOW** = **0** --- The lowest bake quality mode. Fastest to calculate. + +- **BAKE_QUALITY_MEDIUM** = **1** --- The default bake quality mode. + +- **BAKE_QUALITY_HIGH** = **2** --- A higher bake quality mode. Takes longer to calculate. + +- **BAKE_QUALITY_ULTRA** = **3** --- The highest bake quality mode. Takes the longest to calculate. + +---- + +.. _enum_BakedLightmap_BakeError: + +.. _class_BakedLightmap_constant_BAKE_ERROR_OK: + +.. _class_BakedLightmap_constant_BAKE_ERROR_NO_SAVE_PATH: + +.. _class_BakedLightmap_constant_BAKE_ERROR_NO_MESHES: + +.. _class_BakedLightmap_constant_BAKE_ERROR_CANT_CREATE_IMAGE: + +.. _class_BakedLightmap_constant_BAKE_ERROR_LIGHTMAP_SIZE: + +.. _class_BakedLightmap_constant_BAKE_ERROR_INVALID_MESH: + +.. _class_BakedLightmap_constant_BAKE_ERROR_USER_ABORTED: + +.. _class_BakedLightmap_constant_BAKE_ERROR_NO_LIGHTMAPPER: + +.. _class_BakedLightmap_constant_BAKE_ERROR_NO_ROOT: + +enum **BakeError**: + +- **BAKE_ERROR_OK** = **0** --- Baking was successful. + +- **BAKE_ERROR_NO_SAVE_PATH** = **1** --- Returns if no viable save path is found. This can happen where an :ref:`image_path` is not specified or when the save location is invalid. + +- **BAKE_ERROR_NO_MESHES** = **2** --- Currently unused. + +- **BAKE_ERROR_CANT_CREATE_IMAGE** = **3** --- Returns when the baker cannot save per-mesh textures to file. + +- **BAKE_ERROR_LIGHTMAP_SIZE** = **4** --- The size of the generated lightmaps is too large. + +- **BAKE_ERROR_INVALID_MESH** = **5** --- Some mesh contains UV2 values outside the ``[0,1]`` range. + +- **BAKE_ERROR_USER_ABORTED** = **6** --- Returns if user cancels baking. + +- **BAKE_ERROR_NO_LIGHTMAPPER** = **7** --- Returns if lightmapper can't be created. Unless you are using a custom lightmapper, please report this as bug. + +- **BAKE_ERROR_NO_ROOT** = **8** --- There is no root node to start baking from. Either provide ``from_node`` argument or attach this node to a parent that should be used as root. + +---- + +.. _enum_BakedLightmap_EnvironmentMode: + +.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_DISABLED: + +.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_SCENE: + +.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_SKY: + +.. _class_BakedLightmap_constant_ENVIRONMENT_MODE_CUSTOM_COLOR: + +enum **EnvironmentMode**: + +- **ENVIRONMENT_MODE_DISABLED** = **0** --- No environment is used during baking. + +- **ENVIRONMENT_MODE_SCENE** = **1** --- The baked environment is automatically picked from the current scene. + +- **ENVIRONMENT_MODE_CUSTOM_SKY** = **2** --- A custom sky is used as environment during baking. + +- **ENVIRONMENT_MODE_CUSTOM_COLOR** = **3** --- A custom solid color is used as environment during baking. + +Property Descriptions +--------------------- + +.. _class_BakedLightmap_property_atlas_generate: + +- :ref:`bool` **atlas_generate** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_generate_atlas(value) | ++-----------+-----------------------------+ +| *Getter* | is_generate_atlas_enabled() | ++-----------+-----------------------------+ + +When enabled, the lightmapper will merge the textures for all meshes into a single large layered texture. Not supported in GLES2. + +---- + +.. _class_BakedLightmap_property_atlas_max_size: + +- :ref:`int` **atlas_max_size** + ++-----------+---------------------------+ +| *Default* | ``4096`` | ++-----------+---------------------------+ +| *Setter* | set_max_atlas_size(value) | ++-----------+---------------------------+ +| *Getter* | get_max_atlas_size() | ++-----------+---------------------------+ + +Maximum size of each lightmap layer, only used when :ref:`atlas_generate` is enabled. + +---- + +.. _class_BakedLightmap_property_bias: + +- :ref:`float` **bias** + ++-----------+-----------------+ +| *Default* | ``0.005`` | ++-----------+-----------------+ +| *Setter* | set_bias(value) | ++-----------+-----------------+ +| *Getter* | get_bias() | ++-----------+-----------------+ + +Raycasting bias used during baking to avoid floating point precision issues. + +---- + +.. _class_BakedLightmap_property_bounce_indirect_energy: + +- :ref:`float` **bounce_indirect_energy** + ++-----------+-----------------------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_bounce_indirect_energy(value) | ++-----------+-----------------------------------+ +| *Getter* | get_bounce_indirect_energy() | ++-----------+-----------------------------------+ + +The energy multiplier for each bounce. Higher values will make indirect lighting brighter. A value of ``1.0`` represents physically accurate behavior, but higher values can be used to make indirect lighting propagate more visibly when using a low number of bounces. This can be used to speed up bake times by lowering the number of :ref:`bounces` then increasing :ref:`bounce_indirect_energy`. Unlike :ref:`BakedLightmapData.energy`, this property does not affect direct lighting emitted by light nodes, emissive materials and the environment. + +**Note:** :ref:`bounce_indirect_energy` only has an effect if :ref:`bounces` is set to a value greater than or equal to ``1``. + +---- + +.. _class_BakedLightmap_property_bounces: + +- :ref:`int` **bounces** + ++-----------+--------------------+ +| *Default* | ``3`` | ++-----------+--------------------+ +| *Setter* | set_bounces(value) | ++-----------+--------------------+ +| *Getter* | get_bounces() | ++-----------+--------------------+ + +Number of light bounces that are taken into account during baking. See also :ref:`bounce_indirect_energy`. + +---- + +.. _class_BakedLightmap_property_capture_cell_size: + +- :ref:`float` **capture_cell_size** + ++-----------+------------------------------+ +| *Default* | ``0.5`` | ++-----------+------------------------------+ +| *Setter* | set_capture_cell_size(value) | ++-----------+------------------------------+ +| *Getter* | get_capture_cell_size() | ++-----------+------------------------------+ + +Grid size used for real-time capture information on dynamic objects. + +---- + +.. _class_BakedLightmap_property_capture_enabled: + +- :ref:`bool` **capture_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_capture_enabled(value) | ++-----------+----------------------------+ +| *Getter* | get_capture_enabled() | ++-----------+----------------------------+ + +When enabled, an octree containing the scene's lighting information will be computed. This octree will then be used to light dynamic objects in the scene. + +---- + +.. _class_BakedLightmap_property_capture_propagation: + +- :ref:`float` **capture_propagation** + ++-----------+--------------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------------+ +| *Setter* | set_capture_propagation(value) | ++-----------+--------------------------------+ +| *Getter* | get_capture_propagation() | ++-----------+--------------------------------+ + +Bias value to reduce the amount of light propagation in the captured octree. + +---- + +.. _class_BakedLightmap_property_capture_quality: + +- :ref:`BakeQuality` **capture_quality** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_capture_quality(value) | ++-----------+----------------------------+ +| *Getter* | get_capture_quality() | ++-----------+----------------------------+ + +Bake quality of the capture data. + +---- + +.. _class_BakedLightmap_property_default_texels_per_unit: + +- :ref:`float` **default_texels_per_unit** + ++-----------+------------------------------------+ +| *Default* | ``16.0`` | ++-----------+------------------------------------+ +| *Setter* | set_default_texels_per_unit(value) | ++-----------+------------------------------------+ +| *Getter* | get_default_texels_per_unit() | ++-----------+------------------------------------+ + +If a baked mesh doesn't have a UV2 size hint, this value will be used to roughly compute a suitable lightmap size. + +---- + +.. _class_BakedLightmap_property_environment_custom_color: + +- :ref:`Color` **environment_custom_color** + ++----------+-------------------------------------+ +| *Setter* | set_environment_custom_color(value) | ++----------+-------------------------------------+ +| *Getter* | get_environment_custom_color() | ++----------+-------------------------------------+ + +The environment color when :ref:`environment_mode` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR`. + +---- + +.. _class_BakedLightmap_property_environment_custom_energy: + +- :ref:`float` **environment_custom_energy** + ++----------+--------------------------------------+ +| *Setter* | set_environment_custom_energy(value) | ++----------+--------------------------------------+ +| *Getter* | get_environment_custom_energy() | ++----------+--------------------------------------+ + +The energy scaling factor when when :ref:`environment_mode` is set to :ref:`ENVIRONMENT_MODE_CUSTOM_COLOR` or :ref:`ENVIRONMENT_MODE_CUSTOM_SKY`. + +---- + +.. _class_BakedLightmap_property_environment_custom_sky: + +- :ref:`Sky` **environment_custom_sky** + ++----------+-----------------------------------+ +| *Setter* | set_environment_custom_sky(value) | ++----------+-----------------------------------+ +| *Getter* | get_environment_custom_sky() | ++----------+-----------------------------------+ + +The :ref:`Sky` resource to use when :ref:`environment_mode` is set o :ref:`ENVIRONMENT_MODE_CUSTOM_SKY`. + +---- + +.. _class_BakedLightmap_property_environment_custom_sky_rotation_degrees: + +- :ref:`Vector3` **environment_custom_sky_rotation_degrees** + ++----------+----------------------------------------------------+ +| *Setter* | set_environment_custom_sky_rotation_degrees(value) | ++----------+----------------------------------------------------+ +| *Getter* | get_environment_custom_sky_rotation_degrees() | ++----------+----------------------------------------------------+ + +The rotation of the baked custom sky. + +---- + +.. _class_BakedLightmap_property_environment_min_light: + +- :ref:`Color` **environment_min_light** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+----------------------------------+ +| *Setter* | set_environment_min_light(value) | ++-----------+----------------------------------+ +| *Getter* | get_environment_min_light() | ++-----------+----------------------------------+ + +Minimum ambient light for all the lightmap texels. This doesn't take into account any occlusion from the scene's geometry, it simply ensures a minimum amount of light on all the lightmap texels. Can be used for artistic control on shadow color. + +---- + +.. _class_BakedLightmap_property_environment_mode: + +- :ref:`EnvironmentMode` **environment_mode** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_environment_mode(value) | ++-----------+-----------------------------+ +| *Getter* | get_environment_mode() | ++-----------+-----------------------------+ + +Decides which environment to use during baking. + +---- + +.. _class_BakedLightmap_property_extents: + +- :ref:`Vector3` **extents** + ++-----------+---------------------------+ +| *Default* | ``Vector3( 10, 10, 10 )`` | ++-----------+---------------------------+ +| *Setter* | set_extents(value) | ++-----------+---------------------------+ +| *Getter* | get_extents() | ++-----------+---------------------------+ + +Size of the baked lightmap. Only meshes inside this region will be included in the baked lightmap, also used as the bounds of the captured region for dynamic lighting. + +---- + +.. _class_BakedLightmap_property_image_path: + +- :ref:`String` **image_path** + ++----------+-----------------------+ +| *Setter* | set_image_path(value) | ++----------+-----------------------+ +| *Getter* | get_image_path() | ++----------+-----------------------+ + +Deprecated, in previous versions it determined the location where lightmaps were be saved. + +---- + +.. _class_BakedLightmap_property_light_data: + +- :ref:`BakedLightmapData` **light_data** + ++----------+-----------------------+ +| *Setter* | set_light_data(value) | ++----------+-----------------------+ +| *Getter* | get_light_data() | ++----------+-----------------------+ + +The calculated light data. + +---- + +.. _class_BakedLightmap_property_quality: + +- :ref:`BakeQuality` **quality** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_bake_quality(value) | ++-----------+-------------------------+ +| *Getter* | get_bake_quality() | ++-----------+-------------------------+ + +Determines the amount of samples per texel used in indrect light baking. The amount of samples for each quality level can be configured in the project settings. + +---- + +.. _class_BakedLightmap_property_use_color: + +- :ref:`bool` **use_color** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_use_color(value) | ++-----------+----------------------+ +| *Getter* | is_using_color() | ++-----------+----------------------+ + +Store full color values in the lightmap textures. When disabled, lightmap textures will store a single brightness channel. Can be disabled to reduce disk usage if the scene contains only white lights or you don't mind losing color information in indirect lighting. + +---- + +.. _class_BakedLightmap_property_use_denoiser: + +- :ref:`bool` **use_denoiser** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_use_denoiser(value) | ++-----------+-------------------------+ +| *Getter* | is_using_denoiser() | ++-----------+-------------------------+ + +When enabled, a lightmap denoiser will be used to reduce the noise inherent to Monte Carlo based global illumination. + +---- + +.. _class_BakedLightmap_property_use_hdr: + +- :ref:`bool` **use_hdr** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_use_hdr(value) | ++-----------+--------------------+ +| *Getter* | is_using_hdr() | ++-----------+--------------------+ + +If ``true``, stores the lightmap textures in a high dynamic range format (EXR). If ``false``, stores the lightmap texture in a low dynamic range PNG image. This can be set to ``false`` to reduce disk usage, but light values over 1.0 will be clamped and you may see banding caused by the reduced precision. + +**Note:** Setting :ref:`use_hdr` to ``true`` will decrease lightmap banding even when using the GLES2 backend or if :ref:`ProjectSettings.rendering/quality/depth/hdr` is ``false``. + +Method Descriptions +------------------- + +.. _class_BakedLightmap_method_bake: + +- :ref:`BakeError` **bake** **(** :ref:`Node` from_node=null, :ref:`String` data_save_path="" **)** + +Bakes the lightmap, scanning from the given ``from_node`` root and saves the resulting :ref:`BakedLightmapData` in ``data_save_path``. If no root node is provided, parent of this node will be used as root instead. If no save path is provided it will try to match the path from the current :ref:`light_data`. + +.. |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.)` diff --git a/classes/class_bakedlightmapdata.rst b/classes/class_bakedlightmapdata.rst new file mode 100644 index 0000000..a890bbb --- /dev/null +++ b/classes/class_bakedlightmapdata.rst @@ -0,0 +1,180 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BakedLightmapData.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BakedLightmapData: + +BakedLightmapData +================= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`AABB` | :ref:`bounds` | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`cell_space_transform` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`cell_subdiv` | ``1`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`energy` | ``1.0`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`interior` | ``false`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`octree` | ``PoolByteArray( )`` | ++-------------------------------------------+------------------------------------------------------------------------------------+-----------------------------------------------------+ + +Methods +------- + ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_user` **(** :ref:`NodePath` path, :ref:`Resource` lightmap, :ref:`int` lightmap_slice, :ref:`Rect2` lightmap_uv_rect, :ref:`int` instance **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_data` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_users` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_user_count` **(** **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`get_user_lightmap` **(** :ref:`int` user_idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_user_path` **(** :ref:`int` user_idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_BakedLightmapData_property_bounds: + +- :ref:`AABB` **bounds** + ++-----------+------------------------------+ +| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++-----------+------------------------------+ +| *Setter* | set_bounds(value) | ++-----------+------------------------------+ +| *Getter* | get_bounds() | ++-----------+------------------------------+ + +---- + +.. _class_BakedLightmapData_property_cell_space_transform: + +- :ref:`Transform` **cell_space_transform** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_cell_space_transform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_cell_space_transform() | ++-----------+-----------------------------------------------------+ + +---- + +.. _class_BakedLightmapData_property_cell_subdiv: + +- :ref:`int` **cell_subdiv** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_cell_subdiv(value) | ++-----------+------------------------+ +| *Getter* | get_cell_subdiv() | ++-----------+------------------------+ + +---- + +.. _class_BakedLightmapData_property_energy: + +- :ref:`float` **energy** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_energy(value) | ++-----------+-------------------+ +| *Getter* | get_energy() | ++-----------+-------------------+ + +Global energy multiplier for baked and dynamic capture objects. This can be changed at run-time without having to bake lightmaps again. + +To adjust only the energy of indirect lighting (without affecting direct lighting or emissive materials), adjust :ref:`BakedLightmap.bounce_indirect_energy` and bake lightmaps again. + +---- + +.. _class_BakedLightmapData_property_interior: + +- :ref:`bool` **interior** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_interior(value) | ++-----------+---------------------+ +| *Getter* | is_interior() | ++-----------+---------------------+ + +Controls whether dynamic capture objects receive environment lighting or not. + +---- + +.. _class_BakedLightmapData_property_octree: + +- :ref:`PoolByteArray` **octree** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_octree(value) | ++-----------+-----------------------+ +| *Getter* | get_octree() | ++-----------+-----------------------+ + +Method Descriptions +------------------- + +.. _class_BakedLightmapData_method_add_user: + +- void **add_user** **(** :ref:`NodePath` path, :ref:`Resource` lightmap, :ref:`int` lightmap_slice, :ref:`Rect2` lightmap_uv_rect, :ref:`int` instance **)** + +---- + +.. _class_BakedLightmapData_method_clear_data: + +- void **clear_data** **(** **)** + +---- + +.. _class_BakedLightmapData_method_clear_users: + +- void **clear_users** **(** **)** + +---- + +.. _class_BakedLightmapData_method_get_user_count: + +- :ref:`int` **get_user_count** **(** **)** |const| + +---- + +.. _class_BakedLightmapData_method_get_user_lightmap: + +- :ref:`Resource` **get_user_lightmap** **(** :ref:`int` user_idx **)** |const| + +---- + +.. _class_BakedLightmapData_method_get_user_path: + +- :ref:`NodePath` **get_user_path** **(** :ref:`int` user_idx **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_basebutton.rst b/classes/class_basebutton.rst new file mode 100644 index 0000000..8b7a00f --- /dev/null +++ b/classes/class_basebutton.rst @@ -0,0 +1,349 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BaseButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BaseButton: + +BaseButton +========== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`Button`, :ref:`LinkButton`, :ref:`TextureButton` + +Base class for different kinds of buttons. + +Description +----------- + +BaseButton is the abstract base class for buttons, so it shouldn't be used directly (it doesn't display anything). Other types of buttons inherit from it. + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`ActionMode` | :ref:`action_mode` | ``1`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`button_mask` | ``1`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | :ref:`enabled_focus_mode` | ``2`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`ButtonGroup` | :ref:`group` | | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`keep_pressed_outside` | ``false`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`ShortCut` | :ref:`shortcut` | | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`shortcut_in_tooltip` | ``true`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`toggle_mode` | ``false`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_pressed` **(** **)** |virtual| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_toggled` **(** :ref:`bool` button_pressed **)** |virtual| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`DrawMode` | :ref:`get_draw_mode` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_hovered` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_pressed_no_signal` **(** :ref:`bool` pressed **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_BaseButton_signal_button_down: + +- **button_down** **(** **)** + +Emitted when the button starts being held down. + +---- + +.. _class_BaseButton_signal_button_up: + +- **button_up** **(** **)** + +Emitted when the button stops being held down. + +---- + +.. _class_BaseButton_signal_pressed: + +- **pressed** **(** **)** + +Emitted when the button is toggled or pressed. This is on :ref:`button_down` if :ref:`action_mode` is :ref:`ACTION_MODE_BUTTON_PRESS` and on :ref:`button_up` otherwise. + +If you need to know the button's pressed state (and :ref:`toggle_mode` is active), use :ref:`toggled` instead. + +---- + +.. _class_BaseButton_signal_toggled: + +- **toggled** **(** :ref:`bool` button_pressed **)** + +Emitted when the button was just toggled between pressed and normal states (only if :ref:`toggle_mode` is active). The new state is contained in the ``button_pressed`` argument. + +Enumerations +------------ + +.. _enum_BaseButton_DrawMode: + +.. _class_BaseButton_constant_DRAW_NORMAL: + +.. _class_BaseButton_constant_DRAW_PRESSED: + +.. _class_BaseButton_constant_DRAW_HOVER: + +.. _class_BaseButton_constant_DRAW_DISABLED: + +.. _class_BaseButton_constant_DRAW_HOVER_PRESSED: + +enum **DrawMode**: + +- **DRAW_NORMAL** = **0** --- The normal state (i.e. not pressed, not hovered, not toggled and enabled) of buttons. + +- **DRAW_PRESSED** = **1** --- The state of buttons are pressed. + +- **DRAW_HOVER** = **2** --- The state of buttons are hovered. + +- **DRAW_DISABLED** = **3** --- The state of buttons are disabled. + +- **DRAW_HOVER_PRESSED** = **4** --- The state of buttons are both hovered and pressed. + +---- + +.. _enum_BaseButton_ActionMode: + +.. _class_BaseButton_constant_ACTION_MODE_BUTTON_PRESS: + +.. _class_BaseButton_constant_ACTION_MODE_BUTTON_RELEASE: + +enum **ActionMode**: + +- **ACTION_MODE_BUTTON_PRESS** = **0** --- Require just a press to consider the button clicked. + +- **ACTION_MODE_BUTTON_RELEASE** = **1** --- Require a press and a subsequent release before considering the button clicked. + +Property Descriptions +--------------------- + +.. _class_BaseButton_property_action_mode: + +- :ref:`ActionMode` **action_mode** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_action_mode(value) | ++-----------+------------------------+ +| *Getter* | get_action_mode() | ++-----------+------------------------+ + +Determines when the button is considered clicked, one of the :ref:`ActionMode` constants. + +---- + +.. _class_BaseButton_property_button_mask: + +- :ref:`int` **button_mask** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_button_mask(value) | ++-----------+------------------------+ +| *Getter* | get_button_mask() | ++-----------+------------------------+ + +Binary mask to choose which mouse buttons this button will respond to. + +To allow both left-click and right-click, use ``BUTTON_MASK_LEFT | BUTTON_MASK_RIGHT``. + +---- + +.. _class_BaseButton_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +If ``true``, the button is in disabled state and can't be clicked or toggled. + +---- + +.. _class_BaseButton_property_enabled_focus_mode: + +- :ref:`FocusMode` **enabled_focus_mode** + ++-----------+-------------------------------+ +| *Default* | ``2`` | ++-----------+-------------------------------+ +| *Setter* | set_enabled_focus_mode(value) | ++-----------+-------------------------------+ +| *Getter* | get_enabled_focus_mode() | ++-----------+-------------------------------+ + +*Deprecated.* This property has been deprecated due to redundancy and will be removed in Godot 4.0. This property no longer has any effect when set. Please use :ref:`Control.focus_mode` instead. + +---- + +.. _class_BaseButton_property_group: + +- :ref:`ButtonGroup` **group** + ++----------+-------------------------+ +| *Setter* | set_button_group(value) | ++----------+-------------------------+ +| *Getter* | get_button_group() | ++----------+-------------------------+ + +:ref:`ButtonGroup` associated to the button. + +---- + +.. _class_BaseButton_property_keep_pressed_outside: + +- :ref:`bool` **keep_pressed_outside** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_keep_pressed_outside(value) | ++-----------+---------------------------------+ +| *Getter* | is_keep_pressed_outside() | ++-----------+---------------------------------+ + +If ``true``, the button stays pressed when moving the cursor outside the button while pressing it. + +**Note:** This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value. + +---- + +.. _class_BaseButton_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the button's state is pressed. Means the button is pressed down or toggled (if :ref:`toggle_mode` is active). Only works if :ref:`toggle_mode` is ``true``. + +**Note:** Setting :ref:`pressed` will result in :ref:`toggled` to be emitted. If you want to change the pressed state without emitting that signal, use :ref:`set_pressed_no_signal`. + +---- + +.. _class_BaseButton_property_shortcut: + +- :ref:`ShortCut` **shortcut** + ++----------+---------------------+ +| *Setter* | set_shortcut(value) | ++----------+---------------------+ +| *Getter* | get_shortcut() | ++----------+---------------------+ + +:ref:`ShortCut` associated to the button. + +---- + +.. _class_BaseButton_property_shortcut_in_tooltip: + +- :ref:`bool` **shortcut_in_tooltip** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_shortcut_in_tooltip(value) | ++-----------+----------------------------------+ +| *Getter* | is_shortcut_in_tooltip_enabled() | ++-----------+----------------------------------+ + +If ``true``, the button will add information about its shortcut in the tooltip. + +---- + +.. _class_BaseButton_property_toggle_mode: + +- :ref:`bool` **toggle_mode** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_toggle_mode(value) | ++-----------+------------------------+ +| *Getter* | is_toggle_mode() | ++-----------+------------------------+ + +If ``true``, the button is in toggle mode. Makes the button flip state between pressed and unpressed each time its area is clicked. + +Method Descriptions +------------------- + +.. _class_BaseButton_method__pressed: + +- void **_pressed** **(** **)** |virtual| + +Called when the button is pressed. If you need to know the button's pressed state (and :ref:`toggle_mode` is active), use :ref:`_toggled` instead. + +---- + +.. _class_BaseButton_method__toggled: + +- void **_toggled** **(** :ref:`bool` button_pressed **)** |virtual| + +Called when the button is toggled (only if :ref:`toggle_mode` is active). + +---- + +.. _class_BaseButton_method_get_draw_mode: + +- :ref:`DrawMode` **get_draw_mode** **(** **)** |const| + +Returns the visual state used to draw the button. This is useful mainly when implementing your own draw code by either overriding _draw() or connecting to "draw" signal. The visual state of the button is defined by the :ref:`DrawMode` enum. + +---- + +.. _class_BaseButton_method_is_hovered: + +- :ref:`bool` **is_hovered** **(** **)** |const| + +Returns ``true`` if the mouse has entered the button and has not left it yet. + +---- + +.. _class_BaseButton_method_set_pressed_no_signal: + +- void **set_pressed_no_signal** **(** :ref:`bool` pressed **)** + +Changes the :ref:`pressed` state of the button, without emitting :ref:`toggled`. Use when you just want to change the state of the button without sending the pressed event (e.g. when initializing scene). Only works if :ref:`toggle_mode` is ``true``. + +**Note:** This method doesn't unpress other buttons in its button :ref:`group`. + +.. |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.)` diff --git a/classes/class_basis.rst b/classes/class_basis.rst new file mode 100644 index 0000000..de73b2a --- /dev/null +++ b/classes/class_basis.rst @@ -0,0 +1,333 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Basis.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Basis: + +Basis +===== + +3×3 matrix datatype. + +Description +----------- + +3×3 matrix used for 3D rotation and scale. Almost always used as an orthogonal basis for a Transform. + +Contains 3 vector fields X, Y and Z as its columns, which are typically interpreted as the local basis vectors of a transformation. For such use, it is composed of a scaling and a rotation matrix, in that order (M = R.S). + +Can also be accessed as array of 3D vectors. These vectors are normally orthogonal to each other, but are not necessarily normalized (due to scaling). + +For more information, read the "Matrices and transforms" documentation article. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/matrices_and_transforms` + +- :doc:`../tutorials/3d/using_transforms` + +- `Matrix Transform Demo `__ + +- `3D Platformer Demo `__ + +- `3D Voxel Demo `__ + +- `2.5D Demo `__ + +Properties +---------- + ++-------------------------------+----------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`x` | ``Vector3( 1, 0, 0 )`` | ++-------------------------------+----------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`y` | ``Vector3( 0, 1, 0 )`` | ++-------------------------------+----------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`z` | ``Vector3( 0, 0, 1 )`` | ++-------------------------------+----------------------------------+------------------------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`Basis` **(** :ref:`Quat` from **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` from **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`Basis` **(** :ref:`Vector3` x_axis, :ref:`Vector3` y_axis, :ref:`Vector3` z_axis **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`determinant` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_euler` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_orthogonal_index` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`get_rotation_quat` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_scale` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`inverse` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Basis` b, :ref:`float` epsilon=1e-05 **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`orthonormalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`scaled` **(** :ref:`Vector3` scale **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`slerp` **(** :ref:`Basis` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tdotx` **(** :ref:`Vector3` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tdoty` **(** :ref:`Vector3` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tdotz` **(** :ref:`Vector3` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`transposed` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`xform` **(** :ref:`Vector3` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`xform_inv` **(** :ref:`Vector3` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Basis_constant_IDENTITY: + +.. _class_Basis_constant_FLIP_X: + +.. _class_Basis_constant_FLIP_Y: + +.. _class_Basis_constant_FLIP_Z: + +- **IDENTITY** = **Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )** --- The identity basis, with no rotation or scaling applied. + +This is identical to calling ``Basis()`` without any parameters. This constant can be used to make your code clearer, and for consistency with C#. + +- **FLIP_X** = **Basis( -1, 0, 0, 0, 1, 0, 0, 0, 1 )** --- The basis that will flip something along the X axis when used in a transformation. + +- **FLIP_Y** = **Basis( 1, 0, 0, 0, -1, 0, 0, 0, 1 )** --- The basis that will flip something along the Y axis when used in a transformation. + +- **FLIP_Z** = **Basis( 1, 0, 0, 0, 1, 0, 0, 0, -1 )** --- The basis that will flip something along the Z axis when used in a transformation. + +Property Descriptions +--------------------- + +.. _class_Basis_property_x: + +- :ref:`Vector3` **x** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 0, 0 )`` | ++-----------+------------------------+ + +The basis matrix's X vector (column 0). Equivalent to array index ``0``. + +---- + +.. _class_Basis_property_y: + +- :ref:`Vector3` **y** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 1, 0 )`` | ++-----------+------------------------+ + +The basis matrix's Y vector (column 1). Equivalent to array index ``1``. + +---- + +.. _class_Basis_property_z: + +- :ref:`Vector3` **z** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 1 )`` | ++-----------+------------------------+ + +The basis matrix's Z vector (column 2). Equivalent to array index ``2``. + +Method Descriptions +------------------- + +.. _class_Basis_method_Basis: + +- :ref:`Basis` **Basis** **(** :ref:`Quat` from **)** + +Constructs a pure rotation basis matrix from the given quaternion. + +---- + +- :ref:`Basis` **Basis** **(** :ref:`Vector3` from **)** + +Constructs a pure rotation basis matrix from the given Euler angles (in the YXZ convention: when \*composing\*, first Y, then X, and Z last), given in the vector format as (X angle, Y angle, Z angle). + +Consider using the :ref:`Quat` constructor instead, which uses a quaternion instead of Euler angles. + +---- + +- :ref:`Basis` **Basis** **(** :ref:`Vector3` axis, :ref:`float` phi **)** + +Constructs a pure rotation basis matrix, rotated around the given ``axis`` by ``phi``, in radians. The axis must be a normalized vector. + +---- + +- :ref:`Basis` **Basis** **(** :ref:`Vector3` x_axis, :ref:`Vector3` y_axis, :ref:`Vector3` z_axis **)** + +Constructs a basis matrix from 3 axis vectors (matrix columns). + +---- + +.. _class_Basis_method_determinant: + +- :ref:`float` **determinant** **(** **)** + +Returns the determinant of the basis matrix. If the basis is uniformly scaled, its determinant is the square of the scale. + +A negative determinant means the basis has a negative scale. A zero determinant means the basis isn't invertible, and is usually considered invalid. + +---- + +.. _class_Basis_method_get_euler: + +- :ref:`Vector3` **get_euler** **(** **)** + +Returns the basis's rotation in the form of Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last). The returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). + +Consider using the :ref:`get_rotation_quat` method instead, which returns a :ref:`Quat` quaternion instead of Euler angles. + +---- + +.. _class_Basis_method_get_orthogonal_index: + +- :ref:`int` **get_orthogonal_index** **(** **)** + +This function considers a discretization of rotations into 24 points on unit sphere, lying along the vectors (x,y,z) with each component being either -1, 0, or 1, and returns the index of the point best representing the orientation of the object. It is mainly used by the :ref:`GridMap` editor. For further details, refer to the Godot source code. + +---- + +.. _class_Basis_method_get_rotation_quat: + +- :ref:`Quat` **get_rotation_quat** **(** **)** + +Returns the basis's rotation in the form of a quaternion. See :ref:`get_euler` if you need Euler angles, but keep in mind quaternions should generally be preferred to Euler angles. + +---- + +.. _class_Basis_method_get_scale: + +- :ref:`Vector3` **get_scale** **(** **)** + +Assuming that the matrix is the combination of a rotation and scaling, return the absolute value of scaling factors along each axis. + +---- + +.. _class_Basis_method_inverse: + +- :ref:`Basis` **inverse** **(** **)** + +Returns the inverse of the matrix. + +---- + +.. _class_Basis_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Basis` b, :ref:`float` epsilon=1e-05 **)** + +Returns ``true`` if this basis and ``b`` are approximately equal, by calling ``is_equal_approx`` on each component. + +**Note:** For complicated reasons, the epsilon argument is always discarded. Don't use the epsilon argument, it does nothing. + +---- + +.. _class_Basis_method_orthonormalized: + +- :ref:`Basis` **orthonormalized** **(** **)** + +Returns the orthonormalized version of the matrix (useful to call from time to time to avoid rounding error for orthogonal matrices). This performs a Gram-Schmidt orthonormalization on the basis of the matrix. + +---- + +.. _class_Basis_method_rotated: + +- :ref:`Basis` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** + +Introduce an additional rotation around the given axis by phi (radians). The axis must be a normalized vector. + +---- + +.. _class_Basis_method_scaled: + +- :ref:`Basis` **scaled** **(** :ref:`Vector3` scale **)** + +Introduce an additional scaling specified by the given 3D scaling factor. + +---- + +.. _class_Basis_method_slerp: + +- :ref:`Basis` **slerp** **(** :ref:`Basis` to, :ref:`float` weight **)** + +Assuming that the matrix is a proper rotation matrix, slerp performs a spherical-linear interpolation with another rotation matrix. + +---- + +.. _class_Basis_method_tdotx: + +- :ref:`float` **tdotx** **(** :ref:`Vector3` with **)** + +Transposed dot product with the X axis of the matrix. + +---- + +.. _class_Basis_method_tdoty: + +- :ref:`float` **tdoty** **(** :ref:`Vector3` with **)** + +Transposed dot product with the Y axis of the matrix. + +---- + +.. _class_Basis_method_tdotz: + +- :ref:`float` **tdotz** **(** :ref:`Vector3` with **)** + +Transposed dot product with the Z axis of the matrix. + +---- + +.. _class_Basis_method_transposed: + +- :ref:`Basis` **transposed** **(** **)** + +Returns the transposed version of the matrix. + +---- + +.. _class_Basis_method_xform: + +- :ref:`Vector3` **xform** **(** :ref:`Vector3` v **)** + +Returns a vector transformed (multiplied) by the matrix. + +---- + +.. _class_Basis_method_xform_inv: + +- :ref:`Vector3` **xform_inv** **(** :ref:`Vector3` v **)** + +Returns a vector transformed (multiplied) by the transposed basis matrix. + +**Note:** This results in a multiplication by the inverse of the matrix only if it represents a rotation-reflection. + +.. |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.)` diff --git a/classes/class_bitmap.rst b/classes/class_bitmap.rst new file mode 100644 index 0000000..a306e69 --- /dev/null +++ b/classes/class_bitmap.rst @@ -0,0 +1,117 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BitMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BitMap: + +BitMap +====== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Boolean matrix. + +Description +----------- + +A two-dimensional array of boolean values, can be used to efficiently store a binary matrix (every matrix element takes only one bit) and query the values using natural cartesian coordinates. + +Methods +------- + ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create` **(** :ref:`Vector2` size **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from_image_alpha` **(** :ref:`Image` image, :ref:`float` threshold=0.1 **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_bit` **(** :ref:`Vector2` position **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_size` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_true_bit_count` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`grow_mask` **(** :ref:`int` pixels, :ref:`Rect2` rect **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`opaque_to_polygons` **(** :ref:`Rect2` rect, :ref:`float` epsilon=2.0 **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bit` **(** :ref:`Vector2` position, :ref:`bool` bit **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bit_rect` **(** :ref:`Rect2` rect, :ref:`bool` bit **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_BitMap_method_create: + +- void **create** **(** :ref:`Vector2` size **)** + +Creates a bitmap with the specified size, filled with ``false``. + +---- + +.. _class_BitMap_method_create_from_image_alpha: + +- void **create_from_image_alpha** **(** :ref:`Image` image, :ref:`float` threshold=0.1 **)** + +Creates a bitmap that matches the given image dimensions, every element of the bitmap is set to ``false`` if the alpha value of the image at that position is equal to ``threshold`` or less, and ``true`` in other case. + +---- + +.. _class_BitMap_method_get_bit: + +- :ref:`bool` **get_bit** **(** :ref:`Vector2` position **)** |const| + +Returns bitmap's value at the specified position. + +---- + +.. _class_BitMap_method_get_size: + +- :ref:`Vector2` **get_size** **(** **)** |const| + +Returns bitmap's dimensions. + +---- + +.. _class_BitMap_method_get_true_bit_count: + +- :ref:`int` **get_true_bit_count** **(** **)** |const| + +Returns the amount of bitmap elements that are set to ``true``. + +---- + +.. _class_BitMap_method_grow_mask: + +- void **grow_mask** **(** :ref:`int` pixels, :ref:`Rect2` rect **)** + +Applies morphological dilation or erosion to the bitmap. If ``pixels`` is positive, dilation is applied to the bitmap. If ``pixels`` is negative, erosion is applied to the bitmap. ``rect`` defines the area where the morphological operation is applied. Pixels located outside the ``rect`` are unaffected by :ref:`grow_mask`. + +---- + +.. _class_BitMap_method_opaque_to_polygons: + +- :ref:`Array` **opaque_to_polygons** **(** :ref:`Rect2` rect, :ref:`float` epsilon=2.0 **)** |const| + +---- + +.. _class_BitMap_method_set_bit: + +- void **set_bit** **(** :ref:`Vector2` position, :ref:`bool` bit **)** + +Sets the bitmap's element at the specified position, to the specified value. + +---- + +.. _class_BitMap_method_set_bit_rect: + +- void **set_bit_rect** **(** :ref:`Rect2` rect, :ref:`bool` bit **)** + +Sets a rectangular portion of the bitmap to the specified value. + +.. |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.)` diff --git a/classes/class_bitmapfont.rst b/classes/class_bitmapfont.rst new file mode 100644 index 0000000..615b91c --- /dev/null +++ b/classes/class_bitmapfont.rst @@ -0,0 +1,187 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BitmapFont.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BitmapFont: + +BitmapFont +========== + +**Inherits:** :ref:`Font` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Renders text using fonts under the `BMFont `__ format. + +Handles files with the ``.fnt`` extension. + +Description +----------- + +Renders text using ``*.fnt`` fonts containing texture atlases. Supports distance fields. For using vector font files like TTF directly, see :ref:`DynamicFont`. + +Properties +---------- + ++-------------------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`ascent` | ``0.0`` | ++-------------------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`distance_field` | ``false`` | ++-------------------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`BitmapFont` | :ref:`fallback` | | ++-------------------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`height` | ``1.0`` | ++-------------------------------------+-----------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_char` **(** :ref:`int` character, :ref:`int` texture, :ref:`Rect2` rect, :ref:`Vector2` align=Vector2( 0, 0 ), :ref:`float` advance=-1 **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_kerning_pair` **(** :ref:`int` char_a, :ref:`int` char_b, :ref:`int` kerning **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_texture` **(** :ref:`Texture` texture **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_from_fnt` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_kerning_pair` **(** :ref:`int` char_a, :ref:`int` char_b **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_texture` **(** :ref:`int` idx **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_texture_count` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_BitmapFont_property_ascent: + +- :ref:`float` **ascent** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_ascent(value) | ++-----------+-------------------+ +| *Getter* | get_ascent() | ++-----------+-------------------+ + +Ascent (number of pixels above the baseline). + +---- + +.. _class_BitmapFont_property_distance_field: + +- :ref:`bool` **distance_field** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_distance_field_hint(value) | ++-----------+--------------------------------+ +| *Getter* | is_distance_field_hint() | ++-----------+--------------------------------+ + +If ``true``, distance field hint is enabled. + +---- + +.. _class_BitmapFont_property_fallback: + +- :ref:`BitmapFont` **fallback** + ++----------+---------------------+ +| *Setter* | set_fallback(value) | ++----------+---------------------+ +| *Getter* | get_fallback() | ++----------+---------------------+ + +The fallback font. + +---- + +.. _class_BitmapFont_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +Total font height (ascent plus descent) in pixels. + +Method Descriptions +------------------- + +.. _class_BitmapFont_method_add_char: + +- void **add_char** **(** :ref:`int` character, :ref:`int` texture, :ref:`Rect2` rect, :ref:`Vector2` align=Vector2( 0, 0 ), :ref:`float` advance=-1 **)** + +Adds a character to the font, where ``character`` is the Unicode value, ``texture`` is the texture index, ``rect`` is the region in the texture (in pixels!), ``align`` is the (optional) alignment for the character and ``advance`` is the (optional) advance. + +---- + +.. _class_BitmapFont_method_add_kerning_pair: + +- void **add_kerning_pair** **(** :ref:`int` char_a, :ref:`int` char_b, :ref:`int` kerning **)** + +Adds a kerning pair to the ``BitmapFont`` as a difference. Kerning pairs are special cases where a typeface advance is determined by the next character. + +---- + +.. _class_BitmapFont_method_add_texture: + +- void **add_texture** **(** :ref:`Texture` texture **)** + +Adds a texture to the ``BitmapFont``. + +---- + +.. _class_BitmapFont_method_clear: + +- void **clear** **(** **)** + +Clears all the font data and settings. + +---- + +.. _class_BitmapFont_method_create_from_fnt: + +- :ref:`Error` **create_from_fnt** **(** :ref:`String` path **)** + +Creates a BitmapFont from the ``*.fnt`` file at ``path``. + +---- + +.. _class_BitmapFont_method_get_kerning_pair: + +- :ref:`int` **get_kerning_pair** **(** :ref:`int` char_a, :ref:`int` char_b **)** |const| + +Returns a kerning pair as a difference. + +---- + +.. _class_BitmapFont_method_get_texture: + +- :ref:`Texture` **get_texture** **(** :ref:`int` idx **)** |const| + +Returns the font atlas texture at index ``idx``. + +---- + +.. _class_BitmapFont_method_get_texture_count: + +- :ref:`int` **get_texture_count** **(** **)** |const| + +Returns the number of textures in the BitmapFont atlas. + +.. |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.)` diff --git a/classes/class_bone2d.rst b/classes/class_bone2d.rst new file mode 100644 index 0000000..8c19cfa --- /dev/null +++ b/classes/class_bone2d.rst @@ -0,0 +1,107 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Bone2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Bone2D: + +Bone2D +====== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Joint used with :ref:`Skeleton2D` to control and animate other nodes. + +Description +----------- + +Use a hierarchy of ``Bone2D`` bound to a :ref:`Skeleton2D` to control, and animate other :ref:`Node2D` nodes. + +You can use ``Bone2D`` and ``Skeleton2D`` nodes to animate 2D meshes created with the Polygon 2D UV editor. + +Each bone has a :ref:`rest` transform that you can reset to with :ref:`apply_rest`. These rest poses are relative to the bone's parent. + +If in the editor, you can set the rest pose of an entire skeleton using a menu option, from the code, you need to iterate over the bones to set their individual rest poses. + +Properties +---------- + ++---------------------------------------+-------------------------------------------------------------+-------------------------------------+ +| :ref:`float` | :ref:`default_length` | ``16.0`` | ++---------------------------------------+-------------------------------------------------------------+-------------------------------------+ +| :ref:`Transform2D` | :ref:`rest` | ``Transform2D( 0, 0, 0, 0, 0, 0 )`` | ++---------------------------------------+-------------------------------------------------------------+-------------------------------------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------+ +| void | :ref:`apply_rest` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_index_in_skeleton` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_skeleton_rest` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Bone2D_property_default_length: + +- :ref:`float` **default_length** + ++-----------+---------------------------+ +| *Default* | ``16.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_length(value) | ++-----------+---------------------------+ +| *Getter* | get_default_length() | ++-----------+---------------------------+ + +Length of the bone's representation drawn in the editor's viewport in pixels. + +---- + +.. _class_Bone2D_property_rest: + +- :ref:`Transform2D` **rest** + ++-----------+-------------------------------------+ +| *Default* | ``Transform2D( 0, 0, 0, 0, 0, 0 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_rest(value) | ++-----------+-------------------------------------+ +| *Getter* | get_rest() | ++-----------+-------------------------------------+ + +Rest transform of the bone. You can reset the node's transforms to this value using :ref:`apply_rest`. + +Method Descriptions +------------------- + +.. _class_Bone2D_method_apply_rest: + +- void **apply_rest** **(** **)** + +Stores the node's current transforms in :ref:`rest`. + +---- + +.. _class_Bone2D_method_get_index_in_skeleton: + +- :ref:`int` **get_index_in_skeleton** **(** **)** |const| + +Returns the node's index as part of the entire skeleton. See :ref:`Skeleton2D`. + +---- + +.. _class_Bone2D_method_get_skeleton_rest: + +- :ref:`Transform2D` **get_skeleton_rest** **(** **)** |const| + +Returns the node's :ref:`rest` ``Transform2D`` if it doesn't have a parent, or its rest pose relative to its parent. + +.. |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.)` diff --git a/classes/class_boneattachment.rst b/classes/class_boneattachment.rst new file mode 100644 index 0000000..a01c45e --- /dev/null +++ b/classes/class_boneattachment.rst @@ -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 BoneAttachment.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BoneAttachment: + +BoneAttachment +============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A node that will attach to a bone. + +Description +----------- + +This node must be the child of a :ref:`Skeleton` node. You can then select a bone for this node to attach to. The BoneAttachment node will copy the transform of the selected bone. + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------+--------+ +| :ref:`String` | :ref:`bone_name` | ``""`` | ++-----------------------------+-----------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_BoneAttachment_property_bone_name: + +- :ref:`String` **bone_name** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_bone_name(value) | ++-----------+----------------------+ +| *Getter* | get_bone_name() | ++-----------+----------------------+ + +The name of the attached bone. + +.. |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.)` diff --git a/classes/class_bool.rst b/classes/class_bool.rst new file mode 100644 index 0000000..4bafa4e --- /dev/null +++ b/classes/class_bool.rst @@ -0,0 +1,93 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the bool.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_bool: + +bool +==== + +Boolean built-in type. + +Description +----------- + +Boolean is a built-in type. There are two boolean values: ``true`` and ``false``. You can think of it as a switch with on or off (1 or 0) setting. Booleans are used in programming for logic in condition statements, like ``if`` statements. + +Booleans can be directly used in ``if`` statements. The code below demonstrates this on the ``if can_shoot:`` line. You don't need to use ``== true``, you only need ``if can_shoot:``. Similarly, use ``if not can_shoot:`` rather than ``== false``. + +:: + + var can_shoot = true + + func shoot(): + if can_shoot: + pass # Perform shooting actions here. + +The following code will only create a bullet if both conditions are met: action "shoot" is pressed and if ``can_shoot`` is ``true``. + +**Note:** ``Input.is_action_pressed("shoot")`` is also a boolean that is ``true`` when "shoot" is pressed and ``false`` when "shoot" isn't pressed. + +:: + + var can_shoot = true + + func shoot(): + if can_shoot and Input.is_action_pressed("shoot"): + create_bullet() + +The following code will set ``can_shoot`` to ``false`` and start a timer. This will prevent player from shooting until the timer runs out. Next ``can_shoot`` will be set to ``true`` again allowing player to shoot once again. + +:: + + var can_shoot = true + onready var cool_down = $CoolDownTimer + + func shoot(): + if can_shoot and Input.is_action_pressed("shoot"): + create_bullet() + can_shoot = false + cool_down.start() + + func _on_CoolDownTimer_timeout(): + can_shoot = true + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`bool` **(** :ref:`int` from **)** | ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`bool` **(** :ref:`float` from **)** | ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`bool` **(** :ref:`String` from **)** | ++-------------------------+----------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_bool_method_bool: + +- :ref:`bool` **bool** **(** :ref:`int` from **)** + +Cast an :ref:`int` value to a boolean value, this method will return ``false`` if ``0`` is passed in, and ``true`` for all other ints. + +---- + +- :ref:`bool` **bool** **(** :ref:`float` from **)** + +Cast a :ref:`float` value to a boolean value, this method will return ``false`` if ``0.0`` is passed in, and ``true`` for all other floats. + +---- + +- :ref:`bool` **bool** **(** :ref:`String` from **)** + +Cast a :ref:`String` value to a boolean value, this method will return ``false`` if ``""`` is passed in, and ``true`` for all non-empty strings. + +Examples: ``bool("False")`` returns ``true``, ``bool("")`` returns ``false``. + +.. |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.)` diff --git a/classes/class_boxcontainer.rst b/classes/class_boxcontainer.rst new file mode 100644 index 0000000..3f402e2 --- /dev/null +++ b/classes/class_boxcontainer.rst @@ -0,0 +1,86 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the BoxContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BoxContainer: + +BoxContainer +============ + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ColorPicker`, :ref:`HBoxContainer`, :ref:`VBoxContainer` + +Base class for box containers. + +Description +----------- + +Arranges child controls vertically or horizontally, and rearranges the controls automatically when their minimum size changes. + +Properties +---------- + ++-----------------------------------------------+---------------------------------------------------------+---------------------------+ +| :ref:`AlignMode` | :ref:`alignment` | ``0`` | ++-----------------------------------------------+---------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``1`` *(parent override)* | ++-----------------------------------------------+---------------------------------------------------------+---------------------------+ + +Methods +------- + ++------+---------------------------------------------------------------------------------------------------+ +| void | :ref:`add_spacer` **(** :ref:`bool` begin **)** | ++------+---------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_BoxContainer_AlignMode: + +.. _class_BoxContainer_constant_ALIGN_BEGIN: + +.. _class_BoxContainer_constant_ALIGN_CENTER: + +.. _class_BoxContainer_constant_ALIGN_END: + +enum **AlignMode**: + +- **ALIGN_BEGIN** = **0** --- Aligns children with the beginning of the container. + +- **ALIGN_CENTER** = **1** --- Aligns children with the center of the container. + +- **ALIGN_END** = **2** --- Aligns children with the end of the container. + +Property Descriptions +--------------------- + +.. _class_BoxContainer_property_alignment: + +- :ref:`AlignMode` **alignment** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_alignment(value) | ++-----------+----------------------+ +| *Getter* | get_alignment() | ++-----------+----------------------+ + +The alignment of the container's children (must be one of :ref:`ALIGN_BEGIN`, :ref:`ALIGN_CENTER` or :ref:`ALIGN_END`). + +Method Descriptions +------------------- + +.. _class_BoxContainer_method_add_spacer: + +- void **add_spacer** **(** :ref:`bool` begin **)** + +Adds a control to the box as a spacer. If ``true``, ``begin`` will insert the spacer control in front of other children. + +.. |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.)` diff --git a/classes/class_boxshape.rst b/classes/class_boxshape.rst new file mode 100644 index 0000000..a9659e3 --- /dev/null +++ b/classes/class_boxshape.rst @@ -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 BoxShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_BoxShape: + +BoxShape +======== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Box shape resource. + +Description +----------- + +3D box shape that can be a child of a :ref:`PhysicsBody` or :ref:`Area`. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +Properties +---------- + ++-------------------------------+-------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`extents` | ``Vector3( 1, 1, 1 )`` | ++-------------------------------+-------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_BoxShape_property_extents: + +- :ref:`Vector3` **extents** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_extents(value) | ++-----------+------------------------+ +| *Getter* | get_extents() | ++-----------+------------------------+ + +The box's half extents. The width, height and depth of this shape is twice the half extents. + +.. |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.)` diff --git a/classes/class_button.rst b/classes/class_button.rst new file mode 100644 index 0000000..ca215bc --- /dev/null +++ b/classes/class_button.rst @@ -0,0 +1,334 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Button.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Button: + +Button +====== + +**Inherits:** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`CheckBox`, :ref:`CheckButton`, :ref:`ColorPickerButton`, :ref:`MenuButton`, :ref:`OptionButton`, :ref:`ToolButton` + +Standard themed Button. + +Description +----------- + +Button is the standard themed button. It can contain text and an icon, and will display them according to the current :ref:`Theme`. + +**Example of creating a button and assigning an action when pressed by code:** + +:: + + func _ready(): + var button = Button.new() + button.text = "Click me" + button.connect("pressed", self, "_button_pressed") + add_child(button) + + func _button_pressed(): + print("Hello world!") + +Buttons (like all Control nodes) can also be created in the editor, but some situations may require creating them from code. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +**Note:** Buttons do not interpret touch input and therefore don't support multitouch, since mouse emulation can only press one button at a given time. Use :ref:`TouchScreenButton` for buttons that trigger gameplay movement or actions, as :ref:`TouchScreenButton` supports multitouch. + +Tutorials +--------- + +- `2D Dodge The Creeps Demo `__ + +- `OS Test Demo `__ + +Properties +---------- + ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`TextAlign` | :ref:`align` | ``1`` | ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`clip_text` | ``false`` | ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`expand_icon` | ``false`` | ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`flat` | ``false`` | ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`icon` | | ++-----------------------------------------+-------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`text` | ``""`` | ++-----------------------------------------+-------------------------------------------------------+-----------+ + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``2`` | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+--------------------------------------------------------------------------+----------------------------------+ + +Enumerations +------------ + +.. _enum_Button_TextAlign: + +.. _class_Button_constant_ALIGN_LEFT: + +.. _class_Button_constant_ALIGN_CENTER: + +.. _class_Button_constant_ALIGN_RIGHT: + +enum **TextAlign**: + +- **ALIGN_LEFT** = **0** --- Align the text to the left. + +- **ALIGN_CENTER** = **1** --- Align the text to the center. + +- **ALIGN_RIGHT** = **2** --- Align the text to the right. + +Property Descriptions +--------------------- + +.. _class_Button_property_align: + +- :ref:`TextAlign` **align** + ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_text_align(value) | ++-----------+-----------------------+ +| *Getter* | get_text_align() | ++-----------+-----------------------+ + +Text alignment policy for the button's text, use one of the :ref:`TextAlign` constants. + +---- + +.. _class_Button_property_clip_text: + +- :ref:`bool` **clip_text** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_clip_text(value) | ++-----------+----------------------+ +| *Getter* | get_clip_text() | ++-----------+----------------------+ + +When this property is enabled, text that is too large to fit the button is clipped, when disabled the Button will always be wide enough to hold the text. + +---- + +.. _class_Button_property_expand_icon: + +- :ref:`bool` **expand_icon** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_expand_icon(value) | ++-----------+------------------------+ +| *Getter* | is_expand_icon() | ++-----------+------------------------+ + +When enabled, the button's icon will expand/shrink to fit the button's size while keeping its aspect. + +---- + +.. _class_Button_property_flat: + +- :ref:`bool` **flat** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flat(value) | ++-----------+-----------------+ +| *Getter* | is_flat() | ++-----------+-----------------+ + +Flat buttons don't display decoration. + +---- + +.. _class_Button_property_icon: + +- :ref:`Texture` **icon** + ++----------+------------------------+ +| *Setter* | set_button_icon(value) | ++----------+------------------------+ +| *Getter* | get_button_icon() | ++----------+------------------------+ + +Button's icon, if text is present the icon will be placed before the text. + +To edit margin and spacing of the icon, use ``hseparation`` theme property of ``Button`` and ``content_margin_*`` properties of the used :ref:`StyleBox`\ es. + +---- + +.. _class_Button_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The button's text that will be displayed inside the button's area. + +Theme Property Descriptions +--------------------------- + +.. _class_Button_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the ``Button``. + +---- + +.. _class_Button_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +Text :ref:`Color` used when the ``Button`` is disabled. + +---- + +.. _class_Button_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``Button`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_Button_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``Button`` is being hovered. + +---- + +.. _class_Button_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``Button`` is being pressed. + +---- + +.. _class_Button_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The horizontal space between ``Button``'s icon and text. + +---- + +.. _class_Button_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``Button``'s text. + +---- + +.. _class_Button_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +:ref:`StyleBox` used when the ``Button`` is disabled. + +---- + +.. _class_Button_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``Button`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +---- + +.. _class_Button_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` used when the ``Button`` is being hovered. + +---- + +.. _class_Button_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default :ref:`StyleBox` for the ``Button``. + +---- + +.. _class_Button_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +:ref:`StyleBox` used when the ``Button`` is being pressed. + +.. |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.)` diff --git a/classes/class_buttongroup.rst b/classes/class_buttongroup.rst new file mode 100644 index 0000000..e07e109 --- /dev/null +++ b/classes/class_buttongroup.rst @@ -0,0 +1,67 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ButtonGroup.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ButtonGroup: + +ButtonGroup +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Group of Buttons. + +Description +----------- + +Group of :ref:`Button`. All direct and indirect children buttons become radios. Only one allows being pressed. + +:ref:`BaseButton.toggle_mode` should be ``true``. + +Properties +---------- + ++-------------------------+-------------------------+------------------------------+ +| :ref:`bool` | resource_local_to_scene | ``true`` *(parent override)* | ++-------------------------+-------------------------+------------------------------+ + +Methods +------- + ++-------------------------------------+------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_buttons` **(** **)** | ++-------------------------------------+------------------------------------------------------------------------------------+ +| :ref:`BaseButton` | :ref:`get_pressed_button` **(** **)** | ++-------------------------------------+------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ButtonGroup_signal_pressed: + +- **pressed** **(** :ref:`Object` button **)** + +Emitted when one of the buttons of the group is pressed. + +Method Descriptions +------------------- + +.. _class_ButtonGroup_method_get_buttons: + +- :ref:`Array` **get_buttons** **(** **)** + +Returns an :ref:`Array` of :ref:`Button`\ s who have this as their ``ButtonGroup`` (see :ref:`BaseButton.group`). + +---- + +.. _class_ButtonGroup_method_get_pressed_button: + +- :ref:`BaseButton` **get_pressed_button** **(** **)** + +Returns the current pressed button. + +.. |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.)` diff --git a/classes/class_camera.rst b/classes/class_camera.rst new file mode 100644 index 0000000..124bcec --- /dev/null +++ b/classes/class_camera.rst @@ -0,0 +1,508 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Camera.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Camera: + +Camera +====== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ARVRCamera`, :ref:`ClippedCamera`, :ref:`InterpolatedCamera` + +Camera node, displays from a point of view. + +Description +----------- + +Camera is a special node that displays what is visible from its current location. Cameras register themselves in the nearest :ref:`Viewport` node (when ascending the tree). Only one camera can be active per viewport. If no viewport is available ascending the tree, the camera will register in the global viewport. In other words, a camera just provides 3D display capabilities to a :ref:`Viewport`, and, without one, a scene registered in that :ref:`Viewport` (or higher viewports) can't be displayed. + +Tutorials +--------- + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`cull_mask` | ``1048575`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`current` | ``false`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`DopplerTracking` | :ref:`doppler_tracking` | ``0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`Environment` | :ref:`environment` | | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`far` | ``100.0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`fov` | ``70.0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`frustum_offset` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`h_offset` | ``0.0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`KeepAspect` | :ref:`keep_aspect` | ``1`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`near` | ``0.05`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`Projection` | :ref:`projection` | ``0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`size` | ``1.0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`v_offset` | ``0.0`` | ++-----------------------------------------------------+-----------------------------------------------------------------+---------------------+ + +Methods +------- + ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_current` **(** :ref:`bool` enable_next=true **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_camera_rid` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_camera_transform` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_cull_mask_bit` **(** :ref:`int` layer **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_frustum` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_position_behind` **(** :ref:`Vector3` world_point **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_current` **(** **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project_local_ray_normal` **(** :ref:`Vector2` screen_point **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project_position` **(** :ref:`Vector2` screen_point, :ref:`float` z_depth **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project_ray_normal` **(** :ref:`Vector2` screen_point **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project_ray_origin` **(** :ref:`Vector2` screen_point **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cull_mask_bit` **(** :ref:`int` layer, :ref:`bool` enable **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_frustum` **(** :ref:`float` size, :ref:`Vector2` offset, :ref:`float` z_near, :ref:`float` z_far **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_orthogonal` **(** :ref:`float` size, :ref:`float` z_near, :ref:`float` z_far **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_perspective` **(** :ref:`float` fov, :ref:`float` z_near, :ref:`float` z_far **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`unproject_position` **(** :ref:`Vector3` world_point **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Camera_Projection: + +.. _class_Camera_constant_PROJECTION_PERSPECTIVE: + +.. _class_Camera_constant_PROJECTION_ORTHOGONAL: + +.. _class_Camera_constant_PROJECTION_FRUSTUM: + +enum **Projection**: + +- **PROJECTION_PERSPECTIVE** = **0** --- Perspective projection. Objects on the screen becomes smaller when they are far away. + +- **PROJECTION_ORTHOGONAL** = **1** --- Orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. + +- **PROJECTION_FRUSTUM** = **2** --- Frustum projection. This mode allows adjusting :ref:`frustum_offset` to create "tilted frustum" effects. + +---- + +.. _enum_Camera_KeepAspect: + +.. _class_Camera_constant_KEEP_WIDTH: + +.. _class_Camera_constant_KEEP_HEIGHT: + +enum **KeepAspect**: + +- **KEEP_WIDTH** = **0** --- Preserves the horizontal aspect ratio; also known as Vert- scaling. This is usually the best option for projects running in portrait mode, as taller aspect ratios will benefit from a wider vertical FOV. + +- **KEEP_HEIGHT** = **1** --- Preserves the vertical aspect ratio; also known as Hor+ scaling. This is usually the best option for projects running in landscape mode, as wider aspect ratios will automatically benefit from a wider horizontal FOV. + +---- + +.. _enum_Camera_DopplerTracking: + +.. _class_Camera_constant_DOPPLER_TRACKING_DISABLED: + +.. _class_Camera_constant_DOPPLER_TRACKING_IDLE_STEP: + +.. _class_Camera_constant_DOPPLER_TRACKING_PHYSICS_STEP: + +enum **DopplerTracking**: + +- **DOPPLER_TRACKING_DISABLED** = **0** --- Disables `Doppler effect `__ simulation (default). + +- **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Simulate `Doppler effect `__ by tracking positions of objects that are changed in ``_process``. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's ``pitch shift``). + +- **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Simulate `Doppler effect `__ by tracking positions of objects that are changed in ``_physics_process``. Changes in the relative velocity of this camera compared to those objects affect how Audio is perceived (changing the Audio's ``pitch shift``). + +Property Descriptions +--------------------- + +.. _class_Camera_property_cull_mask: + +- :ref:`int` **cull_mask** + ++-----------+----------------------+ +| *Default* | ``1048575`` | ++-----------+----------------------+ +| *Setter* | set_cull_mask(value) | ++-----------+----------------------+ +| *Getter* | get_cull_mask() | ++-----------+----------------------+ + +The culling mask that describes which 3D render layers are rendered by this camera. + +---- + +.. _class_Camera_property_current: + +- :ref:`bool` **current** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_current(value) | ++-----------+--------------------+ +| *Getter* | is_current() | ++-----------+--------------------+ + +If ``true``, the ancestor :ref:`Viewport` is currently using this camera. + +---- + +.. _class_Camera_property_doppler_tracking: + +- :ref:`DopplerTracking` **doppler_tracking** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_doppler_tracking(value) | ++-----------+-----------------------------+ +| *Getter* | get_doppler_tracking() | ++-----------+-----------------------------+ + +If not :ref:`DOPPLER_TRACKING_DISABLED`, this camera will simulate the `Doppler effect `__ for objects changed in particular ``_process`` methods. The Doppler effect is only simulated for :ref:`AudioStreamPlayer3D` nodes that have :ref:`AudioStreamPlayer3D.doppler_tracking` set to a value other than :ref:`AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED`. + +**Note:** To toggle the Doppler effect preview in the editor, use the Perspective menu in the top-left corner of the 3D viewport and toggle **Enable Doppler**. + +---- + +.. _class_Camera_property_environment: + +- :ref:`Environment` **environment** + ++----------+------------------------+ +| *Setter* | set_environment(value) | ++----------+------------------------+ +| *Getter* | get_environment() | ++----------+------------------------+ + +The :ref:`Environment` to use for this camera. + +---- + +.. _class_Camera_property_far: + +- :ref:`float` **far** + ++-----------+-----------------+ +| *Default* | ``100.0`` | ++-----------+-----------------+ +| *Setter* | set_zfar(value) | ++-----------+-----------------+ +| *Getter* | get_zfar() | ++-----------+-----------------+ + +The distance to the far culling boundary for this camera relative to its local Z axis. + +---- + +.. _class_Camera_property_fov: + +- :ref:`float` **fov** + ++-----------+----------------+ +| *Default* | ``70.0`` | ++-----------+----------------+ +| *Setter* | set_fov(value) | ++-----------+----------------+ +| *Getter* | get_fov() | ++-----------+----------------+ + +The camera's field of view angle (in degrees). Only applicable in perspective mode. Since :ref:`keep_aspect` locks one axis, ``fov`` sets the other axis' field of view angle. + +For reference, the default vertical field of view value (``70.0``) is equivalent to a horizontal FOV of: + +- ~86.07 degrees in a 4:3 viewport + +- ~96.50 degrees in a 16:10 viewport + +- ~102.45 degrees in a 16:9 viewport + +- ~117.06 degrees in a 21:9 viewport + +---- + +.. _class_Camera_property_frustum_offset: + +- :ref:`Vector2` **frustum_offset** + ++-----------+---------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------------+ +| *Setter* | set_frustum_offset(value) | ++-----------+---------------------------+ +| *Getter* | get_frustum_offset() | ++-----------+---------------------------+ + +The camera's frustum offset. This can be changed from the default to create "tilted frustum" effects such as `Y-shearing `__. + +---- + +.. _class_Camera_property_h_offset: + +- :ref:`float` **h_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_h_offset(value) | ++-----------+---------------------+ +| *Getter* | get_h_offset() | ++-----------+---------------------+ + +The horizontal (X) offset of the camera viewport. + +---- + +.. _class_Camera_property_keep_aspect: + +- :ref:`KeepAspect` **keep_aspect** + ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_keep_aspect_mode(value) | ++-----------+-----------------------------+ +| *Getter* | get_keep_aspect_mode() | ++-----------+-----------------------------+ + +The axis to lock during :ref:`fov`/:ref:`size` adjustments. Can be either :ref:`KEEP_WIDTH` or :ref:`KEEP_HEIGHT`. + +---- + +.. _class_Camera_property_near: + +- :ref:`float` **near** + ++-----------+------------------+ +| *Default* | ``0.05`` | ++-----------+------------------+ +| *Setter* | set_znear(value) | ++-----------+------------------+ +| *Getter* | get_znear() | ++-----------+------------------+ + +The distance to the near culling boundary for this camera relative to its local Z axis. + +---- + +.. _class_Camera_property_projection: + +- :ref:`Projection` **projection** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_projection(value) | ++-----------+-----------------------+ +| *Getter* | get_projection() | ++-----------+-----------------------+ + +The camera's projection mode. In :ref:`PROJECTION_PERSPECTIVE` mode, objects' Z distance from the camera's local space scales their perceived size. + +---- + +.. _class_Camera_property_size: + +- :ref:`float` **size** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_size(value) | ++-----------+-----------------+ +| *Getter* | get_size() | ++-----------+-----------------+ + +The camera's size measured as 1/2 the width or height. Only applicable in orthogonal mode. Since :ref:`keep_aspect` locks on axis, ``size`` sets the other axis' size length. + +---- + +.. _class_Camera_property_v_offset: + +- :ref:`float` **v_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_v_offset(value) | ++-----------+---------------------+ +| *Getter* | get_v_offset() | ++-----------+---------------------+ + +The vertical (Y) offset of the camera viewport. + +Method Descriptions +------------------- + +.. _class_Camera_method_clear_current: + +- void **clear_current** **(** :ref:`bool` enable_next=true **)** + +If this is the current camera, remove it from being current. If ``enable_next`` is ``true``, request to make the next camera current, if any. + +---- + +.. _class_Camera_method_get_camera_rid: + +- :ref:`RID` **get_camera_rid** **(** **)** |const| + +Returns the camera's RID from the :ref:`VisualServer`. + +---- + +.. _class_Camera_method_get_camera_transform: + +- :ref:`Transform` **get_camera_transform** **(** **)** |const| + +Returns the transform of the camera plus the vertical (:ref:`v_offset`) and horizontal (:ref:`h_offset`) offsets; and any other adjustments made to the position and orientation of the camera by subclassed cameras such as :ref:`ClippedCamera`, :ref:`InterpolatedCamera` and :ref:`ARVRCamera`. + +---- + +.. _class_Camera_method_get_cull_mask_bit: + +- :ref:`bool` **get_cull_mask_bit** **(** :ref:`int` layer **)** |const| + +Returns ``true`` if the given ``layer`` in the :ref:`cull_mask` is enabled, ``false`` otherwise. + +---- + +.. _class_Camera_method_get_frustum: + +- :ref:`Array` **get_frustum** **(** **)** |const| + +Returns the camera's frustum planes in world space units as an array of :ref:`Plane`\ s in the following order: near, far, left, top, right, bottom. Not to be confused with :ref:`frustum_offset`. + +---- + +.. _class_Camera_method_is_position_behind: + +- :ref:`bool` **is_position_behind** **(** :ref:`Vector3` world_point **)** |const| + +Returns ``true`` if the given position is behind the camera. + +**Note:** A position which returns ``false`` may still be outside the camera's field of view. + +---- + +.. _class_Camera_method_make_current: + +- void **make_current** **(** **)** + +Makes this camera the current camera for the :ref:`Viewport` (see class description). If the camera node is outside the scene tree, it will attempt to become current once it's added. + +---- + +.. _class_Camera_method_project_local_ray_normal: + +- :ref:`Vector3` **project_local_ray_normal** **(** :ref:`Vector2` screen_point **)** |const| + +Returns a normal vector from the screen point location directed along the camera. Orthogonal cameras are normalized. Perspective cameras account for perspective, screen width/height, etc. + +---- + +.. _class_Camera_method_project_position: + +- :ref:`Vector3` **project_position** **(** :ref:`Vector2` screen_point, :ref:`float` z_depth **)** |const| + +Returns the 3D point in world space that maps to the given 2D coordinate in the :ref:`Viewport` rectangle on a plane that is the given ``z_depth`` distance into the scene away from the camera. + +---- + +.. _class_Camera_method_project_ray_normal: + +- :ref:`Vector3` **project_ray_normal** **(** :ref:`Vector2` screen_point **)** |const| + +Returns a normal vector in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + +---- + +.. _class_Camera_method_project_ray_origin: + +- :ref:`Vector3` **project_ray_origin** **(** :ref:`Vector2` screen_point **)** |const| + +Returns a 3D position in world space, that is the result of projecting a point on the :ref:`Viewport` rectangle by the camera projection. This is useful for casting rays in the form of (origin, normal) for object intersection or picking. + +---- + +.. _class_Camera_method_set_cull_mask_bit: + +- void **set_cull_mask_bit** **(** :ref:`int` layer, :ref:`bool` enable **)** + +Enables or disables the given ``layer`` in the :ref:`cull_mask`. + +---- + +.. _class_Camera_method_set_frustum: + +- void **set_frustum** **(** :ref:`float` size, :ref:`Vector2` offset, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets the camera projection to frustum mode (see :ref:`PROJECTION_FRUSTUM`), by specifying a ``size``, an ``offset``, and the ``z_near`` and ``z_far`` clip planes in world space units. + +---- + +.. _class_Camera_method_set_orthogonal: + +- void **set_orthogonal** **(** :ref:`float` size, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets the camera projection to orthogonal mode (see :ref:`PROJECTION_ORTHOGONAL`), by specifying a ``size``, and the ``z_near`` and ``z_far`` clip planes in world space units. (As a hint, 2D games often use this projection, with values specified in pixels.) + +---- + +.. _class_Camera_method_set_perspective: + +- void **set_perspective** **(** :ref:`float` fov, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets the camera projection to perspective mode (see :ref:`PROJECTION_PERSPECTIVE`), by specifying a ``fov`` (field of view) angle in degrees, and the ``z_near`` and ``z_far`` clip planes in world space units. + +---- + +.. _class_Camera_method_unproject_position: + +- :ref:`Vector2` **unproject_position** **(** :ref:`Vector3` world_point **)** |const| + +Returns the 2D coordinate in the :ref:`Viewport` rectangle that maps to the given 3D point in world space. + +**Note:** When using this to position GUI elements over a 3D viewport, use :ref:`is_position_behind` to prevent them from appearing if the 3D point is behind the camera: + +:: + + # This code block is part of a script that inherits from Spatial. + # `control` is a reference to a node inheriting from Control. + control.visible = not get_viewport().get_camera().is_position_behind(global_transform.origin) + control.rect_position = get_viewport().get_camera().unproject_position(global_transform.origin) + +.. |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.)` diff --git a/classes/class_camera2d.rst b/classes/class_camera2d.rst new file mode 100644 index 0000000..8df4b16 --- /dev/null +++ b/classes/class_camera2d.rst @@ -0,0 +1,643 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Camera2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Camera2D: + +Camera2D +======== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Camera node for 2D scenes. + +Description +----------- + +Camera node for 2D scenes. It forces the screen (current layer) to scroll following this node. This makes it easier (and faster) to program scrollable scenes than manually changing the position of :ref:`CanvasItem`-based nodes. + +This node is intended to be a simple helper to get things going quickly, but more functionality may be desired to change how the camera works. To make your own custom camera node, inherit it from :ref:`Node2D` and change the transform of the canvas by setting :ref:`Viewport.canvas_transform` in :ref:`Viewport` (you can obtain the current :ref:`Viewport` by using :ref:`Node.get_viewport`). + +Note that the ``Camera2D`` node's ``position`` doesn't represent the actual position of the screen, which may differ due to applied smoothing or limits. You can use :ref:`get_camera_screen_center` to get the real position. + +Tutorials +--------- + +- `2D Platformer Demo `__ + +- `2D Isometric Demo `__ + +- `2D HDR Demo `__ + +Properties +---------- + ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`AnchorMode` | :ref:`anchor_mode` | ``1`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`current` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`Node` | :ref:`custom_viewport` | | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`drag_margin_bottom` | ``0.2`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`drag_margin_h_enabled` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`drag_margin_left` | ``0.2`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`drag_margin_right` | ``0.2`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`drag_margin_top` | ``0.2`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`drag_margin_v_enabled` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`editor_draw_drag_margin` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`editor_draw_limits` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`editor_draw_screen` | ``true`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`limit_bottom` | ``10000000`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`limit_left` | ``-10000000`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`limit_right` | ``10000000`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`limit_smoothed` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`limit_top` | ``-10000000`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`offset_h` | ``0.0`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`offset_v` | ``0.0`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`Camera2DProcessMode` | :ref:`process_mode` | ``1`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`rotating` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`smoothing_enabled` | ``false`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`smoothing_speed` | ``5.0`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`zoom` | ``Vector2( 1, 1 )`` | ++---------------------------------------------------------------+---------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`align` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_current` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_update_scroll` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_camera_position` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_camera_screen_center` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_drag_margin` **(** :ref:`Margin` margin **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_limit` **(** :ref:`Margin` margin **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_current` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reset_smoothing` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_drag_margin` **(** :ref:`Margin` margin, :ref:`float` drag_margin **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_limit` **(** :ref:`Margin` margin, :ref:`int` limit **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Camera2D_AnchorMode: + +.. _class_Camera2D_constant_ANCHOR_MODE_FIXED_TOP_LEFT: + +.. _class_Camera2D_constant_ANCHOR_MODE_DRAG_CENTER: + +enum **AnchorMode**: + +- **ANCHOR_MODE_FIXED_TOP_LEFT** = **0** --- The camera's position is fixed so that the top-left corner is always at the origin. + +- **ANCHOR_MODE_DRAG_CENTER** = **1** --- The camera's position takes into account vertical/horizontal offsets and the screen size. + +---- + +.. _enum_Camera2D_Camera2DProcessMode: + +.. _class_Camera2D_constant_CAMERA2D_PROCESS_PHYSICS: + +.. _class_Camera2D_constant_CAMERA2D_PROCESS_IDLE: + +enum **Camera2DProcessMode**: + +- **CAMERA2D_PROCESS_PHYSICS** = **0** --- The camera updates with the ``_physics_process`` callback. + +- **CAMERA2D_PROCESS_IDLE** = **1** --- The camera updates with the ``_process`` callback. + +Property Descriptions +--------------------- + +.. _class_Camera2D_property_anchor_mode: + +- :ref:`AnchorMode` **anchor_mode** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_anchor_mode(value) | ++-----------+------------------------+ +| *Getter* | get_anchor_mode() | ++-----------+------------------------+ + +The Camera2D's anchor point. See :ref:`AnchorMode` constants. + +---- + +.. _class_Camera2D_property_current: + +- :ref:`bool` **current** + ++-----------+--------------+ +| *Default* | ``false`` | ++-----------+--------------+ +| *Getter* | is_current() | ++-----------+--------------+ + +If ``true``, the camera is the active camera for the current scene. Only one camera can be current, so setting a different camera ``current`` will disable this one. + +---- + +.. _class_Camera2D_property_custom_viewport: + +- :ref:`Node` **custom_viewport** + ++----------+----------------------------+ +| *Setter* | set_custom_viewport(value) | ++----------+----------------------------+ +| *Getter* | get_custom_viewport() | ++----------+----------------------------+ + +The custom :ref:`Viewport` node attached to the ``Camera2D``. If ``null`` or not a :ref:`Viewport`, uses the default viewport instead. + +---- + +.. _class_Camera2D_property_drag_margin_bottom: + +- :ref:`float` **drag_margin_bottom** + ++-----------+------------------------+ +| *Default* | ``0.2`` | ++-----------+------------------------+ +| *Setter* | set_drag_margin(value) | ++-----------+------------------------+ +| *Getter* | get_drag_margin() | ++-----------+------------------------+ + +Bottom margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the edge of the screen. + +---- + +.. _class_Camera2D_property_drag_margin_h_enabled: + +- :ref:`bool` **drag_margin_h_enabled** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_h_drag_enabled(value) | ++-----------+---------------------------+ +| *Getter* | is_h_drag_enabled() | ++-----------+---------------------------+ + +If ``true``, the camera only moves when reaching the horizontal drag margins. If ``false``, the camera moves horizontally regardless of margins. + +---- + +.. _class_Camera2D_property_drag_margin_left: + +- :ref:`float` **drag_margin_left** + ++-----------+------------------------+ +| *Default* | ``0.2`` | ++-----------+------------------------+ +| *Setter* | set_drag_margin(value) | ++-----------+------------------------+ +| *Getter* | get_drag_margin() | ++-----------+------------------------+ + +Left margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the edge of the screen. + +---- + +.. _class_Camera2D_property_drag_margin_right: + +- :ref:`float` **drag_margin_right** + ++-----------+------------------------+ +| *Default* | ``0.2`` | ++-----------+------------------------+ +| *Setter* | set_drag_margin(value) | ++-----------+------------------------+ +| *Getter* | get_drag_margin() | ++-----------+------------------------+ + +Right margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the edge of the screen. + +---- + +.. _class_Camera2D_property_drag_margin_top: + +- :ref:`float` **drag_margin_top** + ++-----------+------------------------+ +| *Default* | ``0.2`` | ++-----------+------------------------+ +| *Setter* | set_drag_margin(value) | ++-----------+------------------------+ +| *Getter* | get_drag_margin() | ++-----------+------------------------+ + +Top margin needed to drag the camera. A value of ``1`` makes the camera move only when reaching the edge of the screen. + +---- + +.. _class_Camera2D_property_drag_margin_v_enabled: + +- :ref:`bool` **drag_margin_v_enabled** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_v_drag_enabled(value) | ++-----------+---------------------------+ +| *Getter* | is_v_drag_enabled() | ++-----------+---------------------------+ + +If ``true``, the camera only moves when reaching the vertical drag margins. If ``false``, the camera moves vertically regardless of margins. + +---- + +.. _class_Camera2D_property_editor_draw_drag_margin: + +- :ref:`bool` **editor_draw_drag_margin** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_margin_drawing_enabled(value) | ++-----------+-----------------------------------+ +| *Getter* | is_margin_drawing_enabled() | ++-----------+-----------------------------------+ + +If ``true``, draws the camera's drag margin rectangle in the editor. + +---- + +.. _class_Camera2D_property_editor_draw_limits: + +- :ref:`bool` **editor_draw_limits** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_limit_drawing_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_limit_drawing_enabled() | ++-----------+----------------------------------+ + +If ``true``, draws the camera's limits rectangle in the editor. + +---- + +.. _class_Camera2D_property_editor_draw_screen: + +- :ref:`bool` **editor_draw_screen** + ++-----------+-----------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------+ +| *Setter* | set_screen_drawing_enabled(value) | ++-----------+-----------------------------------+ +| *Getter* | is_screen_drawing_enabled() | ++-----------+-----------------------------------+ + +If ``true``, draws the camera's screen rectangle in the editor. + +---- + +.. _class_Camera2D_property_limit_bottom: + +- :ref:`int` **limit_bottom** + ++-----------+------------------+ +| *Default* | ``10000000`` | ++-----------+------------------+ +| *Setter* | set_limit(value) | ++-----------+------------------+ +| *Getter* | get_limit() | ++-----------+------------------+ + +Bottom scroll limit in pixels. The camera stops moving when reaching this value. + +---- + +.. _class_Camera2D_property_limit_left: + +- :ref:`int` **limit_left** + ++-----------+------------------+ +| *Default* | ``-10000000`` | ++-----------+------------------+ +| *Setter* | set_limit(value) | ++-----------+------------------+ +| *Getter* | get_limit() | ++-----------+------------------+ + +Left scroll limit in pixels. The camera stops moving when reaching this value. + +---- + +.. _class_Camera2D_property_limit_right: + +- :ref:`int` **limit_right** + ++-----------+------------------+ +| *Default* | ``10000000`` | ++-----------+------------------+ +| *Setter* | set_limit(value) | ++-----------+------------------+ +| *Getter* | get_limit() | ++-----------+------------------+ + +Right scroll limit in pixels. The camera stops moving when reaching this value. + +---- + +.. _class_Camera2D_property_limit_smoothed: + +- :ref:`bool` **limit_smoothed** + ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Setter* | set_limit_smoothing_enabled(value) | ++-----------+------------------------------------+ +| *Getter* | is_limit_smoothing_enabled() | ++-----------+------------------------------------+ + +If ``true``, the camera smoothly stops when reaches its limits. + +This has no effect if smoothing is disabled. + +**Note:** To immediately update the camera's position to be within limits without smoothing, even with this setting enabled, invoke :ref:`reset_smoothing`. + +---- + +.. _class_Camera2D_property_limit_top: + +- :ref:`int` **limit_top** + ++-----------+------------------+ +| *Default* | ``-10000000`` | ++-----------+------------------+ +| *Setter* | set_limit(value) | ++-----------+------------------+ +| *Getter* | get_limit() | ++-----------+------------------+ + +Top scroll limit in pixels. The camera stops moving when reaching this value. + +---- + +.. _class_Camera2D_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The camera's offset, useful for looking around or camera shake animations. + +---- + +.. _class_Camera2D_property_offset_h: + +- :ref:`float` **offset_h** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_h_offset(value) | ++-----------+---------------------+ +| *Getter* | get_h_offset() | ++-----------+---------------------+ + +The horizontal offset of the camera, relative to the drag margins. + +**Note:** Offset H is used only to force offset relative to margins. It's not updated in any way if drag margins are enabled and can be used to set initial offset. + +---- + +.. _class_Camera2D_property_offset_v: + +- :ref:`float` **offset_v** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_v_offset(value) | ++-----------+---------------------+ +| *Getter* | get_v_offset() | ++-----------+---------------------+ + +The vertical offset of the camera, relative to the drag margins. + +**Note:** Used the same as :ref:`offset_h`. + +---- + +.. _class_Camera2D_property_process_mode: + +- :ref:`Camera2DProcessMode` **process_mode** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_process_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_process_mode() | ++-----------+-------------------------+ + +The camera's process callback. See :ref:`Camera2DProcessMode`. + +---- + +.. _class_Camera2D_property_rotating: + +- :ref:`bool` **rotating** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_rotating(value) | ++-----------+---------------------+ +| *Getter* | is_rotating() | ++-----------+---------------------+ + +If ``true``, the camera rotates with the target. + +---- + +.. _class_Camera2D_property_smoothing_enabled: + +- :ref:`bool` **smoothing_enabled** + ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Setter* | set_enable_follow_smoothing(value) | ++-----------+------------------------------------+ +| *Getter* | is_follow_smoothing_enabled() | ++-----------+------------------------------------+ + +If ``true``, the camera smoothly moves towards the target at :ref:`smoothing_speed`. + +---- + +.. _class_Camera2D_property_smoothing_speed: + +- :ref:`float` **smoothing_speed** + ++-----------+-----------------------------+ +| *Default* | ``5.0`` | ++-----------+-----------------------------+ +| *Setter* | set_follow_smoothing(value) | ++-----------+-----------------------------+ +| *Getter* | get_follow_smoothing() | ++-----------+-----------------------------+ + +Speed in pixels per second of the camera's smoothing effect when :ref:`smoothing_enabled` is ``true``. + +---- + +.. _class_Camera2D_property_zoom: + +- :ref:`Vector2` **zoom** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_zoom(value) | ++-----------+---------------------+ +| *Getter* | get_zoom() | ++-----------+---------------------+ + +The camera's zoom relative to the viewport. Values larger than ``Vector2(1, 1)`` zoom out and smaller values zoom in. For an example, use ``Vector2(0.5, 0.5)`` for a 2× zoom-in, and ``Vector2(4, 4)`` for a 4× zoom-out. + +Method Descriptions +------------------- + +.. _class_Camera2D_method_align: + +- void **align** **(** **)** + +Aligns the camera to the tracked node. + +---- + +.. _class_Camera2D_method_clear_current: + +- void **clear_current** **(** **)** + +Removes any ``Camera2D`` from the ancestor :ref:`Viewport`'s internal currently-assigned camera. + +---- + +.. _class_Camera2D_method_force_update_scroll: + +- void **force_update_scroll** **(** **)** + +Forces the camera to update scroll immediately. + +---- + +.. _class_Camera2D_method_get_camera_position: + +- :ref:`Vector2` **get_camera_position** **(** **)** |const| + +Returns the camera position. + +---- + +.. _class_Camera2D_method_get_camera_screen_center: + +- :ref:`Vector2` **get_camera_screen_center** **(** **)** |const| + +Returns the location of the ``Camera2D``'s screen-center, relative to the origin. + +---- + +.. _class_Camera2D_method_get_drag_margin: + +- :ref:`float` **get_drag_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the specified margin. See also :ref:`drag_margin_bottom`, :ref:`drag_margin_top`, :ref:`drag_margin_left`, and :ref:`drag_margin_right`. + +---- + +.. _class_Camera2D_method_get_limit: + +- :ref:`int` **get_limit** **(** :ref:`Margin` margin **)** |const| + +Returns the specified camera limit. See also :ref:`limit_bottom`, :ref:`limit_top`, :ref:`limit_left`, and :ref:`limit_right`. + +---- + +.. _class_Camera2D_method_make_current: + +- void **make_current** **(** **)** + +Make this the current 2D camera for the scene (viewport and layer), in case there are many cameras in the scene. + +---- + +.. _class_Camera2D_method_reset_smoothing: + +- void **reset_smoothing** **(** **)** + +Sets the camera's position immediately to its current smoothing destination. + +This has no effect if smoothing is disabled. + +---- + +.. _class_Camera2D_method_set_drag_margin: + +- void **set_drag_margin** **(** :ref:`Margin` margin, :ref:`float` drag_margin **)** + +Sets the specified margin. See also :ref:`drag_margin_bottom`, :ref:`drag_margin_top`, :ref:`drag_margin_left`, and :ref:`drag_margin_right`. + +---- + +.. _class_Camera2D_method_set_limit: + +- void **set_limit** **(** :ref:`Margin` margin, :ref:`int` limit **)** + +Sets the specified camera limit. See also :ref:`limit_bottom`, :ref:`limit_top`, :ref:`limit_left`, and :ref:`limit_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.)` diff --git a/classes/class_camerafeed.rst b/classes/class_camerafeed.rst new file mode 100644 index 0000000..964f508 --- /dev/null +++ b/classes/class_camerafeed.rst @@ -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 CameraFeed.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CameraFeed: + +CameraFeed +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A camera feed gives you access to a single physical camera attached to your device. + +Description +----------- + +A camera feed gives you access to a single physical camera attached to your device. When enabled, Godot will start capturing frames from the camera which can then be used. See also :ref:`CameraServer`. + +**Note:** Many cameras will return YCbCr images which are split into two textures and need to be combined in a shader. Godot does this automatically for you if you set the environment to show the camera image in the background. + +Properties +---------- + ++---------------------------------------+-----------------------------------------------------------------+--------------------------------------+ +| :ref:`bool` | :ref:`feed_is_active` | ``false`` | ++---------------------------------------+-----------------------------------------------------------------+--------------------------------------+ +| :ref:`Transform2D` | :ref:`feed_transform` | ``Transform2D( 1, 0, 0, -1, 0, 1 )`` | ++---------------------------------------+-----------------------------------------------------------------+--------------------------------------+ + +Methods +------- + ++---------------------------------------------------+-------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_id` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------+ +| :ref:`FeedPosition` | :ref:`get_position` **(** **)** |const| | ++---------------------------------------------------+-------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CameraFeed_FeedDataType: + +.. _class_CameraFeed_constant_FEED_NOIMAGE: + +.. _class_CameraFeed_constant_FEED_RGB: + +.. _class_CameraFeed_constant_FEED_YCBCR: + +.. _class_CameraFeed_constant_FEED_YCBCR_SEP: + +enum **FeedDataType**: + +- **FEED_NOIMAGE** = **0** --- No image set for the feed. + +- **FEED_RGB** = **1** --- Feed supplies RGB images. + +- **FEED_YCBCR** = **2** --- Feed supplies YCbCr images that need to be converted to RGB. + +- **FEED_YCBCR_SEP** = **3** --- Feed supplies separate Y and CbCr images that need to be combined and converted to RGB. + +---- + +.. _enum_CameraFeed_FeedPosition: + +.. _class_CameraFeed_constant_FEED_UNSPECIFIED: + +.. _class_CameraFeed_constant_FEED_FRONT: + +.. _class_CameraFeed_constant_FEED_BACK: + +enum **FeedPosition**: + +- **FEED_UNSPECIFIED** = **0** --- Unspecified position. + +- **FEED_FRONT** = **1** --- Camera is mounted at the front of the device. + +- **FEED_BACK** = **2** --- Camera is mounted at the back of the device. + +Property Descriptions +--------------------- + +.. _class_CameraFeed_property_feed_is_active: + +- :ref:`bool` **feed_is_active** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_active(value) | ++-----------+-------------------+ +| *Getter* | is_active() | ++-----------+-------------------+ + +If ``true``, the feed is active. + +---- + +.. _class_CameraFeed_property_feed_transform: + +- :ref:`Transform2D` **feed_transform** + ++-----------+--------------------------------------+ +| *Default* | ``Transform2D( 1, 0, 0, -1, 0, 1 )`` | ++-----------+--------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+--------------------------------------+ +| *Getter* | get_transform() | ++-----------+--------------------------------------+ + +The transform applied to the camera's image. + +Method Descriptions +------------------- + +.. _class_CameraFeed_method_get_id: + +- :ref:`int` **get_id** **(** **)** |const| + +Returns the unique ID for this feed. + +---- + +.. _class_CameraFeed_method_get_name: + +- :ref:`String` **get_name** **(** **)** |const| + +Returns the camera's name. + +---- + +.. _class_CameraFeed_method_get_position: + +- :ref:`FeedPosition` **get_position** **(** **)** |const| + +Returns the position of camera on the device. + +.. |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.)` diff --git a/classes/class_cameraserver.rst b/classes/class_cameraserver.rst new file mode 100644 index 0000000..38b5606 --- /dev/null +++ b/classes/class_cameraserver.rst @@ -0,0 +1,123 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CameraServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CameraServer: + +CameraServer +============ + +**Inherits:** :ref:`Object` + +Server keeping track of different cameras accessible in Godot. + +Description +----------- + +The ``CameraServer`` keeps track of different cameras accessible in Godot. These are external cameras such as webcams or the cameras on your phone. + +It is notably used to provide AR modules with a video feed from the camera. + +**Note:** This class is currently only implemented on macOS and iOS. On other platforms, no :ref:`CameraFeed`\ s will be available. + +Methods +------- + ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_feed` **(** :ref:`CameraFeed` feed **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`feeds` **(** **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`CameraFeed` | :ref:`get_feed` **(** :ref:`int` index **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_feed_count` **(** **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_feed` **(** :ref:`CameraFeed` feed **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_CameraServer_signal_camera_feed_added: + +- **camera_feed_added** **(** :ref:`int` id **)** + +Emitted when a :ref:`CameraFeed` is added (e.g. a webcam is plugged in). + +---- + +.. _class_CameraServer_signal_camera_feed_removed: + +- **camera_feed_removed** **(** :ref:`int` id **)** + +Emitted when a :ref:`CameraFeed` is removed (e.g. a webcam is unplugged). + +Enumerations +------------ + +.. _enum_CameraServer_FeedImage: + +.. _class_CameraServer_constant_FEED_RGBA_IMAGE: + +.. _class_CameraServer_constant_FEED_YCBCR_IMAGE: + +.. _class_CameraServer_constant_FEED_Y_IMAGE: + +.. _class_CameraServer_constant_FEED_CBCR_IMAGE: + +enum **FeedImage**: + +- **FEED_RGBA_IMAGE** = **0** --- The RGBA camera image. + +- **FEED_YCBCR_IMAGE** = **0** --- The `YCbCr `__ camera image. + +- **FEED_Y_IMAGE** = **0** --- The Y component camera image. + +- **FEED_CBCR_IMAGE** = **1** --- The CbCr component camera image. + +Method Descriptions +------------------- + +.. _class_CameraServer_method_add_feed: + +- void **add_feed** **(** :ref:`CameraFeed` feed **)** + +Adds the camera ``feed`` to the camera server. + +---- + +.. _class_CameraServer_method_feeds: + +- :ref:`Array` **feeds** **(** **)** + +Returns an array of :ref:`CameraFeed`\ s. + +---- + +.. _class_CameraServer_method_get_feed: + +- :ref:`CameraFeed` **get_feed** **(** :ref:`int` index **)** + +Returns the :ref:`CameraFeed` corresponding to the camera with the given ``index``. + +---- + +.. _class_CameraServer_method_get_feed_count: + +- :ref:`int` **get_feed_count** **(** **)** + +Returns the number of :ref:`CameraFeed`\ s registered. + +---- + +.. _class_CameraServer_method_remove_feed: + +- void **remove_feed** **(** :ref:`CameraFeed` feed **)** + +Removes the specified camera ``feed``. + +.. |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.)` diff --git a/classes/class_cameratexture.rst b/classes/class_cameratexture.rst new file mode 100644 index 0000000..36e73f1 --- /dev/null +++ b/classes/class_cameratexture.rst @@ -0,0 +1,87 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CameraTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CameraTexture: + +CameraTexture +============= + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Texture provided by a :ref:`CameraFeed`. + +Description +----------- + +This texture gives access to the camera texture provided by a :ref:`CameraFeed`. + +**Note:** Many cameras supply YCbCr images which need to be converted in a shader. + +Properties +---------- + ++-----------------------------------------------+------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`camera_feed_id` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`camera_is_active` | ``false`` | ++-----------------------------------------------+------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-----------------------------------------------+------------------------------------------------------------------------+---------------------------+ +| :ref:`FeedImage` | :ref:`which_feed` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_CameraTexture_property_camera_feed_id: + +- :ref:`int` **camera_feed_id** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_camera_feed_id(value) | ++-----------+---------------------------+ +| *Getter* | get_camera_feed_id() | ++-----------+---------------------------+ + +The ID of the :ref:`CameraFeed` for which we want to display the image. + +---- + +.. _class_CameraTexture_property_camera_is_active: + +- :ref:`bool` **camera_is_active** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_camera_active(value) | ++-----------+--------------------------+ +| *Getter* | get_camera_active() | ++-----------+--------------------------+ + +Convenience property that gives access to the active property of the :ref:`CameraFeed`. + +---- + +.. _class_CameraTexture_property_which_feed: + +- :ref:`FeedImage` **which_feed** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_which_feed(value) | ++-----------+-----------------------+ +| *Getter* | get_which_feed() | ++-----------+-----------------------+ + +Which image within the :ref:`CameraFeed` we want access to, important if the camera image is split in a Y and CbCr component. + +.. |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.)` diff --git a/classes/class_canvasitem.rst b/classes/class_canvasitem.rst new file mode 100644 index 0000000..1c4c675 --- /dev/null +++ b/classes/class_canvasitem.rst @@ -0,0 +1,757 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CanvasItem.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CanvasItem: + +CanvasItem +========== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`Control`, :ref:`Node2D` + +Base class of anything 2D. + +Description +----------- + +Base class of anything 2D. Canvas items are laid out in a tree; children inherit and extend their parent's transform. ``CanvasItem`` is extended by :ref:`Control` for anything GUI-related, and by :ref:`Node2D` for anything related to the 2D engine. + +Any ``CanvasItem`` can draw. For this, :ref:`update` must be called, then :ref:`NOTIFICATION_DRAW` will be received on idle time to request redraw. Because of this, canvas items don't need to be redrawn on every frame, improving the performance significantly. Several functions for drawing on the ``CanvasItem`` are provided (see ``draw_*`` functions). However, they can only be used inside the :ref:`Object._notification`, signal or :ref:`_draw` virtual functions. + +Canvas items are drawn in tree order. By default, children are on top of their parents so a root ``CanvasItem`` will be drawn behind everything. This behavior can be changed on a per-item basis. + +A ``CanvasItem`` can also be hidden, which will also hide its children. It provides many ways to change parameters such as modulation (for itself and its children) and self modulation (only for itself), as well as its blend mode. + +Ultimately, a transform notification can be requested, which will notify the node that its global position changed in case the parent tree changed. + +**Note:** Unless otherwise specified, all methods that have angle parameters must have angles specified as *radians*. To convert degrees to radians, use :ref:`@GDScript.deg2rad`. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_transforms` + +- :doc:`../tutorials/2d/custom_drawing_in_2d` + +- `Audio Spectrum Demo `__ + +Properties +---------- + ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`light_mask` | ``1`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`self_modulate` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`show_behind_parent` | ``false`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`show_on_top` | | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`use_parent_material` | ``false`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`visible` | ``true`` | ++---------------------------------+---------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_draw` **(** **)** |virtual| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_arc` **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`draw_char` **(** :ref:`Font` font, :ref:`Vector2` position, :ref:`String` char, :ref:`String` next, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_circle` **(** :ref:`Vector2` position, :ref:`float` radius, :ref:`Color` color **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_colored_polygon` **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`Texture` texture=null, :ref:`Texture` normal_map=null, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_line` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_mesh` **(** :ref:`Mesh` mesh, :ref:`Texture` texture, :ref:`Texture` normal_map=null, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_multiline` **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_multiline_colors` **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_multimesh` **(** :ref:`MultiMesh` multimesh, :ref:`Texture` texture, :ref:`Texture` normal_map=null **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_polygon` **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`Texture` texture=null, :ref:`Texture` normal_map=null, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_polyline` **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_polyline_colors` **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_primitive` **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs, :ref:`Texture` texture=null, :ref:`float` width=1.0, :ref:`Texture` normal_map=null **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_rect` **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_set_transform` **(** :ref:`Vector2` position, :ref:`float` rotation, :ref:`Vector2` scale **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_set_transform_matrix` **(** :ref:`Transform2D` xform **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_string` **(** :ref:`Font` font, :ref:`Vector2` position, :ref:`String` text, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1 **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_style_box` **(** :ref:`StyleBox` style_box, :ref:`Rect2` rect **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_texture` **(** :ref:`Texture` texture, :ref:`Vector2` position, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`Texture` normal_map=null **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_texture_rect` **(** :ref:`Texture` texture, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_texture_rect_region` **(** :ref:`Texture` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=true **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_update_transform` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_canvas` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_canvas_item` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_canvas_transform` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_global_mouse_position` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_global_transform` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_global_transform_with_canvas` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_local_mouse_position` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_transform` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_viewport_rect` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_viewport_transform` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`World2D` | :ref:`get_world_2d` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hide` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_local_transform_notification_enabled` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_set_as_toplevel` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_transform_notification_enabled` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_visible_in_tree` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`make_canvas_position_local` **(** :ref:`Vector2` screen_point **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`InputEvent` | :ref:`make_input_local` **(** :ref:`InputEvent` event **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_as_toplevel` **(** :ref:`bool` enable **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_notify_local_transform` **(** :ref:`bool` enable **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_notify_transform` **(** :ref:`bool` enable **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`show` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_CanvasItem_signal_draw: + +- **draw** **(** **)** + +Emitted when the ``CanvasItem`` must redraw. This can only be connected realtime, as deferred will not allow drawing. + +---- + +.. _class_CanvasItem_signal_hide: + +- **hide** **(** **)** + +Emitted when becoming hidden. + +---- + +.. _class_CanvasItem_signal_item_rect_changed: + +- **item_rect_changed** **(** **)** + +Emitted when the item's :ref:`Rect2` boundaries (position or size) have changed, or when an action is taking place that may have impacted these boundaries (e.g. changing :ref:`Sprite.texture`). + +---- + +.. _class_CanvasItem_signal_visibility_changed: + +- **visibility_changed** **(** **)** + +Emitted when the visibility (hidden/visible) changes. + +Enumerations +------------ + +.. _enum_CanvasItem_BlendMode: + +.. _class_CanvasItem_constant_BLEND_MODE_MIX: + +.. _class_CanvasItem_constant_BLEND_MODE_ADD: + +.. _class_CanvasItem_constant_BLEND_MODE_SUB: + +.. _class_CanvasItem_constant_BLEND_MODE_MUL: + +.. _class_CanvasItem_constant_BLEND_MODE_PREMULT_ALPHA: + +.. _class_CanvasItem_constant_BLEND_MODE_DISABLED: + +enum **BlendMode**: + +- **BLEND_MODE_MIX** = **0** --- Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. + +- **BLEND_MODE_ADD** = **1** --- Additive blending mode. + +- **BLEND_MODE_SUB** = **2** --- Subtractive blending mode. + +- **BLEND_MODE_MUL** = **3** --- Multiplicative blending mode. + +- **BLEND_MODE_PREMULT_ALPHA** = **4** --- Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. + +- **BLEND_MODE_DISABLED** = **5** --- Disables blending mode. Colors including alpha are written as-is. Only applicable for render targets with a transparent background. No lighting will be applied. + +Constants +--------- + +.. _class_CanvasItem_constant_NOTIFICATION_TRANSFORM_CHANGED: + +.. _class_CanvasItem_constant_NOTIFICATION_DRAW: + +.. _class_CanvasItem_constant_NOTIFICATION_VISIBILITY_CHANGED: + +.. _class_CanvasItem_constant_NOTIFICATION_ENTER_CANVAS: + +.. _class_CanvasItem_constant_NOTIFICATION_EXIT_CANVAS: + +- **NOTIFICATION_TRANSFORM_CHANGED** = **2000** --- The ``CanvasItem``'s transform has changed. This notification is only received if enabled by :ref:`set_notify_transform` or :ref:`set_notify_local_transform`. + +- **NOTIFICATION_DRAW** = **30** --- The ``CanvasItem`` is requested to draw. + +- **NOTIFICATION_VISIBILITY_CHANGED** = **31** --- The ``CanvasItem``'s visibility has changed. + +- **NOTIFICATION_ENTER_CANVAS** = **32** --- The ``CanvasItem`` has entered the canvas. + +- **NOTIFICATION_EXIT_CANVAS** = **33** --- The ``CanvasItem`` has exited the canvas. + +Property Descriptions +--------------------- + +.. _class_CanvasItem_property_light_mask: + +- :ref:`int` **light_mask** + ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_light_mask(value) | ++-----------+-----------------------+ +| *Getter* | get_light_mask() | ++-----------+-----------------------+ + +The rendering layers in which this ``CanvasItem`` responds to :ref:`Light2D` nodes. + +---- + +.. _class_CanvasItem_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The material applied to textures on this ``CanvasItem``. + +---- + +.. _class_CanvasItem_property_modulate: + +- :ref:`Color` **modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_modulate(value) | ++-----------+-------------------------+ +| *Getter* | get_modulate() | ++-----------+-------------------------+ + +The color applied to textures on this ``CanvasItem``. + +---- + +.. _class_CanvasItem_property_self_modulate: + +- :ref:`Color` **self_modulate** + ++-----------+--------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+--------------------------+ +| *Setter* | set_self_modulate(value) | ++-----------+--------------------------+ +| *Getter* | get_self_modulate() | ++-----------+--------------------------+ + +The color applied to textures on this ``CanvasItem``. This is not inherited by children ``CanvasItem``\ s. + +---- + +.. _class_CanvasItem_property_show_behind_parent: + +- :ref:`bool` **show_behind_parent** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_draw_behind_parent(value) | ++-----------+---------------------------------+ +| *Getter* | is_draw_behind_parent_enabled() | ++-----------+---------------------------------+ + +If ``true``, the object draws behind its parent. + +---- + +.. _class_CanvasItem_property_show_on_top: + +- :ref:`bool` **show_on_top** + +If ``true``, the object draws on top of its parent. + +---- + +.. _class_CanvasItem_property_use_parent_material: + +- :ref:`bool` **use_parent_material** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_use_parent_material(value) | ++-----------+--------------------------------+ +| *Getter* | get_use_parent_material() | ++-----------+--------------------------------+ + +If ``true``, the parent ``CanvasItem``'s :ref:`material` property is used as this one's material. + +---- + +.. _class_CanvasItem_property_visible: + +- :ref:`bool` **visible** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_visible(value) | ++-----------+--------------------+ +| *Getter* | is_visible() | ++-----------+--------------------+ + +If ``true``, this ``CanvasItem`` is drawn. The node is only visible if all of its antecedents are visible as well (in other words, :ref:`is_visible_in_tree` must return ``true``). + +**Note:** For controls that inherit :ref:`Popup`, the correct way to make them visible is to call one of the multiple ``popup*()`` functions instead. + +Method Descriptions +------------------- + +.. _class_CanvasItem_method__draw: + +- void **_draw** **(** **)** |virtual| + +Overridable function called by the engine (if defined) to draw the canvas item. + +---- + +.. _class_CanvasItem_method_draw_arc: + +- void **draw_arc** **(** :ref:`Vector2` center, :ref:`float` radius, :ref:`float` start_angle, :ref:`float` end_angle, :ref:`int` point_count, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws a unfilled arc between the given angles. The larger the value of ``point_count``, the smoother the curve. See also :ref:`draw_circle`. + +---- + +.. _class_CanvasItem_method_draw_char: + +- :ref:`float` **draw_char** **(** :ref:`Font` font, :ref:`Vector2` position, :ref:`String` char, :ref:`String` next, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** + +Draws a string character using a custom font. Returns the advance, depending on the character width and kerning with an optional next character. + +---- + +.. _class_CanvasItem_method_draw_circle: + +- void **draw_circle** **(** :ref:`Vector2` position, :ref:`float` radius, :ref:`Color` color **)** + +Draws a colored, unfilled circle. See also :ref:`draw_arc`, :ref:`draw_polyline` and :ref:`draw_polygon`. + +---- + +.. _class_CanvasItem_method_draw_colored_polygon: + +- void **draw_colored_polygon** **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`Texture` texture=null, :ref:`Texture` normal_map=null, :ref:`bool` antialiased=false **)** + +Draws a colored polygon of any amount of points, convex or concave. Unlike :ref:`draw_polygon`, a single color must be specified for the whole polygon. + +---- + +.. _class_CanvasItem_method_draw_line: + +- void **draw_line** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws a line from a 2D point to another, with a given color and width. It can be optionally antialiased. See also :ref:`draw_multiline` and :ref:`draw_polyline`. + +---- + +.. _class_CanvasItem_method_draw_mesh: + +- void **draw_mesh** **(** :ref:`Mesh` mesh, :ref:`Texture` texture, :ref:`Texture` normal_map=null, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** + +Draws a :ref:`Mesh` in 2D, using the provided texture. See :ref:`MeshInstance2D` for related documentation. + +---- + +.. _class_CanvasItem_method_draw_multiline: + +- void **draw_multiline** **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws multiple disconnected lines with a uniform ``color``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline` instead. + +**Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. + +---- + +.. _class_CanvasItem_method_draw_multiline_colors: + +- void **draw_multiline_colors** **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws multiple disconnected lines with a uniform ``width`` and segment-by-segment coloring. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw interconnected lines, use :ref:`draw_polyline_colors` instead. + +**Note:** ``width`` and ``antialiased`` are currently not implemented and have no effect. + +---- + +.. _class_CanvasItem_method_draw_multimesh: + +- void **draw_multimesh** **(** :ref:`MultiMesh` multimesh, :ref:`Texture` texture, :ref:`Texture` normal_map=null **)** + +Draws a :ref:`MultiMesh` in 2D with the provided texture. See :ref:`MultiMeshInstance2D` for related documentation. + +---- + +.. _class_CanvasItem_method_draw_polygon: + +- void **draw_polygon** **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`Texture` texture=null, :ref:`Texture` normal_map=null, :ref:`bool` antialiased=false **)** + +Draws a solid polygon of any amount of points, convex or concave. Unlike :ref:`draw_colored_polygon`, each point's color can be changed individually. See also :ref:`draw_polyline` and :ref:`draw_polyline_colors`. + +---- + +.. _class_CanvasItem_method_draw_polyline: + +- void **draw_polyline** **(** :ref:`PoolVector2Array` points, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws interconnected line segments with a uniform ``color`` and ``width`` and optional antialiasing. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline` instead. See also :ref:`draw_polygon`. + +---- + +.. _class_CanvasItem_method_draw_polyline_colors: + +- void **draw_polyline_colors** **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws interconnected line segments with a uniform ``width`` and segment-by-segment coloring, and optional antialiasing. Colors assigned to line segments match by index between ``points`` and ``colors``. When drawing large amounts of lines, this is faster than using individual :ref:`draw_line` calls. To draw disconnected lines, use :ref:`draw_multiline_colors` instead. See also :ref:`draw_polygon`. + +---- + +.. _class_CanvasItem_method_draw_primitive: + +- void **draw_primitive** **(** :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs, :ref:`Texture` texture=null, :ref:`float` width=1.0, :ref:`Texture` normal_map=null **)** + +Draws a custom primitive. 1 point for a point, 2 points for a line, 3 points for a triangle, and 4 points for a quad. If 0 points or more than 4 points are specified, nothing will be drawn and an error message will be printed. See also :ref:`draw_line`, :ref:`draw_polyline`, :ref:`draw_polygon`, and :ref:`draw_rect`. + +---- + +.. _class_CanvasItem_method_draw_rect: + +- void **draw_rect** **(** :ref:`Rect2` rect, :ref:`Color` color, :ref:`bool` filled=true, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Draws a rectangle. If ``filled`` is ``true``, the rectangle will be filled with the ``color`` specified. If ``filled`` is ``false``, the rectangle will be drawn as a stroke with the ``color`` and ``width`` specified. If ``antialiased`` is ``true``, the lines will be antialiased. + +**Note:** ``width`` and ``antialiased`` are only effective if ``filled`` is ``false``. + +---- + +.. _class_CanvasItem_method_draw_set_transform: + +- void **draw_set_transform** **(** :ref:`Vector2` position, :ref:`float` rotation, :ref:`Vector2` scale **)** + +Sets a custom transform for drawing via components. Anything drawn afterwards will be transformed by this. + +---- + +.. _class_CanvasItem_method_draw_set_transform_matrix: + +- void **draw_set_transform_matrix** **(** :ref:`Transform2D` xform **)** + +Sets a custom transform for drawing via matrix. Anything drawn afterwards will be transformed by this. + +---- + +.. _class_CanvasItem_method_draw_string: + +- void **draw_string** **(** :ref:`Font` font, :ref:`Vector2` position, :ref:`String` text, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1 **)** + +Draws ``text`` using the specified ``font`` at the ``position`` (bottom-left corner using the baseline of the font). The text will have its color multiplied by ``modulate``. If ``clip_w`` is greater than or equal to 0, the text will be clipped if it exceeds the specified width. + +**Example using the default project font:** + +:: + + # If using this method in a script that redraws constantly, move the + # `default_font` declaration to a member variable assigned in `_ready()` + # so the Control is only created once. + var default_font = Control.new().get_font("font") + draw_string(default_font, Vector2(64, 64), "Hello world") + +See also :ref:`Font.draw`. + +---- + +.. _class_CanvasItem_method_draw_style_box: + +- void **draw_style_box** **(** :ref:`StyleBox` style_box, :ref:`Rect2` rect **)** + +Draws a styled rectangle. + +---- + +.. _class_CanvasItem_method_draw_texture: + +- void **draw_texture** **(** :ref:`Texture` texture, :ref:`Vector2` position, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`Texture` normal_map=null **)** + +Draws a texture at a given position. + +---- + +.. _class_CanvasItem_method_draw_texture_rect: + +- void **draw_texture_rect** **(** :ref:`Texture` texture, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** + +Draws a textured rectangle at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. + +---- + +.. _class_CanvasItem_method_draw_texture_rect_region: + +- void **draw_texture_rect_region** **(** :ref:`Texture` texture, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=true **)** + +Draws a textured rectangle region at a given position, optionally modulated by a color. If ``transpose`` is ``true``, the texture will have its X and Y coordinates swapped. + +---- + +.. _class_CanvasItem_method_force_update_transform: + +- void **force_update_transform** **(** **)** + +Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. + +---- + +.. _class_CanvasItem_method_get_canvas: + +- :ref:`RID` **get_canvas** **(** **)** |const| + +Returns the :ref:`RID` of the :ref:`World2D` canvas where this item is in. + +---- + +.. _class_CanvasItem_method_get_canvas_item: + +- :ref:`RID` **get_canvas_item** **(** **)** |const| + +Returns the canvas item RID used by :ref:`VisualServer` for this item. + +---- + +.. _class_CanvasItem_method_get_canvas_transform: + +- :ref:`Transform2D` **get_canvas_transform** **(** **)** |const| + +Returns the transform matrix of this item's canvas. + +---- + +.. _class_CanvasItem_method_get_global_mouse_position: + +- :ref:`Vector2` **get_global_mouse_position** **(** **)** |const| + +Returns the global position of the mouse. + +---- + +.. _class_CanvasItem_method_get_global_transform: + +- :ref:`Transform2D` **get_global_transform** **(** **)** |const| + +Returns the global transform matrix of this item. + +---- + +.. _class_CanvasItem_method_get_global_transform_with_canvas: + +- :ref:`Transform2D` **get_global_transform_with_canvas** **(** **)** |const| + +Returns the global transform matrix of this item in relation to the canvas. + +---- + +.. _class_CanvasItem_method_get_local_mouse_position: + +- :ref:`Vector2` **get_local_mouse_position** **(** **)** |const| + +Returns the mouse position relative to this item's position. + +---- + +.. _class_CanvasItem_method_get_transform: + +- :ref:`Transform2D` **get_transform** **(** **)** |const| + +Returns the transform matrix of this item. + +---- + +.. _class_CanvasItem_method_get_viewport_rect: + +- :ref:`Rect2` **get_viewport_rect** **(** **)** |const| + +Returns the viewport's boundaries as a :ref:`Rect2`. + +---- + +.. _class_CanvasItem_method_get_viewport_transform: + +- :ref:`Transform2D` **get_viewport_transform** **(** **)** |const| + +Returns this item's transform in relation to the viewport. + +---- + +.. _class_CanvasItem_method_get_world_2d: + +- :ref:`World2D` **get_world_2d** **(** **)** |const| + +Returns the :ref:`World2D` where this item is in. + +---- + +.. _class_CanvasItem_method_hide: + +- void **hide** **(** **)** + +Hide the ``CanvasItem`` if it's currently visible. This is equivalent to setting :ref:`visible` to ``false``. + +---- + +.. _class_CanvasItem_method_is_local_transform_notification_enabled: + +- :ref:`bool` **is_local_transform_notification_enabled** **(** **)** |const| + +Returns ``true`` if local transform notifications are communicated to children. + +---- + +.. _class_CanvasItem_method_is_set_as_toplevel: + +- :ref:`bool` **is_set_as_toplevel** **(** **)** |const| + +Returns ``true`` if the node is set as top-level. See :ref:`set_as_toplevel`. + +---- + +.. _class_CanvasItem_method_is_transform_notification_enabled: + +- :ref:`bool` **is_transform_notification_enabled** **(** **)** |const| + +Returns ``true`` if global transform notifications are communicated to children. + +---- + +.. _class_CanvasItem_method_is_visible_in_tree: + +- :ref:`bool` **is_visible_in_tree** **(** **)** |const| + +Returns ``true`` if the node is present in the :ref:`SceneTree`, its :ref:`visible` property is ``true`` and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. + +---- + +.. _class_CanvasItem_method_make_canvas_position_local: + +- :ref:`Vector2` **make_canvas_position_local** **(** :ref:`Vector2` screen_point **)** |const| + +Assigns ``screen_point`` as this node's new local transform. + +---- + +.. _class_CanvasItem_method_make_input_local: + +- :ref:`InputEvent` **make_input_local** **(** :ref:`InputEvent` event **)** |const| + +Transformations issued by ``event``'s inputs are applied in local space instead of global space. + +---- + +.. _class_CanvasItem_method_set_as_toplevel: + +- void **set_as_toplevel** **(** :ref:`bool` enable **)** + +If ``enable`` is ``true``, the node won't inherit its transform from parent canvas items. + +---- + +.. _class_CanvasItem_method_set_notify_local_transform: + +- void **set_notify_local_transform** **(** :ref:`bool` enable **)** + +If ``enable`` is ``true``, children will be updated with local transform data. + +---- + +.. _class_CanvasItem_method_set_notify_transform: + +- void **set_notify_transform** **(** :ref:`bool` enable **)** + +If ``enable`` is ``true``, children will be updated with global transform data. + +---- + +.. _class_CanvasItem_method_show: + +- void **show** **(** **)** + +Show the ``CanvasItem`` if it's currently hidden. This is equivalent to setting :ref:`visible` to ``true``. For controls that inherit :ref:`Popup`, the correct way to make them visible is to call one of the multiple ``popup*()`` functions instead. + +---- + +.. _class_CanvasItem_method_update: + +- void **update** **(** **)** + +Queue the ``CanvasItem`` for update. :ref:`NOTIFICATION_DRAW` will be called on idle time to request redraw. + +.. |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.)` diff --git a/classes/class_canvasitemmaterial.rst b/classes/class_canvasitemmaterial.rst new file mode 100644 index 0000000..bb5e3b6 --- /dev/null +++ b/classes/class_canvasitemmaterial.rst @@ -0,0 +1,184 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CanvasItemMaterial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CanvasItemMaterial: + +CanvasItemMaterial +================== + +**Inherits:** :ref:`Material` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A material for :ref:`CanvasItem`\ s. + +Description +----------- + +``CanvasItemMaterial``\ s provide a means of modifying the textures associated with a CanvasItem. They specialize in describing blend and lighting behaviors for textures. Use a :ref:`ShaderMaterial` to more fully customize a material's interactions with a :ref:`CanvasItem`. + +Properties +---------- + ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`BlendMode` | :ref:`blend_mode` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`LightMode` | :ref:`light_mode` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`particles_anim_h_frames` | | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`particles_anim_loop` | | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`particles_anim_v_frames` | | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`particles_animation` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------+-----------+ + +Enumerations +------------ + +.. _enum_CanvasItemMaterial_BlendMode: + +.. _class_CanvasItemMaterial_constant_BLEND_MODE_MIX: + +.. _class_CanvasItemMaterial_constant_BLEND_MODE_ADD: + +.. _class_CanvasItemMaterial_constant_BLEND_MODE_SUB: + +.. _class_CanvasItemMaterial_constant_BLEND_MODE_MUL: + +.. _class_CanvasItemMaterial_constant_BLEND_MODE_PREMULT_ALPHA: + +enum **BlendMode**: + +- **BLEND_MODE_MIX** = **0** --- Mix blending mode. Colors are assumed to be independent of the alpha (opacity) value. + +- **BLEND_MODE_ADD** = **1** --- Additive blending mode. + +- **BLEND_MODE_SUB** = **2** --- Subtractive blending mode. + +- **BLEND_MODE_MUL** = **3** --- Multiplicative blending mode. + +- **BLEND_MODE_PREMULT_ALPHA** = **4** --- Mix blending mode. Colors are assumed to be premultiplied by the alpha (opacity) value. + +---- + +.. _enum_CanvasItemMaterial_LightMode: + +.. _class_CanvasItemMaterial_constant_LIGHT_MODE_NORMAL: + +.. _class_CanvasItemMaterial_constant_LIGHT_MODE_UNSHADED: + +.. _class_CanvasItemMaterial_constant_LIGHT_MODE_LIGHT_ONLY: + +enum **LightMode**: + +- **LIGHT_MODE_NORMAL** = **0** --- Render the material using both light and non-light sensitive material properties. + +- **LIGHT_MODE_UNSHADED** = **1** --- Render the material as if there were no light. + +- **LIGHT_MODE_LIGHT_ONLY** = **2** --- Render the material as if there were only light. + +Property Descriptions +--------------------- + +.. _class_CanvasItemMaterial_property_blend_mode: + +- :ref:`BlendMode` **blend_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_blend_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_blend_mode() | ++-----------+-----------------------+ + +The manner in which a material's rendering is applied to underlying textures. + +---- + +.. _class_CanvasItemMaterial_property_light_mode: + +- :ref:`LightMode` **light_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_light_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_light_mode() | ++-----------+-----------------------+ + +The manner in which material reacts to lighting. + +---- + +.. _class_CanvasItemMaterial_property_particles_anim_h_frames: + +- :ref:`int` **particles_anim_h_frames** + ++----------+------------------------------------+ +| *Setter* | set_particles_anim_h_frames(value) | ++----------+------------------------------------+ +| *Getter* | get_particles_anim_h_frames() | ++----------+------------------------------------+ + +The number of columns in the spritesheet assigned as :ref:`Texture` for a :ref:`Particles2D` or :ref:`CPUParticles2D`. + +**Note:** This property is only used and visible in the editor if :ref:`particles_animation` is ``true``. + +---- + +.. _class_CanvasItemMaterial_property_particles_anim_loop: + +- :ref:`bool` **particles_anim_loop** + ++----------+--------------------------------+ +| *Setter* | set_particles_anim_loop(value) | ++----------+--------------------------------+ +| *Getter* | get_particles_anim_loop() | ++----------+--------------------------------+ + +If ``true``, the particles animation will loop. + +**Note:** This property is only used and visible in the editor if :ref:`particles_animation` is ``true``. + +---- + +.. _class_CanvasItemMaterial_property_particles_anim_v_frames: + +- :ref:`int` **particles_anim_v_frames** + ++----------+------------------------------------+ +| *Setter* | set_particles_anim_v_frames(value) | ++----------+------------------------------------+ +| *Getter* | get_particles_anim_v_frames() | ++----------+------------------------------------+ + +The number of rows in the spritesheet assigned as :ref:`Texture` for a :ref:`Particles2D` or :ref:`CPUParticles2D`. + +**Note:** This property is only used and visible in the editor if :ref:`particles_animation` is ``true``. + +---- + +.. _class_CanvasItemMaterial_property_particles_animation: + +- :ref:`bool` **particles_animation** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_particles_animation(value) | ++-----------+--------------------------------+ +| *Getter* | get_particles_animation() | ++-----------+--------------------------------+ + +If ``true``, enable spritesheet-based animation features when assigned to :ref:`Particles2D` and :ref:`CPUParticles2D` nodes. The :ref:`ParticlesMaterial.anim_speed` or :ref:`CPUParticles2D.anim_speed` should also be set to a positive value for the animation to play. + +This property (and other ``particles_anim_*`` properties that depend on it) has no effect on other types of nodes. + +.. |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.)` diff --git a/classes/class_canvaslayer.rst b/classes/class_canvaslayer.rst new file mode 100644 index 0000000..bdab9ef --- /dev/null +++ b/classes/class_canvaslayer.rst @@ -0,0 +1,216 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CanvasLayer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CanvasLayer: + +CanvasLayer +=========== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ParallaxBackground` + +Canvas drawing layer. + +Description +----------- + +Canvas drawing layer. :ref:`CanvasItem` nodes that are direct or indirect children of a ``CanvasLayer`` will be drawn in that layer. The layer is a numeric index that defines the draw order. The default 2D scene renders with index 0, so a ``CanvasLayer`` with index -1 will be drawn below, and one with index 1 will be drawn above. This is very useful for HUDs (in layer 1+ or above), or backgrounds (in layer -1 or below). + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_transforms` + +- :doc:`../tutorials/2d/canvas_layers` + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Node` | :ref:`custom_viewport` | | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`bool` | :ref:`follow_viewport_enable` | ``false`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`float` | :ref:`follow_viewport_scale` | ``1.0`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`layer` | ``1`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`float` | :ref:`rotation` | ``0.0`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`float` | :ref:`rotation_degrees` | ``0.0`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Vector2` | :ref:`scale` | ``Vector2( 1, 1 )`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Transform2D` | :ref:`transform` | ``Transform2D( 1, 0, 0, 1, 0, 0 )`` | ++---------------------------------------+----------------------------------------------------------------------------------+-------------------------------------+ + +Methods +------- + ++-----------------------+----------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_canvas` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_CanvasLayer_property_custom_viewport: + +- :ref:`Node` **custom_viewport** + ++----------+----------------------------+ +| *Setter* | set_custom_viewport(value) | ++----------+----------------------------+ +| *Getter* | get_custom_viewport() | ++----------+----------------------------+ + +The custom :ref:`Viewport` node assigned to the ``CanvasLayer``. If ``null``, uses the default viewport instead. + +---- + +.. _class_CanvasLayer_property_follow_viewport_enable: + +- :ref:`bool` **follow_viewport_enable** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_follow_viewport(value) | ++-----------+----------------------------+ +| *Getter* | is_following_viewport() | ++-----------+----------------------------+ + +Sets the layer to follow the viewport in order to simulate a pseudo 3D effect. + +---- + +.. _class_CanvasLayer_property_follow_viewport_scale: + +- :ref:`float` **follow_viewport_scale** + ++-----------+----------------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------------+ +| *Setter* | set_follow_viewport_scale(value) | ++-----------+----------------------------------+ +| *Getter* | get_follow_viewport_scale() | ++-----------+----------------------------------+ + +Scales the layer when using :ref:`follow_viewport_enable`. Layers moving into the foreground should have increasing scales, while layers moving into the background should have decreasing scales. + +---- + +.. _class_CanvasLayer_property_layer: + +- :ref:`int` **layer** + ++-----------+------------------+ +| *Default* | ``1`` | ++-----------+------------------+ +| *Setter* | set_layer(value) | ++-----------+------------------+ +| *Getter* | get_layer() | ++-----------+------------------+ + +Layer index for draw order. Lower values are drawn first. + +---- + +.. _class_CanvasLayer_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The layer's base offset. + +---- + +.. _class_CanvasLayer_property_rotation: + +- :ref:`float` **rotation** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_rotation(value) | ++-----------+---------------------+ +| *Getter* | get_rotation() | ++-----------+---------------------+ + +The layer's rotation in radians. + +---- + +.. _class_CanvasLayer_property_rotation_degrees: + +- :ref:`float` **rotation_degrees** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_rotation_degrees(value) | ++-----------+-----------------------------+ +| *Getter* | get_rotation_degrees() | ++-----------+-----------------------------+ + +The layer's rotation in degrees. + +---- + +.. _class_CanvasLayer_property_scale: + +- :ref:`Vector2` **scale** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_scale(value) | ++-----------+---------------------+ +| *Getter* | get_scale() | ++-----------+---------------------+ + +The layer's scale. + +---- + +.. _class_CanvasLayer_property_transform: + +- :ref:`Transform2D` **transform** + ++-----------+-------------------------------------+ +| *Default* | ``Transform2D( 1, 0, 0, 1, 0, 0 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-------------------------------------+ +| *Getter* | get_transform() | ++-----------+-------------------------------------+ + +The layer's transform. + +Method Descriptions +------------------- + +.. _class_CanvasLayer_method_get_canvas: + +- :ref:`RID` **get_canvas** **(** **)** |const| + +Returns the RID of the canvas used by this layer. + +.. |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.)` diff --git a/classes/class_canvasmodulate.rst b/classes/class_canvasmodulate.rst new file mode 100644 index 0000000..1462bda --- /dev/null +++ b/classes/class_canvasmodulate.rst @@ -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 CanvasModulate.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CanvasModulate: + +CanvasModulate +============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Tint the entire canvas. + +Description +----------- + +``CanvasModulate`` tints the canvas elements using its assigned :ref:`color`. + +Properties +---------- + ++---------------------------+---------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+---------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_CanvasModulate_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The tint color to apply. + +.. |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.)` diff --git a/classes/class_capsulemesh.rst b/classes/class_capsulemesh.rst new file mode 100644 index 0000000..a2cbad7 --- /dev/null +++ b/classes/class_capsulemesh.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CapsuleMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CapsuleMesh: + +CapsuleMesh +=========== + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a capsule-shaped :ref:`PrimitiveMesh`. + +Description +----------- + +Class representing a capsule-shaped :ref:`PrimitiveMesh`. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`mid_height` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`radial_segments` | ``64`` | ++---------------------------+--------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`rings` | ``8`` | ++---------------------------+--------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_CapsuleMesh_property_mid_height: + +- :ref:`float` **mid_height** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_mid_height(value) | ++-----------+-----------------------+ +| *Getter* | get_mid_height() | ++-----------+-----------------------+ + +Height of the middle cylindrical part of the capsule (without the hemispherical ends). + +**Note:** The capsule's total height is equal to :ref:`mid_height` + 2 \* :ref:`radius`. + +---- + +.. _class_CapsuleMesh_property_radial_segments: + +- :ref:`int` **radial_segments** + ++-----------+----------------------------+ +| *Default* | ``64`` | ++-----------+----------------------------+ +| *Setter* | set_radial_segments(value) | ++-----------+----------------------------+ +| *Getter* | get_radial_segments() | ++-----------+----------------------------+ + +Number of radial segments on the capsule mesh. + +---- + +.. _class_CapsuleMesh_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +Radius of the capsule mesh. + +---- + +.. _class_CapsuleMesh_property_rings: + +- :ref:`int` **rings** + ++-----------+------------------+ +| *Default* | ``8`` | ++-----------+------------------+ +| *Setter* | set_rings(value) | ++-----------+------------------+ +| *Getter* | get_rings() | ++-----------+------------------+ + +Number of rings along the height of the capsule. + +.. |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.)` diff --git a/classes/class_capsuleshape.rst b/classes/class_capsuleshape.rst new file mode 100644 index 0000000..7ef0dec --- /dev/null +++ b/classes/class_capsuleshape.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CapsuleShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CapsuleShape: + +CapsuleShape +============ + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Capsule shape for collisions. + +Description +----------- + +Capsule shape for collisions. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +Properties +---------- + ++---------------------------+---------------------------------------------------+---------+ +| :ref:`float` | :ref:`height` | ``1.0`` | ++---------------------------+---------------------------------------------------+---------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+---------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_CapsuleShape_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +The capsule's height. + +---- + +.. _class_CapsuleShape_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The capsule's radius. + +.. |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.)` diff --git a/classes/class_capsuleshape2d.rst b/classes/class_capsuleshape2d.rst new file mode 100644 index 0000000..071a0b1 --- /dev/null +++ b/classes/class_capsuleshape2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CapsuleShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CapsuleShape2D: + +CapsuleShape2D +============== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Capsule shape for 2D collisions. + +Description +----------- + +Capsule shape for 2D collisions. + +Properties +---------- + ++---------------------------+-----------------------------------------------------+----------+ +| :ref:`float` | :ref:`height` | ``20.0`` | ++---------------------------+-----------------------------------------------------+----------+ +| :ref:`float` | :ref:`radius` | ``10.0`` | ++---------------------------+-----------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_CapsuleShape2D_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``20.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +The capsule's height. + +---- + +.. _class_CapsuleShape2D_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``10.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The capsule's radius. + +.. |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.)` diff --git a/classes/class_centercontainer.rst b/classes/class_centercontainer.rst new file mode 100644 index 0000000..0d459af --- /dev/null +++ b/classes/class_centercontainer.rst @@ -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 CenterContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CenterContainer: + +CenterContainer +=============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Keeps children controls centered. + +Description +----------- + +CenterContainer keeps children controls centered. This container keeps all children to their minimum size, in the center. + +Properties +---------- + ++-------------------------+------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_top_left` | ``false`` | ++-------------------------+------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_CenterContainer_property_use_top_left: + +- :ref:`bool` **use_top_left** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_use_top_left(value) | ++-----------+-------------------------+ +| *Getter* | is_using_top_left() | ++-----------+-------------------------+ + +If ``true``, centers children relative to the ``CenterContainer``'s top left corner. + +.. |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.)` diff --git a/classes/class_charfxtransform.rst b/classes/class_charfxtransform.rst new file mode 100644 index 0000000..135c0a7 --- /dev/null +++ b/classes/class_charfxtransform.rst @@ -0,0 +1,194 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CharFXTransform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CharFXTransform: + +CharFXTransform +=============== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Controls how an individual character will be displayed in a :ref:`RichTextEffect`. + +Description +----------- + +By setting various properties on this object, you can control how individual characters will be displayed in a :ref:`RichTextEffect`. + +Tutorials +--------- + +- :doc:`../tutorials/ui/bbcode_in_richtextlabel` + +- `https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project `__ + +Properties +---------- + ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`absolute_index` | ``0`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`character` | ``0`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 0, 0, 0, 1 )`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`elapsed_time` | ``0.0`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Dictionary` | :ref:`env` | ``{}`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`relative_index` | ``0`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`visible` | ``true`` | ++-------------------------------------+----------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_CharFXTransform_property_absolute_index: + +- :ref:`int` **absolute_index** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_absolute_index(value) | ++-----------+---------------------------+ +| *Getter* | get_absolute_index() | ++-----------+---------------------------+ + +The index of the current character (starting from 0) for the :ref:`RichTextLabel`'s BBCode text. Setting this property won't affect drawing. + +---- + +.. _class_CharFXTransform_property_character: + +- :ref:`int` **character** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_character(value) | ++-----------+----------------------+ +| *Getter* | get_character() | ++-----------+----------------------+ + +The Unicode codepoint the character will use. This only affects non-whitespace characters. :ref:`@GDScript.ord` can be useful here. For example, the following will replace all characters with asterisks: + +:: + + # `char_fx` is the CharFXTransform parameter from `_process_custom_fx()`. + # See the RichTextEffect documentation for details. + char_fx.character = ord("*") + +---- + +.. _class_CharFXTransform_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The color the character will be drawn with. + +---- + +.. _class_CharFXTransform_property_elapsed_time: + +- :ref:`float` **elapsed_time** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_elapsed_time(value) | ++-----------+-------------------------+ +| *Getter* | get_elapsed_time() | ++-----------+-------------------------+ + +The time elapsed since the :ref:`RichTextLabel` was added to the scene tree (in seconds). Time stops when the :ref:`RichTextLabel` is paused (see :ref:`Node.pause_mode`). Resets when the text in the :ref:`RichTextLabel` is changed. + +**Note:** Time still passes while the :ref:`RichTextLabel` is hidden. + +---- + +.. _class_CharFXTransform_property_env: + +- :ref:`Dictionary` **env** + ++-----------+------------------------+ +| *Default* | ``{}`` | ++-----------+------------------------+ +| *Setter* | set_environment(value) | ++-----------+------------------------+ +| *Getter* | get_environment() | ++-----------+------------------------+ + +Contains the arguments passed in the opening BBCode tag. By default, arguments are strings; if their contents match a type such as :ref:`bool`, :ref:`int` or :ref:`float`, they will be converted automatically. Color codes in the form ``#rrggbb`` or ``#rgb`` will be converted to an opaque :ref:`Color`. String arguments may not contain spaces, even if they're quoted. If present, quotes will also be present in the final string. + +For example, the opening BBCode tag ``[example foo=hello bar=true baz=42 color=#ffffff]`` will map to the following :ref:`Dictionary`: + +:: + + {"foo": "hello", "bar": true, "baz": 42, "color": Color(1, 1, 1, 1)} + +---- + +.. _class_CharFXTransform_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The position offset the character will be drawn with (in pixels). + +---- + +.. _class_CharFXTransform_property_relative_index: + +- :ref:`int` **relative_index** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_relative_index(value) | ++-----------+---------------------------+ +| *Getter* | get_relative_index() | ++-----------+---------------------------+ + +The index of the current character (starting from 0) for this :ref:`RichTextEffect` custom block. Setting this property won't affect drawing. + +---- + +.. _class_CharFXTransform_property_visible: + +- :ref:`bool` **visible** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_visibility(value) | ++-----------+-----------------------+ +| *Getter* | is_visible() | ++-----------+-----------------------+ + +If ``true``, the character will be drawn. If ``false``, the character will be hidden. Characters around hidden characters will reflow to take the space of hidden characters. If this is not desired, set their :ref:`color` to ``Color(1, 1, 1, 0)`` instead. + +.. |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.)` diff --git a/classes/class_checkbox.rst b/classes/class_checkbox.rst new file mode 100644 index 0000000..c7353f4 --- /dev/null +++ b/classes/class_checkbox.rst @@ -0,0 +1,298 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CheckBox.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CheckBox: + +CheckBox +======== + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Binary choice user interface widget. See also :ref:`CheckButton`. + +Description +----------- + +A checkbox allows the user to make a binary choice (choosing only one of two possible options). It's similar to :ref:`CheckButton` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckBox when toggling it has **no** immediate effect on something. For instance, it should be used when toggling it will only do something once a confirmation button is pressed. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Properties +---------- + ++-----------------------------------------+-------------+------------------------------+ +| :ref:`TextAlign` | align | ``0`` *(parent override)* | ++-----------------------------------------+-------------+------------------------------+ +| :ref:`bool` | toggle_mode | ``true`` *(parent override)* | ++-----------------------------------------+-------------+------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`check_vadjust` | ``0`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`checked` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`checked_disabled` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_checked` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_checked_disabled` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_unchecked` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_unchecked_disabled` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`unchecked` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`unchecked_disabled` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover_pressed` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+--------------------------------------------------------------------------------------+----------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_CheckBox_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckBox`` text's font color. + +---- + +.. _class_CheckBox_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +The ``CheckBox`` text's font color when it's disabled. + +---- + +.. _class_CheckBox_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckBox`` text's font color when it's focused. Only replaces the normal text color of the checkbox. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_CheckBox_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckBox`` text's font color when it's hovered. + +---- + +.. _class_CheckBox_theme_color_font_color_hover_pressed: + +- :ref:`Color` **font_color_hover_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The ``CheckBox`` text's font color when it's hovered and pressed. + +---- + +.. _class_CheckBox_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The ``CheckBox`` text's font color when it's pressed. + +---- + +.. _class_CheckBox_theme_constant_check_vadjust: + +- :ref:`int` **check_vadjust** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +The vertical offset used when rendering the check icons (in pixels). + +---- + +.. _class_CheckBox_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The separation between the check icon and the text (in pixels). + +---- + +.. _class_CheckBox_theme_font_font: + +- :ref:`Font` **font** + +The :ref:`Font` to use for the ``CheckBox`` text. + +---- + +.. _class_CheckBox_theme_icon_checked: + +- :ref:`Texture` **checked** + +The check icon to display when the ``CheckBox`` is checked. + +---- + +.. _class_CheckBox_theme_icon_checked_disabled: + +- :ref:`Texture` **checked_disabled** + +The check icon to display when the ``CheckBox`` is checked and disabled. + +---- + +.. _class_CheckBox_theme_icon_radio_checked: + +- :ref:`Texture` **radio_checked** + +If the ``CheckBox`` is configured as a radio button, the icon to display when the ``CheckBox`` is checked. + +---- + +.. _class_CheckBox_theme_icon_radio_checked_disabled: + +- :ref:`Texture` **radio_checked_disabled** + +---- + +.. _class_CheckBox_theme_icon_radio_unchecked: + +- :ref:`Texture` **radio_unchecked** + +If the ``CheckBox`` is configured as a radio button, the icon to display when the ``CheckBox`` is unchecked. + +---- + +.. _class_CheckBox_theme_icon_radio_unchecked_disabled: + +- :ref:`Texture` **radio_unchecked_disabled** + +---- + +.. _class_CheckBox_theme_icon_unchecked: + +- :ref:`Texture` **unchecked** + +The check icon to display when the ``CheckBox`` is unchecked. + +---- + +.. _class_CheckBox_theme_icon_unchecked_disabled: + +- :ref:`Texture` **unchecked_disabled** + +The check icon to display when the ``CheckBox`` is unchecked and disabled. + +---- + +.. _class_CheckBox_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +The :ref:`StyleBox` to display as a background when the ``CheckBox`` is disabled. + +---- + +.. _class_CheckBox_theme_style_focus: + +- :ref:`StyleBox` **focus** + +The :ref:`StyleBox` to display as a background when the ``CheckBox`` is focused. + +---- + +.. _class_CheckBox_theme_style_hover: + +- :ref:`StyleBox` **hover** + +The :ref:`StyleBox` to display as a background when the ``CheckBox`` is hovered. + +---- + +.. _class_CheckBox_theme_style_hover_pressed: + +- :ref:`StyleBox` **hover_pressed** + +The :ref:`StyleBox` to display as a background when the ``CheckBox`` is hovered and pressed. + +---- + +.. _class_CheckBox_theme_style_normal: + +- :ref:`StyleBox` **normal** + +The :ref:`StyleBox` to display as a background. + +---- + +.. _class_CheckBox_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +The :ref:`StyleBox` to display as a background when the ``CheckBox`` is pressed. + +.. |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.)` diff --git a/classes/class_checkbutton.rst b/classes/class_checkbutton.rst new file mode 100644 index 0000000..8ed5bfa --- /dev/null +++ b/classes/class_checkbutton.rst @@ -0,0 +1,262 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CheckButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CheckButton: + +CheckButton +=========== + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Checkable button. See also :ref:`CheckBox`. + +Description +----------- + +CheckButton is a toggle button displayed as a check field. It's similar to :ref:`CheckBox` in functionality, but it has a different appearance. To follow established UX patterns, it's recommended to use CheckButton when toggling it has an **immediate** effect on something. For instance, it should be used if toggling it enables/disables a setting without requiring the user to press a confirmation button. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Properties +---------- + ++-----------------------------------------+-------------+------------------------------+ +| :ref:`TextAlign` | align | ``0`` *(parent override)* | ++-----------------------------------------+-------------+------------------------------+ +| :ref:`bool` | toggle_mode | ``true`` *(parent override)* | ++-----------------------------------------+-------------+------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`check_vadjust` | ``0`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`off` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`off_disabled` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`on` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`on_disabled` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover_pressed` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+-----------------------------------------------------------------------------------------+----------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_CheckButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckButton`` text's font color. + +---- + +.. _class_CheckButton_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +The ``CheckButton`` text's font color when it's disabled. + +---- + +.. _class_CheckButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckButton`` text's font color when it's focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_CheckButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +The ``CheckButton`` text's font color when it's hovered. + +---- + +.. _class_CheckButton_theme_color_font_color_hover_pressed: + +- :ref:`Color` **font_color_hover_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The ``CheckButton`` text's font color when it's hovered and pressed. + +---- + +.. _class_CheckButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The ``CheckButton`` text's font color when it's pressed. + +---- + +.. _class_CheckButton_theme_constant_check_vadjust: + +- :ref:`int` **check_vadjust** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +The vertical offset used when rendering the toggle icons (in pixels). + +---- + +.. _class_CheckButton_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The separation between the toggle icon and the text (in pixels). + +---- + +.. _class_CheckButton_theme_font_font: + +- :ref:`Font` **font** + +The :ref:`Font` to use for the ``CheckButton`` text. + +---- + +.. _class_CheckButton_theme_icon_off: + +- :ref:`Texture` **off** + +The icon to display when the ``CheckButton`` is unchecked. + +---- + +.. _class_CheckButton_theme_icon_off_disabled: + +- :ref:`Texture` **off_disabled** + +The icon to display when the ``CheckButton`` is unchecked and disabled. + +---- + +.. _class_CheckButton_theme_icon_on: + +- :ref:`Texture` **on** + +The icon to display when the ``CheckButton`` is checked. + +---- + +.. _class_CheckButton_theme_icon_on_disabled: + +- :ref:`Texture` **on_disabled** + +The icon to display when the ``CheckButton`` is checked and disabled. + +---- + +.. _class_CheckButton_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +The :ref:`StyleBox` to display as a background when the ``CheckButton`` is disabled. + +---- + +.. _class_CheckButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +The :ref:`StyleBox` to display as a background when the ``CheckButton`` is focused. + +---- + +.. _class_CheckButton_theme_style_hover: + +- :ref:`StyleBox` **hover** + +The :ref:`StyleBox` to display as a background when the ``CheckButton`` is hovered. + +---- + +.. _class_CheckButton_theme_style_hover_pressed: + +- :ref:`StyleBox` **hover_pressed** + +The :ref:`StyleBox` to display as a background when the ``CheckButton`` is hovered and pressed. + +---- + +.. _class_CheckButton_theme_style_normal: + +- :ref:`StyleBox` **normal** + +The :ref:`StyleBox` to display as a background. + +---- + +.. _class_CheckButton_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +The :ref:`StyleBox` to display as a background when the ``CheckButton`` is pressed. + +.. |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.)` diff --git a/classes/class_circleshape2d.rst b/classes/class_circleshape2d.rst new file mode 100644 index 0000000..333e2a9 --- /dev/null +++ b/classes/class_circleshape2d.rst @@ -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 CircleShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CircleShape2D: + +CircleShape2D +============= + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Circular shape for 2D collisions. + +Description +----------- + +Circular shape for 2D collisions. This shape is useful for modeling balls or small characters and its collision detection with everything else is very fast. + +Properties +---------- + ++---------------------------+----------------------------------------------------+----------+ +| :ref:`float` | :ref:`radius` | ``10.0`` | ++---------------------------+----------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_CircleShape2D_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``10.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The circle's radius. + +.. |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.)` diff --git a/classes/class_classdb.rst b/classes/class_classdb.rst new file mode 100644 index 0000000..f8595ec --- /dev/null +++ b/classes/class_classdb.rst @@ -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 ClassDB.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ClassDB: + +ClassDB +======= + +**Inherits:** :ref:`Object` + +Class information repository. + +Description +----------- + +Provides access to metadata stored for every available class. + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_instance` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`class_exists` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`class_get_category` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`class_get_enum_constants` **(** :ref:`String` class, :ref:`String` enum, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`class_get_enum_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`class_get_integer_constant` **(** :ref:`String` class, :ref:`String` name **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`class_get_integer_constant_enum` **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`class_get_integer_constant_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`class_get_method_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`class_get_property` **(** :ref:`Object` object, :ref:`String` property **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`class_get_property_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`class_get_signal` **(** :ref:`String` class, :ref:`String` signal **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`class_get_signal_list` **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`class_has_enum` **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`class_has_integer_constant` **(** :ref:`String` class, :ref:`String` name **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`class_has_method` **(** :ref:`String` class, :ref:`String` method, :ref:`bool` no_inheritance=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`class_has_signal` **(** :ref:`String` class, :ref:`String` signal **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`class_set_property` **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_class_list` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_inheriters_from_class` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_parent_class` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`instance` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_class_enabled` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_parent_class` **(** :ref:`String` class, :ref:`String` inherits **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ClassDB_method_can_instance: + +- :ref:`bool` **can_instance** **(** :ref:`String` class **)** |const| + +Returns ``true`` if you can instance objects from the specified ``class``, ``false`` in other case. + +---- + +.. _class_ClassDB_method_class_exists: + +- :ref:`bool` **class_exists** **(** :ref:`String` class **)** |const| + +Returns whether the specified ``class`` is available or not. + +---- + +.. _class_ClassDB_method_class_get_category: + +- :ref:`String` **class_get_category** **(** :ref:`String` class **)** |const| + +Returns a category associated with the class for use in documentation and the Asset Library. Debug mode required. + +---- + +.. _class_ClassDB_method_class_get_enum_constants: + +- :ref:`PoolStringArray` **class_get_enum_constants** **(** :ref:`String` class, :ref:`String` enum, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with all the keys in ``enum`` of ``class`` or its ancestry. + +---- + +.. _class_ClassDB_method_class_get_enum_list: + +- :ref:`PoolStringArray` **class_get_enum_list** **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with all the enums of ``class`` or its ancestry. + +---- + +.. _class_ClassDB_method_class_get_integer_constant: + +- :ref:`int` **class_get_integer_constant** **(** :ref:`String` class, :ref:`String` name **)** |const| + +Returns the value of the integer constant ``name`` of ``class`` or its ancestry. Always returns 0 when the constant could not be found. + +---- + +.. _class_ClassDB_method_class_get_integer_constant_enum: + +- :ref:`String` **class_get_integer_constant_enum** **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| + +Returns which enum the integer constant ``name`` of ``class`` or its ancestry belongs to. + +---- + +.. _class_ClassDB_method_class_get_integer_constant_list: + +- :ref:`PoolStringArray` **class_get_integer_constant_list** **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with the names all the integer constants of ``class`` or its ancestry. + +---- + +.. _class_ClassDB_method_class_get_method_list: + +- :ref:`Array` **class_get_method_list** **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with all the methods of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary` with the following keys: ``args``, ``default_args``, ``flags``, ``id``, ``name``, ``return: (class_name, hint, hint_string, name, type, usage)``. + +**Note:** In exported release builds the debug info is not available, so the returned dictionaries will contain only method names. + +---- + +.. _class_ClassDB_method_class_get_property: + +- :ref:`Variant` **class_get_property** **(** :ref:`Object` object, :ref:`String` property **)** |const| + +Returns the value of ``property`` of ``class`` or its ancestry. + +---- + +.. _class_ClassDB_method_class_get_property_list: + +- :ref:`Array` **class_get_property_list** **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with all the properties of ``class`` or its ancestry if ``no_inheritance`` is ``false``. + +---- + +.. _class_ClassDB_method_class_get_signal: + +- :ref:`Dictionary` **class_get_signal** **(** :ref:`String` class, :ref:`String` signal **)** |const| + +Returns the ``signal`` data of ``class`` or its ancestry. The returned value is a :ref:`Dictionary` with the following keys: ``args``, ``default_args``, ``flags``, ``id``, ``name``, ``return: (class_name, hint, hint_string, name, type, usage)``. + +---- + +.. _class_ClassDB_method_class_get_signal_list: + +- :ref:`Array` **class_get_signal_list** **(** :ref:`String` class, :ref:`bool` no_inheritance=false **)** |const| + +Returns an array with all the signals of ``class`` or its ancestry if ``no_inheritance`` is ``false``. Every element of the array is a :ref:`Dictionary` as described in :ref:`class_get_signal`. + +---- + +.. _class_ClassDB_method_class_has_enum: + +- :ref:`bool` **class_has_enum** **(** :ref:`String` class, :ref:`String` name, :ref:`bool` no_inheritance=false **)** |const| + +Returns whether ``class`` or its ancestry has an enum called ``name`` or not. + +---- + +.. _class_ClassDB_method_class_has_integer_constant: + +- :ref:`bool` **class_has_integer_constant** **(** :ref:`String` class, :ref:`String` name **)** |const| + +Returns whether ``class`` or its ancestry has an integer constant called ``name`` or not. + +---- + +.. _class_ClassDB_method_class_has_method: + +- :ref:`bool` **class_has_method** **(** :ref:`String` class, :ref:`String` method, :ref:`bool` no_inheritance=false **)** |const| + +Returns whether ``class`` (or its ancestry if ``no_inheritance`` is ``false``) has a method called ``method`` or not. + +---- + +.. _class_ClassDB_method_class_has_signal: + +- :ref:`bool` **class_has_signal** **(** :ref:`String` class, :ref:`String` signal **)** |const| + +Returns whether ``class`` or its ancestry has a signal called ``signal`` or not. + +---- + +.. _class_ClassDB_method_class_set_property: + +- :ref:`Error` **class_set_property** **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** |const| + +Sets ``property`` value of ``class`` to ``value``. + +---- + +.. _class_ClassDB_method_get_class_list: + +- :ref:`PoolStringArray` **get_class_list** **(** **)** |const| + +Returns the names of all the classes available. + +---- + +.. _class_ClassDB_method_get_inheriters_from_class: + +- :ref:`PoolStringArray` **get_inheriters_from_class** **(** :ref:`String` class **)** |const| + +Returns the names of all the classes that directly or indirectly inherit from ``class``. + +---- + +.. _class_ClassDB_method_get_parent_class: + +- :ref:`String` **get_parent_class** **(** :ref:`String` class **)** |const| + +Returns the parent class of ``class``. + +---- + +.. _class_ClassDB_method_instance: + +- :ref:`Variant` **instance** **(** :ref:`String` class **)** |const| + +Creates an instance of ``class``. + +---- + +.. _class_ClassDB_method_is_class_enabled: + +- :ref:`bool` **is_class_enabled** **(** :ref:`String` class **)** |const| + +Returns whether this ``class`` is enabled or not. + +---- + +.. _class_ClassDB_method_is_parent_class: + +- :ref:`bool` **is_parent_class** **(** :ref:`String` class, :ref:`String` inherits **)** |const| + +Returns whether ``inherits`` is an ancestor of ``class`` or not. + +.. |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.)` diff --git a/classes/class_clippedcamera.rst b/classes/class_clippedcamera.rst new file mode 100644 index 0000000..d911d9f --- /dev/null +++ b/classes/class_clippedcamera.rst @@ -0,0 +1,224 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ClippedCamera.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ClippedCamera: + +ClippedCamera +============= + +**Inherits:** :ref:`Camera` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A :ref:`Camera` that includes collision. + +Description +----------- + +This node extends :ref:`Camera` to add collisions with :ref:`Area` and/or :ref:`PhysicsBody` nodes. The camera cannot move through colliding objects. + +Properties +---------- + ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`clip_to_areas` | ``false`` | ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`clip_to_bodies` | ``true`` | ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`margin` | ``0.0`` | ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ +| :ref:`ProcessMode` | :ref:`process_mode` | ``0`` | ++----------------------------------------------------+--------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception` **(** :ref:`Object` node **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception_rid` **(** :ref:`RID` rid **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_exceptions` **(** **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_clip_offset` **(** **)** |const| | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception` **(** :ref:`Object` node **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception_rid` **(** :ref:`RID` rid **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ClippedCamera_ProcessMode: + +.. _class_ClippedCamera_constant_CLIP_PROCESS_PHYSICS: + +.. _class_ClippedCamera_constant_CLIP_PROCESS_IDLE: + +enum **ProcessMode**: + +- **CLIP_PROCESS_PHYSICS** = **0** --- The camera updates with the ``_physics_process`` callback. + +- **CLIP_PROCESS_IDLE** = **1** --- The camera updates with the ``_process`` callback. + +Property Descriptions +--------------------- + +.. _class_ClippedCamera_property_clip_to_areas: + +- :ref:`bool` **clip_to_areas** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_clip_to_areas(value) | ++-----------+----------------------------+ +| *Getter* | is_clip_to_areas_enabled() | ++-----------+----------------------------+ + +If ``true``, the camera stops on contact with :ref:`Area`\ s. + +---- + +.. _class_ClippedCamera_property_clip_to_bodies: + +- :ref:`bool` **clip_to_bodies** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_clip_to_bodies(value) | ++-----------+-----------------------------+ +| *Getter* | is_clip_to_bodies_enabled() | ++-----------+-----------------------------+ + +If ``true``, the camera stops on contact with :ref:`PhysicsBody`\ s. + +---- + +.. _class_ClippedCamera_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The camera's collision mask. Only objects in at least one collision layer matching the mask will be detected. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_ClippedCamera_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +The camera's collision margin. The camera can't get closer than this distance to a colliding object. + +---- + +.. _class_ClippedCamera_property_process_mode: + +- :ref:`ProcessMode` **process_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_process_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_process_mode() | ++-----------+-------------------------+ + +The camera's process callback. See :ref:`ProcessMode`. + +Method Descriptions +------------------- + +.. _class_ClippedCamera_method_add_exception: + +- void **add_exception** **(** :ref:`Object` node **)** + +Adds a collision exception so the camera does not collide with the specified node. + +---- + +.. _class_ClippedCamera_method_add_exception_rid: + +- void **add_exception_rid** **(** :ref:`RID` rid **)** + +Adds a collision exception so the camera does not collide with the specified :ref:`RID`. + +---- + +.. _class_ClippedCamera_method_clear_exceptions: + +- void **clear_exceptions** **(** **)** + +Removes all collision exceptions. + +---- + +.. _class_ClippedCamera_method_get_clip_offset: + +- :ref:`float` **get_clip_offset** **(** **)** |const| + +Returns the distance the camera has been offset due to a collision. + +---- + +.. _class_ClippedCamera_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns ``true`` if the specified bit index is on. + +**Note:** Bit indices range from 0-19. + +---- + +.. _class_ClippedCamera_method_remove_exception: + +- void **remove_exception** **(** :ref:`Object` node **)** + +Removes a collision exception with the specified node. + +---- + +.. _class_ClippedCamera_method_remove_exception_rid: + +- void **remove_exception_rid** **(** :ref:`RID` rid **)** + +Removes a collision exception with the specified :ref:`RID`. + +---- + +.. _class_ClippedCamera_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets the specified bit index to the ``value``. + +**Note:** Bit indices range from 0-19. + +.. |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.)` diff --git a/classes/class_collisionobject.rst b/classes/class_collisionobject.rst new file mode 100644 index 0000000..932bb65 --- /dev/null +++ b/classes/class_collisionobject.rst @@ -0,0 +1,352 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionObject.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionObject: + +CollisionObject +=============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`Area`, :ref:`PhysicsBody` + +Base node for collision objects. + +Description +----------- + +CollisionObject is the base class for physics objects. It can hold any number of collision :ref:`Shape`\ s. Each shape must be assigned to a *shape owner*. The CollisionObject can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the ``shape_owner_*`` methods. + +Properties +---------- + ++-------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++-------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++-------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`input_capture_on_drag` | ``false`` | ++-------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`input_ray_pickable` | ``true`` | ++-------------------------+------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_input_event` **(** :ref:`Object` camera, :ref:`InputEvent` event, :ref:`Vector3` position, :ref:`Vector3` normal, :ref:`int` shape_idx **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`create_shape_owner` **(** :ref:`Object` owner **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_rid` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_shape_owners` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_shape_owner_disabled` **(** :ref:`int` owner_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_shape_owner` **(** :ref:`int` owner_id **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_find_owner` **(** :ref:`int` shape_index **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_add_shape` **(** :ref:`int` owner_id, :ref:`Shape` shape **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_clear_shapes` **(** :ref:`int` owner_id **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`shape_owner_get_owner` **(** :ref:`int` owner_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Shape` | :ref:`shape_owner_get_shape` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_owner_get_shape_count` **(** :ref:`int` owner_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_owner_get_shape_index` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`shape_owner_get_transform` **(** :ref:`int` owner_id **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_remove_shape` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_disabled` **(** :ref:`int` owner_id, :ref:`bool` disabled **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_transform` **(** :ref:`int` owner_id, :ref:`Transform` transform **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_CollisionObject_signal_input_event: + +- **input_event** **(** :ref:`Node` camera, :ref:`InputEvent` event, :ref:`Vector3` position, :ref:`Vector3` normal, :ref:`int` shape_idx **)** + +Emitted when the object receives an unhandled :ref:`InputEvent`. ``position`` is the location in world space of the mouse pointer on the surface of the shape with index ``shape_idx`` and ``normal`` is the normal vector of the surface at that point. + +---- + +.. _class_CollisionObject_signal_mouse_entered: + +- **mouse_entered** **(** **)** + +Emitted when the mouse pointer enters any of this object's shapes. + +---- + +.. _class_CollisionObject_signal_mouse_exited: + +- **mouse_exited** **(** **)** + +Emitted when the mouse pointer exits all this object's shapes. + +Property Descriptions +--------------------- + +.. _class_CollisionObject_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layers this CollisionObject3D is in. Collision objects can exist in one or more of 32 different layers. See also :ref:`collision_mask`. + +**Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CollisionObject_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layers this CollisionObject3D scans. Collision objects can scan one or more of 32 different layers. See also :ref:`collision_layer`. + +**Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CollisionObject_property_input_capture_on_drag: + +- :ref:`bool` **input_capture_on_drag** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_capture_input_on_drag(value) | ++-----------+----------------------------------+ +| *Getter* | get_capture_input_on_drag() | ++-----------+----------------------------------+ + +If ``true``, the ``CollisionObject`` will continue to receive input events as the mouse is dragged across its shapes. + +---- + +.. _class_CollisionObject_property_input_ray_pickable: + +- :ref:`bool` **input_ray_pickable** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_ray_pickable(value) | ++-----------+-------------------------+ +| *Getter* | is_ray_pickable() | ++-----------+-------------------------+ + +If ``true``, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one :ref:`collision_layer` bit to be set. + +Method Descriptions +------------------- + +.. _class_CollisionObject_method__input_event: + +- void **_input_event** **(** :ref:`Object` camera, :ref:`InputEvent` event, :ref:`Vector3` position, :ref:`Vector3` normal, :ref:`int` shape_idx **)** |virtual| + +Receives unhandled :ref:`InputEvent`\ s. ``position`` is the location in world space of the mouse pointer on the surface of the shape with index ``shape_idx`` and ``normal`` is the normal vector of the surface at that point. Connect to the :ref:`input_event` signal to easily pick up these events. + +---- + +.. _class_CollisionObject_method_create_shape_owner: + +- :ref:`int` **create_shape_owner** **(** :ref:`Object` owner **)** + +Creates a new shape owner for the given object. Returns ``owner_id`` of the new owner for future reference. + +---- + +.. _class_CollisionObject_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns whether or not the specified ``bit`` of the :ref:`collision_layer` is set. + +---- + +.. _class_CollisionObject_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns whether or not the specified ``bit`` of the :ref:`collision_mask` is set. + +---- + +.. _class_CollisionObject_method_get_rid: + +- :ref:`RID` **get_rid** **(** **)** |const| + +Returns the object's :ref:`RID`. + +---- + +.. _class_CollisionObject_method_get_shape_owners: + +- :ref:`Array` **get_shape_owners** **(** **)** + +Returns an :ref:`Array` of ``owner_id`` identifiers. You can use these ids in other methods that take ``owner_id`` as an argument. + +---- + +.. _class_CollisionObject_method_is_shape_owner_disabled: + +- :ref:`bool` **is_shape_owner_disabled** **(** :ref:`int` owner_id **)** |const| + +If ``true``, the shape owner and its shapes are disabled. + +---- + +.. _class_CollisionObject_method_remove_shape_owner: + +- void **remove_shape_owner** **(** :ref:`int` owner_id **)** + +Removes the given shape owner. + +---- + +.. _class_CollisionObject_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +If ``value`` is ``true``, sets the specified ``bit`` in the the :ref:`collision_layer`. + +If ``value`` is ``false``, clears the specified ``bit`` in the the :ref:`collision_layer`. + +---- + +.. _class_CollisionObject_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +If ``value`` is ``true``, sets the specified ``bit`` in the the :ref:`collision_mask`. + +If ``value`` is ``false``, clears the specified ``bit`` in the the :ref:`collision_mask`. + +---- + +.. _class_CollisionObject_method_shape_find_owner: + +- :ref:`int` **shape_find_owner** **(** :ref:`int` shape_index **)** |const| + +Returns the ``owner_id`` of the given shape. + +---- + +.. _class_CollisionObject_method_shape_owner_add_shape: + +- void **shape_owner_add_shape** **(** :ref:`int` owner_id, :ref:`Shape` shape **)** + +Adds a :ref:`Shape` to the shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_clear_shapes: + +- void **shape_owner_clear_shapes** **(** :ref:`int` owner_id **)** + +Removes all shapes from the shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_get_owner: + +- :ref:`Object` **shape_owner_get_owner** **(** :ref:`int` owner_id **)** |const| + +Returns the parent object of the given shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_get_shape: + +- :ref:`Shape` **shape_owner_get_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| + +Returns the :ref:`Shape` with the given id from the given shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_get_shape_count: + +- :ref:`int` **shape_owner_get_shape_count** **(** :ref:`int` owner_id **)** |const| + +Returns the number of shapes the given shape owner contains. + +---- + +.. _class_CollisionObject_method_shape_owner_get_shape_index: + +- :ref:`int` **shape_owner_get_shape_index** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| + +Returns the child index of the :ref:`Shape` with the given id from the given shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_get_transform: + +- :ref:`Transform` **shape_owner_get_transform** **(** :ref:`int` owner_id **)** |const| + +Returns the shape owner's :ref:`Transform`. + +---- + +.. _class_CollisionObject_method_shape_owner_remove_shape: + +- void **shape_owner_remove_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** + +Removes a shape from the given shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_set_disabled: + +- void **shape_owner_set_disabled** **(** :ref:`int` owner_id, :ref:`bool` disabled **)** + +If ``true``, disables the given shape owner. + +---- + +.. _class_CollisionObject_method_shape_owner_set_transform: + +- void **shape_owner_set_transform** **(** :ref:`int` owner_id, :ref:`Transform` transform **)** + +Sets the :ref:`Transform` of the given shape owner. + +.. |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.)` diff --git a/classes/class_collisionobject2d.rst b/classes/class_collisionobject2d.rst new file mode 100644 index 0000000..59078a3 --- /dev/null +++ b/classes/class_collisionobject2d.rst @@ -0,0 +1,374 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionObject2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionObject2D: + +CollisionObject2D +================= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`Area2D`, :ref:`PhysicsBody2D` + +Base node for 2D collision objects. + +Description +----------- + +CollisionObject2D is the base class for 2D physics objects. It can hold any number of 2D collision :ref:`Shape2D`\ s. Each shape must be assigned to a *shape owner*. The CollisionObject2D can have any number of shape owners. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the ``shape_owner_*`` methods. + +Properties +---------- + ++-------------------------+--------------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++-------------------------+--------------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++-------------------------+--------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`input_pickable` | ``true`` | ++-------------------------+--------------------------------------------------------------------------+----------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_input_event` **(** :ref:`Object` viewport, :ref:`InputEvent` event, :ref:`int` shape_idx **)** |virtual| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`create_shape_owner` **(** :ref:`Object` owner **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_rid` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_shape_owner_one_way_collision_margin` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_shape_owners` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_shape_owner_disabled` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_shape_owner_one_way_collision_enabled` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_shape_owner` **(** :ref:`int` owner_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_find_owner` **(** :ref:`int` shape_index **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_add_shape` **(** :ref:`int` owner_id, :ref:`Shape2D` shape **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_clear_shapes` **(** :ref:`int` owner_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`shape_owner_get_owner` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Shape2D` | :ref:`shape_owner_get_shape` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_owner_get_shape_count` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`shape_owner_get_shape_index` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`shape_owner_get_transform` **(** :ref:`int` owner_id **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_remove_shape` **(** :ref:`int` owner_id, :ref:`int` shape_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_disabled` **(** :ref:`int` owner_id, :ref:`bool` disabled **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_one_way_collision` **(** :ref:`int` owner_id, :ref:`bool` enable **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_one_way_collision_margin` **(** :ref:`int` owner_id, :ref:`float` margin **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_owner_set_transform` **(** :ref:`int` owner_id, :ref:`Transform2D` transform **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_CollisionObject2D_signal_input_event: + +- **input_event** **(** :ref:`Node` viewport, :ref:`InputEvent` event, :ref:`int` shape_idx **)** + +Emitted when an input event occurs. Requires :ref:`input_pickable` to be ``true`` and at least one ``collision_layer`` bit to be set. See :ref:`_input_event` for details. + +---- + +.. _class_CollisionObject2D_signal_mouse_entered: + +- **mouse_entered** **(** **)** + +Emitted when the mouse pointer enters any of this object's shapes. Requires :ref:`input_pickable` to be ``true`` and at least one ``collision_layer`` bit to be set. + +---- + +.. _class_CollisionObject2D_signal_mouse_exited: + +- **mouse_exited** **(** **)** + +Emitted when the mouse pointer exits all this object's shapes. Requires :ref:`input_pickable` to be ``true`` and at least one ``collision_layer`` bit to be set. + +Property Descriptions +--------------------- + +.. _class_CollisionObject2D_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layers this CollisionObject2D is in. Collision objects can exist in one or more of 32 different layers. See also :ref:`collision_mask`. + +**Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CollisionObject2D_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layers this CollisionObject2D scans. Collision objects can scan one or more of 32 different layers. See also :ref:`collision_layer`. + +**Note:** A contact is detected if object A is in any of the layers that object B scans, or object B is in any layers that object A scans. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CollisionObject2D_property_input_pickable: + +- :ref:`bool` **input_pickable** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_pickable(value) | ++-----------+---------------------+ +| *Getter* | is_pickable() | ++-----------+---------------------+ + +If ``true``, this object is pickable. A pickable object can detect the mouse pointer entering/leaving, and if the mouse is inside it, report input events. Requires at least one :ref:`collision_layer` bit to be set. + +Method Descriptions +------------------- + +.. _class_CollisionObject2D_method__input_event: + +- void **_input_event** **(** :ref:`Object` viewport, :ref:`InputEvent` event, :ref:`int` shape_idx **)** |virtual| + +Accepts unhandled :ref:`InputEvent`\ s. Requires :ref:`input_pickable` to be ``true``. ``shape_idx`` is the child index of the clicked :ref:`Shape2D`. Connect to the ``input_event`` signal to easily pick up these events. + +---- + +.. _class_CollisionObject2D_method_create_shape_owner: + +- :ref:`int` **create_shape_owner** **(** :ref:`Object` owner **)** + +Creates a new shape owner for the given object. Returns ``owner_id`` of the new owner for future reference. + +---- + +.. _class_CollisionObject2D_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns whether or not the specified ``bit`` of the :ref:`collision_layer` is set. + +---- + +.. _class_CollisionObject2D_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns whether or not the specified ``bit`` of the :ref:`collision_mask` is set. + +---- + +.. _class_CollisionObject2D_method_get_rid: + +- :ref:`RID` **get_rid** **(** **)** |const| + +Returns the object's :ref:`RID`. + +---- + +.. _class_CollisionObject2D_method_get_shape_owner_one_way_collision_margin: + +- :ref:`float` **get_shape_owner_one_way_collision_margin** **(** :ref:`int` owner_id **)** |const| + +Returns the ``one_way_collision_margin`` of the shape owner identified by given ``owner_id``. + +---- + +.. _class_CollisionObject2D_method_get_shape_owners: + +- :ref:`Array` **get_shape_owners** **(** **)** + +Returns an :ref:`Array` of ``owner_id`` identifiers. You can use these ids in other methods that take ``owner_id`` as an argument. + +---- + +.. _class_CollisionObject2D_method_is_shape_owner_disabled: + +- :ref:`bool` **is_shape_owner_disabled** **(** :ref:`int` owner_id **)** |const| + +If ``true``, the shape owner and its shapes are disabled. + +---- + +.. _class_CollisionObject2D_method_is_shape_owner_one_way_collision_enabled: + +- :ref:`bool` **is_shape_owner_one_way_collision_enabled** **(** :ref:`int` owner_id **)** |const| + +Returns ``true`` if collisions for the shape owner originating from this ``CollisionObject2D`` will not be reported to collided with ``CollisionObject2D``\ s. + +---- + +.. _class_CollisionObject2D_method_remove_shape_owner: + +- void **remove_shape_owner** **(** :ref:`int` owner_id **)** + +Removes the given shape owner. + +---- + +.. _class_CollisionObject2D_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +If ``value`` is ``true``, sets the specified ``bit`` in the the :ref:`collision_layer`. + +If ``value`` is ``false``, clears the specified ``bit`` in the the :ref:`collision_layer`. + +---- + +.. _class_CollisionObject2D_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +If ``value`` is ``true``, sets the specified ``bit`` in the the :ref:`collision_mask`. + +If ``value`` is ``false``, clears the specified ``bit`` in the the :ref:`collision_mask`. + +---- + +.. _class_CollisionObject2D_method_shape_find_owner: + +- :ref:`int` **shape_find_owner** **(** :ref:`int` shape_index **)** |const| + +Returns the ``owner_id`` of the given shape. + +---- + +.. _class_CollisionObject2D_method_shape_owner_add_shape: + +- void **shape_owner_add_shape** **(** :ref:`int` owner_id, :ref:`Shape2D` shape **)** + +Adds a :ref:`Shape2D` to the shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_clear_shapes: + +- void **shape_owner_clear_shapes** **(** :ref:`int` owner_id **)** + +Removes all shapes from the shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_get_owner: + +- :ref:`Object` **shape_owner_get_owner** **(** :ref:`int` owner_id **)** |const| + +Returns the parent object of the given shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_get_shape: + +- :ref:`Shape2D` **shape_owner_get_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| + +Returns the :ref:`Shape2D` with the given id from the given shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_get_shape_count: + +- :ref:`int` **shape_owner_get_shape_count** **(** :ref:`int` owner_id **)** |const| + +Returns the number of shapes the given shape owner contains. + +---- + +.. _class_CollisionObject2D_method_shape_owner_get_shape_index: + +- :ref:`int` **shape_owner_get_shape_index** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** |const| + +Returns the child index of the :ref:`Shape2D` with the given id from the given shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_get_transform: + +- :ref:`Transform2D` **shape_owner_get_transform** **(** :ref:`int` owner_id **)** |const| + +Returns the shape owner's :ref:`Transform2D`. + +---- + +.. _class_CollisionObject2D_method_shape_owner_remove_shape: + +- void **shape_owner_remove_shape** **(** :ref:`int` owner_id, :ref:`int` shape_id **)** + +Removes a shape from the given shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_set_disabled: + +- void **shape_owner_set_disabled** **(** :ref:`int` owner_id, :ref:`bool` disabled **)** + +If ``true``, disables the given shape owner. + +---- + +.. _class_CollisionObject2D_method_shape_owner_set_one_way_collision: + +- void **shape_owner_set_one_way_collision** **(** :ref:`int` owner_id, :ref:`bool` enable **)** + +If ``enable`` is ``true``, collisions for the shape owner originating from this ``CollisionObject2D`` will not be reported to collided with ``CollisionObject2D``\ s. + +---- + +.. _class_CollisionObject2D_method_shape_owner_set_one_way_collision_margin: + +- void **shape_owner_set_one_way_collision_margin** **(** :ref:`int` owner_id, :ref:`float` margin **)** + +Sets the ``one_way_collision_margin`` of the shape owner identified by given ``owner_id`` to ``margin`` pixels. + +---- + +.. _class_CollisionObject2D_method_shape_owner_set_transform: + +- void **shape_owner_set_transform** **(** :ref:`int` owner_id, :ref:`Transform2D` transform **)** + +Sets the :ref:`Transform2D` of the given shape owner. + +.. |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.)` diff --git a/classes/class_collisionpolygon.rst b/classes/class_collisionpolygon.rst new file mode 100644 index 0000000..6a552e5 --- /dev/null +++ b/classes/class_collisionpolygon.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionPolygon.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionPolygon: + +CollisionPolygon +================ + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Editor-only class for defining a collision polygon in 3D space. + +Description +----------- + +Allows editing a collision polygon's vertices on a selected plane. Can also set a depth perpendicular to that plane. This class is only available in the editor. It will not appear in the scene tree at run-time. Creates a :ref:`Shape` for gameplay. Properties modified during gameplay will have no effect. + +Properties +---------- + ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`depth` | ``1.0`` | ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`margin` | ``0.04`` | ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`polygon` | ``PoolVector2Array( )`` | ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ + +Property Descriptions +--------------------- + +.. _class_CollisionPolygon_property_depth: + +- :ref:`float` **depth** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_depth(value) | ++-----------+------------------+ +| *Getter* | get_depth() | ++-----------+------------------+ + +Length that the resulting collision extends in either direction perpendicular to its polygon. + +---- + +.. _class_CollisionPolygon_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +If ``true``, no collision will be produced. + +---- + +.. _class_CollisionPolygon_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.04`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +The collision margin for the generated :ref:`Shape`. See :ref:`Shape.margin` for more details. + +---- + +.. _class_CollisionPolygon_property_polygon: + +- :ref:`PoolVector2Array` **polygon** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_polygon(value) | ++-----------+--------------------------+ +| *Getter* | get_polygon() | ++-----------+--------------------------+ + +Array of vertices which define the polygon. + +**Note:** The returned value is a copy of the original. Methods which mutate the size or properties of the return value will not impact the original polygon. To change properties of the polygon, assign it to a temporary variable and make changes before reassigning the ``polygon`` member. + +.. |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.)` diff --git a/classes/class_collisionpolygon2d.rst b/classes/class_collisionpolygon2d.rst new file mode 100644 index 0000000..3f2d013 --- /dev/null +++ b/classes/class_collisionpolygon2d.rst @@ -0,0 +1,134 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionPolygon2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionPolygon2D: + +CollisionPolygon2D +================== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Defines a 2D collision polygon. + +Description +----------- + +Provides a 2D collision polygon to a :ref:`CollisionObject2D` parent. Polygons can be drawn in the editor or specified by a list of vertices. + +Properties +---------- + ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ +| :ref:`BuildMode` | :ref:`build_mode` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`one_way_collision` | ``false`` | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`one_way_collision_margin` | ``1.0`` | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`polygon` | ``PoolVector2Array( )`` | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------+--------------------------+ + +Enumerations +------------ + +.. _enum_CollisionPolygon2D_BuildMode: + +.. _class_CollisionPolygon2D_constant_BUILD_SOLIDS: + +.. _class_CollisionPolygon2D_constant_BUILD_SEGMENTS: + +enum **BuildMode**: + +- **BUILD_SOLIDS** = **0** --- Collisions will include the polygon and its contained area. + +- **BUILD_SEGMENTS** = **1** --- Collisions will only include the polygon edges. + +Property Descriptions +--------------------- + +.. _class_CollisionPolygon2D_property_build_mode: + +- :ref:`BuildMode` **build_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_build_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_build_mode() | ++-----------+-----------------------+ + +Collision build mode. Use one of the :ref:`BuildMode` constants. + +---- + +.. _class_CollisionPolygon2D_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +If ``true``, no collisions will be detected. + +---- + +.. _class_CollisionPolygon2D_property_one_way_collision: + +- :ref:`bool` **one_way_collision** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_one_way_collision(value) | ++-----------+--------------------------------+ +| *Getter* | is_one_way_collision_enabled() | ++-----------+--------------------------------+ + +If ``true``, only edges that face up, relative to ``CollisionPolygon2D``'s rotation, will collide with other objects. + +---- + +.. _class_CollisionPolygon2D_property_one_way_collision_margin: + +- :ref:`float` **one_way_collision_margin** + ++-----------+-------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_one_way_collision_margin(value) | ++-----------+-------------------------------------+ +| *Getter* | get_one_way_collision_margin() | ++-----------+-------------------------------------+ + +The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the polygon at a high velocity. + +---- + +.. _class_CollisionPolygon2D_property_polygon: + +- :ref:`PoolVector2Array` **polygon** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_polygon(value) | ++-----------+--------------------------+ +| *Getter* | get_polygon() | ++-----------+--------------------------+ + +The polygon's list of vertices. The final point will be connected to the first. The returned value is a clone of the :ref:`PoolVector2Array`, not a reference. + +.. |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.)` diff --git a/classes/class_collisionshape.rst b/classes/class_collisionshape.rst new file mode 100644 index 0000000..318e884 --- /dev/null +++ b/classes/class_collisionshape.rst @@ -0,0 +1,100 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionShape: + +CollisionShape +============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Node that represents collision shape data in 3D space. + +Description +----------- + +Editor facility for creating and editing collision shapes in 3D space. You can use this node to represent all sorts of collision shapes, for example, add this to an :ref:`Area` to give it a detection shape, or add it to a :ref:`PhysicsBody` to create a solid object. **IMPORTANT**: this is an Editor-only helper to create shapes, use :ref:`CollisionObject.shape_owner_get_shape` to get the actual shape. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+---------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++---------------------------+---------------------------------------------------------+-----------+ +| :ref:`Shape` | :ref:`shape` | | ++---------------------------+---------------------------------------------------------+-----------+ + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_convex_from_brothers` **(** **)** | ++------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resource_changed` **(** :ref:`Resource` resource **)** | ++------+----------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_CollisionShape_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +A disabled collision shape has no effect in the world. + +---- + +.. _class_CollisionShape_property_shape: + +- :ref:`Shape` **shape** + ++----------+------------------+ +| *Setter* | set_shape(value) | ++----------+------------------+ +| *Getter* | get_shape() | ++----------+------------------+ + +The actual shape owned by this collision shape. + +Method Descriptions +------------------- + +.. _class_CollisionShape_method_make_convex_from_brothers: + +- void **make_convex_from_brothers** **(** **)** + +Sets the collision shape's shape to the addition of all its convexed :ref:`MeshInstance` siblings geometry. + +---- + +.. _class_CollisionShape_method_resource_changed: + +- void **resource_changed** **(** :ref:`Resource` resource **)** + +If this method exists within a script it will be called whenever the shape resource has been modified. + +.. |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.)` diff --git a/classes/class_collisionshape2d.rst b/classes/class_collisionshape2d.rst new file mode 100644 index 0000000..54cfccc --- /dev/null +++ b/classes/class_collisionshape2d.rst @@ -0,0 +1,110 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CollisionShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CollisionShape2D: + +CollisionShape2D +================ + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Node that represents collision shape data in 2D space. + +Description +----------- + +Editor facility for creating and editing collision shapes in 2D space. You can use this node to represent all sorts of collision shapes, for example, add this to an :ref:`Area2D` to give it a detection shape, or add it to a :ref:`PhysicsBody2D` to create a solid object. **IMPORTANT**: this is an Editor-only helper to create shapes, use :ref:`CollisionObject2D.shape_owner_get_shape` to get the actual shape. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- `2D Dodge The Creeps Demo `__ + +- `2D Pong Demo `__ + +- `2D Kinematic Character Demo `__ + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`disabled` | ``false`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`one_way_collision` | ``false`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`one_way_collision_margin` | ``1.0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-----------+ +| :ref:`Shape2D` | :ref:`shape` | | ++-------------------------------+-------------------------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_CollisionShape2D_property_disabled: + +- :ref:`bool` **disabled** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_disabled(value) | ++-----------+---------------------+ +| *Getter* | is_disabled() | ++-----------+---------------------+ + +A disabled collision shape has no effect in the world. This property should be changed with :ref:`Object.set_deferred`. + +---- + +.. _class_CollisionShape2D_property_one_way_collision: + +- :ref:`bool` **one_way_collision** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_one_way_collision(value) | ++-----------+--------------------------------+ +| *Getter* | is_one_way_collision_enabled() | ++-----------+--------------------------------+ + +Sets whether this collision shape should only detect collision on one side (top or bottom). + +---- + +.. _class_CollisionShape2D_property_one_way_collision_margin: + +- :ref:`float` **one_way_collision_margin** + ++-----------+-------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_one_way_collision_margin(value) | ++-----------+-------------------------------------+ +| *Getter* | get_one_way_collision_margin() | ++-----------+-------------------------------------+ + +The margin used for one-way collision (in pixels). Higher values will make the shape thicker, and work better for colliders that enter the shape at a high velocity. + +---- + +.. _class_CollisionShape2D_property_shape: + +- :ref:`Shape2D` **shape** + ++----------+------------------+ +| *Setter* | set_shape(value) | ++----------+------------------+ +| *Getter* | get_shape() | ++----------+------------------+ + +The actual shape owned by this collision shape. + +.. |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.)` diff --git a/classes/class_color.rst b/classes/class_color.rst new file mode 100644 index 0000000..720c4e5 --- /dev/null +++ b/classes/class_color.rst @@ -0,0 +1,1086 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Color.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Color: + +Color +===== + +Color in RGBA format using floats on the range of 0 to 1. + +Description +----------- + +A color represented by red, green, blue, and alpha (RGBA) components. The alpha component is often used for opacity. Values are in floating-point and usually range from 0 to 1. Some properties (such as CanvasItem.modulate) may accept values greater than 1 (overbright or HDR colors). + +You can also create a color from standardized color names by using :ref:`@GDScript.ColorN` or directly using the color constants defined here. The standardized color set is based on the `X11 color names `__. + +If you want to supply values in a range of 0 to 255, you should use :ref:`@GDScript.Color8`. + +**Note:** In a boolean context, a Color will evaluate to ``false`` if it's equal to ``Color(0, 0, 0, 1)`` (opaque black). Otherwise, a Color will always evaluate to ``true``. + +`Color constants cheatsheet `__ + +Tutorials +--------- + +- `2D GD Paint Demo `__ + +- `Tween Demo `__ + +- `GUI Drag And Drop Demo `__ + +Properties +---------- + ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`a` | ``1.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`int` | :ref:`a8` | ``255`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`b` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`int` | :ref:`b8` | ``0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`g` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`int` | :ref:`g8` | ``0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`h` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`r` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`int` | :ref:`r8` | ``0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`s` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`v` | ``0.0`` | ++---------------------------+------------------------------------+---------+ + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`String` from **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`int` from **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`Color` **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`blend` **(** :ref:`Color` over **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`contrasted` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`darkened` **(** :ref:`float` amount **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`from_hsv` **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1.0 **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gray` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`inverted` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Color` color **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`lightened` **(** :ref:`float` amount **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`linear_interpolate` **(** :ref:`Color` to, :ref:`float` weight **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_abgr32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_abgr64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_argb32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_argb64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_html` **(** :ref:`bool` with_alpha=true **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_rgba32` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_rgba64` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Color_constant_aliceblue: + +.. _class_Color_constant_antiquewhite: + +.. _class_Color_constant_aqua: + +.. _class_Color_constant_aquamarine: + +.. _class_Color_constant_azure: + +.. _class_Color_constant_beige: + +.. _class_Color_constant_bisque: + +.. _class_Color_constant_black: + +.. _class_Color_constant_blanchedalmond: + +.. _class_Color_constant_blue: + +.. _class_Color_constant_blueviolet: + +.. _class_Color_constant_brown: + +.. _class_Color_constant_burlywood: + +.. _class_Color_constant_cadetblue: + +.. _class_Color_constant_chartreuse: + +.. _class_Color_constant_chocolate: + +.. _class_Color_constant_coral: + +.. _class_Color_constant_cornflower: + +.. _class_Color_constant_cornsilk: + +.. _class_Color_constant_crimson: + +.. _class_Color_constant_cyan: + +.. _class_Color_constant_darkblue: + +.. _class_Color_constant_darkcyan: + +.. _class_Color_constant_darkgoldenrod: + +.. _class_Color_constant_darkgray: + +.. _class_Color_constant_darkgreen: + +.. _class_Color_constant_darkkhaki: + +.. _class_Color_constant_darkmagenta: + +.. _class_Color_constant_darkolivegreen: + +.. _class_Color_constant_darkorange: + +.. _class_Color_constant_darkorchid: + +.. _class_Color_constant_darkred: + +.. _class_Color_constant_darksalmon: + +.. _class_Color_constant_darkseagreen: + +.. _class_Color_constant_darkslateblue: + +.. _class_Color_constant_darkslategray: + +.. _class_Color_constant_darkturquoise: + +.. _class_Color_constant_darkviolet: + +.. _class_Color_constant_deeppink: + +.. _class_Color_constant_deepskyblue: + +.. _class_Color_constant_dimgray: + +.. _class_Color_constant_dodgerblue: + +.. _class_Color_constant_firebrick: + +.. _class_Color_constant_floralwhite: + +.. _class_Color_constant_forestgreen: + +.. _class_Color_constant_fuchsia: + +.. _class_Color_constant_gainsboro: + +.. _class_Color_constant_ghostwhite: + +.. _class_Color_constant_gold: + +.. _class_Color_constant_goldenrod: + +.. _class_Color_constant_gray: + +.. _class_Color_constant_green: + +.. _class_Color_constant_greenyellow: + +.. _class_Color_constant_honeydew: + +.. _class_Color_constant_hotpink: + +.. _class_Color_constant_indianred: + +.. _class_Color_constant_indigo: + +.. _class_Color_constant_ivory: + +.. _class_Color_constant_khaki: + +.. _class_Color_constant_lavender: + +.. _class_Color_constant_lavenderblush: + +.. _class_Color_constant_lawngreen: + +.. _class_Color_constant_lemonchiffon: + +.. _class_Color_constant_lightblue: + +.. _class_Color_constant_lightcoral: + +.. _class_Color_constant_lightcyan: + +.. _class_Color_constant_lightgoldenrod: + +.. _class_Color_constant_lightgray: + +.. _class_Color_constant_lightgreen: + +.. _class_Color_constant_lightpink: + +.. _class_Color_constant_lightsalmon: + +.. _class_Color_constant_lightseagreen: + +.. _class_Color_constant_lightskyblue: + +.. _class_Color_constant_lightslategray: + +.. _class_Color_constant_lightsteelblue: + +.. _class_Color_constant_lightyellow: + +.. _class_Color_constant_lime: + +.. _class_Color_constant_limegreen: + +.. _class_Color_constant_linen: + +.. _class_Color_constant_magenta: + +.. _class_Color_constant_maroon: + +.. _class_Color_constant_mediumaquamarine: + +.. _class_Color_constant_mediumblue: + +.. _class_Color_constant_mediumorchid: + +.. _class_Color_constant_mediumpurple: + +.. _class_Color_constant_mediumseagreen: + +.. _class_Color_constant_mediumslateblue: + +.. _class_Color_constant_mediumspringgreen: + +.. _class_Color_constant_mediumturquoise: + +.. _class_Color_constant_mediumvioletred: + +.. _class_Color_constant_midnightblue: + +.. _class_Color_constant_mintcream: + +.. _class_Color_constant_mistyrose: + +.. _class_Color_constant_moccasin: + +.. _class_Color_constant_navajowhite: + +.. _class_Color_constant_navyblue: + +.. _class_Color_constant_oldlace: + +.. _class_Color_constant_olive: + +.. _class_Color_constant_olivedrab: + +.. _class_Color_constant_orange: + +.. _class_Color_constant_orangered: + +.. _class_Color_constant_orchid: + +.. _class_Color_constant_palegoldenrod: + +.. _class_Color_constant_palegreen: + +.. _class_Color_constant_paleturquoise: + +.. _class_Color_constant_palevioletred: + +.. _class_Color_constant_papayawhip: + +.. _class_Color_constant_peachpuff: + +.. _class_Color_constant_peru: + +.. _class_Color_constant_pink: + +.. _class_Color_constant_plum: + +.. _class_Color_constant_powderblue: + +.. _class_Color_constant_purple: + +.. _class_Color_constant_rebeccapurple: + +.. _class_Color_constant_red: + +.. _class_Color_constant_rosybrown: + +.. _class_Color_constant_royalblue: + +.. _class_Color_constant_saddlebrown: + +.. _class_Color_constant_salmon: + +.. _class_Color_constant_sandybrown: + +.. _class_Color_constant_seagreen: + +.. _class_Color_constant_seashell: + +.. _class_Color_constant_sienna: + +.. _class_Color_constant_silver: + +.. _class_Color_constant_skyblue: + +.. _class_Color_constant_slateblue: + +.. _class_Color_constant_slategray: + +.. _class_Color_constant_snow: + +.. _class_Color_constant_springgreen: + +.. _class_Color_constant_steelblue: + +.. _class_Color_constant_tan: + +.. _class_Color_constant_teal: + +.. _class_Color_constant_thistle: + +.. _class_Color_constant_tomato: + +.. _class_Color_constant_transparent: + +.. _class_Color_constant_turquoise: + +.. _class_Color_constant_violet: + +.. _class_Color_constant_webgray: + +.. _class_Color_constant_webgreen: + +.. _class_Color_constant_webmaroon: + +.. _class_Color_constant_webpurple: + +.. _class_Color_constant_wheat: + +.. _class_Color_constant_white: + +.. _class_Color_constant_whitesmoke: + +.. _class_Color_constant_yellow: + +.. _class_Color_constant_yellowgreen: + +- **aliceblue** = **Color( 0.94, 0.97, 1, 1 )** --- Alice blue color. + +- **antiquewhite** = **Color( 0.98, 0.92, 0.84, 1 )** --- Antique white color. + +- **aqua** = **Color( 0, 1, 1, 1 )** --- Aqua color. + +- **aquamarine** = **Color( 0.5, 1, 0.83, 1 )** --- Aquamarine color. + +- **azure** = **Color( 0.94, 1, 1, 1 )** --- Azure color. + +- **beige** = **Color( 0.96, 0.96, 0.86, 1 )** --- Beige color. + +- **bisque** = **Color( 1, 0.89, 0.77, 1 )** --- Bisque color. + +- **black** = **Color( 0, 0, 0, 1 )** --- Black color. + +- **blanchedalmond** = **Color( 1, 0.92, 0.8, 1 )** --- Blanche almond color. + +- **blue** = **Color( 0, 0, 1, 1 )** --- Blue color. + +- **blueviolet** = **Color( 0.54, 0.17, 0.89, 1 )** --- Blue violet color. + +- **brown** = **Color( 0.65, 0.16, 0.16, 1 )** --- Brown color. + +- **burlywood** = **Color( 0.87, 0.72, 0.53, 1 )** --- Burly wood color. + +- **cadetblue** = **Color( 0.37, 0.62, 0.63, 1 )** --- Cadet blue color. + +- **chartreuse** = **Color( 0.5, 1, 0, 1 )** --- Chartreuse color. + +- **chocolate** = **Color( 0.82, 0.41, 0.12, 1 )** --- Chocolate color. + +- **coral** = **Color( 1, 0.5, 0.31, 1 )** --- Coral color. + +- **cornflower** = **Color( 0.39, 0.58, 0.93, 1 )** --- Cornflower color. + +- **cornsilk** = **Color( 1, 0.97, 0.86, 1 )** --- Corn silk color. + +- **crimson** = **Color( 0.86, 0.08, 0.24, 1 )** --- Crimson color. + +- **cyan** = **Color( 0, 1, 1, 1 )** --- Cyan color. + +- **darkblue** = **Color( 0, 0, 0.55, 1 )** --- Dark blue color. + +- **darkcyan** = **Color( 0, 0.55, 0.55, 1 )** --- Dark cyan color. + +- **darkgoldenrod** = **Color( 0.72, 0.53, 0.04, 1 )** --- Dark goldenrod color. + +- **darkgray** = **Color( 0.66, 0.66, 0.66, 1 )** --- Dark gray color. + +- **darkgreen** = **Color( 0, 0.39, 0, 1 )** --- Dark green color. + +- **darkkhaki** = **Color( 0.74, 0.72, 0.42, 1 )** --- Dark khaki color. + +- **darkmagenta** = **Color( 0.55, 0, 0.55, 1 )** --- Dark magenta color. + +- **darkolivegreen** = **Color( 0.33, 0.42, 0.18, 1 )** --- Dark olive green color. + +- **darkorange** = **Color( 1, 0.55, 0, 1 )** --- Dark orange color. + +- **darkorchid** = **Color( 0.6, 0.2, 0.8, 1 )** --- Dark orchid color. + +- **darkred** = **Color( 0.55, 0, 0, 1 )** --- Dark red color. + +- **darksalmon** = **Color( 0.91, 0.59, 0.48, 1 )** --- Dark salmon color. + +- **darkseagreen** = **Color( 0.56, 0.74, 0.56, 1 )** --- Dark sea green color. + +- **darkslateblue** = **Color( 0.28, 0.24, 0.55, 1 )** --- Dark slate blue color. + +- **darkslategray** = **Color( 0.18, 0.31, 0.31, 1 )** --- Dark slate gray color. + +- **darkturquoise** = **Color( 0, 0.81, 0.82, 1 )** --- Dark turquoise color. + +- **darkviolet** = **Color( 0.58, 0, 0.83, 1 )** --- Dark violet color. + +- **deeppink** = **Color( 1, 0.08, 0.58, 1 )** --- Deep pink color. + +- **deepskyblue** = **Color( 0, 0.75, 1, 1 )** --- Deep sky blue color. + +- **dimgray** = **Color( 0.41, 0.41, 0.41, 1 )** --- Dim gray color. + +- **dodgerblue** = **Color( 0.12, 0.56, 1, 1 )** --- Dodger blue color. + +- **firebrick** = **Color( 0.7, 0.13, 0.13, 1 )** --- Firebrick color. + +- **floralwhite** = **Color( 1, 0.98, 0.94, 1 )** --- Floral white color. + +- **forestgreen** = **Color( 0.13, 0.55, 0.13, 1 )** --- Forest green color. + +- **fuchsia** = **Color( 1, 0, 1, 1 )** --- Fuchsia color. + +- **gainsboro** = **Color( 0.86, 0.86, 0.86, 1 )** --- Gainsboro color. + +- **ghostwhite** = **Color( 0.97, 0.97, 1, 1 )** --- Ghost white color. + +- **gold** = **Color( 1, 0.84, 0, 1 )** --- Gold color. + +- **goldenrod** = **Color( 0.85, 0.65, 0.13, 1 )** --- Goldenrod color. + +- **gray** = **Color( 0.75, 0.75, 0.75, 1 )** --- Gray color. + +- **green** = **Color( 0, 1, 0, 1 )** --- Green color. + +- **greenyellow** = **Color( 0.68, 1, 0.18, 1 )** --- Green yellow color. + +- **honeydew** = **Color( 0.94, 1, 0.94, 1 )** --- Honeydew color. + +- **hotpink** = **Color( 1, 0.41, 0.71, 1 )** --- Hot pink color. + +- **indianred** = **Color( 0.8, 0.36, 0.36, 1 )** --- Indian red color. + +- **indigo** = **Color( 0.29, 0, 0.51, 1 )** --- Indigo color. + +- **ivory** = **Color( 1, 1, 0.94, 1 )** --- Ivory color. + +- **khaki** = **Color( 0.94, 0.9, 0.55, 1 )** --- Khaki color. + +- **lavender** = **Color( 0.9, 0.9, 0.98, 1 )** --- Lavender color. + +- **lavenderblush** = **Color( 1, 0.94, 0.96, 1 )** --- Lavender blush color. + +- **lawngreen** = **Color( 0.49, 0.99, 0, 1 )** --- Lawn green color. + +- **lemonchiffon** = **Color( 1, 0.98, 0.8, 1 )** --- Lemon chiffon color. + +- **lightblue** = **Color( 0.68, 0.85, 0.9, 1 )** --- Light blue color. + +- **lightcoral** = **Color( 0.94, 0.5, 0.5, 1 )** --- Light coral color. + +- **lightcyan** = **Color( 0.88, 1, 1, 1 )** --- Light cyan color. + +- **lightgoldenrod** = **Color( 0.98, 0.98, 0.82, 1 )** --- Light goldenrod color. + +- **lightgray** = **Color( 0.83, 0.83, 0.83, 1 )** --- Light gray color. + +- **lightgreen** = **Color( 0.56, 0.93, 0.56, 1 )** --- Light green color. + +- **lightpink** = **Color( 1, 0.71, 0.76, 1 )** --- Light pink color. + +- **lightsalmon** = **Color( 1, 0.63, 0.48, 1 )** --- Light salmon color. + +- **lightseagreen** = **Color( 0.13, 0.7, 0.67, 1 )** --- Light sea green color. + +- **lightskyblue** = **Color( 0.53, 0.81, 0.98, 1 )** --- Light sky blue color. + +- **lightslategray** = **Color( 0.47, 0.53, 0.6, 1 )** --- Light slate gray color. + +- **lightsteelblue** = **Color( 0.69, 0.77, 0.87, 1 )** --- Light steel blue color. + +- **lightyellow** = **Color( 1, 1, 0.88, 1 )** --- Light yellow color. + +- **lime** = **Color( 0, 1, 0, 1 )** --- Lime color. + +- **limegreen** = **Color( 0.2, 0.8, 0.2, 1 )** --- Lime green color. + +- **linen** = **Color( 0.98, 0.94, 0.9, 1 )** --- Linen color. + +- **magenta** = **Color( 1, 0, 1, 1 )** --- Magenta color. + +- **maroon** = **Color( 0.69, 0.19, 0.38, 1 )** --- Maroon color. + +- **mediumaquamarine** = **Color( 0.4, 0.8, 0.67, 1 )** --- Medium aquamarine color. + +- **mediumblue** = **Color( 0, 0, 0.8, 1 )** --- Medium blue color. + +- **mediumorchid** = **Color( 0.73, 0.33, 0.83, 1 )** --- Medium orchid color. + +- **mediumpurple** = **Color( 0.58, 0.44, 0.86, 1 )** --- Medium purple color. + +- **mediumseagreen** = **Color( 0.24, 0.7, 0.44, 1 )** --- Medium sea green color. + +- **mediumslateblue** = **Color( 0.48, 0.41, 0.93, 1 )** --- Medium slate blue color. + +- **mediumspringgreen** = **Color( 0, 0.98, 0.6, 1 )** --- Medium spring green color. + +- **mediumturquoise** = **Color( 0.28, 0.82, 0.8, 1 )** --- Medium turquoise color. + +- **mediumvioletred** = **Color( 0.78, 0.08, 0.52, 1 )** --- Medium violet red color. + +- **midnightblue** = **Color( 0.1, 0.1, 0.44, 1 )** --- Midnight blue color. + +- **mintcream** = **Color( 0.96, 1, 0.98, 1 )** --- Mint cream color. + +- **mistyrose** = **Color( 1, 0.89, 0.88, 1 )** --- Misty rose color. + +- **moccasin** = **Color( 1, 0.89, 0.71, 1 )** --- Moccasin color. + +- **navajowhite** = **Color( 1, 0.87, 0.68, 1 )** --- Navajo white color. + +- **navyblue** = **Color( 0, 0, 0.5, 1 )** --- Navy blue color. + +- **oldlace** = **Color( 0.99, 0.96, 0.9, 1 )** --- Old lace color. + +- **olive** = **Color( 0.5, 0.5, 0, 1 )** --- Olive color. + +- **olivedrab** = **Color( 0.42, 0.56, 0.14, 1 )** --- Olive drab color. + +- **orange** = **Color( 1, 0.65, 0, 1 )** --- Orange color. + +- **orangered** = **Color( 1, 0.27, 0, 1 )** --- Orange red color. + +- **orchid** = **Color( 0.85, 0.44, 0.84, 1 )** --- Orchid color. + +- **palegoldenrod** = **Color( 0.93, 0.91, 0.67, 1 )** --- Pale goldenrod color. + +- **palegreen** = **Color( 0.6, 0.98, 0.6, 1 )** --- Pale green color. + +- **paleturquoise** = **Color( 0.69, 0.93, 0.93, 1 )** --- Pale turquoise color. + +- **palevioletred** = **Color( 0.86, 0.44, 0.58, 1 )** --- Pale violet red color. + +- **papayawhip** = **Color( 1, 0.94, 0.84, 1 )** --- Papaya whip color. + +- **peachpuff** = **Color( 1, 0.85, 0.73, 1 )** --- Peach puff color. + +- **peru** = **Color( 0.8, 0.52, 0.25, 1 )** --- Peru color. + +- **pink** = **Color( 1, 0.75, 0.8, 1 )** --- Pink color. + +- **plum** = **Color( 0.87, 0.63, 0.87, 1 )** --- Plum color. + +- **powderblue** = **Color( 0.69, 0.88, 0.9, 1 )** --- Powder blue color. + +- **purple** = **Color( 0.63, 0.13, 0.94, 1 )** --- Purple color. + +- **rebeccapurple** = **Color( 0.4, 0.2, 0.6, 1 )** --- Rebecca purple color. + +- **red** = **Color( 1, 0, 0, 1 )** --- Red color. + +- **rosybrown** = **Color( 0.74, 0.56, 0.56, 1 )** --- Rosy brown color. + +- **royalblue** = **Color( 0.25, 0.41, 0.88, 1 )** --- Royal blue color. + +- **saddlebrown** = **Color( 0.55, 0.27, 0.07, 1 )** --- Saddle brown color. + +- **salmon** = **Color( 0.98, 0.5, 0.45, 1 )** --- Salmon color. + +- **sandybrown** = **Color( 0.96, 0.64, 0.38, 1 )** --- Sandy brown color. + +- **seagreen** = **Color( 0.18, 0.55, 0.34, 1 )** --- Sea green color. + +- **seashell** = **Color( 1, 0.96, 0.93, 1 )** --- Seashell color. + +- **sienna** = **Color( 0.63, 0.32, 0.18, 1 )** --- Sienna color. + +- **silver** = **Color( 0.75, 0.75, 0.75, 1 )** --- Silver color. + +- **skyblue** = **Color( 0.53, 0.81, 0.92, 1 )** --- Sky blue color. + +- **slateblue** = **Color( 0.42, 0.35, 0.8, 1 )** --- Slate blue color. + +- **slategray** = **Color( 0.44, 0.5, 0.56, 1 )** --- Slate gray color. + +- **snow** = **Color( 1, 0.98, 0.98, 1 )** --- Snow color. + +- **springgreen** = **Color( 0, 1, 0.5, 1 )** --- Spring green color. + +- **steelblue** = **Color( 0.27, 0.51, 0.71, 1 )** --- Steel blue color. + +- **tan** = **Color( 0.82, 0.71, 0.55, 1 )** --- Tan color. + +- **teal** = **Color( 0, 0.5, 0.5, 1 )** --- Teal color. + +- **thistle** = **Color( 0.85, 0.75, 0.85, 1 )** --- Thistle color. + +- **tomato** = **Color( 1, 0.39, 0.28, 1 )** --- Tomato color. + +- **transparent** = **Color( 1, 1, 1, 0 )** --- Transparent color (white with no alpha). + +- **turquoise** = **Color( 0.25, 0.88, 0.82, 1 )** --- Turquoise color. + +- **violet** = **Color( 0.93, 0.51, 0.93, 1 )** --- Violet color. + +- **webgray** = **Color( 0.5, 0.5, 0.5, 1 )** --- Web gray color. + +- **webgreen** = **Color( 0, 0.5, 0, 1 )** --- Web green color. + +- **webmaroon** = **Color( 0.5, 0, 0, 1 )** --- Web maroon color. + +- **webpurple** = **Color( 0.5, 0, 0.5, 1 )** --- Web purple color. + +- **wheat** = **Color( 0.96, 0.87, 0.7, 1 )** --- Wheat color. + +- **white** = **Color( 1, 1, 1, 1 )** --- White color. + +- **whitesmoke** = **Color( 0.96, 0.96, 0.96, 1 )** --- White smoke color. + +- **yellow** = **Color( 1, 1, 0, 1 )** --- Yellow color. + +- **yellowgreen** = **Color( 0.6, 0.8, 0.2, 1 )** --- Yellow green color. + +Property Descriptions +--------------------- + +.. _class_Color_property_a: + +- :ref:`float` **a** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +The color's alpha component, typically on the range of 0 to 1. A value of 0 means that the color is fully transparent. A value of 1 means that the color is fully opaque. + +---- + +.. _class_Color_property_a8: + +- :ref:`int` **a8** + ++-----------+---------+ +| *Default* | ``255`` | ++-----------+---------+ + +Wrapper for :ref:`a` that uses the range 0 to 255 instead of 0 to 1. + +---- + +.. _class_Color_property_b: + +- :ref:`float` **b** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The color's blue component, typically on the range of 0 to 1. + +---- + +.. _class_Color_property_b8: + +- :ref:`int` **b8** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Wrapper for :ref:`b` that uses the range 0 to 255 instead of 0 to 1. + +---- + +.. _class_Color_property_g: + +- :ref:`float` **g** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The color's green component, typically on the range of 0 to 1. + +---- + +.. _class_Color_property_g8: + +- :ref:`int` **g8** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Wrapper for :ref:`g` that uses the range 0 to 255 instead of 0 to 1. + +---- + +.. _class_Color_property_h: + +- :ref:`float` **h** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The HSV hue of this color, on the range 0 to 1. + +---- + +.. _class_Color_property_r: + +- :ref:`float` **r** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The color's red component, typically on the range of 0 to 1. + +---- + +.. _class_Color_property_r8: + +- :ref:`int` **r8** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Wrapper for :ref:`r` that uses the range 0 to 255 instead of 0 to 1. + +---- + +.. _class_Color_property_s: + +- :ref:`float` **s** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The HSV saturation of this color, on the range 0 to 1. + +---- + +.. _class_Color_property_v: + +- :ref:`float` **v** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The HSV value (brightness) of this color, on the range 0 to 1. + +Method Descriptions +------------------- + +.. _class_Color_method_Color: + +- :ref:`Color` **Color** **(** :ref:`String` from **)** + +Constructs a color from an HTML hexadecimal color string in ARGB or RGB format. See also :ref:`@GDScript.ColorN`. + +:: + + # Each of the following creates the same color RGBA(178, 217, 10, 255). + var c1 = Color("#ffb2d90a") # ARGB format with "#". + var c2 = Color("ffb2d90a") # ARGB format. + var c3 = Color("#b2d90a") # RGB format with "#". + var c4 = Color("b2d90a") # RGB format. + +---- + +- :ref:`Color` **Color** **(** :ref:`int` from **)** + +Constructs a color from a 32-bit integer in RGBA format (each byte represents a color channel). + +:: + + var c = Color(274) # Similar to Color(0.0, 0.0, 0.004, 0.07) + +---- + +- :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b **)** + +Constructs a color from RGB values, typically between 0 and 1. Alpha will be 1. + +:: + + var color = Color(0.2, 1.0, 0.7) # Similar to Color8(51, 255, 178, 255) + +---- + +- :ref:`Color` **Color** **(** :ref:`float` r, :ref:`float` g, :ref:`float` b, :ref:`float` a **)** + +Constructs a color from RGBA values, typically between 0 and 1. + +:: + + var color = Color(0.2, 1.0, 0.7, 0.8) # Similar to Color8(51, 255, 178, 204) + +---- + +.. _class_Color_method_blend: + +- :ref:`Color` **blend** **(** :ref:`Color` over **)** + +Returns a new color resulting from blending this color over another. If the color is opaque, the result is also opaque. The second color may have a range of alpha values. + +:: + + var bg = Color(0.0, 1.0, 0.0, 0.5) # Green with alpha of 50% + var fg = Color(1.0, 0.0, 0.0, 0.5) # Red with alpha of 50% + var blended_color = bg.blend(fg) # Brown with alpha of 75% + +---- + +.. _class_Color_method_contrasted: + +- :ref:`Color` **contrasted** **(** **)** + +Returns the most contrasting color. + +:: + + var c = Color(0.3, 0.4, 0.9) + var contrasted_color = c.contrasted() # Equivalent to RGBA(204, 229, 102, 255) + +---- + +.. _class_Color_method_darkened: + +- :ref:`Color` **darkened** **(** :ref:`float` amount **)** + +Returns a new color resulting from making this color darker by the specified percentage (ratio from 0 to 1). + +:: + + var green = Color(0.0, 1.0, 0.0) + var darkgreen = green.darkened(0.2) # 20% darker than regular green + +---- + +.. _class_Color_method_from_hsv: + +- :ref:`Color` **from_hsv** **(** :ref:`float` h, :ref:`float` s, :ref:`float` v, :ref:`float` a=1.0 **)** + +Constructs a color from an HSV profile. ``h``, ``s``, and ``v`` are values between 0 and 1. + +:: + + var c = Color.from_hsv(0.58, 0.5, 0.79, 0.8) # Equivalent to HSV(210, 50, 79, 0.8) or Color8(100, 151, 201, 0.8) + +---- + +.. _class_Color_method_gray: + +- :ref:`float` **gray** **(** **)** + +Returns the color's grayscale representation. + +The gray value is calculated as ``(r + g + b) / 3``. + +:: + + var c = Color(0.2, 0.45, 0.82) + var gray = c.gray() # A value of 0.466667 + +---- + +.. _class_Color_method_inverted: + +- :ref:`Color` **inverted** **(** **)** + +Returns the inverted color ``(1 - r, 1 - g, 1 - b, a)``. + +:: + + var color = Color(0.3, 0.4, 0.9) + var inverted_color = color.inverted() # Equivalent to Color(0.7, 0.6, 0.1) + +---- + +.. _class_Color_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Color` color **)** + +Returns ``true`` if this color and ``color`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_Color_method_lightened: + +- :ref:`Color` **lightened** **(** :ref:`float` amount **)** + +Returns a new color resulting from making this color lighter by the specified percentage (ratio from 0 to 1). + +:: + + var green = Color(0.0, 1.0, 0.0) + var lightgreen = green.lightened(0.2) # 20% lighter than regular green + +---- + +.. _class_Color_method_linear_interpolate: + +- :ref:`Color` **linear_interpolate** **(** :ref:`Color` to, :ref:`float` weight **)** + +Returns the linear interpolation with another color. The interpolation factor ``weight`` is between 0 and 1. + +:: + + var c1 = Color(1.0, 0.0, 0.0) + var c2 = Color(0.0, 1.0, 0.0) + var li_c = c1.linear_interpolate(c2, 0.5) # Equivalent to Color(0.5, 0.5, 0.0) + +---- + +.. _class_Color_method_to_abgr32: + +- :ref:`int` **to_abgr32** **(** **)** + +Returns the color converted to a 32-bit integer in ABGR format (each byte represents a color channel). ABGR is the reversed version of the default format. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_abgr32()) # Prints 4281565439 + +---- + +.. _class_Color_method_to_abgr64: + +- :ref:`int` **to_abgr64** **(** **)** + +Returns the color converted to a 64-bit integer in ABGR format (each word represents a color channel). ABGR is the reversed version of the default format. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_abgr64()) # Prints -225178692812801 + +---- + +.. _class_Color_method_to_argb32: + +- :ref:`int` **to_argb32** **(** **)** + +Returns the color converted to a 32-bit integer in ARGB format (each byte represents a color channel). ARGB is more compatible with DirectX. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_argb32()) # Prints 4294934323 + +---- + +.. _class_Color_method_to_argb64: + +- :ref:`int` **to_argb64** **(** **)** + +Returns the color converted to a 64-bit integer in ARGB format (each word represents a color channel). ARGB is more compatible with DirectX. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_argb64()) # Prints -2147470541 + +---- + +.. _class_Color_method_to_html: + +- :ref:`String` **to_html** **(** :ref:`bool` with_alpha=true **)** + +Returns the color's HTML hexadecimal color string in ARGB format (ex: ``ff34f822``). + +Setting ``with_alpha`` to ``false`` excludes alpha from the hexadecimal string. + +:: + + var c = Color(1, 1, 1, 0.5) + var s1 = c.to_html() # Returns "7fffffff" + var s2 = c.to_html(false) # Returns "ffffff" + +---- + +.. _class_Color_method_to_rgba32: + +- :ref:`int` **to_rgba32** **(** **)** + +Returns the color converted to a 32-bit integer in RGBA format (each byte represents a color channel). RGBA is Godot's default format. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_rgba32()) # Prints 4286526463 + +---- + +.. _class_Color_method_to_rgba64: + +- :ref:`int` **to_rgba64** **(** **)** + +Returns the color converted to a 64-bit integer in RGBA format (each word represents a color channel). RGBA is Godot's default format. + +:: + + var color = Color(1, 0.5, 0.2) + print(color.to_rgba64()) # Prints -140736629309441 + +.. |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.)` diff --git a/classes/class_colorpicker.rst b/classes/class_colorpicker.rst new file mode 100644 index 0000000..edbd2de --- /dev/null +++ b/classes/class_colorpicker.rst @@ -0,0 +1,359 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ColorPicker.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ColorPicker: + +ColorPicker +=========== + +**Inherits:** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Color picker control. + +Description +----------- + +Displays a color picker widget. Useful for selecting a color from an RGB/RGBA colorspace. + +**Note:** This control is the color picker widget itself. You can use a :ref:`ColorPickerButton` instead if you need a button that brings up a ``ColorPicker`` in a pop-up. + +Tutorials +--------- + +- `Tween Demo `__ + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`deferred_mode` | ``false`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`edit_alpha` | ``true`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`hsv_mode` | ``false`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`presets_enabled` | ``true`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`presets_visible` | ``true`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`raw_mode` | ``false`` | ++---------------------------+--------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_preset` **(** :ref:`Color` color **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_preset` **(** :ref:`Color` color **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`PoolColorArray` | :ref:`get_presets` **(** **)** |const| | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`h_width` | ``30`` | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`label_width` | ``10`` | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`margin` | ``4`` | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`sv_height` | ``256`` | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`sv_width` | ``256`` | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`add_preset` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`color_hue` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`color_sample` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`overbright_indicator` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`preset_bg` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ +| :ref:`Texture` | :ref:`screen_picker` | | ++-------------------------------+--------------------------------------------------------------------------------+---------+ + +Signals +------- + +.. _class_ColorPicker_signal_color_changed: + +- **color_changed** **(** :ref:`Color` color **)** + +Emitted when the color is changed. + +---- + +.. _class_ColorPicker_signal_preset_added: + +- **preset_added** **(** :ref:`Color` color **)** + +Emitted when a preset is added. + +---- + +.. _class_ColorPicker_signal_preset_removed: + +- **preset_removed** **(** :ref:`Color` color **)** + +Emitted when a preset is removed. + +Property Descriptions +--------------------- + +.. _class_ColorPicker_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_pick_color(value) | ++-----------+-------------------------+ +| *Getter* | get_pick_color() | ++-----------+-------------------------+ + +The currently selected color. + +---- + +.. _class_ColorPicker_property_deferred_mode: + +- :ref:`bool` **deferred_mode** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_deferred_mode(value) | ++-----------+--------------------------+ +| *Getter* | is_deferred_mode() | ++-----------+--------------------------+ + +If ``true``, the color will apply only after the user releases the mouse button, otherwise it will apply immediately even in mouse motion event (which can cause performance issues). + +---- + +.. _class_ColorPicker_property_edit_alpha: + +- :ref:`bool` **edit_alpha** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_edit_alpha(value) | ++-----------+-----------------------+ +| *Getter* | is_editing_alpha() | ++-----------+-----------------------+ + +If ``true``, shows an alpha channel slider (opacity). + +---- + +.. _class_ColorPicker_property_hsv_mode: + +- :ref:`bool` **hsv_mode** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_hsv_mode(value) | ++-----------+---------------------+ +| *Getter* | is_hsv_mode() | ++-----------+---------------------+ + +If ``true``, allows editing the color with Hue/Saturation/Value sliders. + +**Note:** Cannot be enabled if raw mode is on. + +---- + +.. _class_ColorPicker_property_presets_enabled: + +- :ref:`bool` **presets_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_presets_enabled(value) | ++-----------+----------------------------+ +| *Getter* | are_presets_enabled() | ++-----------+----------------------------+ + +If ``true``, the "add preset" button is enabled. + +---- + +.. _class_ColorPicker_property_presets_visible: + +- :ref:`bool` **presets_visible** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_presets_visible(value) | ++-----------+----------------------------+ +| *Getter* | are_presets_visible() | ++-----------+----------------------------+ + +If ``true``, saved color presets are visible. + +---- + +.. _class_ColorPicker_property_raw_mode: + +- :ref:`bool` **raw_mode** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_raw_mode(value) | ++-----------+---------------------+ +| *Getter* | is_raw_mode() | ++-----------+---------------------+ + +If ``true``, allows the color R, G, B component values to go beyond 1.0, which can be used for certain special operations that require it (like tinting without darkening or rendering sprites in HDR). + +**Note:** Cannot be enabled if HSV mode is on. + +Method Descriptions +------------------- + +.. _class_ColorPicker_method_add_preset: + +- void **add_preset** **(** :ref:`Color` color **)** + +Adds the given color to a list of color presets. The presets are displayed in the color picker and the user will be able to select them. + +**Note:** The presets list is only for *this* color picker. + +---- + +.. _class_ColorPicker_method_erase_preset: + +- void **erase_preset** **(** :ref:`Color` color **)** + +Removes the given color from the list of color presets of this color picker. + +---- + +.. _class_ColorPicker_method_get_presets: + +- :ref:`PoolColorArray` **get_presets** **(** **)** |const| + +Returns the list of colors in the presets of the color picker. + +Theme Property Descriptions +--------------------------- + +.. _class_ColorPicker_theme_constant_h_width: + +- :ref:`int` **h_width** + ++-----------+--------+ +| *Default* | ``30`` | ++-----------+--------+ + +The width of the hue selection slider. + +---- + +.. _class_ColorPicker_theme_constant_label_width: + +- :ref:`int` **label_width** + ++-----------+--------+ +| *Default* | ``10`` | ++-----------+--------+ + +---- + +.. _class_ColorPicker_theme_constant_margin: + +- :ref:`int` **margin** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The margin around the ``ColorPicker``. + +---- + +.. _class_ColorPicker_theme_constant_sv_height: + +- :ref:`int` **sv_height** + ++-----------+---------+ +| *Default* | ``256`` | ++-----------+---------+ + +The height of the saturation-value selection box. + +---- + +.. _class_ColorPicker_theme_constant_sv_width: + +- :ref:`int` **sv_width** + ++-----------+---------+ +| *Default* | ``256`` | ++-----------+---------+ + +The width of the saturation-value selection box. + +---- + +.. _class_ColorPicker_theme_icon_add_preset: + +- :ref:`Texture` **add_preset** + +The icon for the "Add Preset" button. + +---- + +.. _class_ColorPicker_theme_icon_color_hue: + +- :ref:`Texture` **color_hue** + +Custom texture for the hue selection slider on the right. + +---- + +.. _class_ColorPicker_theme_icon_color_sample: + +- :ref:`Texture` **color_sample** + +---- + +.. _class_ColorPicker_theme_icon_overbright_indicator: + +- :ref:`Texture` **overbright_indicator** + +The indicator used to signalize that the color value is outside the 0-1 range. + +---- + +.. _class_ColorPicker_theme_icon_preset_bg: + +- :ref:`Texture` **preset_bg** + +---- + +.. _class_ColorPicker_theme_icon_screen_picker: + +- :ref:`Texture` **screen_picker** + +The icon for the screen color picker button. + +.. |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.)` diff --git a/classes/class_colorpickerbutton.rst b/classes/class_colorpickerbutton.rst new file mode 100644 index 0000000..b40bc9b --- /dev/null +++ b/classes/class_colorpickerbutton.rst @@ -0,0 +1,293 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ColorPickerButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ColorPickerButton: + +ColorPickerButton +================= + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Button that pops out a :ref:`ColorPicker`. + +Description +----------- + +Encapsulates a :ref:`ColorPicker` making it accessible by pressing a button. Pressing the button will toggle the :ref:`ColorPicker` visibility. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +**Note:** By default, the button may not be wide enough for the color preview swatch to be visible. Make sure to set :ref:`Control.rect_min_size` to a big enough value to give the button enough space. + +Tutorials +--------- + +- `GUI Drag And Drop Demo `__ + +- `2D GD Paint Demo `__ + +Properties +---------- + ++---------------------------+----------------------------------------------------------------+------------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------+----------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`edit_alpha` | ``true`` | ++---------------------------+----------------------------------------------------------------+------------------------------+ +| :ref:`bool` | toggle_mode | ``true`` *(parent override)* | ++---------------------------+----------------------------------------------------------------+------------------------------+ + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------+ +| :ref:`ColorPicker` | :ref:`get_picker` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------+ +| :ref:`PopupPanel` | :ref:`get_popup` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.3 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 0.8, 0.8, 0.8, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``2`` | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`Texture` | :ref:`bg` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+-------------------------------------------------------------------------------------+---------------------------------+ + +Signals +------- + +.. _class_ColorPickerButton_signal_color_changed: + +- **color_changed** **(** :ref:`Color` color **)** + +Emitted when the color changes. + +---- + +.. _class_ColorPickerButton_signal_picker_created: + +- **picker_created** **(** **)** + +Emitted when the :ref:`ColorPicker` is created (the button is pressed for the first time). + +---- + +.. _class_ColorPickerButton_signal_popup_closed: + +- **popup_closed** **(** **)** + +Emitted when the :ref:`ColorPicker` is closed. + +Property Descriptions +--------------------- + +.. _class_ColorPickerButton_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_pick_color(value) | ++-----------+-------------------------+ +| *Getter* | get_pick_color() | ++-----------+-------------------------+ + +The currently selected color. + +---- + +.. _class_ColorPickerButton_property_edit_alpha: + +- :ref:`bool` **edit_alpha** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_edit_alpha(value) | ++-----------+-----------------------+ +| *Getter* | is_editing_alpha() | ++-----------+-----------------------+ + +If ``true``, the alpha channel in the displayed :ref:`ColorPicker` will be visible. + +Method Descriptions +------------------- + +.. _class_ColorPickerButton_method_get_picker: + +- :ref:`ColorPicker` **get_picker** **(** **)** + +Returns the :ref:`ColorPicker` that this node toggles. + +**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` property. + +---- + +.. _class_ColorPickerButton_method_get_popup: + +- :ref:`PopupPanel` **get_popup** **(** **)** + +Returns the control's :ref:`PopupPanel` which allows you to connect to popup signals. This allows you to handle events when the ColorPicker is shown or hidden. + +**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` property. + +Theme Property Descriptions +--------------------------- + +.. _class_ColorPickerButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Default text :ref:`Color` of the ``ColorPickerButton``. + +---- + +.. _class_ColorPickerButton_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.3 )`` | ++-----------+---------------------------------+ + +Text :ref:`Color` used when the ``ColorPickerButton`` is disabled. + +---- + +.. _class_ColorPickerButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``ColorPickerButton`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_ColorPickerButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``ColorPickerButton`` is being hovered. + +---- + +.. _class_ColorPickerButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.8, 0.8, 0.8, 1 )`` | ++-----------+-------------------------------+ + +Text :ref:`Color` used when the ``ColorPickerButton`` is being pressed. + +---- + +.. _class_ColorPickerButton_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The horizontal space between ``ColorPickerButton``'s icon and text. + +---- + +.. _class_ColorPickerButton_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``ColorPickerButton``'s text. + +---- + +.. _class_ColorPickerButton_theme_icon_bg: + +- :ref:`Texture` **bg** + +The background of the color preview rect on the button. + +---- + +.. _class_ColorPickerButton_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +:ref:`StyleBox` used when the ``ColorPickerButton`` is disabled. + +---- + +.. _class_ColorPickerButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``ColorPickerButton`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +---- + +.. _class_ColorPickerButton_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` used when the ``ColorPickerButton`` is being hovered. + +---- + +.. _class_ColorPickerButton_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default :ref:`StyleBox` for the ``ColorPickerButton``. + +---- + +.. _class_ColorPickerButton_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +:ref:`StyleBox` used when the ``ColorPickerButton`` is being pressed. + +.. |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.)` diff --git a/classes/class_colorrect.rst b/classes/class_colorrect.rst new file mode 100644 index 0000000..ebf400f --- /dev/null +++ b/classes/class_colorrect.rst @@ -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 ColorRect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ColorRect: + +ColorRect +========= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Colored rectangle. + +Description +----------- + +Displays a rectangle filled with a solid :ref:`color`. If you need to display the border alone, consider using :ref:`ReferenceRect` instead. + +Tutorials +--------- + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++---------------------------+----------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+----------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_ColorRect_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_frame_color(value) | ++-----------+-------------------------+ +| *Getter* | get_frame_color() | ++-----------+-------------------------+ + +The fill color. + +:: + + $ColorRect.color = Color(1, 0, 0, 1) # Set ColorRect's color to red. + +.. |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.)` diff --git a/classes/class_concavepolygonshape.rst b/classes/class_concavepolygonshape.rst new file mode 100644 index 0000000..34b8ab7 --- /dev/null +++ b/classes/class_concavepolygonshape.rst @@ -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 ConcavePolygonShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConcavePolygonShape: + +ConcavePolygonShape +=================== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Concave polygon shape. + +Description +----------- + +Concave polygon shape resource, which can be set into a :ref:`PhysicsBody` or area. This shape is created by feeding a list of triangles. + +**Note:** When used for collision, ``ConcavePolygonShape`` is intended to work with static :ref:`PhysicsBody` nodes like :ref:`StaticBody` and will not work with :ref:`KinematicBody` or :ref:`RigidBody` with a mode other than Static. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +Methods +------- + ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_faces` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_faces` **(** :ref:`PoolVector3Array` faces **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ConcavePolygonShape_method_get_faces: + +- :ref:`PoolVector3Array` **get_faces** **(** **)** |const| + +Returns the faces (an array of triangles). + +---- + +.. _class_ConcavePolygonShape_method_set_faces: + +- void **set_faces** **(** :ref:`PoolVector3Array` faces **)** + +Sets the faces (an array of triangles). + +.. |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.)` diff --git a/classes/class_concavepolygonshape2d.rst b/classes/class_concavepolygonshape2d.rst new file mode 100644 index 0000000..a2e751f --- /dev/null +++ b/classes/class_concavepolygonshape2d.rst @@ -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 ConcavePolygonShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConcavePolygonShape2D: + +ConcavePolygonShape2D +===================== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Concave polygon 2D shape resource for physics. + +Description +----------- + +Concave polygon 2D shape resource for physics. It is made out of segments and is optimal for complex polygonal concave collisions. However, it is not advised to use for :ref:`RigidBody2D` nodes. A CollisionPolygon2D in convex decomposition mode (solids) or several convex objects are advised for that instead. Otherwise, a concave polygon 2D shape is better for static collisions. + +The main difference between a :ref:`ConvexPolygonShape2D` and a ``ConcavePolygonShape2D`` is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. + +Properties +---------- + ++-------------------------------------------------+----------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`segments` | ``PoolVector2Array( )`` | ++-------------------------------------------------+----------------------------------------------------------------+--------------------------+ + +Property Descriptions +--------------------- + +.. _class_ConcavePolygonShape2D_property_segments: + +- :ref:`PoolVector2Array` **segments** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_segments(value) | ++-----------+--------------------------+ +| *Getter* | get_segments() | ++-----------+--------------------------+ + +The array of points that make up the ``ConcavePolygonShape2D``'s line segments. + +.. |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.)` diff --git a/classes/class_conetwistjoint.rst b/classes/class_conetwistjoint.rst new file mode 100644 index 0000000..3deca1b --- /dev/null +++ b/classes/class_conetwistjoint.rst @@ -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 ConeTwistJoint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConeTwistJoint: + +ConeTwistJoint +============== + +**Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A twist joint between two 3D PhysicsBodies. + +Description +----------- + +The joint can rotate the bodies across an axis defined by the local x-axes of the :ref:`Joint`. + +The twist axis is initiated as the X axis of the :ref:`Joint`. + +Once the Bodies swing, the twist axis is calculated as the middle of the x-axes of the Joint in the local space of the two Bodies. See also :ref:`Generic6DOFJoint`. + +Properties +---------- + ++---------------------------+-------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`bias` | ``0.3`` | ++---------------------------+-------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`relaxation` | ``1.0`` | ++---------------------------+-------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`softness` | ``0.8`` | ++---------------------------+-------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`swing_span` | ``45.0`` | ++---------------------------+-------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`twist_span` | ``180.0`` | ++---------------------------+-------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ConeTwistJoint_Param: + +.. _class_ConeTwistJoint_constant_PARAM_SWING_SPAN: + +.. _class_ConeTwistJoint_constant_PARAM_TWIST_SPAN: + +.. _class_ConeTwistJoint_constant_PARAM_BIAS: + +.. _class_ConeTwistJoint_constant_PARAM_SOFTNESS: + +.. _class_ConeTwistJoint_constant_PARAM_RELAXATION: + +.. _class_ConeTwistJoint_constant_PARAM_MAX: + +enum **Param**: + +- **PARAM_SWING_SPAN** = **0** --- Swing is rotation from side to side, around the axis perpendicular to the twist axis. + +The swing span defines, how much rotation will not get corrected along the swing axis. + +Could be defined as looseness in the ``ConeTwistJoint``. + +If below 0.05, this behavior is locked. + +- **PARAM_TWIST_SPAN** = **1** --- Twist is the rotation around the twist axis, this value defined how far the joint can twist. + +Twist is locked if below 0.05. + +- **PARAM_BIAS** = **2** --- The speed with which the swing or twist will take place. + +The higher, the faster. + +- **PARAM_SOFTNESS** = **3** --- The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. + +- **PARAM_RELAXATION** = **4** --- Defines, how fast the swing- and twist-speed-difference on both sides gets synced. + +- **PARAM_MAX** = **5** --- Represents the size of the :ref:`Param` enum. + +Property Descriptions +--------------------- + +.. _class_ConeTwistJoint_property_bias: + +- :ref:`float` **bias** + ++-----------+------------------+ +| *Default* | ``0.3`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The speed with which the swing or twist will take place. + +The higher, the faster. + +---- + +.. _class_ConeTwistJoint_property_relaxation: + +- :ref:`float` **relaxation** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Defines, how fast the swing- and twist-speed-difference on both sides gets synced. + +---- + +.. _class_ConeTwistJoint_property_softness: + +- :ref:`float` **softness** + ++-----------+------------------+ +| *Default* | ``0.8`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The ease with which the joint starts to twist. If it's too low, it takes more force to start twisting the joint. + +---- + +.. _class_ConeTwistJoint_property_swing_span: + +- :ref:`float` **swing_span** + ++-----------+----------+ +| *Default* | ``45.0`` | ++-----------+----------+ + +Swing is rotation from side to side, around the axis perpendicular to the twist axis. + +The swing span defines, how much rotation will not get corrected along the swing axis. + +Could be defined as looseness in the ``ConeTwistJoint``. + +If below 0.05, this behavior is locked. + +---- + +.. _class_ConeTwistJoint_property_twist_span: + +- :ref:`float` **twist_span** + ++-----------+-----------+ +| *Default* | ``180.0`` | ++-----------+-----------+ + +Twist is the rotation around the twist axis, this value defined how far the joint can twist. + +Twist is locked if below 0.05. + +Method Descriptions +------------------- + +.. _class_ConeTwistJoint_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| + +---- + +.. _class_ConeTwistJoint_method_set_param: + +- void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** + +.. |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.)` diff --git a/classes/class_configfile.rst b/classes/class_configfile.rst new file mode 100644 index 0000000..0c6c20f --- /dev/null +++ b/classes/class_configfile.rst @@ -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 ConfigFile.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConfigFile: + +ConfigFile +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper class to handle INI-style files. + +Description +----------- + +This helper class can be used to store :ref:`Variant` values on the filesystem using INI-style formatting. The stored values are identified by a section and a key: + +:: + + [section] + some_key=42 + string_example="Hello World!" + a_vector=Vector3( 1, 0, 2 ) + +The stored data can be saved to or parsed from a file, though ConfigFile objects can also be used directly without accessing the filesystem. + +The following example shows how to create a simple ``ConfigFile`` and save it on disk: + +:: + + # Create new ConfigFile object. + var config = ConfigFile.new() + + # Store some values. + config.set_value("Player1", "player_name", "Steve") + config.set_value("Player1", "best_score", 10) + config.set_value("Player2", "player_name", "V3geta") + config.set_value("Player2", "best_score", 9001) + + # Save it to a file (overwrite if already exists). + config.save("user://scores.cfg") + +This example shows how the above file could be loaded: + +:: + + var score_data = {} + var config = ConfigFile.new() + + # Load data from a file. + var err = config.load("user://scores.cfg") + + # If the file didn't load, ignore it. + if err != OK: + return + + # Iterate over all sections. + for player in config.get_sections(): + # Fetch the data for each section. + var player_name = config.get_value(player, "player_name") + var player_score = config.get_value(player, "best_score") + score_data[player_name] = player_score + +Any operation that mutates the ConfigFile such as :ref:`set_value`, :ref:`clear`, or :ref:`erase_section`, only changes what is loaded in memory. If you want to write the change to a file, you have to save the changes with :ref:`save`, :ref:`save_encrypted`, or :ref:`save_encrypted_pass`. + +Keep in mind that section and property names can't contain spaces. Anything after a space will be ignored on save and on load. + +ConfigFiles can also contain manually written comment lines starting with a semicolon (``;``). Those lines will be ignored when parsing the file. Note that comments will be lost when saving the ConfigFile. This can still be useful for dedicated server configuration files, which are typically never overwritten without explicit user action. + +**Note:** The file extension given to a ConfigFile does not have any impact on its formatting or behavior. By convention, the ``.cfg`` extension is used here, but any other extension such as ``.ini`` is also valid. Since neither ``.cfg`` nor ``.ini`` are standardized, Godot's ConfigFile formatting may differ from files written by other programs. + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_section` **(** :ref:`String` section **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_section_key` **(** :ref:`String` section, :ref:`String` key **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_section_keys` **(** :ref:`String` section **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_sections` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_value` **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` default=null **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_section` **(** :ref:`String` section **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_section_key` **(** :ref:`String` section, :ref:`String` key **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_encrypted` **(** :ref:`String` path, :ref:`PoolByteArray` key **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_encrypted_pass` **(** :ref:`String` path, :ref:`String` password **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`parse` **(** :ref:`String` data **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** :ref:`String` path **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_encrypted` **(** :ref:`String` path, :ref:`PoolByteArray` key **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_encrypted_pass` **(** :ref:`String` path, :ref:`String` password **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_value` **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` value **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ConfigFile_method_clear: + +- void **clear** **(** **)** + +Removes the entire contents of the config. + +---- + +.. _class_ConfigFile_method_erase_section: + +- void **erase_section** **(** :ref:`String` section **)** + +Deletes the specified section along with all the key-value pairs inside. Raises an error if the section does not exist. + +---- + +.. _class_ConfigFile_method_erase_section_key: + +- void **erase_section_key** **(** :ref:`String` section, :ref:`String` key **)** + +Deletes the specified key in a section. Raises an error if either the section or the key do not exist. + +---- + +.. _class_ConfigFile_method_get_section_keys: + +- :ref:`PoolStringArray` **get_section_keys** **(** :ref:`String` section **)** |const| + +Returns an array of all defined key identifiers in the specified section. Raises an error and returns an empty array if the section does not exist. + +---- + +.. _class_ConfigFile_method_get_sections: + +- :ref:`PoolStringArray` **get_sections** **(** **)** |const| + +Returns an array of all defined section identifiers. + +---- + +.. _class_ConfigFile_method_get_value: + +- :ref:`Variant` **get_value** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` default=null **)** |const| + +Returns the current value for the specified section and key. If either the section or the key do not exist, the method returns the fallback ``default`` value. If ``default`` is not specified or set to ``null``, an error is also raised. + +---- + +.. _class_ConfigFile_method_has_section: + +- :ref:`bool` **has_section** **(** :ref:`String` section **)** |const| + +Returns ``true`` if the specified section exists. + +---- + +.. _class_ConfigFile_method_has_section_key: + +- :ref:`bool` **has_section_key** **(** :ref:`String` section, :ref:`String` key **)** |const| + +Returns ``true`` if the specified section-key pair exists. + +---- + +.. _class_ConfigFile_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path **)** + +Loads the config file specified as a parameter. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_load_encrypted: + +- :ref:`Error` **load_encrypted** **(** :ref:`String` path, :ref:`PoolByteArray` key **)** + +Loads the encrypted config file specified as a parameter, using the provided ``key`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_load_encrypted_pass: + +- :ref:`Error` **load_encrypted_pass** **(** :ref:`String` path, :ref:`String` password **)** + +Loads the encrypted config file specified as a parameter, using the provided ``password`` to decrypt it. The file's contents are parsed and loaded in the ``ConfigFile`` object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_parse: + +- :ref:`Error` **parse** **(** :ref:`String` data **)** + +Parses the passed string as the contents of a config file. The string is parsed and loaded in the ConfigFile object which the method was called on. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_save: + +- :ref:`Error` **save** **(** :ref:`String` path **)** + +Saves the contents of the ``ConfigFile`` object to the file specified as a parameter. The output file uses an INI-style structure. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_save_encrypted: + +- :ref:`Error` **save_encrypted** **(** :ref:`String` path, :ref:`PoolByteArray` key **)** + +Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``key`` to encrypt it. The output file uses an INI-style structure. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_save_encrypted_pass: + +- :ref:`Error` **save_encrypted_pass** **(** :ref:`String` path, :ref:`String` password **)** + +Saves the contents of the ``ConfigFile`` object to the AES-256 encrypted file specified as a parameter, using the provided ``password`` to encrypt it. The output file uses an INI-style structure. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_ConfigFile_method_set_value: + +- void **set_value** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` value **)** + +Assigns a value to the specified key of the specified section. If either the section or the key do not exist, they are created. Passing a ``null`` value deletes the specified key if it exists, and deletes the section if it ends up empty once the key has been removed. + +.. |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.)` diff --git a/classes/class_confirmationdialog.rst b/classes/class_confirmationdialog.rst new file mode 100644 index 0000000..5df5bd8 --- /dev/null +++ b/classes/class_confirmationdialog.rst @@ -0,0 +1,58 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ConfirmationDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConfirmationDialog: + +ConfirmationDialog +================== + +**Inherits:** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorFileDialog`, :ref:`FileDialog`, :ref:`ScriptCreateDialog` + +Dialog for confirmation of actions. + +Description +----------- + +Dialog for confirmation of actions. This dialog inherits from :ref:`AcceptDialog`, but has by default an OK and Cancel button (in host OS order). + +To get cancel action, you can use: + +:: + + get_cancel().connect("pressed", self, "cancelled"). + +Properties +---------- + ++-------------------------------+---------------+---------------------------------------------+ +| :ref:`Vector2` | rect_min_size | ``Vector2( 200, 70 )`` *(parent override)* | ++-------------------------------+---------------+---------------------------------------------+ +| :ref:`String` | window_title | ``"Please Confirm..."`` *(parent override)* | ++-------------------------------+---------------+---------------------------------------------+ + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------+ +| :ref:`Button` | :ref:`get_cancel` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ConfirmationDialog_method_get_cancel: + +- :ref:`Button` **get_cancel** **(** **)** + +Returns the cancel button. + +**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` property. + +.. |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.)` diff --git a/classes/class_container.rst b/classes/class_container.rst new file mode 100644 index 0000000..4c09a3a --- /dev/null +++ b/classes/class_container.rst @@ -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 Container.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Container: + +Container +========= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`AspectRatioContainer`, :ref:`BoxContainer`, :ref:`CenterContainer`, :ref:`EditorProperty`, :ref:`GraphNode`, :ref:`GridContainer`, :ref:`MarginContainer`, :ref:`PanelContainer`, :ref:`ScrollContainer`, :ref:`SplitContainer`, :ref:`TabContainer`, :ref:`ViewportContainer` + +Base node for containers. + +Description +----------- + +Base node for containers. A ``Container`` contains other controls and automatically arranges them in a certain way. + +A Control can inherit this to create custom container classes. + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fit_child_in_rect` **(** :ref:`Control` child, :ref:`Rect2` rect **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_sort` **(** **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Container_signal_sort_children: + +- **sort_children** **(** **)** + +Emitted when sorting the children is needed. + +Constants +--------- + +.. _class_Container_constant_NOTIFICATION_SORT_CHILDREN: + +- **NOTIFICATION_SORT_CHILDREN** = **50** --- Notification for when sorting the children, it must be obeyed immediately. + +Method Descriptions +------------------- + +.. _class_Container_method_fit_child_in_rect: + +- void **fit_child_in_rect** **(** :ref:`Control` child, :ref:`Rect2` rect **)** + +Fit a child control in a given rect. This is mainly a helper for creating custom container classes. + +---- + +.. _class_Container_method_queue_sort: + +- void **queue_sort** **(** **)** + +Queue resort of the contained children. This is called automatically anyway, but can be called upon request. + +.. |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.)` diff --git a/classes/class_control.rst b/classes/class_control.rst new file mode 100644 index 0000000..80393ee --- /dev/null +++ b/classes/class_control.rst @@ -0,0 +1,1990 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Control.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Control: + +Control +======= + +**Inherits:** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`BaseButton`, :ref:`ColorRect`, :ref:`Container`, :ref:`GraphEdit`, :ref:`ItemList`, :ref:`Label`, :ref:`LineEdit`, :ref:`NinePatchRect`, :ref:`Panel`, :ref:`Popup`, :ref:`Range`, :ref:`ReferenceRect`, :ref:`RichTextLabel`, :ref:`Separator`, :ref:`Tabs`, :ref:`TextEdit`, :ref:`TextureRect`, :ref:`Tree`, :ref:`VideoPlayer` + +All user interface nodes inherit from Control. A control's anchors and margins adapt its position and size relative to its parent. + +Description +----------- + +Base class for all UI-related nodes. ``Control`` features a bounding rectangle that defines its extents, an anchor position relative to its parent control or the current viewport, and margins that represent an offset to the anchor. The margins update automatically when the node, any of its parents, or the screen size change. + +For more information on Godot's UI system, anchors, margins, and containers, see the related tutorials in the manual. To build flexible UIs, you'll need a mix of UI elements that inherit from ``Control`` and :ref:`Container` nodes. + +**User Interface nodes and input** + +Godot sends input events to the scene's root node first, by calling :ref:`Node._input`. :ref:`Node._input` forwards the event down the node tree to the nodes under the mouse cursor, or on keyboard focus. To do so, it calls :ref:`MainLoop._input_event`. Call :ref:`accept_event` so no other node receives the event. Once you accept an input, it becomes handled so :ref:`Node._unhandled_input` will not process it. + +Only one ``Control`` node can be in keyboard focus. Only the node in focus will receive keyboard events. To get the focus, call :ref:`grab_focus`. ``Control`` nodes lose focus when another node grabs it, or if you hide the node in focus. + +Sets :ref:`mouse_filter` to :ref:`MOUSE_FILTER_IGNORE` to tell a ``Control`` node to ignore mouse or touch events. You'll need it if you place an icon on top of a button. + +:ref:`Theme` resources change the Control's appearance. If you change the :ref:`Theme` on a ``Control`` node, it affects all of its children. To override some of the theme's parameters, call one of the ``add_*_override`` methods, like :ref:`add_font_override`. You can override the theme with the inspector. + +**Note:** Theme items are *not* :ref:`Object` properties. This means you can't access their values using :ref:`Object.get` and :ref:`Object.set`. Instead, use :ref:`get_color`, :ref:`get_constant`, :ref:`get_font`, :ref:`get_icon`, :ref:`get_stylebox`, and the ``add_*_override`` methods provided by this class. + +Tutorials +--------- + +- :doc:`../tutorials/ui/index` + +- :doc:`../tutorials/2d/custom_drawing_in_2d` + +- :doc:`../tutorials/ui/control_node_gallery` + +- `All GUI Demos `__ + +Properties +---------- + ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`anchor_bottom` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`anchor_left` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`anchor_right` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`anchor_top` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`FocusMode` | :ref:`focus_mode` | ``0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_neighbour_bottom` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_neighbour_left` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_neighbour_right` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_neighbour_top` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_next` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`NodePath` | :ref:`focus_previous` | ``NodePath("")`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`GrowDirection` | :ref:`grow_horizontal` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`GrowDirection` | :ref:`grow_vertical` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`hint_tooltip` | ``""`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`input_pass_on_modal_close_click` | ``true`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`margin_bottom` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`margin_left` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`margin_right` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`margin_top` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`CursorShape` | :ref:`mouse_default_cursor_shape` | ``0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`MouseFilter` | :ref:`mouse_filter` | ``0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`rect_clip_content` | ``false`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_global_position` | | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_min_size` | ``Vector2( 0, 0 )`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_pivot_offset` | ``Vector2( 0, 0 )`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_position` | ``Vector2( 0, 0 )`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`rect_rotation` | ``0.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_scale` | ``Vector2( 1, 1 )`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`rect_size` | ``Vector2( 0, 0 )`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`size_flags_horizontal` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`size_flags_stretch_ratio` | ``1.0`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`size_flags_vertical` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Theme` | :ref:`theme` | | ++--------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_clips_input` **(** **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`_get_minimum_size` **(** **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_gui_input` **(** :ref:`InputEvent` event **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`_make_custom_tooltip` **(** :ref:`String` for_text **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`accept_event` **(** **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_color_override` **(** :ref:`String` name, :ref:`Color` color **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_constant_override` **(** :ref:`String` name, :ref:`int` constant **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_font_override` **(** :ref:`String` name, :ref:`Font` font **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_override` **(** :ref:`String` name, :ref:`Texture` texture **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_shader_override` **(** :ref:`String` name, :ref:`Shader` shader **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_stylebox_override` **(** :ref:`String` name, :ref:`StyleBox` stylebox **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_drop_data` **(** :ref:`Vector2` position, :ref:`Variant` data **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`drop_data` **(** :ref:`Vector2` position, :ref:`Variant` data **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`find_next_valid_focus` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`find_prev_valid_focus` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_drag` **(** :ref:`Variant` data, :ref:`Control` preview **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_anchor` **(** :ref:`Margin` margin **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_begin` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_combined_minimum_size` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`CursorShape` | :ref:`get_cursor_shape` **(** :ref:`Vector2` position=Vector2( 0, 0 ) **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_drag_data` **(** :ref:`Vector2` position **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_end` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_focus_neighbour` **(** :ref:`Margin` margin **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_focus_owner` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_global_rect` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_margin` **(** :ref:`Margin` margin **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_minimum_size` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_parent_area_size` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_parent_control` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_rect` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_rotation` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Font` | :ref:`get_theme_default_font` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tooltip` **(** :ref:`Vector2` at_position=Vector2( 0, 0 ) **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`grab_click_focus` **(** **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`grab_focus` **(** **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_color_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_constant_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_focus` **(** **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_font_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_icon_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector2` point **)** |virtual| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_shader_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_stylebox_override` **(** :ref:`String` name **)** |const| | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`minimum_size_changed` **(** **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`release_focus` **(** **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_anchor` **(** :ref:`Margin` margin, :ref:`float` anchor, :ref:`bool` keep_margin=false, :ref:`bool` push_opposite_anchor=true **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_anchor_and_margin` **(** :ref:`Margin` margin, :ref:`float` anchor, :ref:`float` offset, :ref:`bool` push_opposite_anchor=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_anchors_and_margins_preset` **(** :ref:`LayoutPreset` preset, :ref:`LayoutPresetMode` resize_mode=0, :ref:`int` margin=0 **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_anchors_preset` **(** :ref:`LayoutPreset` preset, :ref:`bool` keep_margins=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_begin` **(** :ref:`Vector2` position **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_drag_forwarding` **(** :ref:`Control` target **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_drag_preview` **(** :ref:`Control` control **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_end` **(** :ref:`Vector2` position **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_focus_neighbour` **(** :ref:`Margin` margin, :ref:`NodePath` neighbour **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_global_position` **(** :ref:`Vector2` position, :ref:`bool` keep_margins=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_margin` **(** :ref:`Margin` margin, :ref:`float` offset **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_margins_preset` **(** :ref:`LayoutPreset` preset, :ref:`LayoutPresetMode` resize_mode=0, :ref:`int` margin=0 **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_position` **(** :ref:`Vector2` position, :ref:`bool` keep_margins=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_rotation` **(** :ref:`float` radians **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_size` **(** :ref:`Vector2` size, :ref:`bool` keep_margins=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`show_modal` **(** :ref:`bool` exclusive=false **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`warp_mouse` **(** :ref:`Vector2` to_position **)** | ++----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Control_signal_focus_entered: + +- **focus_entered** **(** **)** + +Emitted when the node gains keyboard focus. + +---- + +.. _class_Control_signal_focus_exited: + +- **focus_exited** **(** **)** + +Emitted when the node loses keyboard focus. + +---- + +.. _class_Control_signal_gui_input: + +- **gui_input** **(** :ref:`InputEvent` event **)** + +Emitted when the node receives an :ref:`InputEvent`. + +---- + +.. _class_Control_signal_minimum_size_changed: + +- **minimum_size_changed** **(** **)** + +Emitted when the node's minimum size changes. + +---- + +.. _class_Control_signal_modal_closed: + +- **modal_closed** **(** **)** + +Emitted when a modal ``Control`` is closed. See :ref:`show_modal`. + +---- + +.. _class_Control_signal_mouse_entered: + +- **mouse_entered** **(** **)** + +Emitted when the mouse enters the control's ``Rect`` area, provided its :ref:`mouse_filter` lets the event reach it. + +**Note:** :ref:`mouse_entered` will not be emitted if the mouse enters a child ``Control`` node before entering the parent's ``Rect`` area, at least until the mouse is moved to reach the parent's ``Rect`` area. + +---- + +.. _class_Control_signal_mouse_exited: + +- **mouse_exited** **(** **)** + +Emitted when the mouse leaves the control's ``Rect`` area, provided its :ref:`mouse_filter` lets the event reach it. + +**Note:** :ref:`mouse_exited` will be emitted if the mouse enters a child ``Control`` node, even if the mouse cursor is still inside the parent's ``Rect`` area. + +If you want to check whether the mouse truly left the area, ignoring any top nodes, you can use code like this: + +:: + + func _on_mouse_exited(): + if not Rect2(Vector2(), rect_size).has_point(get_local_mouse_position()): + # Not hovering over area. + +---- + +.. _class_Control_signal_resized: + +- **resized** **(** **)** + +Emitted when the control changes size. + +---- + +.. _class_Control_signal_size_flags_changed: + +- **size_flags_changed** **(** **)** + +Emitted when one of the size flags changes. See :ref:`size_flags_horizontal` and :ref:`size_flags_vertical`. + +Enumerations +------------ + +.. _enum_Control_FocusMode: + +.. _class_Control_constant_FOCUS_NONE: + +.. _class_Control_constant_FOCUS_CLICK: + +.. _class_Control_constant_FOCUS_ALL: + +enum **FocusMode**: + +- **FOCUS_NONE** = **0** --- The node cannot grab focus. Use with :ref:`focus_mode`. + +- **FOCUS_CLICK** = **1** --- The node can only grab focus on mouse clicks. Use with :ref:`focus_mode`. + +- **FOCUS_ALL** = **2** --- The node can grab focus on mouse click or using the arrows and the Tab keys on the keyboard. Use with :ref:`focus_mode`. + +---- + +.. _enum_Control_CursorShape: + +.. _class_Control_constant_CURSOR_ARROW: + +.. _class_Control_constant_CURSOR_IBEAM: + +.. _class_Control_constant_CURSOR_POINTING_HAND: + +.. _class_Control_constant_CURSOR_CROSS: + +.. _class_Control_constant_CURSOR_WAIT: + +.. _class_Control_constant_CURSOR_BUSY: + +.. _class_Control_constant_CURSOR_DRAG: + +.. _class_Control_constant_CURSOR_CAN_DROP: + +.. _class_Control_constant_CURSOR_FORBIDDEN: + +.. _class_Control_constant_CURSOR_VSIZE: + +.. _class_Control_constant_CURSOR_HSIZE: + +.. _class_Control_constant_CURSOR_BDIAGSIZE: + +.. _class_Control_constant_CURSOR_FDIAGSIZE: + +.. _class_Control_constant_CURSOR_MOVE: + +.. _class_Control_constant_CURSOR_VSPLIT: + +.. _class_Control_constant_CURSOR_HSPLIT: + +.. _class_Control_constant_CURSOR_HELP: + +enum **CursorShape**: + +- **CURSOR_ARROW** = **0** --- Show the system's arrow mouse cursor when the user hovers the node. Use with :ref:`mouse_default_cursor_shape`. + +- **CURSOR_IBEAM** = **1** --- Show the system's I-beam mouse cursor when the user hovers the node. The I-beam pointer has a shape similar to "I". It tells the user they can highlight or insert text. + +- **CURSOR_POINTING_HAND** = **2** --- Show the system's pointing hand mouse cursor when the user hovers the node. + +- **CURSOR_CROSS** = **3** --- Show the system's cross mouse cursor when the user hovers the node. + +- **CURSOR_WAIT** = **4** --- Show the system's wait mouse cursor, often an hourglass, when the user hovers the node. + +- **CURSOR_BUSY** = **5** --- Show the system's busy mouse cursor when the user hovers the node. Often an hourglass. + +- **CURSOR_DRAG** = **6** --- Show the system's drag mouse cursor, often a closed fist or a cross symbol, when the user hovers the node. It tells the user they're currently dragging an item, like a node in the Scene dock. + +- **CURSOR_CAN_DROP** = **7** --- Show the system's drop mouse cursor when the user hovers the node. It can be an open hand. It tells the user they can drop an item they're currently grabbing, like a node in the Scene dock. + +- **CURSOR_FORBIDDEN** = **8** --- Show the system's forbidden mouse cursor when the user hovers the node. Often a crossed circle. + +- **CURSOR_VSIZE** = **9** --- Show the system's vertical resize mouse cursor when the user hovers the node. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. + +- **CURSOR_HSIZE** = **10** --- Show the system's horizontal resize mouse cursor when the user hovers the node. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. + +- **CURSOR_BDIAGSIZE** = **11** --- Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. + +- **CURSOR_FDIAGSIZE** = **12** --- Show the system's window resize mouse cursor when the user hovers the node. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of :ref:`CURSOR_BDIAGSIZE`. It tells the user they can resize the window or the panel both horizontally and vertically. + +- **CURSOR_MOVE** = **13** --- Show the system's move mouse cursor when the user hovers the node. It shows 2 double-headed arrows at a 90 degree angle. It tells the user they can move a UI element freely. + +- **CURSOR_VSPLIT** = **14** --- Show the system's vertical split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_VSIZE`. + +- **CURSOR_HSPLIT** = **15** --- Show the system's horizontal split mouse cursor when the user hovers the node. On Windows, it's the same as :ref:`CURSOR_HSIZE`. + +- **CURSOR_HELP** = **16** --- Show the system's help mouse cursor when the user hovers the node, a question mark. + +---- + +.. _enum_Control_LayoutPreset: + +.. _class_Control_constant_PRESET_TOP_LEFT: + +.. _class_Control_constant_PRESET_TOP_RIGHT: + +.. _class_Control_constant_PRESET_BOTTOM_LEFT: + +.. _class_Control_constant_PRESET_BOTTOM_RIGHT: + +.. _class_Control_constant_PRESET_CENTER_LEFT: + +.. _class_Control_constant_PRESET_CENTER_TOP: + +.. _class_Control_constant_PRESET_CENTER_RIGHT: + +.. _class_Control_constant_PRESET_CENTER_BOTTOM: + +.. _class_Control_constant_PRESET_CENTER: + +.. _class_Control_constant_PRESET_LEFT_WIDE: + +.. _class_Control_constant_PRESET_TOP_WIDE: + +.. _class_Control_constant_PRESET_RIGHT_WIDE: + +.. _class_Control_constant_PRESET_BOTTOM_WIDE: + +.. _class_Control_constant_PRESET_VCENTER_WIDE: + +.. _class_Control_constant_PRESET_HCENTER_WIDE: + +.. _class_Control_constant_PRESET_WIDE: + +enum **LayoutPreset**: + +- **PRESET_TOP_LEFT** = **0** --- Snap all 4 anchors to the top-left of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_TOP_RIGHT** = **1** --- Snap all 4 anchors to the top-right of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_BOTTOM_LEFT** = **2** --- Snap all 4 anchors to the bottom-left of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_BOTTOM_RIGHT** = **3** --- Snap all 4 anchors to the bottom-right of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_CENTER_LEFT** = **4** --- Snap all 4 anchors to the center of the left edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_CENTER_TOP** = **5** --- Snap all 4 anchors to the center of the top edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_CENTER_RIGHT** = **6** --- Snap all 4 anchors to the center of the right edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_CENTER_BOTTOM** = **7** --- Snap all 4 anchors to the center of the bottom edge of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_CENTER** = **8** --- Snap all 4 anchors to the center of the parent control's bounds. Use with :ref:`set_anchors_preset`. + +- **PRESET_LEFT_WIDE** = **9** --- Snap all 4 anchors to the left edge of the parent control. The left margin becomes relative to the left edge and the top margin relative to the top left corner of the node's parent. Use with :ref:`set_anchors_preset`. + +- **PRESET_TOP_WIDE** = **10** --- Snap all 4 anchors to the top edge of the parent control. The left margin becomes relative to the top left corner, the top margin relative to the top edge, and the right margin relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset`. + +- **PRESET_RIGHT_WIDE** = **11** --- Snap all 4 anchors to the right edge of the parent control. The right margin becomes relative to the right edge and the top margin relative to the top right corner of the node's parent. Use with :ref:`set_anchors_preset`. + +- **PRESET_BOTTOM_WIDE** = **12** --- Snap all 4 anchors to the bottom edge of the parent control. The left margin becomes relative to the bottom left corner, the bottom margin relative to the bottom edge, and the right margin relative to the bottom right corner of the node's parent. Use with :ref:`set_anchors_preset`. + +- **PRESET_VCENTER_WIDE** = **13** --- Snap all 4 anchors to a vertical line that cuts the parent control in half. Use with :ref:`set_anchors_preset`. + +- **PRESET_HCENTER_WIDE** = **14** --- Snap all 4 anchors to a horizontal line that cuts the parent control in half. Use with :ref:`set_anchors_preset`. + +- **PRESET_WIDE** = **15** --- Snap all 4 anchors to the respective corners of the parent control. Set all 4 margins to 0 after you applied this preset and the ``Control`` will fit its parent control. This is equivalent to the "Full Rect" layout option in the editor. Use with :ref:`set_anchors_preset`. + +---- + +.. _enum_Control_LayoutPresetMode: + +.. _class_Control_constant_PRESET_MODE_MINSIZE: + +.. _class_Control_constant_PRESET_MODE_KEEP_WIDTH: + +.. _class_Control_constant_PRESET_MODE_KEEP_HEIGHT: + +.. _class_Control_constant_PRESET_MODE_KEEP_SIZE: + +enum **LayoutPresetMode**: + +- **PRESET_MODE_MINSIZE** = **0** --- The control will be resized to its minimum size. + +- **PRESET_MODE_KEEP_WIDTH** = **1** --- The control's width will not change. + +- **PRESET_MODE_KEEP_HEIGHT** = **2** --- The control's height will not change. + +- **PRESET_MODE_KEEP_SIZE** = **3** --- The control's size will not change. + +---- + +.. _enum_Control_SizeFlags: + +.. _class_Control_constant_SIZE_FILL: + +.. _class_Control_constant_SIZE_EXPAND: + +.. _class_Control_constant_SIZE_EXPAND_FILL: + +.. _class_Control_constant_SIZE_SHRINK_CENTER: + +.. _class_Control_constant_SIZE_SHRINK_END: + +enum **SizeFlags**: + +- **SIZE_FILL** = **1** --- Tells the parent :ref:`Container` to expand the bounds of this node to fill all the available space without pushing any other node. Use with :ref:`size_flags_horizontal` and :ref:`size_flags_vertical`. + +- **SIZE_EXPAND** = **2** --- Tells the parent :ref:`Container` to let this node take all the available space on the axis you flag. If multiple neighboring nodes are set to expand, they'll share the space based on their stretch ratio. See :ref:`size_flags_stretch_ratio`. Use with :ref:`size_flags_horizontal` and :ref:`size_flags_vertical`. + +- **SIZE_EXPAND_FILL** = **3** --- Sets the node's size flags to both fill and expand. See the 2 constants above for more information. + +- **SIZE_SHRINK_CENTER** = **4** --- Tells the parent :ref:`Container` to center the node in itself. It centers the control based on its bounding box, so it doesn't work with the fill or expand size flags. Use with :ref:`size_flags_horizontal` and :ref:`size_flags_vertical`. + +- **SIZE_SHRINK_END** = **8** --- Tells the parent :ref:`Container` to align the node with its end, either the bottom or the right edge. It doesn't work with the fill or expand size flags. Use with :ref:`size_flags_horizontal` and :ref:`size_flags_vertical`. + +---- + +.. _enum_Control_MouseFilter: + +.. _class_Control_constant_MOUSE_FILTER_STOP: + +.. _class_Control_constant_MOUSE_FILTER_PASS: + +.. _class_Control_constant_MOUSE_FILTER_IGNORE: + +enum **MouseFilter**: + +- **MOUSE_FILTER_STOP** = **0** --- The control will receive mouse button input events through :ref:`_gui_input` if clicked on. And the control will receive the :ref:`mouse_entered` and :ref:`mouse_exited` signals. These events are automatically marked as handled, and they will not propagate further to other controls. This also results in blocking signals in other controls. + +- **MOUSE_FILTER_PASS** = **1** --- The control will receive mouse button input events through :ref:`_gui_input` if clicked on. And the control will receive the :ref:`mouse_entered` and :ref:`mouse_exited` signals. If this control does not handle the event, the parent control (if any) will be considered, and so on until there is no more parent control to potentially handle it. This also allows signals to fire in other controls. Even if no control handled it at all, the event will still be handled automatically, so unhandled input will not be fired. + +- **MOUSE_FILTER_IGNORE** = **2** --- The control will not receive mouse button input events through :ref:`_gui_input`. The control will also not receive the :ref:`mouse_entered` nor :ref:`mouse_exited` signals. This will not block other controls from receiving these events or firing the signals. Ignored events will not be handled automatically. + +---- + +.. _enum_Control_GrowDirection: + +.. _class_Control_constant_GROW_DIRECTION_BEGIN: + +.. _class_Control_constant_GROW_DIRECTION_END: + +.. _class_Control_constant_GROW_DIRECTION_BOTH: + +enum **GrowDirection**: + +- **GROW_DIRECTION_BEGIN** = **0** --- The control will grow to the left or top to make up if its minimum size is changed to be greater than its current size on the respective axis. + +- **GROW_DIRECTION_END** = **1** --- The control will grow to the right or bottom to make up if its minimum size is changed to be greater than its current size on the respective axis. + +- **GROW_DIRECTION_BOTH** = **2** --- The control will grow in both directions equally to make up if its minimum size is changed to be greater than its current size. + +---- + +.. _enum_Control_Anchor: + +.. _class_Control_constant_ANCHOR_BEGIN: + +.. _class_Control_constant_ANCHOR_END: + +enum **Anchor**: + +- **ANCHOR_BEGIN** = **0** --- Snaps one of the 4 anchor's sides to the origin of the node's ``Rect``, in the top left. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset`. + +- **ANCHOR_END** = **1** --- Snaps one of the 4 anchor's sides to the end of the node's ``Rect``, in the bottom right. Use it with one of the ``anchor_*`` member variables, like :ref:`anchor_left`. To change all 4 anchors at once, use :ref:`set_anchors_preset`. + +Constants +--------- + +.. _class_Control_constant_NOTIFICATION_RESIZED: + +.. _class_Control_constant_NOTIFICATION_MOUSE_ENTER: + +.. _class_Control_constant_NOTIFICATION_MOUSE_EXIT: + +.. _class_Control_constant_NOTIFICATION_FOCUS_ENTER: + +.. _class_Control_constant_NOTIFICATION_FOCUS_EXIT: + +.. _class_Control_constant_NOTIFICATION_THEME_CHANGED: + +.. _class_Control_constant_NOTIFICATION_MODAL_CLOSE: + +.. _class_Control_constant_NOTIFICATION_SCROLL_BEGIN: + +.. _class_Control_constant_NOTIFICATION_SCROLL_END: + +- **NOTIFICATION_RESIZED** = **40** --- Sent when the node changes size. Use :ref:`rect_size` to get the new size. + +- **NOTIFICATION_MOUSE_ENTER** = **41** --- Sent when the mouse pointer enters the node. + +- **NOTIFICATION_MOUSE_EXIT** = **42** --- Sent when the mouse pointer exits the node. + +- **NOTIFICATION_FOCUS_ENTER** = **43** --- Sent when the node grabs focus. + +- **NOTIFICATION_FOCUS_EXIT** = **44** --- Sent when the node loses focus. + +- **NOTIFICATION_THEME_CHANGED** = **45** --- Sent when the node's :ref:`theme` changes, right before Godot redraws the control. Happens when you call one of the ``add_*_override`` methods. + +- **NOTIFICATION_MODAL_CLOSE** = **46** --- Sent when an open modal dialog closes. See :ref:`show_modal`. + +- **NOTIFICATION_SCROLL_BEGIN** = **47** --- Sent when this node is inside a :ref:`ScrollContainer` which has begun being scrolled. + +- **NOTIFICATION_SCROLL_END** = **48** --- Sent when this node is inside a :ref:`ScrollContainer` which has stopped being scrolled. + +Property Descriptions +--------------------- + +.. _class_Control_property_anchor_bottom: + +- :ref:`float` **anchor_bottom** + ++-----------+--------------+ +| *Default* | ``0.0`` | ++-----------+--------------+ +| *Getter* | get_anchor() | ++-----------+--------------+ + +Anchors the bottom edge of the node to the origin, the center, or the end of its parent control. It changes how the bottom margin updates when the node moves or changes size. You can use one of the :ref:`Anchor` constants for convenience. + +---- + +.. _class_Control_property_anchor_left: + +- :ref:`float` **anchor_left** + ++-----------+--------------+ +| *Default* | ``0.0`` | ++-----------+--------------+ +| *Getter* | get_anchor() | ++-----------+--------------+ + +Anchors the left edge of the node to the origin, the center or the end of its parent control. It changes how the left margin updates when the node moves or changes size. You can use one of the :ref:`Anchor` constants for convenience. + +---- + +.. _class_Control_property_anchor_right: + +- :ref:`float` **anchor_right** + ++-----------+--------------+ +| *Default* | ``0.0`` | ++-----------+--------------+ +| *Getter* | get_anchor() | ++-----------+--------------+ + +Anchors the right edge of the node to the origin, the center or the end of its parent control. It changes how the right margin updates when the node moves or changes size. You can use one of the :ref:`Anchor` constants for convenience. + +---- + +.. _class_Control_property_anchor_top: + +- :ref:`float` **anchor_top** + ++-----------+--------------+ +| *Default* | ``0.0`` | ++-----------+--------------+ +| *Getter* | get_anchor() | ++-----------+--------------+ + +Anchors the top edge of the node to the origin, the center or the end of its parent control. It changes how the top margin updates when the node moves or changes size. You can use one of the :ref:`Anchor` constants for convenience. + +---- + +.. _class_Control_property_focus_mode: + +- :ref:`FocusMode` **focus_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_focus_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_focus_mode() | ++-----------+-----------------------+ + +The focus access mode for the control (None, Click or All). Only one Control can be focused at the same time, and it will receive keyboard signals. + +---- + +.. _class_Control_property_focus_neighbour_bottom: + +- :ref:`NodePath` **focus_neighbour_bottom** + ++-----------+----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+----------------------------+ +| *Setter* | set_focus_neighbour(value) | ++-----------+----------------------------+ +| *Getter* | get_focus_neighbour() | ++-----------+----------------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses the down arrow on the keyboard or down on a gamepad by default. You can change the key by editing the ``ui_down`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. + +---- + +.. _class_Control_property_focus_neighbour_left: + +- :ref:`NodePath` **focus_neighbour_left** + ++-----------+----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+----------------------------+ +| *Setter* | set_focus_neighbour(value) | ++-----------+----------------------------+ +| *Getter* | get_focus_neighbour() | ++-----------+----------------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses the left arrow on the keyboard or left on a gamepad by default. You can change the key by editing the ``ui_left`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the left of this one. + +---- + +.. _class_Control_property_focus_neighbour_right: + +- :ref:`NodePath` **focus_neighbour_right** + ++-----------+----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+----------------------------+ +| *Setter* | set_focus_neighbour(value) | ++-----------+----------------------------+ +| *Getter* | get_focus_neighbour() | ++-----------+----------------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses the right arrow on the keyboard or right on a gamepad by default. You can change the key by editing the ``ui_right`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. + +---- + +.. _class_Control_property_focus_neighbour_top: + +- :ref:`NodePath` **focus_neighbour_top** + ++-----------+----------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+----------------------------+ +| *Setter* | set_focus_neighbour(value) | ++-----------+----------------------------+ +| *Getter* | get_focus_neighbour() | ++-----------+----------------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses the top arrow on the keyboard or top on a gamepad by default. You can change the key by editing the ``ui_top`` input action. The node must be a ``Control``. If this property is not set, Godot will give focus to the closest ``Control`` to the bottom of this one. + +---- + +.. _class_Control_property_focus_next: + +- :ref:`NodePath` **focus_next** + ++-----------+-----------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-----------------------+ +| *Setter* | set_focus_next(value) | ++-----------+-----------------------+ +| *Getter* | get_focus_next() | ++-----------+-----------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses Tab on a keyboard by default. You can change the key by editing the ``ui_focus_next`` input action. + +If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. + +---- + +.. _class_Control_property_focus_previous: + +- :ref:`NodePath` **focus_previous** + ++-----------+---------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+---------------------------+ +| *Setter* | set_focus_previous(value) | ++-----------+---------------------------+ +| *Getter* | get_focus_previous() | ++-----------+---------------------------+ + +Tells Godot which node it should give keyboard focus to if the user presses Shift+Tab on a keyboard by default. You can change the key by editing the ``ui_focus_prev`` input action. + +If this property is not set, Godot will select a "best guess" based on surrounding nodes in the scene tree. + +---- + +.. _class_Control_property_grow_horizontal: + +- :ref:`GrowDirection` **grow_horizontal** + ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_h_grow_direction(value) | ++-----------+-----------------------------+ +| *Getter* | get_h_grow_direction() | ++-----------+-----------------------------+ + +Controls the direction on the horizontal axis in which the control should grow if its horizontal minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. + +---- + +.. _class_Control_property_grow_vertical: + +- :ref:`GrowDirection` **grow_vertical** + ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_v_grow_direction(value) | ++-----------+-----------------------------+ +| *Getter* | get_v_grow_direction() | ++-----------+-----------------------------+ + +Controls the direction on the vertical axis in which the control should grow if its vertical minimum size is changed to be greater than its current size, as the control always has to be at least the minimum size. + +---- + +.. _class_Control_property_hint_tooltip: + +- :ref:`String` **hint_tooltip** + ++-----------+--------------------+ +| *Default* | ``""`` | ++-----------+--------------------+ +| *Setter* | set_tooltip(value) | ++-----------+--------------------+ + +Changes the tooltip text. The tooltip appears when the user's mouse cursor stays idle over this control for a few moments, provided that the :ref:`mouse_filter` property is not :ref:`MOUSE_FILTER_IGNORE`. You can change the time required for the tooltip to appear with ``gui/timers/tooltip_delay_sec`` option in Project Settings. + +The tooltip popup will use either a default implementation, or a custom one that you can provide by overriding :ref:`_make_custom_tooltip`. The default tooltip includes a :ref:`PopupPanel` and :ref:`Label` whose theme properties can be customized using :ref:`Theme` methods with the ``"TooltipPanel"`` and ``"TooltipLabel"`` respectively. For example: + +:: + + var style_box = StyleBoxFlat.new() + style_box.set_bg_color(Color(1, 1, 0)) + style_box.set_border_width_all(2) + # We assume here that the `theme` property has been assigned a custom Theme beforehand. + theme.set_stylebox("panel", "TooltipPanel", style_box) + theme.set_color("font_color", "TooltipLabel", Color(0, 1, 1)) + +---- + +.. _class_Control_property_input_pass_on_modal_close_click: + +- :ref:`bool` **input_pass_on_modal_close_click** + ++-----------+--------------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------------+ +| *Setter* | set_pass_on_modal_close_click(value) | ++-----------+--------------------------------------+ +| *Getter* | get_pass_on_modal_close_click() | ++-----------+--------------------------------------+ + +Enables whether input should propagate when you close the control as modal. + +If ``false``, stops event handling at the viewport input event handling. The viewport first hides the modal and after marks the input as handled. + +---- + +.. _class_Control_property_margin_bottom: + +- :ref:`float` **margin_bottom** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +Distance between the node's bottom edge and its parent control, based on :ref:`anchor_bottom`. + +Margins are often controlled by one or multiple parent :ref:`Container` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container`. Margins update automatically when you move or resize the node. + +---- + +.. _class_Control_property_margin_left: + +- :ref:`float` **margin_left** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +Distance between the node's left edge and its parent control, based on :ref:`anchor_left`. + +Margins are often controlled by one or multiple parent :ref:`Container` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container`. Margins update automatically when you move or resize the node. + +---- + +.. _class_Control_property_margin_right: + +- :ref:`float` **margin_right** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +Distance between the node's right edge and its parent control, based on :ref:`anchor_right`. + +Margins are often controlled by one or multiple parent :ref:`Container` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container`. Margins update automatically when you move or resize the node. + +---- + +.. _class_Control_property_margin_top: + +- :ref:`float` **margin_top** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +Distance between the node's top edge and its parent control, based on :ref:`anchor_top`. + +Margins are often controlled by one or multiple parent :ref:`Container` nodes, so you should not modify them manually if your node is a direct child of a :ref:`Container`. Margins update automatically when you move or resize the node. + +---- + +.. _class_Control_property_mouse_default_cursor_shape: + +- :ref:`CursorShape` **mouse_default_cursor_shape** + ++-----------+---------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------+ +| *Setter* | set_default_cursor_shape(value) | ++-----------+---------------------------------+ +| *Getter* | get_default_cursor_shape() | ++-----------+---------------------------------+ + +The default cursor shape for this control. Useful for Godot plugins and applications or games that use the system's mouse cursors. + +**Note:** On Linux, shapes may vary depending on the cursor theme of the system. + +---- + +.. _class_Control_property_mouse_filter: + +- :ref:`MouseFilter` **mouse_filter** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_mouse_filter(value) | ++-----------+-------------------------+ +| *Getter* | get_mouse_filter() | ++-----------+-------------------------+ + +Controls whether the control will be able to receive mouse button input events through :ref:`_gui_input` and how these events should be handled. Also controls whether the control can receive the :ref:`mouse_entered`, and :ref:`mouse_exited` signals. See the constants to learn what each does. + +---- + +.. _class_Control_property_rect_clip_content: + +- :ref:`bool` **rect_clip_content** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_clip_contents(value) | ++-----------+--------------------------+ +| *Getter* | is_clipping_contents() | ++-----------+--------------------------+ + +Enables whether rendering of :ref:`CanvasItem` based children should be clipped to this control's rectangle. If ``true``, parts of a child which would be visibly outside of this control's rectangle will not be rendered. + +---- + +.. _class_Control_property_rect_global_position: + +- :ref:`Vector2` **rect_global_position** + ++----------+-----------------------+ +| *Getter* | get_global_position() | ++----------+-----------------------+ + +The node's global position, relative to the world (usually to the top-left corner of the window). + +---- + +.. _class_Control_property_rect_min_size: + +- :ref:`Vector2` **rect_min_size** + ++-----------+--------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+--------------------------------+ +| *Setter* | set_custom_minimum_size(value) | ++-----------+--------------------------------+ +| *Getter* | get_custom_minimum_size() | ++-----------+--------------------------------+ + +The minimum size of the node's bounding rectangle. If you set it to a value greater than (0, 0), the node's bounding rectangle will always have at least this size, even if its content is smaller. If it's set to (0, 0), the node sizes automatically to fit its content, be it a texture or child nodes. + +---- + +.. _class_Control_property_rect_pivot_offset: + +- :ref:`Vector2` **rect_pivot_offset** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_pivot_offset(value) | ++-----------+-------------------------+ +| *Getter* | get_pivot_offset() | ++-----------+-------------------------+ + +By default, the node's pivot is its top-left corner. When you change its :ref:`rect_scale`, it will scale around this pivot. Set this property to :ref:`rect_size` / 2 to center the pivot in the node's rectangle. + +---- + +.. _class_Control_property_rect_position: + +- :ref:`Vector2` **rect_position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The node's position, relative to its parent. It corresponds to the rectangle's top-left corner. The property is not affected by :ref:`rect_pivot_offset`. + +---- + +.. _class_Control_property_rect_rotation: + +- :ref:`float` **rect_rotation** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_rotation_degrees(value) | ++-----------+-----------------------------+ +| *Getter* | get_rotation_degrees() | ++-----------+-----------------------------+ + +The node's rotation around its pivot, in degrees. See :ref:`rect_pivot_offset` to change the pivot's position. + +---- + +.. _class_Control_property_rect_scale: + +- :ref:`Vector2` **rect_scale** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_scale(value) | ++-----------+---------------------+ +| *Getter* | get_scale() | ++-----------+---------------------+ + +The node's scale, relative to its :ref:`rect_size`. Change this property to scale the node around its :ref:`rect_pivot_offset`. The Control's :ref:`hint_tooltip` will also scale according to this value. + +**Note:** This property is mainly intended to be used for animation purposes. Text inside the Control will look pixelated or blurry when the Control is scaled. To support multiple resolutions in your project, use an appropriate viewport stretch mode as described in the `documentation `__ instead of scaling Controls individually. + +**Note:** If the Control node is a child of a :ref:`Container` node, the scale will be reset to ``Vector2(1, 1)`` when the scene is instanced. To set the Control's scale when it's instanced, wait for one frame using ``yield(get_tree(), "idle_frame")`` then set its :ref:`rect_scale` property. + +---- + +.. _class_Control_property_rect_size: + +- :ref:`Vector2` **rect_size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +The size of the node's bounding rectangle, in pixels. :ref:`Container` nodes update this property automatically. + +---- + +.. _class_Control_property_size_flags_horizontal: + +- :ref:`int` **size_flags_horizontal** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_h_size_flags(value) | ++-----------+-------------------------+ +| *Getter* | get_h_size_flags() | ++-----------+-------------------------+ + +Tells the parent :ref:`Container` nodes how they should resize and place the node on the X axis. Use one of the :ref:`SizeFlags` constants to change the flags. See the constants to learn what each does. + +---- + +.. _class_Control_property_size_flags_stretch_ratio: + +- :ref:`float` **size_flags_stretch_ratio** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_stretch_ratio(value) | ++-----------+--------------------------+ +| *Getter* | get_stretch_ratio() | ++-----------+--------------------------+ + +If the node and at least one of its neighbours uses the :ref:`SIZE_EXPAND` size flag, the parent :ref:`Container` will let it take more or less space depending on this property. If this node has a stretch ratio of 2 and its neighbour a ratio of 1, this node will take two thirds of the available space. + +---- + +.. _class_Control_property_size_flags_vertical: + +- :ref:`int` **size_flags_vertical** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_v_size_flags(value) | ++-----------+-------------------------+ +| *Getter* | get_v_size_flags() | ++-----------+-------------------------+ + +Tells the parent :ref:`Container` nodes how they should resize and place the node on the Y axis. Use one of the :ref:`SizeFlags` constants to change the flags. See the constants to learn what each does. + +---- + +.. _class_Control_property_theme: + +- :ref:`Theme` **theme** + ++----------+------------------+ +| *Setter* | set_theme(value) | ++----------+------------------+ +| *Getter* | get_theme() | ++----------+------------------+ + +Changing this property replaces the current :ref:`Theme` resource this node and all its ``Control`` children use. + +Method Descriptions +------------------- + +.. _class_Control_method__clips_input: + +- :ref:`bool` **_clips_input** **(** **)** |virtual| + +Virtual method to be implemented by the user. Returns whether :ref:`_gui_input` should not be called for children controls outside this control's rectangle. Input will be clipped to the Rect of this ``Control``. Similar to :ref:`rect_clip_content`, but doesn't affect visibility. + +If not overridden, defaults to ``false``. + +---- + +.. _class_Control_method__get_minimum_size: + +- :ref:`Vector2` **_get_minimum_size** **(** **)** |virtual| + +Virtual method to be implemented by the user. Returns the minimum size for this control. Alternative to :ref:`rect_min_size` for controlling minimum size via code. The actual minimum size will be the max value of these two (in each axis separately). + +If not overridden, defaults to :ref:`Vector2.ZERO`. + +---- + +.. _class_Control_method__gui_input: + +- void **_gui_input** **(** :ref:`InputEvent` event **)** |virtual| + +Virtual method to be implemented by the user. Use this method to process and accept inputs on UI elements. See :ref:`accept_event`. + +Example: clicking a control. + +:: + + func _gui_input(event): + if event is InputEventMouseButton: + if event.button_index == BUTTON_LEFT and event.pressed: + print("I've been clicked D:") + +The event won't trigger if: + +\* clicking outside the control (see :ref:`has_point`); + +\* control has :ref:`mouse_filter` set to :ref:`MOUSE_FILTER_IGNORE`; + +\* control is obstructed by another ``Control`` on top of it, which doesn't have :ref:`mouse_filter` set to :ref:`MOUSE_FILTER_IGNORE`; + +\* control's parent has :ref:`mouse_filter` set to :ref:`MOUSE_FILTER_STOP` or has accepted the event; + +\* it happens outside the parent's rectangle and the parent has either :ref:`rect_clip_content` or :ref:`_clips_input` enabled. + +**Note:** Event position is relative to the control origin. + +---- + +.. _class_Control_method__make_custom_tooltip: + +- :ref:`Control` **_make_custom_tooltip** **(** :ref:`String` for_text **)** |virtual| + +Virtual method to be implemented by the user. Returns a ``Control`` node that should be used as a tooltip instead of the default one. The ``for_text`` includes the contents of the :ref:`hint_tooltip` property. + +The returned node must be of type ``Control`` or Control-derived. It can have child nodes of any type. It is freed when the tooltip disappears, so make sure you always provide a new instance (if you want to use a pre-existing node from your scene tree, you can duplicate it and pass the duplicated instance). When ``null`` or a non-Control node is returned, the default tooltip will be used instead. + +The returned node will be added as child to a :ref:`PopupPanel`, so you should only provide the contents of that panel. That :ref:`PopupPanel` can be themed using :ref:`Theme.set_stylebox` for the type ``"TooltipPanel"`` (see :ref:`hint_tooltip` for an example). + +**Note:** The tooltip is shrunk to minimal size. If you want to ensure it's fully visible, you might want to set its :ref:`rect_min_size` to some non-zero value. + +Example of usage with a custom-constructed node: + +:: + + func _make_custom_tooltip(for_text): + var label = Label.new() + label.text = for_text + return label + +Example of usage with a custom scene instance: + +:: + + func _make_custom_tooltip(for_text): + var tooltip = preload("res://SomeTooltipScene.tscn").instance() + tooltip.get_node("Label").text = for_text + return tooltip + +---- + +.. _class_Control_method_accept_event: + +- void **accept_event** **(** **)** + +Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to :ref:`Node._unhandled_input` or :ref:`Node._unhandled_key_input`. + +---- + +.. _class_Control_method_add_color_override: + +- void **add_color_override** **(** :ref:`String` name, :ref:`Color` color **)** + +Creates a local override for a theme :ref:`Color` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override cannot be removed, but it can be overridden with the corresponding default value. + +See also :ref:`get_color`. + +**Example of overriding a label's color and resetting it later:** + +:: + + # Given the child Label node "MyLabel", override its font color with a custom value. + $MyLabel.add_color_override("font_color", Color(1, 0.5, 0)) + # Reset the font color of the child label. + $MyLabel.add_color_override("font_color", get_color("font_color", "Label")) + +---- + +.. _class_Control_method_add_constant_override: + +- void **add_constant_override** **(** :ref:`String` name, :ref:`int` constant **)** + +Creates a local override for a theme constant with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override cannot be removed, but it can be overridden with the corresponding default value. + +See also :ref:`get_constant`. + +---- + +.. _class_Control_method_add_font_override: + +- void **add_font_override** **(** :ref:`String` name, :ref:`Font` font **)** + +Creates a local override for a theme :ref:`Font` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed by assigning it a ``null`` value. + +See also :ref:`get_font`. + +---- + +.. _class_Control_method_add_icon_override: + +- void **add_icon_override** **(** :ref:`String` name, :ref:`Texture` texture **)** + +Creates a local override for a theme icon with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed by assigning it a ``null`` value. + +See also :ref:`get_icon`. + +---- + +.. _class_Control_method_add_shader_override: + +- void **add_shader_override** **(** :ref:`String` name, :ref:`Shader` shader **)** + +Creates a local override for a theme shader with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed by assigning it a ``null`` value. + +---- + +.. _class_Control_method_add_stylebox_override: + +- void **add_stylebox_override** **(** :ref:`String` name, :ref:`StyleBox` stylebox **)** + +Creates a local override for a theme :ref:`StyleBox` with the specified ``name``. Local overrides always take precedence when fetching theme items for the control. An override can be removed by assigning it a ``null`` value. + +See also :ref:`get_stylebox`. + +**Example of modifying a property in a StyleBox by duplicating it:** + +:: + + # The snippet below assumes the child node MyButton has a StyleBoxFlat assigned. + # Resources are shared across instances, so we need to duplicate it + # to avoid modifying the appearance of all other buttons. + var new_stylebox_normal = $MyButton.get_stylebox("normal").duplicate() + new_stylebox_normal.border_width_top = 3 + new_stylebox_normal.border_color = Color(0, 1, 0.5) + $MyButton.add_stylebox_override("normal", new_stylebox_normal) + # Remove the stylebox override. + $MyButton.add_stylebox_override("normal", null) + +---- + +.. _class_Control_method_can_drop_data: + +- :ref:`bool` **can_drop_data** **(** :ref:`Vector2` position, :ref:`Variant` data **)** |virtual| + +Godot calls this method to test if ``data`` from a control's :ref:`get_drag_data` can be dropped at ``position``. ``position`` is local to this control. + +This method should only be used to test the data. Process the data in :ref:`drop_data`. + +:: + + func can_drop_data(position, data): + # Check position if it is relevant to you + # Otherwise, just check data + return typeof(data) == TYPE_DICTIONARY and data.has("expected") + +---- + +.. _class_Control_method_drop_data: + +- void **drop_data** **(** :ref:`Vector2` position, :ref:`Variant` data **)** |virtual| + +Godot calls this method to pass you the ``data`` from a control's :ref:`get_drag_data` result. Godot first calls :ref:`can_drop_data` to test if ``data`` is allowed to drop at ``position`` where ``position`` is local to this control. + +:: + + func can_drop_data(position, data): + return typeof(data) == TYPE_DICTIONARY and data.has("color") + + func drop_data(position, data): + color = data["color"] + +---- + +.. _class_Control_method_find_next_valid_focus: + +- :ref:`Control` **find_next_valid_focus** **(** **)** |const| + +Finds the next (below in the tree) ``Control`` that can receive the focus. + +---- + +.. _class_Control_method_find_prev_valid_focus: + +- :ref:`Control` **find_prev_valid_focus** **(** **)** |const| + +Finds the previous (above in the tree) ``Control`` that can receive the focus. + +---- + +.. _class_Control_method_force_drag: + +- void **force_drag** **(** :ref:`Variant` data, :ref:`Control` preview **)** + +Forces drag and bypasses :ref:`get_drag_data` and :ref:`set_drag_preview` by passing ``data`` and ``preview``. Drag will start even if the mouse is neither over nor pressed on this control. + +The methods :ref:`can_drop_data` and :ref:`drop_data` must be implemented on controls that want to receive drop data. + +---- + +.. _class_Control_method_get_anchor: + +- :ref:`float` **get_anchor** **(** :ref:`Margin` margin **)** |const| + +Returns the anchor identified by ``margin`` constant from :ref:`Margin` enum. A getter method for :ref:`anchor_bottom`, :ref:`anchor_left`, :ref:`anchor_right` and :ref:`anchor_top`. + +---- + +.. _class_Control_method_get_begin: + +- :ref:`Vector2` **get_begin** **(** **)** |const| + +Returns :ref:`margin_left` and :ref:`margin_top`. See also :ref:`rect_position`. + +---- + +.. _class_Control_method_get_color: + +- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns a :ref:`Color` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a color item with the specified ``name`` and ``theme_type``. If ``theme_type`` is omitted the class name of the current control is used as the type. If the type is a class name its parent classes are also checked, in order of inheritance. + +For the current control its local overrides are considered first (see :ref:`add_color_override`), then its assigned :ref:`theme`. After the current control, each parent control and its assigned :ref:`theme` are considered; controls without a :ref:`theme` assigned are skipped. If no matching :ref:`Theme` is found in the tree, a custom project :ref:`Theme` (see :ref:`ProjectSettings.gui/theme/custom`) and the default :ref:`Theme` are used. + +:: + + func _ready(): + # Get the font color defined for the current Control's class, if it exists. + modulate = get_color("font_color") + # Get the font color defined for the Button class. + modulate = get_color("font_color", "Button") + +---- + +.. _class_Control_method_get_combined_minimum_size: + +- :ref:`Vector2` **get_combined_minimum_size** **(** **)** |const| + +Returns combined minimum size from :ref:`rect_min_size` and :ref:`get_minimum_size`. + +---- + +.. _class_Control_method_get_constant: + +- :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns a constant from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a constant item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_get_cursor_shape: + +- :ref:`CursorShape` **get_cursor_shape** **(** :ref:`Vector2` position=Vector2( 0, 0 ) **)** |const| + +Returns the mouse cursor shape the control displays on mouse hover. See :ref:`CursorShape`. + +---- + +.. _class_Control_method_get_drag_data: + +- :ref:`Variant` **get_drag_data** **(** :ref:`Vector2` position **)** |virtual| + +Godot calls this method to get data that can be dragged and dropped onto controls that expect drop data. Returns ``null`` if there is no data to drag. Controls that want to receive drop data should implement :ref:`can_drop_data` and :ref:`drop_data`. ``position`` is local to this control. Drag may be forced with :ref:`force_drag`. + +A preview that will follow the mouse that should represent the data can be set with :ref:`set_drag_preview`. A good time to set the preview is in this method. + +:: + + func get_drag_data(position): + var mydata = make_data() + set_drag_preview(make_preview(mydata)) + return mydata + +---- + +.. _class_Control_method_get_end: + +- :ref:`Vector2` **get_end** **(** **)** |const| + +Returns :ref:`margin_right` and :ref:`margin_bottom`. + +---- + +.. _class_Control_method_get_focus_neighbour: + +- :ref:`NodePath` **get_focus_neighbour** **(** :ref:`Margin` margin **)** |const| + +Returns the focus neighbour identified by ``margin`` constant from :ref:`Margin` enum. A getter method for :ref:`focus_neighbour_bottom`, :ref:`focus_neighbour_left`, :ref:`focus_neighbour_right` and :ref:`focus_neighbour_top`. + +---- + +.. _class_Control_method_get_focus_owner: + +- :ref:`Control` **get_focus_owner** **(** **)** |const| + +Returns the control that has the keyboard focus or ``null`` if none. + +---- + +.. _class_Control_method_get_font: + +- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns a :ref:`Font` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a font item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_get_global_rect: + +- :ref:`Rect2` **get_global_rect** **(** **)** |const| + +Returns the position and size of the control relative to the top-left corner of the screen. See :ref:`rect_position` and :ref:`rect_size`. + +---- + +.. _class_Control_method_get_icon: + +- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns an icon from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has an icon item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_get_margin: + +- :ref:`float` **get_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the anchor identified by ``margin`` constant from :ref:`Margin` enum. A getter method for :ref:`margin_bottom`, :ref:`margin_left`, :ref:`margin_right` and :ref:`margin_top`. + +---- + +.. _class_Control_method_get_minimum_size: + +- :ref:`Vector2` **get_minimum_size** **(** **)** |const| + +Returns the minimum size for this control. See :ref:`rect_min_size`. + +---- + +.. _class_Control_method_get_parent_area_size: + +- :ref:`Vector2` **get_parent_area_size** **(** **)** |const| + +Returns the width/height occupied in the parent control. + +---- + +.. _class_Control_method_get_parent_control: + +- :ref:`Control` **get_parent_control** **(** **)** |const| + +Returns the parent control node. + +---- + +.. _class_Control_method_get_rect: + +- :ref:`Rect2` **get_rect** **(** **)** |const| + +Returns the position and size of the control relative to the top-left corner of the parent Control. See :ref:`rect_position` and :ref:`rect_size`. + +---- + +.. _class_Control_method_get_rotation: + +- :ref:`float` **get_rotation** **(** **)** |const| + +Returns the rotation (in radians). + +---- + +.. _class_Control_method_get_stylebox: + +- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns a :ref:`StyleBox` from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a stylebox item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_get_theme_default_font: + +- :ref:`Font` **get_theme_default_font** **(** **)** |const| + +Returns the default font from the first matching :ref:`Theme` in the tree if that :ref:`Theme` has a valid :ref:`Theme.default_font` value. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_get_tooltip: + +- :ref:`String` **get_tooltip** **(** :ref:`Vector2` at_position=Vector2( 0, 0 ) **)** |const| + +Returns the tooltip, which will appear when the cursor is resting over this control. See :ref:`hint_tooltip`. + +---- + +.. _class_Control_method_grab_click_focus: + +- void **grab_click_focus** **(** **)** + +Creates an :ref:`InputEventMouseButton` that attempts to click the control. If the event is received, the control acquires focus. + +:: + + func _process(delta): + grab_click_focus() #when clicking another Control node, this node will be clicked instead + +---- + +.. _class_Control_method_grab_focus: + +- void **grab_focus** **(** **)** + +Steal the focus from another control and become the focused control (see :ref:`focus_mode`). + +---- + +.. _class_Control_method_has_color: + +- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a color item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_has_color_override: + +- :ref:`bool` **has_color_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`Color` with the specified ``name`` in this ``Control`` node. + +See :ref:`add_color_override`. + +---- + +.. _class_Control_method_has_constant: + +- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a constant item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_has_constant_override: + +- :ref:`bool` **has_constant_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme constant with the specified ``name`` in this ``Control`` node. + +See :ref:`add_constant_override`. + +---- + +.. _class_Control_method_has_focus: + +- :ref:`bool` **has_focus** **(** **)** |const| + +Returns ``true`` if this is the current focused control. See :ref:`focus_mode`. + +---- + +.. _class_Control_method_has_font: + +- :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a font item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_has_font_override: + +- :ref:`bool` **has_font_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`Font` with the specified ``name`` in this ``Control`` node. + +See :ref:`add_font_override`. + +---- + +.. _class_Control_method_has_icon: + +- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has an icon item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_has_icon_override: + +- :ref:`bool` **has_icon_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme icon with the specified ``name`` in this ``Control`` node. + +See :ref:`add_icon_override`. + +---- + +.. _class_Control_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`Vector2` point **)** |virtual| + +Virtual method to be implemented by the user. Returns whether the given ``point`` is inside this control. + +If not overridden, default behavior is checking if the point is within control's Rect. + +**Note:** If you want to check if a point is inside the control, you can use ``get_rect().has_point(point)``. + +---- + +.. _class_Control_method_has_shader_override: + +- :ref:`bool` **has_shader_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme shader with the specified ``name`` in this ``Control`` node. + +See :ref:`add_shader_override`. + +---- + +.. _class_Control_method_has_stylebox: + +- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` theme_type="" **)** |const| + +Returns ``true`` if there is a matching :ref:`Theme` in the tree that has a stylebox item with the specified ``name`` and ``theme_type``. + +See :ref:`get_color` for details. + +---- + +.. _class_Control_method_has_stylebox_override: + +- :ref:`bool` **has_stylebox_override** **(** :ref:`String` name **)** |const| + +Returns ``true`` if there is a local override for a theme :ref:`StyleBox` with the specified ``name`` in this ``Control`` node. + +See :ref:`add_stylebox_override`. + +---- + +.. _class_Control_method_minimum_size_changed: + +- void **minimum_size_changed** **(** **)** + +Invalidates the size cache in this node and in parent nodes up to toplevel. Intended to be used with :ref:`get_minimum_size` when the return value is changed. Setting :ref:`rect_min_size` directly calls this method automatically. + +---- + +.. _class_Control_method_release_focus: + +- void **release_focus** **(** **)** + +Give up the focus. No other control will be able to receive keyboard input. + +---- + +.. _class_Control_method_set_anchor: + +- void **set_anchor** **(** :ref:`Margin` margin, :ref:`float` anchor, :ref:`bool` keep_margin=false, :ref:`bool` push_opposite_anchor=true **)** + +Sets the anchor identified by ``margin`` constant from :ref:`Margin` enum to value ``anchor``. A setter method for :ref:`anchor_bottom`, :ref:`anchor_left`, :ref:`anchor_right` and :ref:`anchor_top`. + +If ``keep_margin`` is ``true``, margins aren't updated after this operation. + +If ``push_opposite_anchor`` is ``true`` and the opposite anchor overlaps this anchor, the opposite one will have its value overridden. For example, when setting left anchor to 1 and the right anchor has value of 0.5, the right anchor will also get value of 1. If ``push_opposite_anchor`` was ``false``, the left anchor would get value 0.5. + +---- + +.. _class_Control_method_set_anchor_and_margin: + +- void **set_anchor_and_margin** **(** :ref:`Margin` margin, :ref:`float` anchor, :ref:`float` offset, :ref:`bool` push_opposite_anchor=false **)** + +Works the same as :ref:`set_anchor`, but instead of ``keep_margin`` argument and automatic update of margin, it allows to set the margin offset yourself (see :ref:`set_margin`). + +---- + +.. _class_Control_method_set_anchors_and_margins_preset: + +- void **set_anchors_and_margins_preset** **(** :ref:`LayoutPreset` preset, :ref:`LayoutPresetMode` resize_mode=0, :ref:`int` margin=0 **)** + +Sets both anchor preset and margin preset. See :ref:`set_anchors_preset` and :ref:`set_margins_preset`. + +---- + +.. _class_Control_method_set_anchors_preset: + +- void **set_anchors_preset** **(** :ref:`LayoutPreset` preset, :ref:`bool` keep_margins=false **)** + +Sets the anchors to a ``preset`` from :ref:`LayoutPreset` enum. This is the code equivalent to using the Layout menu in the 2D editor. + +If ``keep_margins`` is ``true``, control's position will also be updated. + +---- + +.. _class_Control_method_set_begin: + +- void **set_begin** **(** :ref:`Vector2` position **)** + +Sets :ref:`margin_left` and :ref:`margin_top` at the same time. Equivalent of changing :ref:`rect_position`. + +---- + +.. _class_Control_method_set_drag_forwarding: + +- void **set_drag_forwarding** **(** :ref:`Control` target **)** + +Forwards the handling of this control's drag and drop to ``target`` control. + +Forwarding can be implemented in the target control similar to the methods :ref:`get_drag_data`, :ref:`can_drop_data`, and :ref:`drop_data` but with two differences: + +1. The function name must be suffixed with **_fw** + +2. The function must take an extra argument that is the control doing the forwarding + +:: + + # ThisControl.gd + extends Control + func _ready(): + set_drag_forwarding(target_control) + + # TargetControl.gd + extends Control + func can_drop_data_fw(position, data, from_control): + return true + + func drop_data_fw(position, data, from_control): + my_handle_data(data) + + func get_drag_data_fw(position, from_control): + set_drag_preview(my_preview) + return my_data() + +---- + +.. _class_Control_method_set_drag_preview: + +- void **set_drag_preview** **(** :ref:`Control` control **)** + +Shows the given control at the mouse pointer. A good time to call this method is in :ref:`get_drag_data`. The control must not be in the scene tree. You should not free the control, and you should not keep a reference to the control beyond the duration of the drag. It will be deleted automatically after the drag has ended. + +:: + + export (Color, RGBA) var color = Color(1, 0, 0, 1) + + func get_drag_data(position): + # Use a control that is not in the tree + var cpb = ColorPickerButton.new() + cpb.color = color + cpb.rect_size = Vector2(50, 50) + set_drag_preview(cpb) + return color + +---- + +.. _class_Control_method_set_end: + +- void **set_end** **(** :ref:`Vector2` position **)** + +Sets :ref:`margin_right` and :ref:`margin_bottom` at the same time. + +---- + +.. _class_Control_method_set_focus_neighbour: + +- void **set_focus_neighbour** **(** :ref:`Margin` margin, :ref:`NodePath` neighbour **)** + +Sets the anchor identified by ``margin`` constant from :ref:`Margin` enum to ``Control`` at ``neighbor`` node path. A setter method for :ref:`focus_neighbour_bottom`, :ref:`focus_neighbour_left`, :ref:`focus_neighbour_right` and :ref:`focus_neighbour_top`. + +---- + +.. _class_Control_method_set_global_position: + +- void **set_global_position** **(** :ref:`Vector2` position, :ref:`bool` keep_margins=false **)** + +Sets the :ref:`rect_global_position` to given ``position``. + +If ``keep_margins`` is ``true``, control's anchors will be updated instead of margins. + +---- + +.. _class_Control_method_set_margin: + +- void **set_margin** **(** :ref:`Margin` margin, :ref:`float` offset **)** + +Sets the margin identified by ``margin`` constant from :ref:`Margin` enum to given ``offset``. A setter method for :ref:`margin_bottom`, :ref:`margin_left`, :ref:`margin_right` and :ref:`margin_top`. + +---- + +.. _class_Control_method_set_margins_preset: + +- void **set_margins_preset** **(** :ref:`LayoutPreset` preset, :ref:`LayoutPresetMode` resize_mode=0, :ref:`int` margin=0 **)** + +Sets the margins to a ``preset`` from :ref:`LayoutPreset` enum. This is the code equivalent to using the Layout menu in the 2D editor. + +Use parameter ``resize_mode`` with constants from :ref:`LayoutPresetMode` to better determine the resulting size of the ``Control``. Constant size will be ignored if used with presets that change size, e.g. ``PRESET_LEFT_WIDE``. + +Use parameter ``margin`` to determine the gap between the ``Control`` and the edges. + +---- + +.. _class_Control_method_set_position: + +- void **set_position** **(** :ref:`Vector2` position, :ref:`bool` keep_margins=false **)** + +Sets the :ref:`rect_position` to given ``position``. + +If ``keep_margins`` is ``true``, control's anchors will be updated instead of margins. + +---- + +.. _class_Control_method_set_rotation: + +- void **set_rotation** **(** :ref:`float` radians **)** + +Sets the rotation (in radians). + +---- + +.. _class_Control_method_set_size: + +- void **set_size** **(** :ref:`Vector2` size, :ref:`bool` keep_margins=false **)** + +Sets the size (see :ref:`rect_size`). + +If ``keep_margins`` is ``true``, control's anchors will be updated instead of margins. + +---- + +.. _class_Control_method_show_modal: + +- void **show_modal** **(** :ref:`bool` exclusive=false **)** + +Displays a control as modal. Control must be a subwindow. Modal controls capture the input signals until closed or the area outside them is accessed. When a modal control loses focus, or the ESC key is pressed, they automatically hide. Modal controls are used extensively for popup dialogs and menus. + +If ``exclusive`` is ``true``, other controls will not receive input and clicking outside this control will not close it. + +---- + +.. _class_Control_method_warp_mouse: + +- void **warp_mouse** **(** :ref:`Vector2` to_position **)** + +Moves the mouse cursor to ``to_position``, relative to :ref:`rect_position` of this ``Control``. + +.. |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.)` diff --git a/classes/class_convexpolygonshape.rst b/classes/class_convexpolygonshape.rst new file mode 100644 index 0000000..3ee4edd --- /dev/null +++ b/classes/class_convexpolygonshape.rst @@ -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 ConvexPolygonShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConvexPolygonShape: + +ConvexPolygonShape +================== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Convex polygon shape for 3D physics. + +Description +----------- + +Convex polygon shape resource, which can be added to a :ref:`PhysicsBody` or area. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +Properties +---------- + ++-------------------------------------------------+---------------------------------------------------------+--------------------------+ +| :ref:`PoolVector3Array` | :ref:`points` | ``PoolVector3Array( )`` | ++-------------------------------------------------+---------------------------------------------------------+--------------------------+ + +Property Descriptions +--------------------- + +.. _class_ConvexPolygonShape_property_points: + +- :ref:`PoolVector3Array` **points** + ++-----------+--------------------------+ +| *Default* | ``PoolVector3Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_points(value) | ++-----------+--------------------------+ +| *Getter* | get_points() | ++-----------+--------------------------+ + +The list of 3D points forming the convex polygon shape. + +.. |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.)` diff --git a/classes/class_convexpolygonshape2d.rst b/classes/class_convexpolygonshape2d.rst new file mode 100644 index 0000000..80982da --- /dev/null +++ b/classes/class_convexpolygonshape2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ConvexPolygonShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ConvexPolygonShape2D: + +ConvexPolygonShape2D +==================== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Convex polygon shape for 2D physics. + +Description +----------- + +Convex polygon shape for 2D physics. A convex polygon, whatever its shape, is internally decomposed into as many convex polygons as needed to ensure all collision checks against it are always done on convex polygons (which are faster to check). + +The main difference between a ``ConvexPolygonShape2D`` and a :ref:`ConcavePolygonShape2D` is that a concave polygon assumes it is concave and uses a more complex method of collision detection, and a convex one forces itself to be convex in order to speed up collision detection. + +Properties +---------- + ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`points` | ``PoolVector2Array( )`` | ++-------------------------------------------------+-----------------------------------------------------------+--------------------------+ + +Methods +------- + ++------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_cloud` **(** :ref:`PoolVector2Array` point_cloud **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ConvexPolygonShape2D_property_points: + +- :ref:`PoolVector2Array` **points** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_points(value) | ++-----------+--------------------------+ +| *Getter* | get_points() | ++-----------+--------------------------+ + +The polygon's list of vertices. Can be in either clockwise or counterclockwise order. Only set this property with convex hull points, use :ref:`set_point_cloud` to generate a convex hull shape from concave shape points. + +Method Descriptions +------------------- + +.. _class_ConvexPolygonShape2D_method_set_point_cloud: + +- void **set_point_cloud** **(** :ref:`PoolVector2Array` point_cloud **)** + +Based on the set of points provided, this creates and assigns the :ref:`points` property using the convex hull algorithm. Removing all unneeded points. See :ref:`Geometry.convex_hull_2d` for details. + +.. |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.)` diff --git a/classes/class_cpuparticles.rst b/classes/class_cpuparticles.rst new file mode 100644 index 0000000..0f56e2e --- /dev/null +++ b/classes/class_cpuparticles.rst @@ -0,0 +1,1452 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CPUParticles.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CPUParticles: + +CPUParticles +============ + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +CPU-based 3D particle emitter. + +Description +----------- + +CPU-based 3D particle node used to create a variety of particle systems and effects. + +See also :ref:`Particles`, which provides the same functionality with hardware acceleration, but may not run on older devices. + +**Note:** Unlike :ref:`Particles`, the visibility rect is generated on-the-fly and doesn't need to be configured by the user. + +Properties +---------- + ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`amount` | ``8`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angle` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`angle_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angle_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angular_velocity` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`angular_velocity_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angular_velocity_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_offset` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`anim_offset_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_offset_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_speed` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`anim_speed_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_speed_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Gradient` | :ref:`color_ramp` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`damping` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`damping_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`damping_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`direction` | ``Vector3( 1, 0, 0 )`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`emission_box_extents` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`PoolColorArray` | :ref:`emission_colors` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`PoolVector3Array` | :ref:`emission_normals` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`PoolVector3Array` | :ref:`emission_points` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`emission_ring_axis` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_height` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_inner_radius` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_radius` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`EmissionShape` | :ref:`emission_shape` | ``0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_sphere_radius` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`emitting` | ``true`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`explosiveness` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`fixed_fps` | ``0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_align_y` | ``false`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_disable_z` | ``false`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_rotate_y` | ``false`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`flatness` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`fract_delta` | ``true`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`gravity` | ``Vector3( 0, -9.8, 0 )`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`hue_variation` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`hue_variation_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`hue_variation_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`initial_velocity` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`initial_velocity_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`lifetime` | ``1.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`lifetime_randomness` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`linear_accel` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`linear_accel_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`linear_accel_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`local_coords` | ``true`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Mesh` | :ref:`mesh` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`one_shot` | ``false`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`orbit_velocity` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`orbit_velocity_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`orbit_velocity_random` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`preprocess` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_accel` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`radial_accel_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_accel_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`randomness` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`scale_amount` | ``1.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`scale_amount_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`scale_amount_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`spread` | ``45.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`tangential_accel` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Curve` | :ref:`tangential_accel_curve` | | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`tangential_accel_random` | ``0.0`` | ++-------------------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`convert_from_particles` **(** :ref:`Node` particles **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Curve` | :ref:`get_param_curve` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_randomness` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_particle_flag` **(** :ref:`Flags` flag **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`restart` **(** **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Parameter` param, :ref:`float` value **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_curve` **(** :ref:`Parameter` param, :ref:`Curve` curve **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_randomness` **(** :ref:`Parameter` param, :ref:`float` randomness **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_particle_flag` **(** :ref:`Flags` flag, :ref:`bool` enable **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CPUParticles_DrawOrder: + +.. _class_CPUParticles_constant_DRAW_ORDER_INDEX: + +.. _class_CPUParticles_constant_DRAW_ORDER_LIFETIME: + +.. _class_CPUParticles_constant_DRAW_ORDER_VIEW_DEPTH: + +enum **DrawOrder**: + +- **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted. + +- **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. + +- **DRAW_ORDER_VIEW_DEPTH** = **2** --- Particles are drawn in order of depth. + +---- + +.. _enum_CPUParticles_Parameter: + +.. _class_CPUParticles_constant_PARAM_INITIAL_LINEAR_VELOCITY: + +.. _class_CPUParticles_constant_PARAM_ANGULAR_VELOCITY: + +.. _class_CPUParticles_constant_PARAM_ORBIT_VELOCITY: + +.. _class_CPUParticles_constant_PARAM_LINEAR_ACCEL: + +.. _class_CPUParticles_constant_PARAM_RADIAL_ACCEL: + +.. _class_CPUParticles_constant_PARAM_TANGENTIAL_ACCEL: + +.. _class_CPUParticles_constant_PARAM_DAMPING: + +.. _class_CPUParticles_constant_PARAM_ANGLE: + +.. _class_CPUParticles_constant_PARAM_SCALE: + +.. _class_CPUParticles_constant_PARAM_HUE_VARIATION: + +.. _class_CPUParticles_constant_PARAM_ANIM_SPEED: + +.. _class_CPUParticles_constant_PARAM_ANIM_OFFSET: + +.. _class_CPUParticles_constant_PARAM_MAX: + +enum **Parameter**: + +- **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set initial velocity properties. + +- **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set angular velocity properties. + +- **PARAM_ORBIT_VELOCITY** = **2** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set orbital velocity properties. + +- **PARAM_LINEAR_ACCEL** = **3** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set linear acceleration properties. + +- **PARAM_RADIAL_ACCEL** = **4** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set radial acceleration properties. + +- **PARAM_TANGENTIAL_ACCEL** = **5** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set tangential acceleration properties. + +- **PARAM_DAMPING** = **6** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set damping properties. + +- **PARAM_ANGLE** = **7** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set angle properties. + +- **PARAM_SCALE** = **8** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set scale properties. + +- **PARAM_HUE_VARIATION** = **9** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set hue variation properties. + +- **PARAM_ANIM_SPEED** = **10** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set animation speed properties. + +- **PARAM_ANIM_OFFSET** = **11** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set animation offset properties. + +- **PARAM_MAX** = **12** --- Represents the size of the :ref:`Parameter` enum. + +---- + +.. _enum_CPUParticles_Flags: + +.. _class_CPUParticles_constant_FLAG_ALIGN_Y_TO_VELOCITY: + +.. _class_CPUParticles_constant_FLAG_ROTATE_Y: + +.. _class_CPUParticles_constant_FLAG_DISABLE_Z: + +.. _class_CPUParticles_constant_FLAG_MAX: + +enum **Flags**: + +- **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_particle_flag` to set :ref:`flag_align_y`. + +- **FLAG_ROTATE_Y** = **1** --- Use with :ref:`set_particle_flag` to set :ref:`flag_rotate_y`. + +- **FLAG_DISABLE_Z** = **2** --- Use with :ref:`set_particle_flag` to set :ref:`flag_disable_z`. + +- **FLAG_MAX** = **3** --- Represents the size of the :ref:`Flags` enum. + +---- + +.. _enum_CPUParticles_EmissionShape: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_POINT: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_SPHERE: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_BOX: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_POINTS: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_DIRECTED_POINTS: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_RING: + +.. _class_CPUParticles_constant_EMISSION_SHAPE_MAX: + +enum **EmissionShape**: + +- **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point. + +- **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere. + +- **EMISSION_SHAPE_BOX** = **2** --- Particles will be emitted in the volume of a box. + +- **EMISSION_SHAPE_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points`. Particle color will be modulated by :ref:`emission_colors`. + +- **EMISSION_SHAPE_DIRECTED_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points`. Particle velocity and rotation will be set based on :ref:`emission_normals`. Particle color will be modulated by :ref:`emission_colors`. + +- **EMISSION_SHAPE_RING** = **5** --- Particles will be emitted in a ring or cylinder. + +- **EMISSION_SHAPE_MAX** = **6** --- Represents the size of the :ref:`EmissionShape` enum. + +Property Descriptions +--------------------- + +.. _class_CPUParticles_property_amount: + +- :ref:`int` **amount** + ++-----------+-------------------+ +| *Default* | ``8`` | ++-----------+-------------------+ +| *Setter* | set_amount(value) | ++-----------+-------------------+ +| *Getter* | get_amount() | ++-----------+-------------------+ + +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. + +---- + +.. _class_CPUParticles_property_angle: + +- :ref:`float` **angle** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial rotation applied to each particle, in degrees. + +---- + +.. _class_CPUParticles_property_angle_curve: + +- :ref:`Curve` **angle_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's rotation will be animated along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_angle_random: + +- :ref:`float` **angle_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Rotation randomness ratio. + +---- + +.. _class_CPUParticles_property_angular_velocity: + +- :ref:`float` **angular_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. + +---- + +.. _class_CPUParticles_property_angular_velocity_curve: + +- :ref:`Curve` **angular_velocity_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's angular velocity will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_angular_velocity_random: + +- :ref:`float` **angular_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Angular velocity randomness ratio. + +---- + +.. _class_CPUParticles_property_anim_offset: + +- :ref:`float` **anim_offset** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation offset. + +---- + +.. _class_CPUParticles_property_anim_offset_curve: + +- :ref:`Curve` **anim_offset_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's animation offset will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_anim_offset_random: + +- :ref:`float` **anim_offset_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation offset randomness ratio. + +---- + +.. _class_CPUParticles_property_anim_speed: + +- :ref:`float` **anim_speed** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation speed. + +---- + +.. _class_CPUParticles_property_anim_speed_curve: + +- :ref:`Curve` **anim_speed_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's animation speed will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_anim_speed_random: + +- :ref:`float` **anim_speed_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation speed randomness ratio. + +---- + +.. _class_CPUParticles_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +Each particle's initial color. To have particle display color in a :ref:`SpatialMaterial` make sure to set :ref:`SpatialMaterial.vertex_color_use_as_albedo` to ``true``. + +---- + +.. _class_CPUParticles_property_color_ramp: + +- :ref:`Gradient` **color_ramp** + ++----------+-----------------------+ +| *Setter* | set_color_ramp(value) | ++----------+-----------------------+ +| *Getter* | get_color_ramp() | ++----------+-----------------------+ + +Each particle's color will vary along this :ref:`GradientTexture` over its lifetime (multiplied with :ref:`color`). + +---- + +.. _class_CPUParticles_property_damping: + +- :ref:`float` **damping** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The rate at which particles lose velocity. + +---- + +.. _class_CPUParticles_property_damping_curve: + +- :ref:`Curve` **damping_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Damping will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_damping_random: + +- :ref:`float` **damping_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Damping randomness ratio. + +---- + +.. _class_CPUParticles_property_direction: + +- :ref:`Vector3` **direction** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_direction(value) | ++-----------+------------------------+ +| *Getter* | get_direction() | ++-----------+------------------------+ + +Unit vector specifying the particles' emission direction. + +---- + +.. _class_CPUParticles_property_draw_order: + +- :ref:`DrawOrder` **draw_order** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_draw_order(value) | ++-----------+-----------------------+ +| *Getter* | get_draw_order() | ++-----------+-----------------------+ + +Particle draw order. Uses :ref:`DrawOrder` values. + +---- + +.. _class_CPUParticles_property_emission_box_extents: + +- :ref:`Vector3` **emission_box_extents** + ++----------+---------------------------------+ +| *Setter* | set_emission_box_extents(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_box_extents() | ++----------+---------------------------------+ + +The rectangle's extents if :ref:`emission_shape` is set to :ref:`EMISSION_SHAPE_BOX`. + +---- + +.. _class_CPUParticles_property_emission_colors: + +- :ref:`PoolColorArray` **emission_colors** + ++----------+----------------------------+ +| *Setter* | set_emission_colors(value) | ++----------+----------------------------+ +| *Getter* | get_emission_colors() | ++----------+----------------------------+ + +Sets the :ref:`Color`\ s to modulate particles by when using :ref:`EMISSION_SHAPE_POINTS` or :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles_property_emission_normals: + +- :ref:`PoolVector3Array` **emission_normals** + ++----------+-----------------------------+ +| *Setter* | set_emission_normals(value) | ++----------+-----------------------------+ +| *Getter* | get_emission_normals() | ++----------+-----------------------------+ + +Sets the direction the particles will be emitted in when using :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles_property_emission_points: + +- :ref:`PoolVector3Array` **emission_points** + ++----------+----------------------------+ +| *Setter* | set_emission_points(value) | ++----------+----------------------------+ +| *Getter* | get_emission_points() | ++----------+----------------------------+ + +Sets the initial positions to spawn particles when using :ref:`EMISSION_SHAPE_POINTS` or :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles_property_emission_ring_axis: + +- :ref:`Vector3` **emission_ring_axis** + ++----------+-------------------------------+ +| *Setter* | set_emission_ring_axis(value) | ++----------+-------------------------------+ +| *Getter* | get_emission_ring_axis() | ++----------+-------------------------------+ + +The axis for the ring shaped emitter when using :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_CPUParticles_property_emission_ring_height: + +- :ref:`float` **emission_ring_height** + ++----------+---------------------------------+ +| *Setter* | set_emission_ring_height(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_ring_height() | ++----------+---------------------------------+ + +The height for the ring shaped emitter when using :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_CPUParticles_property_emission_ring_inner_radius: + +- :ref:`float` **emission_ring_inner_radius** + ++----------+---------------------------------------+ +| *Setter* | set_emission_ring_inner_radius(value) | ++----------+---------------------------------------+ +| *Getter* | get_emission_ring_inner_radius() | ++----------+---------------------------------------+ + +The inner radius for the ring shaped emitter when using :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_CPUParticles_property_emission_ring_radius: + +- :ref:`float` **emission_ring_radius** + ++----------+---------------------------------+ +| *Setter* | set_emission_ring_radius(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_ring_radius() | ++----------+---------------------------------+ + +The radius for the ring shaped emitter when using :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_CPUParticles_property_emission_shape: + +- :ref:`EmissionShape` **emission_shape** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_emission_shape(value) | ++-----------+---------------------------+ +| *Getter* | get_emission_shape() | ++-----------+---------------------------+ + +Particles will be emitted inside this region. See :ref:`EmissionShape` for possible values. + +---- + +.. _class_CPUParticles_property_emission_sphere_radius: + +- :ref:`float` **emission_sphere_radius** + ++----------+-----------------------------------+ +| *Setter* | set_emission_sphere_radius(value) | ++----------+-----------------------------------+ +| *Getter* | get_emission_sphere_radius() | ++----------+-----------------------------------+ + +The sphere's radius if :ref:`EmissionShape` is set to :ref:`EMISSION_SHAPE_SPHERE`. + +---- + +.. _class_CPUParticles_property_emitting: + +- :ref:`bool` **emitting** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_emitting(value) | ++-----------+---------------------+ +| *Getter* | is_emitting() | ++-----------+---------------------+ + +If ``true``, particles are being emitted. + +---- + +.. _class_CPUParticles_property_explosiveness: + +- :ref:`float` **explosiveness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_explosiveness_ratio(value) | ++-----------+--------------------------------+ +| *Getter* | get_explosiveness_ratio() | ++-----------+--------------------------------+ + +How rapidly particles in an emission cycle are emitted. If greater than ``0``, there will be a gap in emissions before the next cycle begins. + +---- + +.. _class_CPUParticles_property_fixed_fps: + +- :ref:`int` **fixed_fps** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_fixed_fps(value) | ++-----------+----------------------+ +| *Getter* | get_fixed_fps() | ++-----------+----------------------+ + +The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself. + +---- + +.. _class_CPUParticles_property_flag_align_y: + +- :ref:`bool` **flag_align_y** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_particle_flag(value) | ++-----------+--------------------------+ +| *Getter* | get_particle_flag() | ++-----------+--------------------------+ + +Align Y axis of particle with the direction of its velocity. + +---- + +.. _class_CPUParticles_property_flag_disable_z: + +- :ref:`bool` **flag_disable_z** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_particle_flag(value) | ++-----------+--------------------------+ +| *Getter* | get_particle_flag() | ++-----------+--------------------------+ + +If ``true``, particles will not move on the z axis. + +---- + +.. _class_CPUParticles_property_flag_rotate_y: + +- :ref:`bool` **flag_rotate_y** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_particle_flag(value) | ++-----------+--------------------------+ +| *Getter* | get_particle_flag() | ++-----------+--------------------------+ + +If ``true``, particles rotate around Y axis by :ref:`angle`. + +---- + +.. _class_CPUParticles_property_flatness: + +- :ref:`float` **flatness** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_flatness(value) | ++-----------+---------------------+ +| *Getter* | get_flatness() | ++-----------+---------------------+ + +Amount of :ref:`spread` in Y/Z plane. A value of ``1`` restricts particles to X/Z plane. + +---- + +.. _class_CPUParticles_property_fract_delta: + +- :ref:`bool` **fract_delta** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_fractional_delta(value) | ++-----------+-----------------------------+ +| *Getter* | get_fractional_delta() | ++-----------+-----------------------------+ + +If ``true``, results in fractional delta calculation which has a smoother particles display effect. + +---- + +.. _class_CPUParticles_property_gravity: + +- :ref:`Vector3` **gravity** + ++-----------+---------------------------+ +| *Default* | ``Vector3( 0, -9.8, 0 )`` | ++-----------+---------------------------+ +| *Setter* | set_gravity(value) | ++-----------+---------------------------+ +| *Getter* | get_gravity() | ++-----------+---------------------------+ + +Gravity applied to every particle. + +---- + +.. _class_CPUParticles_property_hue_variation: + +- :ref:`float` **hue_variation** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial hue variation applied to each particle. + +---- + +.. _class_CPUParticles_property_hue_variation_curve: + +- :ref:`Curve` **hue_variation_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's hue will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_hue_variation_random: + +- :ref:`float` **hue_variation_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Hue variation randomness ratio. + +---- + +.. _class_CPUParticles_property_initial_velocity: + +- :ref:`float` **initial_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial velocity magnitude for each particle. Direction comes from :ref:`spread` and the node's orientation. + +---- + +.. _class_CPUParticles_property_initial_velocity_random: + +- :ref:`float` **initial_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Initial velocity randomness ratio. + +---- + +.. _class_CPUParticles_property_lifetime: + +- :ref:`float` **lifetime** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_lifetime(value) | ++-----------+---------------------+ +| *Getter* | get_lifetime() | ++-----------+---------------------+ + +The amount of time each particle will exist (in seconds). + +---- + +.. _class_CPUParticles_property_lifetime_randomness: + +- :ref:`float` **lifetime_randomness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_lifetime_randomness(value) | ++-----------+--------------------------------+ +| *Getter* | get_lifetime_randomness() | ++-----------+--------------------------------+ + +Particle lifetime randomness ratio. + +---- + +.. _class_CPUParticles_property_linear_accel: + +- :ref:`float` **linear_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Linear acceleration applied to each particle in the direction of motion. + +---- + +.. _class_CPUParticles_property_linear_accel_curve: + +- :ref:`Curve` **linear_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's linear acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_linear_accel_random: + +- :ref:`float` **linear_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Linear acceleration randomness ratio. + +---- + +.. _class_CPUParticles_property_local_coords: + +- :ref:`bool` **local_coords** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_use_local_coordinates(value) | ++-----------+----------------------------------+ +| *Getter* | get_use_local_coordinates() | ++-----------+----------------------------------+ + +If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. + +---- + +.. _class_CPUParticles_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +The :ref:`Mesh` used for each particle. If ``null``, particles will be spheres. + +---- + +.. _class_CPUParticles_property_one_shot: + +- :ref:`bool` **one_shot** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_one_shot(value) | ++-----------+---------------------+ +| *Getter* | get_one_shot() | ++-----------+---------------------+ + +If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. + +---- + +.. _class_CPUParticles_property_orbit_velocity: + +- :ref:`float` **orbit_velocity** + ++----------+------------------+ +| *Setter* | set_param(value) | ++----------+------------------+ +| *Getter* | get_param() | ++----------+------------------+ + +Orbital velocity applied to each particle. Makes the particles circle around origin in the local XY plane. Specified in number of full rotations around origin per second. + +This property is only available when :ref:`flag_disable_z` is ``true``. + +---- + +.. _class_CPUParticles_property_orbit_velocity_curve: + +- :ref:`Curve` **orbit_velocity_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's orbital velocity will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_orbit_velocity_random: + +- :ref:`float` **orbit_velocity_random** + ++----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++----------+-----------------------------+ + +Orbital velocity randomness ratio. + +---- + +.. _class_CPUParticles_property_preprocess: + +- :ref:`float` **preprocess** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_pre_process_time(value) | ++-----------+-----------------------------+ +| *Getter* | get_pre_process_time() | ++-----------+-----------------------------+ + +Particle system starts as if it had already run for this many seconds. + +---- + +.. _class_CPUParticles_property_radial_accel: + +- :ref:`float` **radial_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Radial acceleration applied to each particle. Makes particle accelerate away from origin. + +---- + +.. _class_CPUParticles_property_radial_accel_curve: + +- :ref:`Curve` **radial_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's radial acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_radial_accel_random: + +- :ref:`float` **radial_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Radial acceleration randomness ratio. + +---- + +.. _class_CPUParticles_property_randomness: + +- :ref:`float` **randomness** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_randomness_ratio(value) | ++-----------+-----------------------------+ +| *Getter* | get_randomness_ratio() | ++-----------+-----------------------------+ + +Emission lifetime randomness ratio. + +---- + +.. _class_CPUParticles_property_scale_amount: + +- :ref:`float` **scale_amount** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial scale applied to each particle. + +---- + +.. _class_CPUParticles_property_scale_amount_curve: + +- :ref:`Curve` **scale_amount_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's scale will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_scale_amount_random: + +- :ref:`float` **scale_amount_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Scale randomness ratio. + +---- + +.. _class_CPUParticles_property_speed_scale: + +- :ref:`float` **speed_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_speed_scale(value) | ++-----------+------------------------+ +| *Getter* | get_speed_scale() | ++-----------+------------------------+ + +Particle system's running speed scaling ratio. A value of ``0`` can be used to pause the particles. + +---- + +.. _class_CPUParticles_property_spread: + +- :ref:`float` **spread** + ++-----------+-------------------+ +| *Default* | ``45.0`` | ++-----------+-------------------+ +| *Setter* | set_spread(value) | ++-----------+-------------------+ +| *Getter* | get_spread() | ++-----------+-------------------+ + +Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. Applied to X/Z plane and Y/Z planes. + +---- + +.. _class_CPUParticles_property_tangential_accel: + +- :ref:`float` **tangential_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. + +---- + +.. _class_CPUParticles_property_tangential_accel_curve: + +- :ref:`Curve` **tangential_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's tangential acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles_property_tangential_accel_random: + +- :ref:`float` **tangential_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Tangential acceleration randomness ratio. + +Method Descriptions +------------------- + +.. _class_CPUParticles_method_convert_from_particles: + +- void **convert_from_particles** **(** :ref:`Node` particles **)** + +Sets this node's properties to match a given :ref:`Particles` node with an assigned :ref:`ParticlesMaterial`. + +---- + +.. _class_CPUParticles_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Parameter` param **)** |const| + +Returns the base value of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_get_param_curve: + +- :ref:`Curve` **get_param_curve** **(** :ref:`Parameter` param **)** |const| + +Returns the :ref:`Curve` of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_get_param_randomness: + +- :ref:`float` **get_param_randomness** **(** :ref:`Parameter` param **)** |const| + +Returns the randomness factor of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_get_particle_flag: + +- :ref:`bool` **get_particle_flag** **(** :ref:`Flags` flag **)** |const| + +Returns the enabled state of the given flag (see :ref:`Flags` for options). + +---- + +.. _class_CPUParticles_method_restart: + +- void **restart** **(** **)** + +Restarts the particle emitter. + +---- + +.. _class_CPUParticles_method_set_param: + +- void **set_param** **(** :ref:`Parameter` param, :ref:`float` value **)** + +Sets the base value of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_set_param_curve: + +- void **set_param_curve** **(** :ref:`Parameter` param, :ref:`Curve` curve **)** + +Sets the :ref:`Curve` of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_set_param_randomness: + +- void **set_param_randomness** **(** :ref:`Parameter` param, :ref:`float` randomness **)** + +Sets the randomness factor of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles_method_set_particle_flag: + +- void **set_particle_flag** **(** :ref:`Flags` flag, :ref:`bool` enable **)** + +Enables or disables the given flag (see :ref:`Flags` for options). + +.. |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.)` diff --git a/classes/class_cpuparticles2d.rst b/classes/class_cpuparticles2d.rst new file mode 100644 index 0000000..5414e6a --- /dev/null +++ b/classes/class_cpuparticles2d.rst @@ -0,0 +1,1351 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CPUParticles2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CPUParticles2D: + +CPUParticles2D +============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +CPU-based 2D particle emitter. + +Description +----------- + +CPU-based 2D particle node used to create a variety of particle systems and effects. + +See also :ref:`Particles2D`, which provides the same functionality with hardware acceleration, but may not run on older devices. + +**Note:** Unlike :ref:`Particles2D`, the visibility rect is generated on-the-fly and doesn't need to be configured by the user. + +Tutorials +--------- + +- :doc:`../tutorials/2d/particle_systems_2d` + +Properties +---------- + ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`amount` | ``8`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`angle` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`angle_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`angle_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`angular_velocity` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`angular_velocity_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`angular_velocity_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`anim_offset` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`anim_offset_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`anim_offset_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`anim_speed` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`anim_speed_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`anim_speed_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Gradient` | :ref:`color_ramp` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`damping` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`damping_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`damping_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`direction` | ``Vector2( 1, 0 )`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`PoolColorArray` | :ref:`emission_colors` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`PoolVector2Array` | :ref:`emission_normals` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`PoolVector2Array` | :ref:`emission_points` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`emission_rect_extents` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`EmissionShape` | :ref:`emission_shape` | ``0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`emission_sphere_radius` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`emitting` | ``true`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`explosiveness` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`fixed_fps` | ``0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flag_align_y` | ``false`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`fract_delta` | ``true`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`gravity` | ``Vector2( 0, 98 )`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`hue_variation` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`hue_variation_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`hue_variation_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`initial_velocity` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`initial_velocity_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`lifetime` | ``1.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`lifetime_randomness` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`linear_accel` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`linear_accel_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`linear_accel_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`local_coords` | ``true`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`normalmap` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`one_shot` | ``false`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`orbit_velocity` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`orbit_velocity_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`orbit_velocity_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`preprocess` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`radial_accel` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`radial_accel_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`radial_accel_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`randomness` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`scale_amount` | ``1.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`scale_amount_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`scale_amount_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`spread` | ``45.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`tangential_accel` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Curve` | :ref:`tangential_accel_curve` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`tangential_accel_random` | ``0.0`` | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++---------------------------------------------------------+---------------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`convert_from_particles` **(** :ref:`Node` particles **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Curve` | :ref:`get_param_curve` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_randomness` **(** :ref:`Parameter` param **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_particle_flag` **(** :ref:`Flags` flag **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`restart` **(** **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Parameter` param, :ref:`float` value **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_curve` **(** :ref:`Parameter` param, :ref:`Curve` curve **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_randomness` **(** :ref:`Parameter` param, :ref:`float` randomness **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_particle_flag` **(** :ref:`Flags` flag, :ref:`bool` enable **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CPUParticles2D_DrawOrder: + +.. _class_CPUParticles2D_constant_DRAW_ORDER_INDEX: + +.. _class_CPUParticles2D_constant_DRAW_ORDER_LIFETIME: + +enum **DrawOrder**: + +- **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted. + +- **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. + +---- + +.. _enum_CPUParticles2D_Parameter: + +.. _class_CPUParticles2D_constant_PARAM_INITIAL_LINEAR_VELOCITY: + +.. _class_CPUParticles2D_constant_PARAM_ANGULAR_VELOCITY: + +.. _class_CPUParticles2D_constant_PARAM_ORBIT_VELOCITY: + +.. _class_CPUParticles2D_constant_PARAM_LINEAR_ACCEL: + +.. _class_CPUParticles2D_constant_PARAM_RADIAL_ACCEL: + +.. _class_CPUParticles2D_constant_PARAM_TANGENTIAL_ACCEL: + +.. _class_CPUParticles2D_constant_PARAM_DAMPING: + +.. _class_CPUParticles2D_constant_PARAM_ANGLE: + +.. _class_CPUParticles2D_constant_PARAM_SCALE: + +.. _class_CPUParticles2D_constant_PARAM_HUE_VARIATION: + +.. _class_CPUParticles2D_constant_PARAM_ANIM_SPEED: + +.. _class_CPUParticles2D_constant_PARAM_ANIM_OFFSET: + +.. _class_CPUParticles2D_constant_PARAM_MAX: + +enum **Parameter**: + +- **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set initial velocity properties. + +- **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set angular velocity properties. + +- **PARAM_ORBIT_VELOCITY** = **2** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set orbital velocity properties. + +- **PARAM_LINEAR_ACCEL** = **3** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set linear acceleration properties. + +- **PARAM_RADIAL_ACCEL** = **4** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set radial acceleration properties. + +- **PARAM_TANGENTIAL_ACCEL** = **5** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set tangential acceleration properties. + +- **PARAM_DAMPING** = **6** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set damping properties. + +- **PARAM_ANGLE** = **7** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set angle properties. + +- **PARAM_SCALE** = **8** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set scale properties. + +- **PARAM_HUE_VARIATION** = **9** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set hue variation properties. + +- **PARAM_ANIM_SPEED** = **10** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set animation speed properties. + +- **PARAM_ANIM_OFFSET** = **11** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_curve` to set animation offset properties. + +- **PARAM_MAX** = **12** --- Represents the size of the :ref:`Parameter` enum. + +---- + +.. _enum_CPUParticles2D_Flags: + +.. _class_CPUParticles2D_constant_FLAG_ALIGN_Y_TO_VELOCITY: + +.. _class_CPUParticles2D_constant_FLAG_ROTATE_Y: + +.. _class_CPUParticles2D_constant_FLAG_DISABLE_Z: + +.. _class_CPUParticles2D_constant_FLAG_MAX: + +enum **Flags**: + +- **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_particle_flag` to set :ref:`flag_align_y`. + +- **FLAG_ROTATE_Y** = **1** --- Present for consistency with 3D particle nodes, not used in 2D. + +- **FLAG_DISABLE_Z** = **2** --- Present for consistency with 3D particle nodes, not used in 2D. + +- **FLAG_MAX** = **3** --- Represents the size of the :ref:`Flags` enum. + +---- + +.. _enum_CPUParticles2D_EmissionShape: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_POINT: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_SPHERE: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_RECTANGLE: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_POINTS: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_DIRECTED_POINTS: + +.. _class_CPUParticles2D_constant_EMISSION_SHAPE_MAX: + +enum **EmissionShape**: + +- **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point. + +- **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted on the surface of a sphere flattened to two dimensions. + +- **EMISSION_SHAPE_RECTANGLE** = **2** --- Particles will be emitted in the area of a rectangle. + +- **EMISSION_SHAPE_POINTS** = **3** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points`. Particle color will be modulated by :ref:`emission_colors`. + +- **EMISSION_SHAPE_DIRECTED_POINTS** = **4** --- Particles will be emitted at a position chosen randomly among :ref:`emission_points`. Particle velocity and rotation will be set based on :ref:`emission_normals`. Particle color will be modulated by :ref:`emission_colors`. + +- **EMISSION_SHAPE_MAX** = **5** --- Represents the size of the :ref:`EmissionShape` enum. + +Property Descriptions +--------------------- + +.. _class_CPUParticles2D_property_amount: + +- :ref:`int` **amount** + ++-----------+-------------------+ +| *Default* | ``8`` | ++-----------+-------------------+ +| *Setter* | set_amount(value) | ++-----------+-------------------+ +| *Getter* | get_amount() | ++-----------+-------------------+ + +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. + +---- + +.. _class_CPUParticles2D_property_angle: + +- :ref:`float` **angle** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial rotation applied to each particle, in degrees. + +---- + +.. _class_CPUParticles2D_property_angle_curve: + +- :ref:`Curve` **angle_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's rotation will be animated along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_angle_random: + +- :ref:`float` **angle_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Rotation randomness ratio. + +---- + +.. _class_CPUParticles2D_property_angular_velocity: + +- :ref:`float` **angular_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. + +---- + +.. _class_CPUParticles2D_property_angular_velocity_curve: + +- :ref:`Curve` **angular_velocity_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's angular velocity will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_angular_velocity_random: + +- :ref:`float` **angular_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Angular velocity randomness ratio. + +---- + +.. _class_CPUParticles2D_property_anim_offset: + +- :ref:`float` **anim_offset** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation offset. + +---- + +.. _class_CPUParticles2D_property_anim_offset_curve: + +- :ref:`Curve` **anim_offset_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's animation offset will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_anim_offset_random: + +- :ref:`float` **anim_offset_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation offset randomness ratio. + +---- + +.. _class_CPUParticles2D_property_anim_speed: + +- :ref:`float` **anim_speed** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation speed. + +---- + +.. _class_CPUParticles2D_property_anim_speed_curve: + +- :ref:`Curve` **anim_speed_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's animation speed will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_anim_speed_random: + +- :ref:`float` **anim_speed_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation speed randomness ratio. + +---- + +.. _class_CPUParticles2D_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +Each particle's initial color. If :ref:`texture` is defined, it will be multiplied by this color. + +---- + +.. _class_CPUParticles2D_property_color_ramp: + +- :ref:`Gradient` **color_ramp** + ++----------+-----------------------+ +| *Setter* | set_color_ramp(value) | ++----------+-----------------------+ +| *Getter* | get_color_ramp() | ++----------+-----------------------+ + +Each particle's color will vary along this :ref:`Gradient` (multiplied with :ref:`color`). + +---- + +.. _class_CPUParticles2D_property_damping: + +- :ref:`float` **damping** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The rate at which particles lose velocity. + +---- + +.. _class_CPUParticles2D_property_damping_curve: + +- :ref:`Curve` **damping_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Damping will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_damping_random: + +- :ref:`float` **damping_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Damping randomness ratio. + +---- + +.. _class_CPUParticles2D_property_direction: + +- :ref:`Vector2` **direction** + ++-----------+----------------------+ +| *Default* | ``Vector2( 1, 0 )`` | ++-----------+----------------------+ +| *Setter* | set_direction(value) | ++-----------+----------------------+ +| *Getter* | get_direction() | ++-----------+----------------------+ + +Unit vector specifying the particles' emission direction. + +---- + +.. _class_CPUParticles2D_property_draw_order: + +- :ref:`DrawOrder` **draw_order** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_draw_order(value) | ++-----------+-----------------------+ +| *Getter* | get_draw_order() | ++-----------+-----------------------+ + +Particle draw order. Uses :ref:`DrawOrder` values. + +---- + +.. _class_CPUParticles2D_property_emission_colors: + +- :ref:`PoolColorArray` **emission_colors** + ++----------+----------------------------+ +| *Setter* | set_emission_colors(value) | ++----------+----------------------------+ +| *Getter* | get_emission_colors() | ++----------+----------------------------+ + +Sets the :ref:`Color`\ s to modulate particles by when using :ref:`EMISSION_SHAPE_POINTS` or :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles2D_property_emission_normals: + +- :ref:`PoolVector2Array` **emission_normals** + ++----------+-----------------------------+ +| *Setter* | set_emission_normals(value) | ++----------+-----------------------------+ +| *Getter* | get_emission_normals() | ++----------+-----------------------------+ + +Sets the direction the particles will be emitted in when using :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles2D_property_emission_points: + +- :ref:`PoolVector2Array` **emission_points** + ++----------+----------------------------+ +| *Setter* | set_emission_points(value) | ++----------+----------------------------+ +| *Getter* | get_emission_points() | ++----------+----------------------------+ + +Sets the initial positions to spawn particles when using :ref:`EMISSION_SHAPE_POINTS` or :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_CPUParticles2D_property_emission_rect_extents: + +- :ref:`Vector2` **emission_rect_extents** + ++----------+----------------------------------+ +| *Setter* | set_emission_rect_extents(value) | ++----------+----------------------------------+ +| *Getter* | get_emission_rect_extents() | ++----------+----------------------------------+ + +The rectangle's extents if :ref:`emission_shape` is set to :ref:`EMISSION_SHAPE_RECTANGLE`. + +---- + +.. _class_CPUParticles2D_property_emission_shape: + +- :ref:`EmissionShape` **emission_shape** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_emission_shape(value) | ++-----------+---------------------------+ +| *Getter* | get_emission_shape() | ++-----------+---------------------------+ + +Particles will be emitted inside this region. See :ref:`EmissionShape` for possible values. + +---- + +.. _class_CPUParticles2D_property_emission_sphere_radius: + +- :ref:`float` **emission_sphere_radius** + ++----------+-----------------------------------+ +| *Setter* | set_emission_sphere_radius(value) | ++----------+-----------------------------------+ +| *Getter* | get_emission_sphere_radius() | ++----------+-----------------------------------+ + +The sphere's radius if :ref:`emission_shape` is set to :ref:`EMISSION_SHAPE_SPHERE`. + +---- + +.. _class_CPUParticles2D_property_emitting: + +- :ref:`bool` **emitting** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_emitting(value) | ++-----------+---------------------+ +| *Getter* | is_emitting() | ++-----------+---------------------+ + +If ``true``, particles are being emitted. + +---- + +.. _class_CPUParticles2D_property_explosiveness: + +- :ref:`float` **explosiveness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_explosiveness_ratio(value) | ++-----------+--------------------------------+ +| *Getter* | get_explosiveness_ratio() | ++-----------+--------------------------------+ + +How rapidly particles in an emission cycle are emitted. If greater than ``0``, there will be a gap in emissions before the next cycle begins. + +---- + +.. _class_CPUParticles2D_property_fixed_fps: + +- :ref:`int` **fixed_fps** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_fixed_fps(value) | ++-----------+----------------------+ +| *Getter* | get_fixed_fps() | ++-----------+----------------------+ + +The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + +---- + +.. _class_CPUParticles2D_property_flag_align_y: + +- :ref:`bool` **flag_align_y** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_particle_flag(value) | ++-----------+--------------------------+ +| *Getter* | get_particle_flag() | ++-----------+--------------------------+ + +Align Y axis of particle with the direction of its velocity. + +---- + +.. _class_CPUParticles2D_property_fract_delta: + +- :ref:`bool` **fract_delta** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_fractional_delta(value) | ++-----------+-----------------------------+ +| *Getter* | get_fractional_delta() | ++-----------+-----------------------------+ + +If ``true``, results in fractional delta calculation which has a smoother particles display effect. + +---- + +.. _class_CPUParticles2D_property_gravity: + +- :ref:`Vector2` **gravity** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, 98 )`` | ++-----------+----------------------+ +| *Setter* | set_gravity(value) | ++-----------+----------------------+ +| *Getter* | get_gravity() | ++-----------+----------------------+ + +Gravity applied to every particle. + +---- + +.. _class_CPUParticles2D_property_hue_variation: + +- :ref:`float` **hue_variation** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial hue variation applied to each particle. + +---- + +.. _class_CPUParticles2D_property_hue_variation_curve: + +- :ref:`Curve` **hue_variation_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's hue will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_hue_variation_random: + +- :ref:`float` **hue_variation_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Hue variation randomness ratio. + +---- + +.. _class_CPUParticles2D_property_initial_velocity: + +- :ref:`float` **initial_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial velocity magnitude for each particle. Direction comes from :ref:`spread` and the node's orientation. + +---- + +.. _class_CPUParticles2D_property_initial_velocity_random: + +- :ref:`float` **initial_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Initial velocity randomness ratio. + +---- + +.. _class_CPUParticles2D_property_lifetime: + +- :ref:`float` **lifetime** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_lifetime(value) | ++-----------+---------------------+ +| *Getter* | get_lifetime() | ++-----------+---------------------+ + +The amount of time each particle will exist (in seconds). + +---- + +.. _class_CPUParticles2D_property_lifetime_randomness: + +- :ref:`float` **lifetime_randomness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_lifetime_randomness(value) | ++-----------+--------------------------------+ +| *Getter* | get_lifetime_randomness() | ++-----------+--------------------------------+ + +Particle lifetime randomness ratio. + +---- + +.. _class_CPUParticles2D_property_linear_accel: + +- :ref:`float` **linear_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Linear acceleration applied to each particle in the direction of motion. + +---- + +.. _class_CPUParticles2D_property_linear_accel_curve: + +- :ref:`Curve` **linear_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's linear acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_linear_accel_random: + +- :ref:`float` **linear_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Linear acceleration randomness ratio. + +---- + +.. _class_CPUParticles2D_property_local_coords: + +- :ref:`bool` **local_coords** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_use_local_coordinates(value) | ++-----------+----------------------------------+ +| *Getter* | get_use_local_coordinates() | ++-----------+----------------------------------+ + +If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. + +---- + +.. _class_CPUParticles2D_property_normalmap: + +- :ref:`Texture` **normalmap** + ++----------+----------------------+ +| *Setter* | set_normalmap(value) | ++----------+----------------------+ +| *Getter* | get_normalmap() | ++----------+----------------------+ + +Normal map to be used for the :ref:`texture` property. + +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_CPUParticles2D_property_one_shot: + +- :ref:`bool` **one_shot** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_one_shot(value) | ++-----------+---------------------+ +| *Getter* | get_one_shot() | ++-----------+---------------------+ + +If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. + +---- + +.. _class_CPUParticles2D_property_orbit_velocity: + +- :ref:`float` **orbit_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + +---- + +.. _class_CPUParticles2D_property_orbit_velocity_curve: + +- :ref:`Curve` **orbit_velocity_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's orbital velocity will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_orbit_velocity_random: + +- :ref:`float` **orbit_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Orbital velocity randomness ratio. + +---- + +.. _class_CPUParticles2D_property_preprocess: + +- :ref:`float` **preprocess** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_pre_process_time(value) | ++-----------+-----------------------------+ +| *Getter* | get_pre_process_time() | ++-----------+-----------------------------+ + +Particle system starts as if it had already run for this many seconds. + +---- + +.. _class_CPUParticles2D_property_radial_accel: + +- :ref:`float` **radial_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Radial acceleration applied to each particle. Makes particle accelerate away from origin. + +---- + +.. _class_CPUParticles2D_property_radial_accel_curve: + +- :ref:`Curve` **radial_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's radial acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_radial_accel_random: + +- :ref:`float` **radial_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Radial acceleration randomness ratio. + +---- + +.. _class_CPUParticles2D_property_randomness: + +- :ref:`float` **randomness** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_randomness_ratio(value) | ++-----------+-----------------------------+ +| *Getter* | get_randomness_ratio() | ++-----------+-----------------------------+ + +Emission lifetime randomness ratio. + +---- + +.. _class_CPUParticles2D_property_scale_amount: + +- :ref:`float` **scale_amount** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial scale applied to each particle. + +---- + +.. _class_CPUParticles2D_property_scale_amount_curve: + +- :ref:`Curve` **scale_amount_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's scale will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_scale_amount_random: + +- :ref:`float` **scale_amount_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Scale randomness ratio. + +---- + +.. _class_CPUParticles2D_property_speed_scale: + +- :ref:`float` **speed_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_speed_scale(value) | ++-----------+------------------------+ +| *Getter* | get_speed_scale() | ++-----------+------------------------+ + +Particle system's running speed scaling ratio. A value of ``0`` can be used to pause the particles. + +---- + +.. _class_CPUParticles2D_property_spread: + +- :ref:`float` **spread** + ++-----------+-------------------+ +| *Default* | ``45.0`` | ++-----------+-------------------+ +| *Setter* | set_spread(value) | ++-----------+-------------------+ +| *Getter* | get_spread() | ++-----------+-------------------+ + +Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. + +---- + +.. _class_CPUParticles2D_property_tangential_accel: + +- :ref:`float` **tangential_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. + +---- + +.. _class_CPUParticles2D_property_tangential_accel_curve: + +- :ref:`Curve` **tangential_accel_curve** + ++----------+------------------------+ +| *Setter* | set_param_curve(value) | ++----------+------------------------+ +| *Getter* | get_param_curve() | ++----------+------------------------+ + +Each particle's tangential acceleration will vary along this :ref:`Curve`. + +---- + +.. _class_CPUParticles2D_property_tangential_accel_random: + +- :ref:`float` **tangential_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Tangential acceleration randomness ratio. + +---- + +.. _class_CPUParticles2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Particle texture. If ``null``, particles will be squares. + +Method Descriptions +------------------- + +.. _class_CPUParticles2D_method_convert_from_particles: + +- void **convert_from_particles** **(** :ref:`Node` particles **)** + +Sets this node's properties to match a given :ref:`Particles2D` node with an assigned :ref:`ParticlesMaterial`. + +---- + +.. _class_CPUParticles2D_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Parameter` param **)** |const| + +Returns the base value of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_get_param_curve: + +- :ref:`Curve` **get_param_curve** **(** :ref:`Parameter` param **)** |const| + +Returns the :ref:`Curve` of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_get_param_randomness: + +- :ref:`float` **get_param_randomness** **(** :ref:`Parameter` param **)** |const| + +Returns the randomness factor of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_get_particle_flag: + +- :ref:`bool` **get_particle_flag** **(** :ref:`Flags` flag **)** |const| + +Returns the enabled state of the given flag (see :ref:`Flags` for options). + +---- + +.. _class_CPUParticles2D_method_restart: + +- void **restart** **(** **)** + +Restarts the particle emitter. + +---- + +.. _class_CPUParticles2D_method_set_param: + +- void **set_param** **(** :ref:`Parameter` param, :ref:`float` value **)** + +Sets the base value of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_set_param_curve: + +- void **set_param_curve** **(** :ref:`Parameter` param, :ref:`Curve` curve **)** + +Sets the :ref:`Curve` of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_set_param_randomness: + +- void **set_param_randomness** **(** :ref:`Parameter` param, :ref:`float` randomness **)** + +Sets the randomness factor of the parameter specified by :ref:`Parameter`. + +---- + +.. _class_CPUParticles2D_method_set_particle_flag: + +- void **set_particle_flag** **(** :ref:`Flags` flag, :ref:`bool` enable **)** + +Enables or disables the given flag (see :ref:`Flags` for options). + +.. |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.)` diff --git a/classes/class_crypto.rst b/classes/class_crypto.rst new file mode 100644 index 0000000..dc772d1 --- /dev/null +++ b/classes/class_crypto.rst @@ -0,0 +1,170 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Crypto.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Crypto: + +Crypto +====== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Access to advanced cryptographic functionalities. + +Description +----------- + +The Crypto class allows you to access some more advanced cryptographic functionalities in Godot. + +For now, this includes generating cryptographically secure random bytes, RSA keys and self-signed X509 certificates generation, asymmetric key encryption/decryption, and signing/verification. + +:: + + extends Node + + var crypto = Crypto.new() + var key = CryptoKey.new() + var cert = X509Certificate.new() + + func _ready(): + # Generate new RSA key. + key = crypto.generate_rsa(4096) + # Generate new self-signed certificate with the given key. + cert = crypto.generate_self_signed_certificate(key, "CN=mydomain.com,O=My Game Company,C=IT") + # Save key and certificate in the user folder. + key.save("user://generated.key") + cert.save("user://generated.crt") + # Encryption + var data = "Some data" + var encrypted = crypto.encrypt(key, data.to_utf8()) + # Decryption + var decrypted = crypto.decrypt(key, encrypted) + # Signing + var signature = crypto.sign(HashingContext.HASH_SHA256, data.sha256_buffer(), key) + # Verifying + var verified = crypto.verify(HashingContext.HASH_SHA256, data.sha256_buffer(), signature, key) + # Checks + assert(verified) + assert(data.to_utf8() == decrypted) + +**Note:** Not available in HTML5 exports. + +Methods +------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`constant_time_compare` **(** :ref:`PoolByteArray` trusted, :ref:`PoolByteArray` received **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`decrypt` **(** :ref:`CryptoKey` key, :ref:`PoolByteArray` ciphertext **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`encrypt` **(** :ref:`CryptoKey` key, :ref:`PoolByteArray` plaintext **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`generate_random_bytes` **(** :ref:`int` size **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`CryptoKey` | :ref:`generate_rsa` **(** :ref:`int` size **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`X509Certificate` | :ref:`generate_self_signed_certificate` **(** :ref:`CryptoKey` key, :ref:`String` issuer_name="CN=myserver,O=myorganisation,C=IT", :ref:`String` not_before="20140101000000", :ref:`String` not_after="20340101000000" **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`hmac_digest` **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` key, :ref:`PoolByteArray` msg **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`sign` **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` hash, :ref:`CryptoKey` key **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`verify` **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` hash, :ref:`PoolByteArray` signature, :ref:`CryptoKey` key **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Crypto_method_constant_time_compare: + +- :ref:`bool` **constant_time_compare** **(** :ref:`PoolByteArray` trusted, :ref:`PoolByteArray` received **)** + +Compares two :ref:`PoolByteArray`\ s for equality without leaking timing information in order to prevent timing attacks. + +See `this blog post `__ for more information. + +---- + +.. _class_Crypto_method_decrypt: + +- :ref:`PoolByteArray` **decrypt** **(** :ref:`CryptoKey` key, :ref:`PoolByteArray` ciphertext **)** + +Decrypt the given ``ciphertext`` with the provided private ``key``. + +**Note:** The maximum size of accepted ciphertext is limited by the key size. + +---- + +.. _class_Crypto_method_encrypt: + +- :ref:`PoolByteArray` **encrypt** **(** :ref:`CryptoKey` key, :ref:`PoolByteArray` plaintext **)** + +Encrypt the given ``plaintext`` with the provided public ``key``. + +**Note:** The maximum size of accepted plaintext is limited by the key size. + +---- + +.. _class_Crypto_method_generate_random_bytes: + +- :ref:`PoolByteArray` **generate_random_bytes** **(** :ref:`int` size **)** + +Generates a :ref:`PoolByteArray` of cryptographically secure random bytes with given ``size``. + +---- + +.. _class_Crypto_method_generate_rsa: + +- :ref:`CryptoKey` **generate_rsa** **(** :ref:`int` size **)** + +Generates an RSA :ref:`CryptoKey` that can be used for creating self-signed certificates and passed to :ref:`StreamPeerSSL.accept_stream`. + +---- + +.. _class_Crypto_method_generate_self_signed_certificate: + +- :ref:`X509Certificate` **generate_self_signed_certificate** **(** :ref:`CryptoKey` key, :ref:`String` issuer_name="CN=myserver,O=myorganisation,C=IT", :ref:`String` not_before="20140101000000", :ref:`String` not_after="20340101000000" **)** + +Generates a self-signed :ref:`X509Certificate` from the given :ref:`CryptoKey` and ``issuer_name``. The certificate validity will be defined by ``not_before`` and ``not_after`` (first valid date and last valid date). The ``issuer_name`` must contain at least "CN=" (common name, i.e. the domain name), "O=" (organization, i.e. your company name), "C=" (country, i.e. 2 lettered ISO-3166 code of the country the organization is based in). + +A small example to generate an RSA key and a X509 self-signed certificate. + +:: + + var crypto = Crypto.new() + # Generate 4096 bits RSA key. + var key = crypto.generate_rsa(4096) + # Generate self-signed certificate using the given key. + var cert = crypto.generate_self_signed_certificate(key, "CN=example.com,O=A Game Company,C=IT") + +---- + +.. _class_Crypto_method_hmac_digest: + +- :ref:`PoolByteArray` **hmac_digest** **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` key, :ref:`PoolByteArray` msg **)** + +Generates an `HMAC `__ digest of ``msg`` using ``key``. The ``hash_type`` parameter is the hashing algorithm that is used for the inner and outer hashes. + +Currently, only :ref:`HashingContext.HASH_SHA256` and :ref:`HashingContext.HASH_SHA1` are supported. + +---- + +.. _class_Crypto_method_sign: + +- :ref:`PoolByteArray` **sign** **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` hash, :ref:`CryptoKey` key **)** + +Sign a given ``hash`` of type ``hash_type`` with the provided private ``key``. + +---- + +.. _class_Crypto_method_verify: + +- :ref:`bool` **verify** **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` hash, :ref:`PoolByteArray` signature, :ref:`CryptoKey` key **)** + +Verify that a given ``signature`` for ``hash`` of type ``hash_type`` against the provided public ``key``. + +.. |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.)` diff --git a/classes/class_cryptokey.rst b/classes/class_cryptokey.rst new file mode 100644 index 0000000..3e4bf2b --- /dev/null +++ b/classes/class_cryptokey.rst @@ -0,0 +1,87 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CryptoKey.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CryptoKey: + +CryptoKey +========= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A cryptographic key (RSA). + +Description +----------- + +The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other :ref:`Resource`. + +They can be used to generate a self-signed :ref:`X509Certificate` via :ref:`Crypto.generate_self_signed_certificate` and as private key in :ref:`StreamPeerSSL.accept_stream` along with the appropriate certificate. + +**Note:** Not available in HTML5 exports. + +Methods +------- + ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_public_only` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path, :ref:`bool` public_only=false **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_from_string` **(** :ref:`String` string_key, :ref:`bool` public_only=false **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** :ref:`String` path, :ref:`bool` public_only=false **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`save_to_string` **(** :ref:`bool` public_only=false **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_CryptoKey_method_is_public_only: + +- :ref:`bool` **is_public_only** **(** **)** |const| + +Return ``true`` if this CryptoKey only has the public part, and not the private one. + +---- + +.. _class_CryptoKey_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path, :ref:`bool` public_only=false **)** + +Loads a key from ``path``. If ``public_only`` is ``true``, only the public key will be loaded. + +**Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise. + +---- + +.. _class_CryptoKey_method_load_from_string: + +- :ref:`Error` **load_from_string** **(** :ref:`String` string_key, :ref:`bool` public_only=false **)** + +Loads a key from the given ``string``. If ``public_only`` is ``true``, only the public key will be loaded. + +---- + +.. _class_CryptoKey_method_save: + +- :ref:`Error` **save** **(** :ref:`String` path, :ref:`bool` public_only=false **)** + +Saves a key to the given ``path``. If ``public_only`` is ``true``, only the public key will be saved. + +**Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise. + +---- + +.. _class_CryptoKey_method_save_to_string: + +- :ref:`String` **save_to_string** **(** :ref:`bool` public_only=false **)** + +Returns a string containing the key in PEM format. If ``public_only`` is ``true``, only the public key will be included. + +.. |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.)` diff --git a/classes/class_csgbox.rst b/classes/class_csgbox.rst new file mode 100644 index 0000000..f9cfc94 --- /dev/null +++ b/classes/class_csgbox.rst @@ -0,0 +1,106 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGBox.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGBox: + +CSGBox +====== + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG Box shape. + +Description +----------- + +This node allows you to create a box for use with the CSG system. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++---------------------------------+-------------------------------------------------+---------+ +| :ref:`float` | :ref:`depth` | ``2.0`` | ++---------------------------------+-------------------------------------------------+---------+ +| :ref:`float` | :ref:`height` | ``2.0`` | ++---------------------------------+-------------------------------------------------+---------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+-------------------------------------------------+---------+ +| :ref:`float` | :ref:`width` | ``2.0`` | ++---------------------------------+-------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_CSGBox_property_depth: + +- :ref:`float` **depth** + ++-----------+------------------+ +| *Default* | ``2.0`` | ++-----------+------------------+ +| *Setter* | set_depth(value) | ++-----------+------------------+ +| *Getter* | get_depth() | ++-----------+------------------+ + +Depth of the box measured from the center of the box. + +---- + +.. _class_CSGBox_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +Height of the box measured from the center of the box. + +---- + +.. _class_CSGBox_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The material used to render the box. + +---- + +.. _class_CSGBox_property_width: + +- :ref:`float` **width** + ++-----------+------------------+ +| *Default* | ``2.0`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +Width of the box measured from the center of the box. + +.. |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.)` diff --git a/classes/class_csgcombiner.rst b/classes/class_csgcombiner.rst new file mode 100644 index 0000000..47bb853 --- /dev/null +++ b/classes/class_csgcombiner.rst @@ -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 CSGCombiner.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGCombiner: + +CSGCombiner +=========== + +**Inherits:** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG node that allows you to combine other CSG modifiers. + +Description +----------- + +For complex arrangements of shapes, it is sometimes needed to add structure to your CSG nodes. The CSGCombiner node allows you to create this structure. The node encapsulates the result of the CSG operations of its children. In this way, it is possible to do operations on one set of shapes that are children of one CSGCombiner node, and a set of separate operations on a second set of shapes that are children of a second CSGCombiner node, and then do an operation that takes the two end results as its input to create the final shape. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +.. |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.)` diff --git a/classes/class_csgcylinder.rst b/classes/class_csgcylinder.rst new file mode 100644 index 0000000..eb408ca --- /dev/null +++ b/classes/class_csgcylinder.rst @@ -0,0 +1,142 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGCylinder.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGCylinder: + +CSGCylinder +=========== + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG Cylinder shape. + +Description +----------- + +This node allows you to create a cylinder (or cone) for use with the CSG system. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`cone` | ``false`` | ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`height` | ``1.0`` | ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`sides` | ``8`` | ++---------------------------------+--------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`smooth_faces` | ``true`` | ++---------------------------------+--------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_CSGCylinder_property_cone: + +- :ref:`bool` **cone** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_cone(value) | ++-----------+-----------------+ +| *Getter* | is_cone() | ++-----------+-----------------+ + +If ``true`` a cone is created, the :ref:`radius` will only apply to one side. + +---- + +.. _class_CSGCylinder_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +The height of the cylinder. + +---- + +.. _class_CSGCylinder_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The material used to render the cylinder. + +---- + +.. _class_CSGCylinder_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The radius of the cylinder. + +---- + +.. _class_CSGCylinder_property_sides: + +- :ref:`int` **sides** + ++-----------+------------------+ +| *Default* | ``8`` | ++-----------+------------------+ +| *Setter* | set_sides(value) | ++-----------+------------------+ +| *Getter* | get_sides() | ++-----------+------------------+ + +The number of sides of the cylinder, the higher this number the more detail there will be in the cylinder. + +---- + +.. _class_CSGCylinder_property_smooth_faces: + +- :ref:`bool` **smooth_faces** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_smooth_faces(value) | ++-----------+-------------------------+ +| *Getter* | get_smooth_faces() | ++-----------+-------------------------+ + +If ``true`` the normals of the cylinder are set to give a smooth effect making the cylinder seem rounded. If ``false`` the cylinder will have a flat shaded look. + +.. |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.)` diff --git a/classes/class_csgmesh.rst b/classes/class_csgmesh.rst new file mode 100644 index 0000000..3a573b6 --- /dev/null +++ b/classes/class_csgmesh.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGMesh: + +CSGMesh +======= + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG Mesh shape that uses a mesh resource. + +Description +----------- + +This CSG node allows you to use any mesh resource as a CSG shape, provided it is closed, does not self-intersect, does not contain internal faces and has no edges that connect to more than two faces. See also :ref:`CSGPolygon` for drawing 2D extruded polygons to be used as CSG nodes. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++---------------------------------+--------------------------------------------------+ +| :ref:`Material` | :ref:`material` | ++---------------------------------+--------------------------------------------------+ +| :ref:`Mesh` | :ref:`mesh` | ++---------------------------------+--------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_CSGMesh_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The :ref:`Material` used in drawing the CSG shape. + +---- + +.. _class_CSGMesh_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +The :ref:`Mesh` resource to use as a CSG shape. + +**Note:** When using an :ref:`ArrayMesh`, avoid meshes with vertex normals unless a flat shader is required. By default, CSGMesh will ignore the mesh's vertex normals and use a smooth shader calculated using the faces' normals. If a flat shader is required, ensure that all faces' vertex normals are parallel. + +.. |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.)` diff --git a/classes/class_csgpolygon.rst b/classes/class_csgpolygon.rst new file mode 100644 index 0000000..8d62e9e --- /dev/null +++ b/classes/class_csgpolygon.rst @@ -0,0 +1,357 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGPolygon.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGPolygon: + +CSGPolygon +========== + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Extrudes a 2D polygon shape to create a 3D mesh. + +Description +----------- + +An array of 2D points is extruded to quickly and easily create a variety of 3D meshes. See also :ref:`CSGMesh` for using 3D meshes as CSG nodes. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`float` | :ref:`depth` | ``1.0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`Material` | :ref:`material` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`bool` | :ref:`path_continuous_u` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`float` | :ref:`path_interval` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`PathIntervalType` | :ref:`path_interval_type` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`bool` | :ref:`path_joined` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`bool` | :ref:`path_local` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`NodePath` | :ref:`path_node` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`PathRotation` | :ref:`path_rotation` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`float` | :ref:`path_simplify_angle` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`float` | :ref:`path_u_distance` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`polygon` | ``PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`bool` | :ref:`smooth_faces` | ``false`` | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`float` | :ref:`spin_degrees` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ +| :ref:`int` | :ref:`spin_sides` | | ++-----------------------------------------------------------+---------------------------------------------------------------------------+------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CSGPolygon_Mode: + +.. _class_CSGPolygon_constant_MODE_DEPTH: + +.. _class_CSGPolygon_constant_MODE_SPIN: + +.. _class_CSGPolygon_constant_MODE_PATH: + +enum **Mode**: + +- **MODE_DEPTH** = **0** --- The :ref:`polygon` shape is extruded along the negative Z axis. + +- **MODE_SPIN** = **1** --- The :ref:`polygon` shape is extruded by rotating it around the Y axis. + +- **MODE_PATH** = **2** --- The :ref:`polygon` shape is extruded along the :ref:`Path` specified in :ref:`path_node`. + +---- + +.. _enum_CSGPolygon_PathRotation: + +.. _class_CSGPolygon_constant_PATH_ROTATION_POLYGON: + +.. _class_CSGPolygon_constant_PATH_ROTATION_PATH: + +.. _class_CSGPolygon_constant_PATH_ROTATION_PATH_FOLLOW: + +enum **PathRotation**: + +- **PATH_ROTATION_POLYGON** = **0** --- The :ref:`polygon` shape is not rotated. + +**Note:** Requires the path's Z coordinates to continually decrease to ensure viable shapes. + +- **PATH_ROTATION_PATH** = **1** --- The :ref:`polygon` shape is rotated along the path, but it is not rotated around the path axis. + +**Note:** Requires the path's Z coordinates to continually decrease to ensure viable shapes. + +- **PATH_ROTATION_PATH_FOLLOW** = **2** --- The :ref:`polygon` shape follows the path and its rotations around the path axis. + +---- + +.. _enum_CSGPolygon_PathIntervalType: + +.. _class_CSGPolygon_constant_PATH_INTERVAL_DISTANCE: + +.. _class_CSGPolygon_constant_PATH_INTERVAL_SUBDIVIDE: + +enum **PathIntervalType**: + +- **PATH_INTERVAL_DISTANCE** = **0** --- When :ref:`mode` is set to :ref:`MODE_PATH`, :ref:`path_interval` will determine the distance, in meters, each interval of the path will extrude. + +- **PATH_INTERVAL_SUBDIVIDE** = **1** --- When :ref:`mode` is set to :ref:`MODE_PATH`, :ref:`path_interval` will subdivide the polygons along the path. + +Property Descriptions +--------------------- + +.. _class_CSGPolygon_property_depth: + +- :ref:`float` **depth** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_depth(value) | ++-----------+------------------+ +| *Getter* | get_depth() | ++-----------+------------------+ + +When :ref:`mode` is :ref:`MODE_DEPTH`, the depth of the extrusion. + +---- + +.. _class_CSGPolygon_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +Material to use for the resulting mesh. The UV maps the top half of the material to the extruded shape (U along the the length of the extrusions and V around the outline of the :ref:`polygon`), the bottom-left quarter to the front end face, and the bottom-right quarter to the back end face. + +---- + +.. _class_CSGPolygon_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The :ref:`mode` used to extrude the :ref:`polygon`. + +---- + +.. _class_CSGPolygon_property_path_continuous_u: + +- :ref:`bool` **path_continuous_u** + ++----------+------------------------------+ +| *Setter* | set_path_continuous_u(value) | ++----------+------------------------------+ +| *Getter* | is_path_continuous_u() | ++----------+------------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, by default, the top half of the :ref:`material` is stretched along the entire length of the extruded shape. If ``false`` the top half of the material is repeated every step of the extrusion. + +---- + +.. _class_CSGPolygon_property_path_interval: + +- :ref:`float` **path_interval** + ++----------+--------------------------+ +| *Setter* | set_path_interval(value) | ++----------+--------------------------+ +| *Getter* | get_path_interval() | ++----------+--------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, the path interval or ratio of path points to extrusions. + +---- + +.. _class_CSGPolygon_property_path_interval_type: + +- :ref:`PathIntervalType` **path_interval_type** + ++----------+-------------------------------+ +| *Setter* | set_path_interval_type(value) | ++----------+-------------------------------+ +| *Getter* | get_path_interval_type() | ++----------+-------------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, this will determine if the interval should be by distance (:ref:`PATH_INTERVAL_DISTANCE`) or subdivision fractions (:ref:`PATH_INTERVAL_SUBDIVIDE`). + +---- + +.. _class_CSGPolygon_property_path_joined: + +- :ref:`bool` **path_joined** + ++----------+------------------------+ +| *Setter* | set_path_joined(value) | ++----------+------------------------+ +| *Getter* | is_path_joined() | ++----------+------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, if ``true`` the ends of the path are joined, by adding an extrusion between the last and first points of the path. + +---- + +.. _class_CSGPolygon_property_path_local: + +- :ref:`bool` **path_local** + ++----------+-----------------------+ +| *Setter* | set_path_local(value) | ++----------+-----------------------+ +| *Getter* | is_path_local() | ++----------+-----------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, if ``true`` the :ref:`Transform` of the ``CSGPolygon`` is used as the starting point for the extrusions, not the :ref:`Transform` of the :ref:`path_node`. + +---- + +.. _class_CSGPolygon_property_path_node: + +- :ref:`NodePath` **path_node** + ++----------+----------------------+ +| *Setter* | set_path_node(value) | ++----------+----------------------+ +| *Getter* | get_path_node() | ++----------+----------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, the location of the :ref:`Path` object used to extrude the :ref:`polygon`. + +---- + +.. _class_CSGPolygon_property_path_rotation: + +- :ref:`PathRotation` **path_rotation** + ++----------+--------------------------+ +| *Setter* | set_path_rotation(value) | ++----------+--------------------------+ +| *Getter* | get_path_rotation() | ++----------+--------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, the :ref:`PathRotation` method used to rotate the :ref:`polygon` as it is extruded. + +---- + +.. _class_CSGPolygon_property_path_simplify_angle: + +- :ref:`float` **path_simplify_angle** + ++----------+--------------------------------+ +| *Setter* | set_path_simplify_angle(value) | ++----------+--------------------------------+ +| *Getter* | get_path_simplify_angle() | ++----------+--------------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, extrusions that are less than this angle, will be merged together to reduce polygon count. + +---- + +.. _class_CSGPolygon_property_path_u_distance: + +- :ref:`float` **path_u_distance** + ++----------+----------------------------+ +| *Setter* | set_path_u_distance(value) | ++----------+----------------------------+ +| *Getter* | get_path_u_distance() | ++----------+----------------------------+ + +When :ref:`mode` is :ref:`MODE_PATH`, this is the distance along the path, in meters, the texture coordinates will tile. When set to 0, texture coordinates will match geometry exactly with no tiling. + +---- + +.. _class_CSGPolygon_property_polygon: + +- :ref:`PoolVector2Array` **polygon** + ++-----------+------------------------------------------------+ +| *Default* | ``PoolVector2Array( 0, 0, 0, 1, 1, 1, 1, 0 )`` | ++-----------+------------------------------------------------+ +| *Setter* | set_polygon(value) | ++-----------+------------------------------------------------+ +| *Getter* | get_polygon() | ++-----------+------------------------------------------------+ + +The point array that defines the 2D polygon that is extruded. This can be a convex or concave polygon with 3 or more points. The polygon must *not* have any intersecting edges. Otherwise, triangulation will fail and no mesh will be generated. + +**Note:** If only 1 or 2 points are defined in :ref:`polygon`, no mesh will be generated. + +---- + +.. _class_CSGPolygon_property_smooth_faces: + +- :ref:`bool` **smooth_faces** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_smooth_faces(value) | ++-----------+-------------------------+ +| *Getter* | get_smooth_faces() | ++-----------+-------------------------+ + +If ``true``, applies smooth shading to the extrusions. + +---- + +.. _class_CSGPolygon_property_spin_degrees: + +- :ref:`float` **spin_degrees** + ++----------+-------------------------+ +| *Setter* | set_spin_degrees(value) | ++----------+-------------------------+ +| *Getter* | get_spin_degrees() | ++----------+-------------------------+ + +When :ref:`mode` is :ref:`MODE_SPIN`, the total number of degrees the :ref:`polygon` is rotated when extruding. + +---- + +.. _class_CSGPolygon_property_spin_sides: + +- :ref:`int` **spin_sides** + ++----------+-----------------------+ +| *Setter* | set_spin_sides(value) | ++----------+-----------------------+ +| *Getter* | get_spin_sides() | ++----------+-----------------------+ + +When :ref:`mode` is :ref:`MODE_SPIN`, the number of extrusions made. + +.. |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.)` diff --git a/classes/class_csgprimitive.rst b/classes/class_csgprimitive.rst new file mode 100644 index 0000000..8197ae5 --- /dev/null +++ b/classes/class_csgprimitive.rst @@ -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 CSGPrimitive.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGPrimitive: + +CSGPrimitive +============ + +**Inherits:** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`CSGBox`, :ref:`CSGCylinder`, :ref:`CSGMesh`, :ref:`CSGPolygon`, :ref:`CSGSphere`, :ref:`CSGTorus` + +Base class for CSG primitives. + +Description +----------- + +Parent class for various CSG primitives. It contains code and functionality that is common between them. It cannot be used directly. Instead use one of the various classes that inherit from it. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`invert_faces` | ``false`` | ++-------------------------+---------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_CSGPrimitive_property_invert_faces: + +- :ref:`bool` **invert_faces** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_invert_faces(value) | ++-----------+-------------------------+ +| *Getter* | is_inverting_faces() | ++-----------+-------------------------+ + +Invert the faces of the mesh. + +.. |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.)` diff --git a/classes/class_csgshape.rst b/classes/class_csgshape.rst new file mode 100644 index 0000000..9ed2ddb --- /dev/null +++ b/classes/class_csgshape.rst @@ -0,0 +1,235 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGShape: + +CSGShape +======== + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`CSGCombiner`, :ref:`CSGPrimitive` + +The CSG base class. + +Description +----------- + +This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`calculate_tangents` | ``true`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`Operation` | :ref:`operation` | ``0`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`snap` | ``0.001`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_collision` | ``false`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_meshes` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_root_shape` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CSGShape_Operation: + +.. _class_CSGShape_constant_OPERATION_UNION: + +.. _class_CSGShape_constant_OPERATION_INTERSECTION: + +.. _class_CSGShape_constant_OPERATION_SUBTRACTION: + +enum **Operation**: + +- **OPERATION_UNION** = **0** --- Geometry of both primitives is merged, intersecting geometry is removed. + +- **OPERATION_INTERSECTION** = **1** --- Only intersecting geometry remains, the rest is removed. + +- **OPERATION_SUBTRACTION** = **2** --- The second shape is subtracted from the first, leaving a dent with its shape. + +Property Descriptions +--------------------- + +.. _class_CSGShape_property_calculate_tangents: + +- :ref:`bool` **calculate_tangents** + ++-----------+-------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------+ +| *Setter* | set_calculate_tangents(value) | ++-----------+-------------------------------+ +| *Getter* | is_calculating_tangents() | ++-----------+-------------------------------+ + +Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child. + +---- + +.. _class_CSGShape_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layers this area is in. + +Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. + +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CSGShape_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layers this CSG shape scans for collisions. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_CSGShape_property_operation: + +- :ref:`Operation` **operation** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_operation(value) | ++-----------+----------------------+ +| *Getter* | get_operation() | ++-----------+----------------------+ + +The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent. + +---- + +.. _class_CSGShape_property_snap: + +- :ref:`float` **snap** + ++-----------+-----------------+ +| *Default* | ``0.001`` | ++-----------+-----------------+ +| *Setter* | set_snap(value) | ++-----------+-----------------+ +| *Getter* | get_snap() | ++-----------+-----------------+ + +Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust. + +---- + +.. _class_CSGShape_property_use_collision: + +- :ref:`bool` **use_collision** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_use_collision(value) | ++-----------+--------------------------+ +| *Getter* | is_using_collision() | ++-----------+--------------------------+ + +Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden. + +Method Descriptions +------------------- + +.. _class_CSGShape_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the collision mask. + +---- + +.. _class_CSGShape_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the collision mask. + +---- + +.. _class_CSGShape_method_get_meshes: + +- :ref:`Array` **get_meshes** **(** **)** |const| + +Returns an :ref:`Array` with two elements, the first is the :ref:`Transform` of this node and the second is the root :ref:`Mesh` of this node. Only works when this node is the root shape. + +---- + +.. _class_CSGShape_method_is_root_shape: + +- :ref:`bool` **is_root_shape** **(** **)** |const| + +Returns ``true`` if this is a root shape and is thus the object that is rendered. + +---- + +.. _class_CSGShape_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets individual bits on the layer mask. Use this if you only need to change one layer's value. + +---- + +.. _class_CSGShape_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets individual bits on the collision mask. Use this if you only need to change one layer's value. + +.. |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.)` diff --git a/classes/class_csgsphere.rst b/classes/class_csgsphere.rst new file mode 100644 index 0000000..522a50f --- /dev/null +++ b/classes/class_csgsphere.rst @@ -0,0 +1,124 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGSphere.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGSphere: + +CSGSphere +========= + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG Sphere shape. + +Description +----------- + +This node allows you to create a sphere for use with the CSG system. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++---------------------------------+------------------------------------------------------------------+----------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`radial_segments` | ``12`` | ++---------------------------------+------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------------+------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`rings` | ``6`` | ++---------------------------------+------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`smooth_faces` | ``true`` | ++---------------------------------+------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_CSGSphere_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The material used to render the sphere. + +---- + +.. _class_CSGSphere_property_radial_segments: + +- :ref:`int` **radial_segments** + ++-----------+----------------------------+ +| *Default* | ``12`` | ++-----------+----------------------------+ +| *Setter* | set_radial_segments(value) | ++-----------+----------------------------+ +| *Getter* | get_radial_segments() | ++-----------+----------------------------+ + +Number of vertical slices for the sphere. + +---- + +.. _class_CSGSphere_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +Radius of the sphere. + +---- + +.. _class_CSGSphere_property_rings: + +- :ref:`int` **rings** + ++-----------+------------------+ +| *Default* | ``6`` | ++-----------+------------------+ +| *Setter* | set_rings(value) | ++-----------+------------------+ +| *Getter* | get_rings() | ++-----------+------------------+ + +Number of horizontal slices for the sphere. + +---- + +.. _class_CSGSphere_property_smooth_faces: + +- :ref:`bool` **smooth_faces** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_smooth_faces(value) | ++-----------+-------------------------+ +| *Getter* | get_smooth_faces() | ++-----------+-------------------------+ + +If ``true`` the normals of the sphere are set to give a smooth effect making the sphere seem rounded. If ``false`` the sphere will have a flat shaded look. + +.. |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.)` diff --git a/classes/class_csgtorus.rst b/classes/class_csgtorus.rst new file mode 100644 index 0000000..e7ffb06 --- /dev/null +++ b/classes/class_csgtorus.rst @@ -0,0 +1,142 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSGTorus.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSGTorus: + +CSGTorus +======== + +**Inherits:** :ref:`CSGPrimitive` **<** :ref:`CSGShape` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A CSG Torus shape. + +Description +----------- + +This node allows you to create a torus for use with the CSG system. + +**Note:** CSG nodes are intended to be used for level prototyping. Creating CSG nodes has a significant CPU cost compared to creating a :ref:`MeshInstance` with a :ref:`PrimitiveMesh`. Moving a CSG node within another CSG node also has a significant CPU cost, so it should be avoided during gameplay. + +Tutorials +--------- + +- `Prototyping levels with CSG <$DOCS_URL/tutorials/3d/csg_tools.html>`__ + +Properties +---------- + ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`float` | :ref:`inner_radius` | ``2.0`` | ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`float` | :ref:`outer_radius` | ``3.0`` | ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`int` | :ref:`ring_sides` | ``6`` | ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`int` | :ref:`sides` | ``8`` | ++---------------------------------+-----------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`smooth_faces` | ``true`` | ++---------------------------------+-----------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_CSGTorus_property_inner_radius: + +- :ref:`float` **inner_radius** + ++-----------+-------------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------------+ +| *Setter* | set_inner_radius(value) | ++-----------+-------------------------+ +| *Getter* | get_inner_radius() | ++-----------+-------------------------+ + +The inner radius of the torus. + +---- + +.. _class_CSGTorus_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The material used to render the torus. + +---- + +.. _class_CSGTorus_property_outer_radius: + +- :ref:`float` **outer_radius** + ++-----------+-------------------------+ +| *Default* | ``3.0`` | ++-----------+-------------------------+ +| *Setter* | set_outer_radius(value) | ++-----------+-------------------------+ +| *Getter* | get_outer_radius() | ++-----------+-------------------------+ + +The outer radius of the torus. + +---- + +.. _class_CSGTorus_property_ring_sides: + +- :ref:`int` **ring_sides** + ++-----------+-----------------------+ +| *Default* | ``6`` | ++-----------+-----------------------+ +| *Setter* | set_ring_sides(value) | ++-----------+-----------------------+ +| *Getter* | get_ring_sides() | ++-----------+-----------------------+ + +The number of edges each ring of the torus is constructed of. + +---- + +.. _class_CSGTorus_property_sides: + +- :ref:`int` **sides** + ++-----------+------------------+ +| *Default* | ``8`` | ++-----------+------------------+ +| *Setter* | set_sides(value) | ++-----------+------------------+ +| *Getter* | get_sides() | ++-----------+------------------+ + +The number of slices the torus is constructed of. + +---- + +.. _class_CSGTorus_property_smooth_faces: + +- :ref:`bool` **smooth_faces** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_smooth_faces(value) | ++-----------+-------------------------+ +| *Getter* | get_smooth_faces() | ++-----------+-------------------------+ + +If ``true`` the normals of the torus are set to give a smooth effect making the torus seem rounded. If ``false`` the torus will have a flat shaded look. + +.. |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.)` diff --git a/classes/class_csharpscript.rst b/classes/class_csharpscript.rst new file mode 100644 index 0000000..7017ab7 --- /dev/null +++ b/classes/class_csharpscript.rst @@ -0,0 +1,46 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CSharpScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CSharpScript: + +CSharpScript +============ + +**Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A script implemented in the C# programming language (Mono-enabled builds only). + +Description +----------- + +This class represents a C# script. It is the C# equivalent of the :ref:`GDScript` class and is only available in Mono-enabled Godot builds. + +See also :ref:`GodotSharp`. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/c_sharp/index` + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`new` **(** ... **)** |vararg| | ++-------------------------------+--------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_CSharpScript_method_new: + +- :ref:`Variant` **new** **(** ... **)** |vararg| + +Returns a new instance of the script. + +.. |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.)` diff --git a/classes/class_cubemap.rst b/classes/class_cubemap.rst new file mode 100644 index 0000000..ee83da0 --- /dev/null +++ b/classes/class_cubemap.rst @@ -0,0 +1,200 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CubeMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CubeMap: + +CubeMap +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A CubeMap is a 6-sided 3D texture. + +Description +----------- + +A 6-sided 3D texture typically used for faking reflections. It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods. + +Properties +---------- + ++--------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`flags` | ``7`` | ++--------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`lossy_storage_quality` | ``0.7`` | ++--------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`Storage` | :ref:`storage_mode` | ``0`` | ++--------------------------------------+----------------------------------------------------------------------------+---------+ + +Methods +------- + ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_height` **(** **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_side` **(** :ref:`Side` side **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_width` **(** **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_side` **(** :ref:`Side` side, :ref:`Image` image **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_CubeMap_Storage: + +.. _class_CubeMap_constant_STORAGE_RAW: + +.. _class_CubeMap_constant_STORAGE_COMPRESS_LOSSY: + +.. _class_CubeMap_constant_STORAGE_COMPRESS_LOSSLESS: + +enum **Storage**: + +- **STORAGE_RAW** = **0** --- Store the ``CubeMap`` without any compression. + +- **STORAGE_COMPRESS_LOSSY** = **1** --- Store the ``CubeMap`` with strong compression that reduces image quality. + +- **STORAGE_COMPRESS_LOSSLESS** = **2** --- Store the ``CubeMap`` with moderate compression that doesn't reduce image quality. + +---- + +.. _enum_CubeMap_Side: + +.. _class_CubeMap_constant_SIDE_LEFT: + +.. _class_CubeMap_constant_SIDE_RIGHT: + +.. _class_CubeMap_constant_SIDE_BOTTOM: + +.. _class_CubeMap_constant_SIDE_TOP: + +.. _class_CubeMap_constant_SIDE_FRONT: + +.. _class_CubeMap_constant_SIDE_BACK: + +enum **Side**: + +- **SIDE_LEFT** = **0** --- Identifier for the left face of the ``CubeMap``. + +- **SIDE_RIGHT** = **1** --- Identifier for the right face of the ``CubeMap``. + +- **SIDE_BOTTOM** = **2** --- Identifier for the bottom face of the ``CubeMap``. + +- **SIDE_TOP** = **3** --- Identifier for the top face of the ``CubeMap``. + +- **SIDE_FRONT** = **4** --- Identifier for the front face of the ``CubeMap``. + +- **SIDE_BACK** = **5** --- Identifier for the back face of the ``CubeMap``. + +---- + +.. _enum_CubeMap_Flags: + +.. _class_CubeMap_constant_FLAG_MIPMAPS: + +.. _class_CubeMap_constant_FLAG_REPEAT: + +.. _class_CubeMap_constant_FLAG_FILTER: + +.. _class_CubeMap_constant_FLAGS_DEFAULT: + +enum **Flags**: + +- **FLAG_MIPMAPS** = **1** --- Generate mipmaps, to enable smooth zooming out of the texture. + +- **FLAG_REPEAT** = **2** --- Repeat (instead of clamp to edge). + +- **FLAG_FILTER** = **4** --- Turn on magnifying filter, to enable smooth zooming in of the texture. + +- **FLAGS_DEFAULT** = **7** --- Default flags. Generate mipmaps, repeat, and filter are enabled. + +Property Descriptions +--------------------- + +.. _class_CubeMap_property_flags: + +- :ref:`int` **flags** + ++-----------+------------------+ +| *Default* | ``7`` | ++-----------+------------------+ +| *Setter* | set_flags(value) | ++-----------+------------------+ +| *Getter* | get_flags() | ++-----------+------------------+ + +The render flags for the ``CubeMap``. See the :ref:`Flags` constants for details. + +---- + +.. _class_CubeMap_property_lossy_storage_quality: + +- :ref:`float` **lossy_storage_quality** + ++-----------+----------------------------------+ +| *Default* | ``0.7`` | ++-----------+----------------------------------+ +| *Setter* | set_lossy_storage_quality(value) | ++-----------+----------------------------------+ +| *Getter* | get_lossy_storage_quality() | ++-----------+----------------------------------+ + +The lossy storage quality of the ``CubeMap`` if the storage mode is set to :ref:`STORAGE_COMPRESS_LOSSY`. + +---- + +.. _class_CubeMap_property_storage_mode: + +- :ref:`Storage` **storage_mode** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_storage(value) | ++-----------+--------------------+ +| *Getter* | get_storage() | ++-----------+--------------------+ + +The ``CubeMap``'s storage mode. See :ref:`Storage` constants. + +Method Descriptions +------------------- + +.. _class_CubeMap_method_get_height: + +- :ref:`int` **get_height** **(** **)** |const| + +Returns the ``CubeMap``'s height. + +---- + +.. _class_CubeMap_method_get_side: + +- :ref:`Image` **get_side** **(** :ref:`Side` side **)** |const| + +Returns an :ref:`Image` for a side of the ``CubeMap`` using one of the :ref:`Side` constants. + +---- + +.. _class_CubeMap_method_get_width: + +- :ref:`int` **get_width** **(** **)** |const| + +Returns the ``CubeMap``'s width. + +---- + +.. _class_CubeMap_method_set_side: + +- void **set_side** **(** :ref:`Side` side, :ref:`Image` image **)** + +Sets an :ref:`Image` for a side of the ``CubeMap`` using one of the :ref:`Side` 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.)` diff --git a/classes/class_cubemesh.rst b/classes/class_cubemesh.rst new file mode 100644 index 0000000..6f5e6d2 --- /dev/null +++ b/classes/class_cubemesh.rst @@ -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 CubeMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CubeMesh: + +CubeMesh +======== + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Generate an axis-aligned cuboid :ref:`PrimitiveMesh`. + +Description +----------- + +Generate an axis-aligned cuboid :ref:`PrimitiveMesh`. + +The cube's UV layout is arranged in a 3×2 layout that allows texturing each face individually. To apply the same texture on all faces, change the material's UV property to ``Vector3(3, 2, 1)``. + +**Note:** When using a large textured ``CubeMesh`` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth`, :ref:`subdivide_height` and :ref:`subdivide_width` until you no longer notice UV jittering. + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`size` | ``Vector3( 2, 2, 2 )`` | ++-------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_depth` | ``0`` | ++-------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_height` | ``0`` | ++-------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_width` | ``0`` | ++-------------------------------+-------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_CubeMesh_property_size: + +- :ref:`Vector3` **size** + ++-----------+------------------------+ +| *Default* | ``Vector3( 2, 2, 2 )`` | ++-----------+------------------------+ +| *Setter* | set_size(value) | ++-----------+------------------------+ +| *Getter* | get_size() | ++-----------+------------------------+ + +Size of the cuboid mesh. + +---- + +.. _class_CubeMesh_property_subdivide_depth: + +- :ref:`int` **subdivide_depth** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_depth(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_depth() | ++-----------+----------------------------+ + +Number of extra edge loops inserted along the Z axis. + +---- + +.. _class_CubeMesh_property_subdivide_height: + +- :ref:`int` **subdivide_height** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_subdivide_height(value) | ++-----------+-----------------------------+ +| *Getter* | get_subdivide_height() | ++-----------+-----------------------------+ + +Number of extra edge loops inserted along the Y axis. + +---- + +.. _class_CubeMesh_property_subdivide_width: + +- :ref:`int` **subdivide_width** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_width(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_width() | ++-----------+----------------------------+ + +Number of extra edge loops inserted along the X 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.)` diff --git a/classes/class_cullinstance.rst b/classes/class_cullinstance.rst new file mode 100644 index 0000000..1d26e52 --- /dev/null +++ b/classes/class_cullinstance.rst @@ -0,0 +1,130 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CullInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CullInstance: + +CullInstance +============ + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`VisibilityNotifier`, :ref:`VisualInstance` + +Parent of all nodes that can be culled by the Portal system. + +Description +----------- + +Provides common functionality to nodes that can be culled by the :ref:`Portal` system. + +``Static`` and ``Dynamic`` objects are the most efficiently managed objects in the system, but there are some caveats. They are expected to be present initially when :ref:`Room`\ s are converted using the :ref:`RoomManager` ``rooms_convert`` function, and their lifetime should be the same as the game level (i.e. present until you call ``rooms_clear`` on the :ref:`RoomManager`. Although you shouldn't create / delete these objects during gameplay, you can manage their visibility with the standard ``hide`` and ``show`` commands. + +``Roaming`` objects on the other hand, require extra processing to keep track of which :ref:`Room` they are within. This enables them to be culled effectively, wherever they are. + +``Global`` objects are not culled by the portal system, and use view frustum culling only. + +Objects that are not ``Static`` or ``Dynamic`` can be freely created and deleted during the lifetime of the game level. + +Properties +---------- + ++-------------------------------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`autoplace_priority` | ``0`` | ++-------------------------------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`include_in_bound` | ``true`` | ++-------------------------------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`PortalMode` | :ref:`portal_mode` | ``0`` | ++-------------------------------------------------+---------------------------------------------------------------------------+----------+ + +Enumerations +------------ + +.. _enum_CullInstance_PortalMode: + +.. _class_CullInstance_constant_PORTAL_MODE_STATIC: + +.. _class_CullInstance_constant_PORTAL_MODE_DYNAMIC: + +.. _class_CullInstance_constant_PORTAL_MODE_ROAMING: + +.. _class_CullInstance_constant_PORTAL_MODE_GLOBAL: + +.. _class_CullInstance_constant_PORTAL_MODE_IGNORE: + +enum **PortalMode**: + +- **PORTAL_MODE_STATIC** = **0** --- Use for instances within :ref:`Room`\ s that will **not move** - e.g. walls, floors. + +**Note:** If you attempt to delete a ``PORTAL_MODE_STATIC`` instance while the room graph is loaded (converted), it will unload the room graph and deactivate portal culling. This is because the **room graph** data has been invalidated. You will need to reconvert the rooms using the :ref:`RoomManager` to activate the system again. + +- **PORTAL_MODE_DYNAMIC** = **1** --- Use for instances within rooms that will move but **not change room** - e.g. moving platforms. + +**Note:** If you attempt to delete a ``PORTAL_MODE_DYNAMIC`` instance while the room graph is loaded (converted), it will unload the room graph and deactivate portal culling. This is because the **room graph** data has been invalidated. You will need to reconvert the rooms using the :ref:`RoomManager` to activate the system again. + +- **PORTAL_MODE_ROAMING** = **2** --- Use for instances that will move **between** :ref:`Room`\ s - e.g. players. + +- **PORTAL_MODE_GLOBAL** = **3** --- Use for instances that will be frustum culled only - e.g. first person weapon, debug. + +- **PORTAL_MODE_IGNORE** = **4** --- Use for instances that will not be shown at all - e.g. **manual room bounds** (specified by prefix *'Bound\_'*). + +Property Descriptions +--------------------- + +.. _class_CullInstance_property_autoplace_priority: + +- :ref:`int` **autoplace_priority** + ++-----------+--------------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------------+ +| *Setter* | set_portal_autoplace_priority(value) | ++-----------+--------------------------------------+ +| *Getter* | get_portal_autoplace_priority() | ++-----------+--------------------------------------+ + +When set to ``0``, ``CullInstance``\ s will be autoplaced in the :ref:`Room` with the highest priority. + +When set to a value other than ``0``, the system will attempt to autoplace in a :ref:`Room` with the ``autoplace_priority``, if it is present. + +This can be used to control autoplacement of building exteriors in an outer :ref:`RoomGroup`. + +---- + +.. _class_CullInstance_property_include_in_bound: + +- :ref:`bool` **include_in_bound** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_include_in_bound(value) | ++-----------+-----------------------------+ +| *Getter* | get_include_in_bound() | ++-----------+-----------------------------+ + +When a manual bound has not been explicitly specified for a :ref:`Room`, the convex hull bound will be estimated from the geometry of the objects within the room. This setting determines whether the geometry of an object is included in this estimate of the room bound. + +**Note:** This setting is only relevant when the object is set to ``PORTAL_MODE_STATIC`` or ``PORTAL_MODE_DYNAMIC``, and for :ref:`Portal`\ s. + +---- + +.. _class_CullInstance_property_portal_mode: + +- :ref:`PortalMode` **portal_mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_portal_mode(value) | ++-----------+------------------------+ +| *Getter* | get_portal_mode() | ++-----------+------------------------+ + +When using :ref:`Room`\ s and :ref:`Portal`\ s, this specifies how the ``CullInstance`` is processed in the system. + +.. |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.)` diff --git a/classes/class_curve.rst b/classes/class_curve.rst new file mode 100644 index 0000000..98d1111 --- /dev/null +++ b/classes/class_curve.rst @@ -0,0 +1,307 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Curve.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Curve: + +Curve +===== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A mathematic curve. + +Description +----------- + +A curve that can be saved and re-used for other objects. By default, it ranges between ``0`` and ``1`` on the Y axis and positions points relative to the ``0.5`` Y position. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`bake_resolution` | ``100`` | ++---------------------------+--------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`max_value` | ``1.0`` | ++---------------------------+--------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`min_value` | ``0.0`` | ++---------------------------+--------------------------------------------------------------+---------+ + +Methods +------- + ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_point` **(** :ref:`Vector2` position, :ref:`float` left_tangent=0, :ref:`float` right_tangent=0, :ref:`TangentMode` left_mode=0, :ref:`TangentMode` right_mode=0 **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bake` **(** **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clean_dupes` **(** **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_points` **(** **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TangentMode` | :ref:`get_point_left_mode` **(** :ref:`int` index **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_left_tangent` **(** :ref:`int` index **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` index **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TangentMode` | :ref:`get_point_right_mode` **(** :ref:`int` index **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_right_tangent` **(** :ref:`int` index **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`interpolate` **(** :ref:`float` offset **)** |const| | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`interpolate_baked` **(** :ref:`float` offset **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` index **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_left_mode` **(** :ref:`int` index, :ref:`TangentMode` mode **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_left_tangent` **(** :ref:`int` index, :ref:`float` tangent **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`set_point_offset` **(** :ref:`int` index, :ref:`float` offset **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_right_mode` **(** :ref:`int` index, :ref:`TangentMode` mode **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_right_tangent` **(** :ref:`int` index, :ref:`float` tangent **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_value` **(** :ref:`int` index, :ref:`float` y **)** | ++--------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Curve_signal_range_changed: + +- **range_changed** **(** **)** + +Emitted when :ref:`max_value` or :ref:`min_value` is changed. + +Enumerations +------------ + +.. _enum_Curve_TangentMode: + +.. _class_Curve_constant_TANGENT_FREE: + +.. _class_Curve_constant_TANGENT_LINEAR: + +.. _class_Curve_constant_TANGENT_MODE_COUNT: + +enum **TangentMode**: + +- **TANGENT_FREE** = **0** --- The tangent on this side of the point is user-defined. + +- **TANGENT_LINEAR** = **1** --- The curve calculates the tangent on this side of the point as the slope halfway towards the adjacent point. + +- **TANGENT_MODE_COUNT** = **2** --- The total number of available tangent modes. + +Property Descriptions +--------------------- + +.. _class_Curve_property_bake_resolution: + +- :ref:`int` **bake_resolution** + ++-----------+----------------------------+ +| *Default* | ``100`` | ++-----------+----------------------------+ +| *Setter* | set_bake_resolution(value) | ++-----------+----------------------------+ +| *Getter* | get_bake_resolution() | ++-----------+----------------------------+ + +The number of points to include in the baked (i.e. cached) curve data. + +---- + +.. _class_Curve_property_max_value: + +- :ref:`float` **max_value** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_max_value(value) | ++-----------+----------------------+ +| *Getter* | get_max_value() | ++-----------+----------------------+ + +The maximum value the curve can reach. + +---- + +.. _class_Curve_property_min_value: + +- :ref:`float` **min_value** + ++-----------+----------------------+ +| *Default* | ``0.0`` | ++-----------+----------------------+ +| *Setter* | set_min_value(value) | ++-----------+----------------------+ +| *Getter* | get_min_value() | ++-----------+----------------------+ + +The minimum value the curve can reach. + +Method Descriptions +------------------- + +.. _class_Curve_method_add_point: + +- :ref:`int` **add_point** **(** :ref:`Vector2` position, :ref:`float` left_tangent=0, :ref:`float` right_tangent=0, :ref:`TangentMode` left_mode=0, :ref:`TangentMode` right_mode=0 **)** + +Adds a point to the curve. For each side, if the ``*_mode`` is :ref:`TANGENT_LINEAR`, the ``*_tangent`` angle (in degrees) uses the slope of the curve halfway to the adjacent point. Allows custom assignments to the ``*_tangent`` angle if ``*_mode`` is set to :ref:`TANGENT_FREE`. + +---- + +.. _class_Curve_method_bake: + +- void **bake** **(** **)** + +Recomputes the baked cache of points for the curve. + +---- + +.. _class_Curve_method_clean_dupes: + +- void **clean_dupes** **(** **)** + +Removes points that are closer than ``CMP_EPSILON`` (0.00001) units to their neighbor on the curve. + +---- + +.. _class_Curve_method_clear_points: + +- void **clear_points** **(** **)** + +Removes all points from the curve. + +---- + +.. _class_Curve_method_get_point_count: + +- :ref:`int` **get_point_count** **(** **)** |const| + +Returns the number of points describing the curve. + +---- + +.. _class_Curve_method_get_point_left_mode: + +- :ref:`TangentMode` **get_point_left_mode** **(** :ref:`int` index **)** |const| + +Returns the left :ref:`TangentMode` for the point at ``index``. + +---- + +.. _class_Curve_method_get_point_left_tangent: + +- :ref:`float` **get_point_left_tangent** **(** :ref:`int` index **)** |const| + +Returns the left tangent angle (in degrees) for the point at ``index``. + +---- + +.. _class_Curve_method_get_point_position: + +- :ref:`Vector2` **get_point_position** **(** :ref:`int` index **)** |const| + +Returns the curve coordinates for the point at ``index``. + +---- + +.. _class_Curve_method_get_point_right_mode: + +- :ref:`TangentMode` **get_point_right_mode** **(** :ref:`int` index **)** |const| + +Returns the right :ref:`TangentMode` for the point at ``index``. + +---- + +.. _class_Curve_method_get_point_right_tangent: + +- :ref:`float` **get_point_right_tangent** **(** :ref:`int` index **)** |const| + +Returns the right tangent angle (in degrees) for the point at ``index``. + +---- + +.. _class_Curve_method_interpolate: + +- :ref:`float` **interpolate** **(** :ref:`float` offset **)** |const| + +Returns the Y value for the point that would exist at the X position ``offset`` along the curve. + +---- + +.. _class_Curve_method_interpolate_baked: + +- :ref:`float` **interpolate_baked** **(** :ref:`float` offset **)** + +Returns the Y value for the point that would exist at the X position ``offset`` along the curve using the baked cache. Bakes the curve's points if not already baked. + +---- + +.. _class_Curve_method_remove_point: + +- void **remove_point** **(** :ref:`int` index **)** + +Removes the point at ``index`` from the curve. + +---- + +.. _class_Curve_method_set_point_left_mode: + +- void **set_point_left_mode** **(** :ref:`int` index, :ref:`TangentMode` mode **)** + +Sets the left :ref:`TangentMode` for the point at ``index`` to ``mode``. + +---- + +.. _class_Curve_method_set_point_left_tangent: + +- void **set_point_left_tangent** **(** :ref:`int` index, :ref:`float` tangent **)** + +Sets the left tangent angle for the point at ``index`` to ``tangent``. + +---- + +.. _class_Curve_method_set_point_offset: + +- :ref:`int` **set_point_offset** **(** :ref:`int` index, :ref:`float` offset **)** + +Sets the offset from ``0.5``. + +---- + +.. _class_Curve_method_set_point_right_mode: + +- void **set_point_right_mode** **(** :ref:`int` index, :ref:`TangentMode` mode **)** + +Sets the right :ref:`TangentMode` for the point at ``index`` to ``mode``. + +---- + +.. _class_Curve_method_set_point_right_tangent: + +- void **set_point_right_tangent** **(** :ref:`int` index, :ref:`float` tangent **)** + +Sets the right tangent angle for the point at ``index`` to ``tangent``. + +---- + +.. _class_Curve_method_set_point_value: + +- void **set_point_value** **(** :ref:`int` index, :ref:`float` y **)** + +Assigns the vertical position ``y`` to the point at ``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.)` diff --git a/classes/class_curve2d.rst b/classes/class_curve2d.rst new file mode 100644 index 0000000..57ee8dd --- /dev/null +++ b/classes/class_curve2d.rst @@ -0,0 +1,253 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Curve2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Curve2D: + +Curve2D +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Describes a Bézier curve in 2D space. + +Description +----------- + +This class describes a Bézier curve in 2D space. It is mainly used to give a shape to a :ref:`Path2D`, but can be manually sampled for other purposes. + +It keeps a cache of precalculated points along the curve, to speed up further calculations. + +Properties +---------- + ++---------------------------+------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`bake_interval` | ``5.0`` | ++---------------------------+------------------------------------------------------------+---------+ + +Methods +------- + ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`Vector2` position, :ref:`Vector2` in=Vector2( 0, 0 ), :ref:`Vector2` out=Vector2( 0, 0 ), :ref:`int` at_position=-1 **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_points` **(** **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_baked_length` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_baked_points` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_closest_offset` **(** :ref:`Vector2` to_point **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point` **(** :ref:`Vector2` to_point **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_in` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_out` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`interpolate` **(** :ref:`int` idx, :ref:`float` t **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`interpolate_baked` **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`interpolatef` **(** :ref:`float` fofs **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` idx **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_in` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_out` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` idx, :ref:`Vector2` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`tessellate` **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Curve2D_property_bake_interval: + +- :ref:`float` **bake_interval** + ++-----------+--------------------------+ +| *Default* | ``5.0`` | ++-----------+--------------------------+ +| *Setter* | set_bake_interval(value) | ++-----------+--------------------------+ +| *Getter* | get_bake_interval() | ++-----------+--------------------------+ + +The distance in pixels between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points` or :ref:`get_baked_length` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. + +Method Descriptions +------------------- + +.. _class_Curve2D_method_add_point: + +- void **add_point** **(** :ref:`Vector2` position, :ref:`Vector2` in=Vector2( 0, 0 ), :ref:`Vector2` out=Vector2( 0, 0 ), :ref:`int` at_position=-1 **)** + +Adds a point to a curve at ``position``, with control points ``in`` and ``out``. + +If ``at_position`` is given, the point is inserted before the point number ``at_position``, moving that point (and every point after) after the inserted point. If ``at_position`` is not given, or is an illegal value (``at_position <0`` or ``at_position >= [method get_point_count]``), the point will be appended at the end of the point list. + +---- + +.. _class_Curve2D_method_clear_points: + +- void **clear_points** **(** **)** + +Removes all points from the curve. + +---- + +.. _class_Curve2D_method_get_baked_length: + +- :ref:`float` **get_baked_length** **(** **)** |const| + +Returns the total length of the curve, based on the cached points. Given enough density (see :ref:`bake_interval`), it should be approximate enough. + +---- + +.. _class_Curve2D_method_get_baked_points: + +- :ref:`PoolVector2Array` **get_baked_points** **(** **)** |const| + +Returns the cache of points as a :ref:`PoolVector2Array`. + +---- + +.. _class_Curve2D_method_get_closest_offset: + +- :ref:`float` **get_closest_offset** **(** :ref:`Vector2` to_point **)** |const| + +Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`interpolate_baked`. + +``to_point`` must be in this curve's local space. + +---- + +.. _class_Curve2D_method_get_closest_point: + +- :ref:`Vector2` **get_closest_point** **(** :ref:`Vector2` to_point **)** |const| + +Returns the closest baked point (in curve's local space) to ``to_point``. + +``to_point`` must be in this curve's local space. + +---- + +.. _class_Curve2D_method_get_point_count: + +- :ref:`int` **get_point_count** **(** **)** |const| + +Returns the number of points describing the curve. + +---- + +.. _class_Curve2D_method_get_point_in: + +- :ref:`Vector2` **get_point_in** **(** :ref:`int` idx **)** |const| + +Returns the position of the control point leading to the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. + +---- + +.. _class_Curve2D_method_get_point_out: + +- :ref:`Vector2` **get_point_out** **(** :ref:`int` idx **)** |const| + +Returns the position of the control point leading out of the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. + +---- + +.. _class_Curve2D_method_get_point_position: + +- :ref:`Vector2` **get_point_position** **(** :ref:`int` idx **)** |const| + +Returns the position of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0)``. + +---- + +.. _class_Curve2D_method_interpolate: + +- :ref:`Vector2` **interpolate** **(** :ref:`int` idx, :ref:`float` t **)** |const| + +Returns the position between the vertex ``idx`` and the vertex ``idx + 1``, where ``t`` controls if the point is the first vertex (``t = 0.0``), the last vertex (``t = 1.0``), or in between. Values of ``t`` outside the range (``0.0 >= t <=1``) give strange, but predictable results. + +If ``idx`` is out of bounds it is truncated to the first or last vertex, and ``t`` is ignored. If the curve has no points, the function sends an error to the console, and returns ``(0, 0)``. + +---- + +.. _class_Curve2D_method_interpolate_baked: + +- :ref:`Vector2` **interpolate_baked** **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| + +Returns a point within the curve at position ``offset``, where ``offset`` is measured as a pixel distance along the curve. + +To do that, it finds the two cached points where the ``offset`` lies between, then interpolates the values. This interpolation is cubic if ``cubic`` is set to ``true``, or linear if set to ``false``. + +Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + +---- + +.. _class_Curve2D_method_interpolatef: + +- :ref:`Vector2` **interpolatef** **(** :ref:`float` fofs **)** |const| + +Returns the position at the vertex ``fofs``. It calls :ref:`interpolate` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. + +---- + +.. _class_Curve2D_method_remove_point: + +- void **remove_point** **(** :ref:`int` idx **)** + +Deletes the point ``idx`` from the curve. Sends an error to the console if ``idx`` is out of bounds. + +---- + +.. _class_Curve2D_method_set_point_in: + +- void **set_point_in** **(** :ref:`int` idx, :ref:`Vector2` position **)** + +Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + +---- + +.. _class_Curve2D_method_set_point_out: + +- void **set_point_out** **(** :ref:`int` idx, :ref:`Vector2` position **)** + +Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + +---- + +.. _class_Curve2D_method_set_point_position: + +- void **set_point_position** **(** :ref:`int` idx, :ref:`Vector2` position **)** + +Sets the position for the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. + +---- + +.. _class_Curve2D_method_tessellate: + +- :ref:`PoolVector2Array` **tessellate** **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| + +Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. + +This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. + +``max_stages`` controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! + +``tolerance_degrees`` controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. + +.. |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.)` diff --git a/classes/class_curve3d.rst b/classes/class_curve3d.rst new file mode 100644 index 0000000..7847790 --- /dev/null +++ b/classes/class_curve3d.rst @@ -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 Curve3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Curve3D: + +Curve3D +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Describes a Bézier curve in 3D space. + +Description +----------- + +This class describes a Bézier curve in 3D space. It is mainly used to give a shape to a :ref:`Path`, but can be manually sampled for other purposes. + +It keeps a cache of precalculated points along the curve, to speed up further calculations. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`bake_interval` | ``0.2`` | ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`up_vector_enabled` | ``true`` | ++---------------------------+--------------------------------------------------------------------+----------+ + +Methods +------- + ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`Vector3` position, :ref:`Vector3` in=Vector3( 0, 0, 0 ), :ref:`Vector3` out=Vector3( 0, 0, 0 ), :ref:`int` at_position=-1 **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_points` **(** **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_baked_length` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_baked_points` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`get_baked_tilts` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_baked_up_vectors` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_closest_offset` **(** :ref:`Vector3` to_point **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point` **(** :ref:`Vector3` to_point **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_in` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_out` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_position` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_tilt` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`interpolate` **(** :ref:`int` idx, :ref:`float` t **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`interpolate_baked` **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`interpolate_baked_up_vector` **(** :ref:`float` offset, :ref:`bool` apply_tilt=false **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`interpolatef` **(** :ref:`float` fofs **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` idx **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_in` **(** :ref:`int` idx, :ref:`Vector3` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_out` **(** :ref:`int` idx, :ref:`Vector3` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` idx, :ref:`Vector3` position **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_tilt` **(** :ref:`int` idx, :ref:`float` tilt **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`tessellate` **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Curve3D_property_bake_interval: + +- :ref:`float` **bake_interval** + ++-----------+--------------------------+ +| *Default* | ``0.2`` | ++-----------+--------------------------+ +| *Setter* | set_bake_interval(value) | ++-----------+--------------------------+ +| *Getter* | get_bake_interval() | ++-----------+--------------------------+ + +The distance in meters between two adjacent cached points. Changing it forces the cache to be recomputed the next time the :ref:`get_baked_points` or :ref:`get_baked_length` function is called. The smaller the distance, the more points in the cache and the more memory it will consume, so use with care. + +---- + +.. _class_Curve3D_property_up_vector_enabled: + +- :ref:`bool` **up_vector_enabled** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_up_vector_enabled(value) | ++-----------+------------------------------+ +| *Getter* | is_up_vector_enabled() | ++-----------+------------------------------+ + +If ``true``, the curve will bake up vectors used for orientation. This is used when :ref:`PathFollow.rotation_mode` is set to :ref:`PathFollow.ROTATION_ORIENTED`. Changing it forces the cache to be recomputed. + +Method Descriptions +------------------- + +.. _class_Curve3D_method_add_point: + +- void **add_point** **(** :ref:`Vector3` position, :ref:`Vector3` in=Vector3( 0, 0, 0 ), :ref:`Vector3` out=Vector3( 0, 0, 0 ), :ref:`int` at_position=-1 **)** + +Adds a point to a curve at ``position``, with control points ``in`` and ``out``. + +If ``at_position`` is given, the point is inserted before the point number ``at_position``, moving that point (and every point after) after the inserted point. If ``at_position`` is not given, or is an illegal value (``at_position <0`` or ``at_position >= [method get_point_count]``), the point will be appended at the end of the point list. + +---- + +.. _class_Curve3D_method_clear_points: + +- void **clear_points** **(** **)** + +Removes all points from the curve. + +---- + +.. _class_Curve3D_method_get_baked_length: + +- :ref:`float` **get_baked_length** **(** **)** |const| + +Returns the total length of the curve, based on the cached points. Given enough density (see :ref:`bake_interval`), it should be approximate enough. + +---- + +.. _class_Curve3D_method_get_baked_points: + +- :ref:`PoolVector3Array` **get_baked_points** **(** **)** |const| + +Returns the cache of points as a :ref:`PoolVector3Array`. + +---- + +.. _class_Curve3D_method_get_baked_tilts: + +- :ref:`PoolRealArray` **get_baked_tilts** **(** **)** |const| + +Returns the cache of tilts as a :ref:`PoolRealArray`. + +---- + +.. _class_Curve3D_method_get_baked_up_vectors: + +- :ref:`PoolVector3Array` **get_baked_up_vectors** **(** **)** |const| + +Returns the cache of up vectors as a :ref:`PoolVector3Array`. + +If :ref:`up_vector_enabled` is ``false``, the cache will be empty. + +---- + +.. _class_Curve3D_method_get_closest_offset: + +- :ref:`float` **get_closest_offset** **(** :ref:`Vector3` to_point **)** |const| + +Returns the closest offset to ``to_point``. This offset is meant to be used in :ref:`interpolate_baked` or :ref:`interpolate_baked_up_vector`. + +``to_point`` must be in this curve's local space. + +---- + +.. _class_Curve3D_method_get_closest_point: + +- :ref:`Vector3` **get_closest_point** **(** :ref:`Vector3` to_point **)** |const| + +Returns the closest baked point (in curve's local space) to ``to_point``. + +``to_point`` must be in this curve's local space. + +---- + +.. _class_Curve3D_method_get_point_count: + +- :ref:`int` **get_point_count** **(** **)** |const| + +Returns the number of points describing the curve. + +---- + +.. _class_Curve3D_method_get_point_in: + +- :ref:`Vector3` **get_point_in** **(** :ref:`int` idx **)** |const| + +Returns the position of the control point leading to the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. + +---- + +.. _class_Curve3D_method_get_point_out: + +- :ref:`Vector3` **get_point_out** **(** :ref:`int` idx **)** |const| + +Returns the position of the control point leading out of the vertex ``idx``. The returned position is relative to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. + +---- + +.. _class_Curve3D_method_get_point_position: + +- :ref:`Vector3` **get_point_position** **(** :ref:`int` idx **)** |const| + +Returns the position of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``(0, 0, 0)``. + +---- + +.. _class_Curve3D_method_get_point_tilt: + +- :ref:`float` **get_point_tilt** **(** :ref:`int` idx **)** |const| + +Returns the tilt angle in radians for the point ``idx``. If the index is out of bounds, the function sends an error to the console, and returns ``0``. + +---- + +.. _class_Curve3D_method_interpolate: + +- :ref:`Vector3` **interpolate** **(** :ref:`int` idx, :ref:`float` t **)** |const| + +Returns the position between the vertex ``idx`` and the vertex ``idx + 1``, where ``t`` controls if the point is the first vertex (``t = 0.0``), the last vertex (``t = 1.0``), or in between. Values of ``t`` outside the range (``0.0 >= t <=1``) give strange, but predictable results. + +If ``idx`` is out of bounds it is truncated to the first or last vertex, and ``t`` is ignored. If the curve has no points, the function sends an error to the console, and returns ``(0, 0, 0)``. + +---- + +.. _class_Curve3D_method_interpolate_baked: + +- :ref:`Vector3` **interpolate_baked** **(** :ref:`float` offset, :ref:`bool` cubic=false **)** |const| + +Returns a point within the curve at position ``offset``, where ``offset`` is measured as a distance in 3D units along the curve. + +To do that, it finds the two cached points where the ``offset`` lies between, then interpolates the values. This interpolation is cubic if ``cubic`` is set to ``true``, or linear if set to ``false``. + +Cubic interpolation tends to follow the curves better, but linear is faster (and often, precise enough). + +---- + +.. _class_Curve3D_method_interpolate_baked_up_vector: + +- :ref:`Vector3` **interpolate_baked_up_vector** **(** :ref:`float` offset, :ref:`bool` apply_tilt=false **)** |const| + +Returns an up vector within the curve at position ``offset``, where ``offset`` is measured as a distance in 3D units along the curve. + +To do that, it finds the two cached up vectors where the ``offset`` lies between, then interpolates the values. If ``apply_tilt`` is ``true``, an interpolated tilt is applied to the interpolated up vector. + +If the curve has no up vectors, the function sends an error to the console, and returns ``(0, 1, 0)``. + +---- + +.. _class_Curve3D_method_interpolatef: + +- :ref:`Vector3` **interpolatef** **(** :ref:`float` fofs **)** |const| + +Returns the position at the vertex ``fofs``. It calls :ref:`interpolate` using the integer part of ``fofs`` as ``idx``, and its fractional part as ``t``. + +---- + +.. _class_Curve3D_method_remove_point: + +- void **remove_point** **(** :ref:`int` idx **)** + +Deletes the point ``idx`` from the curve. Sends an error to the console if ``idx`` is out of bounds. + +---- + +.. _class_Curve3D_method_set_point_in: + +- void **set_point_in** **(** :ref:`int` idx, :ref:`Vector3` position **)** + +Sets the position of the control point leading to the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + +---- + +.. _class_Curve3D_method_set_point_out: + +- void **set_point_out** **(** :ref:`int` idx, :ref:`Vector3` position **)** + +Sets the position of the control point leading out of the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. The position is relative to the vertex. + +---- + +.. _class_Curve3D_method_set_point_position: + +- void **set_point_position** **(** :ref:`int` idx, :ref:`Vector3` position **)** + +Sets the position for the vertex ``idx``. If the index is out of bounds, the function sends an error to the console. + +---- + +.. _class_Curve3D_method_set_point_tilt: + +- void **set_point_tilt** **(** :ref:`int` idx, :ref:`float` tilt **)** + +Sets the tilt angle in radians for the point ``idx``. If the index is out of bounds, the function sends an error to the console. + +The tilt controls the rotation along the look-at axis an object traveling the path would have. In the case of a curve controlling a :ref:`PathFollow`, this tilt is an offset over the natural tilt the :ref:`PathFollow` calculates. + +---- + +.. _class_Curve3D_method_tessellate: + +- :ref:`PoolVector3Array` **tessellate** **(** :ref:`int` max_stages=5, :ref:`float` tolerance_degrees=4 **)** |const| + +Returns a list of points along the curve, with a curvature controlled point density. That is, the curvier parts will have more points than the straighter parts. + +This approximation makes straight segments between each point, then subdivides those segments until the resulting shape is similar enough. + +``max_stages`` controls how many subdivisions a curve segment may face before it is considered approximate enough. Each subdivision splits the segment in half, so the default 5 stages may mean up to 32 subdivisions per curve segment. Increase with care! + +``tolerance_degrees`` controls how many degrees the midpoint of a segment may deviate from the real curve, before the segment has to be subdivided. + +.. |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.)` diff --git a/classes/class_curvetexture.rst b/classes/class_curvetexture.rst new file mode 100644 index 0000000..88ccab0 --- /dev/null +++ b/classes/class_curvetexture.rst @@ -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 CurveTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CurveTexture: + +CurveTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A texture that shows a curve. + +Description +----------- + +Renders a given :ref:`Curve` provided to it. Simplifies the task of drawing curves and/or saving them as image files. + +Properties +---------- + ++---------------------------+-------------------------------------------------+----------+ +| :ref:`Curve` | :ref:`curve` | | ++---------------------------+-------------------------------------------------+----------+ +| :ref:`int` | :ref:`width` | ``2048`` | ++---------------------------+-------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_CurveTexture_property_curve: + +- :ref:`Curve` **curve** + ++----------+------------------+ +| *Setter* | set_curve(value) | ++----------+------------------+ +| *Getter* | get_curve() | ++----------+------------------+ + +The ``curve`` rendered onto the texture. + +---- + +.. _class_CurveTexture_property_width: + +- :ref:`int` **width** + ++-----------+------------------+ +| *Default* | ``2048`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +The width of the texture. + +.. |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.)` diff --git a/classes/class_cylindermesh.rst b/classes/class_cylindermesh.rst new file mode 100644 index 0000000..2d5576a --- /dev/null +++ b/classes/class_cylindermesh.rst @@ -0,0 +1,119 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CylinderMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CylinderMesh: + +CylinderMesh +============ + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a cylindrical :ref:`PrimitiveMesh`. + +Description +----------- + +Class representing a cylindrical :ref:`PrimitiveMesh`. This class can be used to create cones by setting either the :ref:`top_radius` or :ref:`bottom_radius` properties to ``0.0``. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`bottom_radius` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`height` | ``2.0`` | ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`radial_segments` | ``64`` | ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`rings` | ``4`` | ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`top_radius` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_CylinderMesh_property_bottom_radius: + +- :ref:`float` **bottom_radius** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_bottom_radius(value) | ++-----------+--------------------------+ +| *Getter* | get_bottom_radius() | ++-----------+--------------------------+ + +Bottom radius of the cylinder. If set to ``0.0``, the bottom faces will not be generated, resulting in a conic shape. + +---- + +.. _class_CylinderMesh_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +Full height of the cylinder. + +---- + +.. _class_CylinderMesh_property_radial_segments: + +- :ref:`int` **radial_segments** + ++-----------+----------------------------+ +| *Default* | ``64`` | ++-----------+----------------------------+ +| *Setter* | set_radial_segments(value) | ++-----------+----------------------------+ +| *Getter* | get_radial_segments() | ++-----------+----------------------------+ + +Number of radial segments on the cylinder. Higher values result in a more detailed cylinder/cone at the cost of performance. + +---- + +.. _class_CylinderMesh_property_rings: + +- :ref:`int` **rings** + ++-----------+------------------+ +| *Default* | ``4`` | ++-----------+------------------+ +| *Setter* | set_rings(value) | ++-----------+------------------+ +| *Getter* | get_rings() | ++-----------+------------------+ + +Number of edge rings along the height of the cylinder. Changing :ref:`rings` does not have any visual impact unless a shader or procedural mesh tool is used to alter the vertex data. Higher values result in more subdivisions, which can be used to create smoother-looking effects with shaders or procedural mesh tools (at the cost of performance). When not altering the vertex data using a shader or procedural mesh tool, :ref:`rings` should be kept to its default value. + +---- + +.. _class_CylinderMesh_property_top_radius: + +- :ref:`float` **top_radius** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_top_radius(value) | ++-----------+-----------------------+ +| *Getter* | get_top_radius() | ++-----------+-----------------------+ + +Top radius of the cylinder. If set to ``0.0``, the top faces will not be generated, resulting in a conic shape. + +.. |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.)` diff --git a/classes/class_cylindershape.rst b/classes/class_cylindershape.rst new file mode 100644 index 0000000..61f2304 --- /dev/null +++ b/classes/class_cylindershape.rst @@ -0,0 +1,74 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the CylinderShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_CylinderShape: + +CylinderShape +============= + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Cylinder shape for collisions. + +Description +----------- + +Cylinder shape for collisions. + +Tutorials +--------- + +- `Third Person Shooter Demo `__ + +- `3D Physics Tests Demo `__ + +- `3D Voxel Demo `__ + +Properties +---------- + ++---------------------------+----------------------------------------------------+---------+ +| :ref:`float` | :ref:`height` | ``2.0`` | ++---------------------------+----------------------------------------------------+---------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+----------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_CylinderShape_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +The cylinder's height. + +---- + +.. _class_CylinderShape_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The cylinder's radius. + +.. |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.)` diff --git a/classes/class_dampedspringjoint2d.rst b/classes/class_dampedspringjoint2d.rst new file mode 100644 index 0000000..6bc65f7 --- /dev/null +++ b/classes/class_dampedspringjoint2d.rst @@ -0,0 +1,101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DampedSpringJoint2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DampedSpringJoint2D: + +DampedSpringJoint2D +=================== + +**Inherits:** :ref:`Joint2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Damped spring constraint for 2D physics. + +Description +----------- + +Damped spring constraint for 2D physics. This resembles a spring joint that always wants to go back to a given length. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`damping` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`length` | ``50.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`rest_length` | ``0.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`stiffness` | ``20.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_DampedSpringJoint2D_property_damping: + +- :ref:`float` **damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_damping(value) | ++-----------+--------------------+ +| *Getter* | get_damping() | ++-----------+--------------------+ + +The spring joint's damping ratio. A value between ``0`` and ``1``. When the two bodies move into different directions the system tries to align them to the spring axis again. A high ``damping`` value forces the attached bodies to align faster. + +---- + +.. _class_DampedSpringJoint2D_property_length: + +- :ref:`float` **length** + ++-----------+-------------------+ +| *Default* | ``50.0`` | ++-----------+-------------------+ +| *Setter* | set_length(value) | ++-----------+-------------------+ +| *Getter* | get_length() | ++-----------+-------------------+ + +The spring joint's maximum length. The two attached bodies cannot stretch it past this value. + +---- + +.. _class_DampedSpringJoint2D_property_rest_length: + +- :ref:`float` **rest_length** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_rest_length(value) | ++-----------+------------------------+ +| *Getter* | get_rest_length() | ++-----------+------------------------+ + +When the bodies attached to the spring joint move they stretch or squash it. The joint always tries to resize towards this length. + +---- + +.. _class_DampedSpringJoint2D_property_stiffness: + +- :ref:`float` **stiffness** + ++-----------+----------------------+ +| *Default* | ``20.0`` | ++-----------+----------------------+ +| *Setter* | set_stiffness(value) | ++-----------+----------------------+ +| *Getter* | get_stiffness() | ++-----------+----------------------+ + +The higher the value, the less the bodies attached to the joint will deform it. The joint applies an opposing force to the bodies, the product of the stiffness multiplied by the size difference from its resting length. + +.. |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.)` diff --git a/classes/class_dictionary.rst b/classes/class_dictionary.rst new file mode 100644 index 0000000..1d01309 --- /dev/null +++ b/classes/class_dictionary.rst @@ -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 Dictionary.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Dictionary: + +Dictionary +========== + +Dictionary type. + +Description +----------- + +Dictionary type. Associative container which contains values referenced by unique keys. Dictionaries are composed of pairs of keys (which must be unique) and values. Dictionaries will preserve the insertion order when adding elements, even though this may not be reflected when printing the dictionary. In other programming languages, this data structure is sometimes referred to as a hash map or associative array. + +You can define a dictionary by placing a comma-separated list of ``key: value`` pairs in curly braces ``{}``. + +Erasing elements while iterating over them **is not supported** and will result in undefined behavior. + +**Note:** Dictionaries are always passed by reference. To get a copy of a dictionary which can be modified independently of the original dictionary, use :ref:`duplicate`. + +Creating a dictionary: + +:: + + var my_dict = {} # Creates an empty dictionary. + + var dict_variable_key = "Another key name" + var dict_variable_value = "value2" + var another_dict = { + "Some key name": "value1", + dict_variable_key: dict_variable_value, + } + + var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} + + # Alternative Lua-style syntax. + # Doesn't require quotes around keys, but only string constants can be used as key names. + # Additionally, key names must start with a letter or an underscore. + # Here, `some_key` is a string literal, not a variable! + another_dict = { + some_key = 42, + } + +You can access a dictionary's values by referencing the appropriate key. In the above example, ``points_dict["White"]`` will return ``50``. You can also write ``points_dict.White``, which is equivalent. However, you'll have to use the bracket syntax if the key you're accessing the dictionary with isn't a fixed string (such as a number or variable). + +:: + + export(string, "White", "Yellow", "Orange") var my_color + var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} + func _ready(): + # We can't use dot syntax here as `my_color` is a variable. + var points = points_dict[my_color] + +In the above code, ``points`` will be assigned the value that is paired with the appropriate color selected in ``my_color``. + +Dictionaries can contain more complex data: + +:: + + my_dict = {"First Array": [1, 2, 3, 4]} # Assigns an Array to a String key. + +To add a key to an existing dictionary, access it like an existing key and assign to it: + +:: + + var points_dict = {"White": 50, "Yellow": 75, "Orange": 100} + points_dict["Blue"] = 150 # Add "Blue" as a key and assign 150 as its value. + +Finally, dictionaries can contain different types of keys and values in the same dictionary: + +:: + + # This is a valid dictionary. + # To access the string "Nested value" below, use `my_dict.sub_dict.sub_key` or `my_dict["sub_dict"]["sub_key"]`. + # Indexing styles can be mixed and matched depending on your needs. + var my_dict = { + "String Key": 5, + 4: [1, 2, 3], + 7: "Hello", + "sub_dict": {"sub_key": "Nested value"}, + } + +**Note:** Unlike :ref:`Array`\ s, you can't compare dictionaries directly: + +:: + + array1 = [1, 2, 3] + array2 = [1, 2, 3] + + func compare_arrays(): + print(array1 == array2) # Will print true. + + var dict1 = {"a": 1, "b": 2, "c": 3} + var dict2 = {"a": 1, "b": 2, "c": 3} + + func compare_dictionaries(): + print(dict1 == dict2) # Will NOT print true. + +You need to first calculate the dictionary's hash with :ref:`hash` before you can compare them: + +:: + + var dict1 = {"a": 1, "b": 2, "c": 3} + var dict2 = {"a": 1, "b": 2, "c": 3} + + func compare_dictionaries(): + print(dict1.hash() == dict2.hash()) # Will print true. + +**Note:** When declaring a dictionary with ``const``, the dictionary itself can still be mutated by defining the values of individual keys. Using ``const`` will only prevent assigning the constant with another value after it was initialized. + +Tutorials +--------- + +- `#dictionary <../tutorials/scripting/gdscript/gdscript_basics.html#dictionary>`_ in :doc:`../tutorials/scripting/gdscript/gdscript_basics` + +- `3D Voxel Demo `__ + +- `OS Test Demo `__ + +Methods +------- + ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`duplicate` **(** :ref:`bool` deep=false **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`erase` **(** :ref:`Variant` key **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get` **(** :ref:`Variant` key, :ref:`Variant` default=null **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`Variant` key **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_all` **(** :ref:`Array` keys **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`keys` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`values` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Dictionary_method_clear: + +- void **clear** **(** **)** + +Clear the dictionary, removing all key/value pairs. + +---- + +.. _class_Dictionary_method_duplicate: + +- :ref:`Dictionary` **duplicate** **(** :ref:`bool` deep=false **)** + +Creates a copy of the dictionary, and returns it. The ``deep`` parameter causes inner dictionaries and arrays to be copied recursively, but does not apply to objects. + +---- + +.. _class_Dictionary_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the dictionary is empty. + +---- + +.. _class_Dictionary_method_erase: + +- :ref:`bool` **erase** **(** :ref:`Variant` key **)** + +Erase a dictionary key/value pair by key. Returns ``true`` if the given key was present in the dictionary, ``false`` otherwise. + +**Note:** Don't erase elements while iterating over the dictionary. You can iterate over the :ref:`keys` array instead. + +---- + +.. _class_Dictionary_method_get: + +- :ref:`Variant` **get** **(** :ref:`Variant` key, :ref:`Variant` default=null **)** + +Returns the current value for the specified key in the ``Dictionary``. If the key does not exist, the method returns the value of the optional default argument, or ``null`` if it is omitted. + +---- + +.. _class_Dictionary_method_has: + +- :ref:`bool` **has** **(** :ref:`Variant` key **)** + +Returns ``true`` if the dictionary has a given key. + +**Note:** This is equivalent to using the ``in`` operator as follows: + +:: + + # Will evaluate to `true`. + if "godot" in {"godot": "engine"}: + pass + +This method (like the ``in`` operator) will evaluate to ``true`` as long as the key exists, even if the associated value is ``null``. + +---- + +.. _class_Dictionary_method_has_all: + +- :ref:`bool` **has_all** **(** :ref:`Array` keys **)** + +Returns ``true`` if the dictionary has all the keys in the given array. + +---- + +.. _class_Dictionary_method_hash: + +- :ref:`int` **hash** **(** **)** + +Returns a hashed 32-bit integer value representing the dictionary contents. This can be used to compare dictionaries by value: + +:: + + var dict1 = {0: 10} + var dict2 = {0: 10} + # The line below prints `true`, whereas it would have printed `false` if both variables were compared directly. + print(dict1.hash() == dict2.hash()) + +**Note:** Dictionaries with the same keys/values but in a different order will have a different hash. + +**Note:** Dictionaries with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the dictionaries are equal, because different dictionaries can have identical hash values due to hash collisions. + +---- + +.. _class_Dictionary_method_keys: + +- :ref:`Array` **keys** **(** **)** + +Returns the list of keys in the ``Dictionary``. + +---- + +.. _class_Dictionary_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the number of keys in the dictionary. + +---- + +.. _class_Dictionary_method_values: + +- :ref:`Array` **values** **(** **)** + +Returns the list of values in the ``Dictionary``. + +.. |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.)` diff --git a/classes/class_directionallight.rst b/classes/class_directionallight.rst new file mode 100644 index 0000000..0b6fb66 --- /dev/null +++ b/classes/class_directionallight.rst @@ -0,0 +1,231 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DirectionalLight.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DirectionalLight: + +DirectionalLight +================ + +**Inherits:** :ref:`Light` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Directional light from a distance, as from the Sun. + +Description +----------- + +A directional light is a type of :ref:`Light` node that models an infinite number of parallel rays covering the entire scene. It is used for lights with strong intensity that are located far away from the scene to model sunlight or moonlight. The worldspace location of the DirectionalLight transform (origin) is ignored. Only the basis is used to determine light direction. + +Tutorials +--------- + +- :doc:`../tutorials/3d/lights_and_shadows` + +Properties +---------- + ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_bias_split_scale` | ``0.25`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`bool` | :ref:`directional_shadow_blend_splits` | ``false`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`ShadowDepthRange` | :ref:`directional_shadow_depth_range` | ``0`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_max_distance` | ``100.0`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`ShadowMode` | :ref:`directional_shadow_mode` | ``2`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_normal_bias` | ``0.8`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_split_1` | ``0.1`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_split_2` | ``0.2`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`directional_shadow_split_3` | ``0.5`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ +| :ref:`float` | shadow_bias | ``0.1`` *(parent override)* | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------+-----------------------------+ + +Enumerations +------------ + +.. _enum_DirectionalLight_ShadowMode: + +.. _class_DirectionalLight_constant_SHADOW_ORTHOGONAL: + +.. _class_DirectionalLight_constant_SHADOW_PARALLEL_2_SPLITS: + +.. _class_DirectionalLight_constant_SHADOW_PARALLEL_4_SPLITS: + +enum **ShadowMode**: + +- **SHADOW_ORTHOGONAL** = **0** --- Renders the entire scene's shadow map from an orthogonal point of view. This is the fastest directional shadow mode. May result in blurrier shadows on close objects. + +- **SHADOW_PARALLEL_2_SPLITS** = **1** --- Splits the view frustum in 2 areas, each with its own shadow map. This shadow mode is a compromise between :ref:`SHADOW_ORTHOGONAL` and :ref:`SHADOW_PARALLEL_4_SPLITS` in terms of performance. + +- **SHADOW_PARALLEL_4_SPLITS** = **2** --- Splits the view frustum in 4 areas, each with its own shadow map. This is the slowest directional shadow mode. + +---- + +.. _enum_DirectionalLight_ShadowDepthRange: + +.. _class_DirectionalLight_constant_SHADOW_DEPTH_RANGE_STABLE: + +.. _class_DirectionalLight_constant_SHADOW_DEPTH_RANGE_OPTIMIZED: + +enum **ShadowDepthRange**: + +- **SHADOW_DEPTH_RANGE_STABLE** = **0** --- Keeps the shadow stable when the camera moves, at the cost of lower effective shadow resolution. + +- **SHADOW_DEPTH_RANGE_OPTIMIZED** = **1** --- Tries to achieve maximum shadow resolution. May result in saw effect on shadow edges. This mode typically works best in games where the camera will often move at high speeds, such as most racing games. + +Property Descriptions +--------------------- + +.. _class_DirectionalLight_property_directional_shadow_bias_split_scale: + +- :ref:`float` **directional_shadow_bias_split_scale** + ++-----------+------------------+ +| *Default* | ``0.25`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Amount of extra bias for shadow splits that are far away. If self-shadowing occurs only on the splits far away, increasing this value can fix them. + +---- + +.. _class_DirectionalLight_property_directional_shadow_blend_splits: + +- :ref:`bool` **directional_shadow_blend_splits** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_blend_splits(value) | ++-----------+---------------------------+ +| *Getter* | is_blend_splits_enabled() | ++-----------+---------------------------+ + +If ``true``, shadow detail is sacrificed in exchange for smoother transitions between splits. + +---- + +.. _class_DirectionalLight_property_directional_shadow_depth_range: + +- :ref:`ShadowDepthRange` **directional_shadow_depth_range** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_shadow_depth_range(value) | ++-----------+-------------------------------+ +| *Getter* | get_shadow_depth_range() | ++-----------+-------------------------------+ + +Optimizes shadow rendering for detail versus movement. See :ref:`ShadowDepthRange`. + +---- + +.. _class_DirectionalLight_property_directional_shadow_max_distance: + +- :ref:`float` **directional_shadow_max_distance** + ++-----------+------------------+ +| *Default* | ``100.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The maximum distance for shadow splits. + +---- + +.. _class_DirectionalLight_property_directional_shadow_mode: + +- :ref:`ShadowMode` **directional_shadow_mode** + ++-----------+------------------------+ +| *Default* | ``2`` | ++-----------+------------------------+ +| *Setter* | set_shadow_mode(value) | ++-----------+------------------------+ +| *Getter* | get_shadow_mode() | ++-----------+------------------------+ + +The light's shadow rendering algorithm. See :ref:`ShadowMode`. + +---- + +.. _class_DirectionalLight_property_directional_shadow_normal_bias: + +- :ref:`float` **directional_shadow_normal_bias** + ++-----------+------------------+ +| *Default* | ``0.8`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Can be used to fix special cases of self shadowing when objects are perpendicular to the light. + +---- + +.. _class_DirectionalLight_property_directional_shadow_split_1: + +- :ref:`float` **directional_shadow_split_1** + ++-----------+------------------+ +| *Default* | ``0.1`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The distance from camera to shadow split 1. Relative to :ref:`directional_shadow_max_distance`. Only used when :ref:`directional_shadow_mode` is ``SHADOW_PARALLEL_2_SPLITS`` or ``SHADOW_PARALLEL_4_SPLITS``. + +---- + +.. _class_DirectionalLight_property_directional_shadow_split_2: + +- :ref:`float` **directional_shadow_split_2** + ++-----------+------------------+ +| *Default* | ``0.2`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The distance from shadow split 1 to split 2. Relative to :ref:`directional_shadow_max_distance`. Only used when :ref:`directional_shadow_mode` is ``SHADOW_PARALLEL_2_SPLITS`` or ``SHADOW_PARALLEL_4_SPLITS``. + +---- + +.. _class_DirectionalLight_property_directional_shadow_split_3: + +- :ref:`float` **directional_shadow_split_3** + ++-----------+------------------+ +| *Default* | ``0.5`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The distance from shadow split 2 to split 3. Relative to :ref:`directional_shadow_max_distance`. Only used when :ref:`directional_shadow_mode` is ``SHADOW_PARALLEL_4_SPLITS``. + +.. |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.)` diff --git a/classes/class_directory.rst b/classes/class_directory.rst new file mode 100644 index 0000000..0650e96 --- /dev/null +++ b/classes/class_directory.rst @@ -0,0 +1,256 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Directory.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Directory: + +Directory +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Type used to handle the filesystem. + +Description +----------- + +Directory type. It is used to manage directories and their content (not restricted to the project folder). + +When creating a new ``Directory``, its default opened directory will be ``res://``. This may change in the future, so it is advised to always use :ref:`open` to initialize your ``Directory`` where you want to operate, with explicit error checking. + +**Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. Use :ref:`ResourceLoader` to access imported resources. + +Here is an example on how to iterate through the files of a directory: + +:: + + func dir_contents(path): + var dir = Directory.new() + if dir.open(path) == OK: + dir.list_dir_begin() + var file_name = dir.get_next() + while file_name != "": + if dir.current_is_dir(): + print("Found directory: " + file_name) + else: + print("Found file: " + file_name) + file_name = dir.get_next() + else: + print("An error occurred when trying to access the path.") + +Tutorials +--------- + +- :doc:`../tutorials/scripting/filesystem` + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`change_dir` **(** :ref:`String` todir **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`copy` **(** :ref:`String` from, :ref:`String` to **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`current_is_dir` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`dir_exists` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`file_exists` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_dir` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_drive` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_drive` **(** :ref:`int` idx **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_drive_count` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_next` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_space_left` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`list_dir_begin` **(** :ref:`bool` skip_navigational=false, :ref:`bool` skip_hidden=false **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`list_dir_end` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`make_dir` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`make_dir_recursive` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`remove` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`rename` **(** :ref:`String` from, :ref:`String` to **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Directory_method_change_dir: + +- :ref:`Error` **change_dir** **(** :ref:`String` todir **)** + +Changes the currently opened directory to the one passed as an argument. The argument can be relative to the current directory (e.g. ``newdir`` or ``../newdir``), or an absolute path (e.g. ``/tmp/newdir`` or ``res://somedir/newdir``). + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_copy: + +- :ref:`Error` **copy** **(** :ref:`String` from, :ref:`String` to **)** + +Copies the ``from`` file to the ``to`` destination. Both arguments should be paths to files, either relative or absolute. If the destination file exists and is not access-protected, it will be overwritten. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_current_is_dir: + +- :ref:`bool` **current_is_dir** **(** **)** |const| + +Returns whether the current item processed with the last :ref:`get_next` call is a directory (``.`` and ``..`` are considered directories). + +---- + +.. _class_Directory_method_dir_exists: + +- :ref:`bool` **dir_exists** **(** :ref:`String` path **)** + +Returns whether the target directory exists. The argument can be relative to the current directory, or an absolute path. + +---- + +.. _class_Directory_method_file_exists: + +- :ref:`bool` **file_exists** **(** :ref:`String` path **)** + +Returns whether the target file exists. The argument can be relative to the current directory, or an absolute path. + +---- + +.. _class_Directory_method_get_current_dir: + +- :ref:`String` **get_current_dir** **(** **)** + +Returns the absolute path to the currently opened directory (e.g. ``res://folder`` or ``C:\tmp\folder``). + +---- + +.. _class_Directory_method_get_current_drive: + +- :ref:`int` **get_current_drive** **(** **)** + +Returns the currently opened directory's drive index. See :ref:`get_drive` to convert returned index to the name of the drive. + +---- + +.. _class_Directory_method_get_drive: + +- :ref:`String` **get_drive** **(** :ref:`int` idx **)** + +On Windows, returns the name of the drive (partition) passed as an argument (e.g. ``C:``). On other platforms, or if the requested drive does not exist, the method returns an empty String. + +---- + +.. _class_Directory_method_get_drive_count: + +- :ref:`int` **get_drive_count** **(** **)** + +On Windows, returns the number of drives (partitions) mounted on the current filesystem. On other platforms, the method returns 0. + +---- + +.. _class_Directory_method_get_next: + +- :ref:`String` **get_next** **(** **)** + +Returns the next element (file or directory) in the current directory (including ``.`` and ``..``, unless ``skip_navigational`` was given to :ref:`list_dir_begin`). + +The name of the file or directory is returned (and not its full path). Once the stream has been fully processed, the method returns an empty String and closes the stream automatically (i.e. :ref:`list_dir_end` would not be mandatory in such a case). + +---- + +.. _class_Directory_method_get_space_left: + +- :ref:`int` **get_space_left** **(** **)** + +On UNIX desktop systems, returns the available space on the current directory's disk. On other platforms, this information is not available and the method returns 0 or -1. + +---- + +.. _class_Directory_method_list_dir_begin: + +- :ref:`Error` **list_dir_begin** **(** :ref:`bool` skip_navigational=false, :ref:`bool` skip_hidden=false **)** + +Initializes the stream used to list all files and directories using the :ref:`get_next` function, closing the currently opened stream if needed. Once the stream has been processed, it should typically be closed with :ref:`list_dir_end`. + +If ``skip_navigational`` is ``true``, ``.`` and ``..`` are filtered out. + +If ``skip_hidden`` is ``true``, hidden files are filtered out. + +---- + +.. _class_Directory_method_list_dir_end: + +- void **list_dir_end** **(** **)** + +Closes the current stream opened with :ref:`list_dir_begin` (whether it has been fully processed with :ref:`get_next` does not matter). + +---- + +.. _class_Directory_method_make_dir: + +- :ref:`Error` **make_dir** **(** :ref:`String` path **)** + +Creates a directory. The argument can be relative to the current directory, or an absolute path. The target directory should be placed in an already existing directory (to create the full path recursively, see :ref:`make_dir_recursive`). + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_make_dir_recursive: + +- :ref:`Error` **make_dir_recursive** **(** :ref:`String` path **)** + +Creates a target directory and all necessary intermediate directories in its path, by calling :ref:`make_dir` recursively. The argument can be relative to the current directory, or an absolute path. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_open: + +- :ref:`Error` **open** **(** :ref:`String` path **)** + +Opens an existing directory of the filesystem. The ``path`` argument can be within the project tree (``res://folder``), the user directory (``user://folder``) or an absolute path of the user filesystem (e.g. ``/tmp/folder`` or ``C:\tmp\folder``). + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_remove: + +- :ref:`Error` **remove** **(** :ref:`String` path **)** + +Deletes the target file or an empty directory. The argument can be relative to the current directory, or an absolute path. If the target directory is not empty, the operation will fail. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +---- + +.. _class_Directory_method_rename: + +- :ref:`Error` **rename** **(** :ref:`String` from, :ref:`String` to **)** + +Renames (move) the ``from`` file or directory to the ``to`` destination. Both arguments should be paths to files or directories, either relative or absolute. If the destination file or directory exists and is not access-protected, it will be overwritten. + +Returns one of the :ref:`Error` code constants (``OK`` on success). + +.. |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.)` diff --git a/classes/class_dtlsserver.rst b/classes/class_dtlsserver.rst new file mode 100644 index 0000000..a482f3a --- /dev/null +++ b/classes/class_dtlsserver.rst @@ -0,0 +1,106 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DTLSServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DTLSServer: + +DTLSServer +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper class to implement a DTLS server. + +Description +----------- + +This class is used to store the state of a DTLS server. Upon :ref:`setup` it converts connected :ref:`PacketPeerUDP` to :ref:`PacketPeerDTLS` accepting them via :ref:`take_connection` as DTLS clients. Under the hood, this class is used to store the DTLS state and cookies of the server. The reason of why the state and cookies are needed is outside of the scope of this documentation. + +Below a small example of how to use it: + +:: + + # server.gd + extends Node + + var dtls := DTLSServer.new() + var server := UDPServer.new() + var peers = [] + + func _ready(): + server.listen(4242) + var key = load("key.key") # Your private key. + var cert = load("cert.crt") # Your X509 certificate. + dtls.setup(key, cert) + + func _process(delta): + while server.is_connection_available(): + var peer : PacketPeerUDP = server.take_connection() + var dtls_peer : PacketPeerDTLS = dtls.take_connection(peer) + if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING: + continue # It is normal that 50% of the connections fails due to cookie exchange. + print("Peer connected!") + peers.append(dtls_peer) + for p in peers: + p.poll() # Must poll to update the state. + if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED: + while p.get_available_packet_count() > 0: + print("Received message from client: %s" % p.get_packet().get_string_from_utf8()) + p.put_packet("Hello DTLS client".to_utf8()) + +:: + + # client.gd + extends Node + + var dtls := PacketPeerDTLS.new() + var udp := PacketPeerUDP.new() + var connected = false + + func _ready(): + udp.connect_to_host("127.0.0.1", 4242) + dtls.connect_to_peer(udp, false) # Use true in production for certificate validation! + + func _process(delta): + dtls.poll() + if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED: + if !connected: + # Try to contact server + dtls.put_packet("The answer is... 42!".to_utf8()) + while dtls.get_available_packet_count() > 0: + print("Connected: %s" % dtls.get_packet().get_string_from_utf8()) + connected = true + +Methods +------- + ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`setup` **(** :ref:`CryptoKey` key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PacketPeerDTLS` | :ref:`take_connection` **(** :ref:`PacketPeerUDP` udp_peer **)** | ++---------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_DTLSServer_method_setup: + +- :ref:`Error` **setup** **(** :ref:`CryptoKey` key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** + +Setup the DTLS server to use the given ``private_key`` and provide the given ``certificate`` to clients. You can pass the optional ``chain`` parameter to provide additional CA chain information along with the certificate. + +---- + +.. _class_DTLSServer_method_take_connection: + +- :ref:`PacketPeerDTLS` **take_connection** **(** :ref:`PacketPeerUDP` udp_peer **)** + +Try to initiate the DTLS handshake with the given ``udp_peer`` which must be already connected (see :ref:`PacketPeerUDP.connect_to_host`). + +**Note:** You must check that the state of the return PacketPeerUDP is :ref:`PacketPeerDTLS.STATUS_HANDSHAKING`, as it is normal that 50% of the new connections will be invalid due to cookie exchange. + +.. |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.)` diff --git a/classes/class_dynamicfont.rst b/classes/class_dynamicfont.rst new file mode 100644 index 0000000..8d6df40 --- /dev/null +++ b/classes/class_dynamicfont.rst @@ -0,0 +1,340 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DynamicFont.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DynamicFont: + +DynamicFont +=========== + +**Inherits:** :ref:`Font` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +DynamicFont renders vector font files at runtime. + +Description +----------- + +DynamicFont renders vector font files dynamically at runtime instead of using a prerendered texture atlas like :ref:`BitmapFont`. This trades the faster loading time of :ref:`BitmapFont`\ s for the ability to change font parameters like size and spacing during runtime. :ref:`DynamicFontData` is used for referencing the font file paths. DynamicFont also supports defining one or more fallback fonts, which will be used when displaying a character not supported by the main font. + +DynamicFont uses the `FreeType `__ library for rasterization. Supported formats are TrueType (``.ttf``), OpenType (``.otf``) and Web Open Font Format 1 (``.woff``). Web Open Font Format 2 (``.woff2``) is *not* supported. + +:: + + var dynamic_font = DynamicFont.new() + dynamic_font.font_data = load("res://BarlowCondensed-Bold.ttf") + dynamic_font.size = 64 + $"Label".set("custom_fonts/font", dynamic_font) + +**Note:** DynamicFont doesn't support features such as kerning, right-to-left typesetting, ligatures, text shaping, variable fonts and optional font features yet. If you wish to "bake" an optional font feature into a TTF font file, you can use `FontForge `__ to do so. In FontForge, use **File > Generate Fonts**, click **Options**, choose the desired features then generate the font. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Properties +---------- + ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`extra_spacing_bottom` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`extra_spacing_char` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`extra_spacing_space` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`extra_spacing_top` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`DynamicFontData` | :ref:`font_data` | | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`outline_color` | ``Color( 1, 1, 1, 1 )`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`outline_size` | ``0`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`size` | ``16`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`use_filter` | ``false`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`use_mipmaps` | ``false`` | ++-----------------------------------------------+------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_fallback` **(** :ref:`DynamicFontData` data **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_available_chars` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`DynamicFontData` | :ref:`get_fallback` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_fallback_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_spacing` **(** :ref:`int` type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_fallback` **(** :ref:`int` idx **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_fallback` **(** :ref:`int` idx, :ref:`DynamicFontData` data **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_spacing` **(** :ref:`int` type, :ref:`int` value **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_DynamicFont_SpacingType: + +.. _class_DynamicFont_constant_SPACING_TOP: + +.. _class_DynamicFont_constant_SPACING_BOTTOM: + +.. _class_DynamicFont_constant_SPACING_CHAR: + +.. _class_DynamicFont_constant_SPACING_SPACE: + +enum **SpacingType**: + +- **SPACING_TOP** = **0** --- Spacing at the top. + +- **SPACING_BOTTOM** = **1** --- Spacing at the bottom. + +- **SPACING_CHAR** = **2** --- Spacing for each character. + +- **SPACING_SPACE** = **3** --- Spacing for the space character. + +Property Descriptions +--------------------- + +.. _class_DynamicFont_property_extra_spacing_bottom: + +- :ref:`int` **extra_spacing_bottom** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_spacing(value) | ++-----------+--------------------+ +| *Getter* | get_spacing() | ++-----------+--------------------+ + +Extra spacing at the bottom in pixels. + +---- + +.. _class_DynamicFont_property_extra_spacing_char: + +- :ref:`int` **extra_spacing_char** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_spacing(value) | ++-----------+--------------------+ +| *Getter* | get_spacing() | ++-----------+--------------------+ + +Extra spacing for each character in pixels. + +This can be a negative number to make the distance between characters smaller. + +---- + +.. _class_DynamicFont_property_extra_spacing_space: + +- :ref:`int` **extra_spacing_space** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_spacing(value) | ++-----------+--------------------+ +| *Getter* | get_spacing() | ++-----------+--------------------+ + +Extra spacing for the space character (in addition to :ref:`extra_spacing_char`) in pixels. + +This can be a negative number to make the distance between words smaller. + +---- + +.. _class_DynamicFont_property_extra_spacing_top: + +- :ref:`int` **extra_spacing_top** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_spacing(value) | ++-----------+--------------------+ +| *Getter* | get_spacing() | ++-----------+--------------------+ + +Extra spacing at the top in pixels. + +---- + +.. _class_DynamicFont_property_font_data: + +- :ref:`DynamicFontData` **font_data** + ++----------+----------------------+ +| *Setter* | set_font_data(value) | ++----------+----------------------+ +| *Getter* | get_font_data() | ++----------+----------------------+ + +The font data. + +---- + +.. _class_DynamicFont_property_outline_color: + +- :ref:`Color` **outline_color** + ++-----------+--------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+--------------------------+ +| *Setter* | set_outline_color(value) | ++-----------+--------------------------+ +| *Getter* | get_outline_color() | ++-----------+--------------------------+ + +The font outline's color. + +**Note:** It's recommended to leave this at the default value so that you can adjust it in individual controls. For example, if the outline is made black here, it won't be possible to change its color using a Label's font outline modulate theme item. + +---- + +.. _class_DynamicFont_property_outline_size: + +- :ref:`int` **outline_size** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_outline_size(value) | ++-----------+-------------------------+ +| *Getter* | get_outline_size() | ++-----------+-------------------------+ + +The font outline's thickness in pixels (not relative to the font size). + +---- + +.. _class_DynamicFont_property_size: + +- :ref:`int` **size** + ++-----------+-----------------+ +| *Default* | ``16`` | ++-----------+-----------------+ +| *Setter* | set_size(value) | ++-----------+-----------------+ +| *Getter* | get_size() | ++-----------+-----------------+ + +The font size in pixels. + +---- + +.. _class_DynamicFont_property_use_filter: + +- :ref:`bool` **use_filter** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_use_filter(value) | ++-----------+-----------------------+ +| *Getter* | get_use_filter() | ++-----------+-----------------------+ + +If ``true``, filtering is used. This makes the font blurry instead of pixelated when scaling it if font oversampling is disabled or ineffective. It's recommended to enable this when using the font in a control whose size changes over time, unless a pixel art aesthetic is desired. + +---- + +.. _class_DynamicFont_property_use_mipmaps: + +- :ref:`bool` **use_mipmaps** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_use_mipmaps(value) | ++-----------+------------------------+ +| *Getter* | get_use_mipmaps() | ++-----------+------------------------+ + +If ``true``, mipmapping is used. This improves the font's appearance when downscaling it if font oversampling is disabled or ineffective. + +Method Descriptions +------------------- + +.. _class_DynamicFont_method_add_fallback: + +- void **add_fallback** **(** :ref:`DynamicFontData` data **)** + +Adds a fallback font. + +---- + +.. _class_DynamicFont_method_get_available_chars: + +- :ref:`String` **get_available_chars** **(** **)** |const| + +Returns a string containing all the characters available in the main and all the fallback fonts. + +If a given character is included in more than one font, it appears only once in the returned string. + +---- + +.. _class_DynamicFont_method_get_fallback: + +- :ref:`DynamicFontData` **get_fallback** **(** :ref:`int` idx **)** |const| + +Returns the fallback font at index ``idx``. + +---- + +.. _class_DynamicFont_method_get_fallback_count: + +- :ref:`int` **get_fallback_count** **(** **)** |const| + +Returns the number of fallback fonts. + +---- + +.. _class_DynamicFont_method_get_spacing: + +- :ref:`int` **get_spacing** **(** :ref:`int` type **)** |const| + +Returns the spacing for the given ``type`` (see :ref:`SpacingType`). + +---- + +.. _class_DynamicFont_method_remove_fallback: + +- void **remove_fallback** **(** :ref:`int` idx **)** + +Removes the fallback font at index ``idx``. + +---- + +.. _class_DynamicFont_method_set_fallback: + +- void **set_fallback** **(** :ref:`int` idx, :ref:`DynamicFontData` data **)** + +Sets the fallback font at index ``idx``. + +---- + +.. _class_DynamicFont_method_set_spacing: + +- void **set_spacing** **(** :ref:`int` type, :ref:`int` value **)** + +Sets the spacing for ``type`` (see :ref:`SpacingType`) to ``value`` in pixels (not relative to the font size). + +.. |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.)` diff --git a/classes/class_dynamicfontdata.rst b/classes/class_dynamicfontdata.rst new file mode 100644 index 0000000..ec865a6 --- /dev/null +++ b/classes/class_dynamicfontdata.rst @@ -0,0 +1,107 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the DynamicFontData.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_DynamicFontData: + +DynamicFontData +=============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Used with :ref:`DynamicFont` to describe the location of a font file. + +Description +----------- + +Used with :ref:`DynamicFont` to describe the location of a vector font file for dynamic rendering at runtime. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Properties +---------- + ++----------------------------------------------+----------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`antialiased` | ``true`` | ++----------------------------------------------+----------------------------------------------------------------+----------+ +| :ref:`String` | :ref:`font_path` | ``""`` | ++----------------------------------------------+----------------------------------------------------------------+----------+ +| :ref:`Hinting` | :ref:`hinting` | ``2`` | ++----------------------------------------------+----------------------------------------------------------------+----------+ + +Enumerations +------------ + +.. _enum_DynamicFontData_Hinting: + +.. _class_DynamicFontData_constant_HINTING_NONE: + +.. _class_DynamicFontData_constant_HINTING_LIGHT: + +.. _class_DynamicFontData_constant_HINTING_NORMAL: + +enum **Hinting**: + +- **HINTING_NONE** = **0** --- Disables font hinting (smoother but less crisp). + +- **HINTING_LIGHT** = **1** --- Use the light font hinting mode. + +- **HINTING_NORMAL** = **2** --- Use the default font hinting mode (crisper but less smooth). + +Property Descriptions +--------------------- + +.. _class_DynamicFontData_property_antialiased: + +- :ref:`bool` **antialiased** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_antialiased(value) | ++-----------+------------------------+ +| *Getter* | is_antialiased() | ++-----------+------------------------+ + +If ``true``, the font is rendered with anti-aliasing. This property applies both to the main font and its outline (if it has one). + +---- + +.. _class_DynamicFontData_property_font_path: + +- :ref:`String` **font_path** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_font_path(value) | ++-----------+----------------------+ +| *Getter* | get_font_path() | ++-----------+----------------------+ + +The path to the vector font file. + +---- + +.. _class_DynamicFontData_property_hinting: + +- :ref:`Hinting` **hinting** + ++-----------+--------------------+ +| *Default* | ``2`` | ++-----------+--------------------+ +| *Setter* | set_hinting(value) | ++-----------+--------------------+ +| *Getter* | get_hinting() | ++-----------+--------------------+ + +The font hinting mode used by FreeType. See :ref:`Hinting` for options. + +.. |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.)` diff --git a/classes/class_editorexportplugin.rst b/classes/class_editorexportplugin.rst new file mode 100644 index 0000000..57d80a1 --- /dev/null +++ b/classes/class_editorexportplugin.rst @@ -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 EditorExportPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorExportPlugin: + +EditorExportPlugin +================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A script that is executed when exporting the project. + +Description +----------- + +``EditorExportPlugin``\ s are automatically invoked whenever the user exports the project. Their most common use is to determine what files are being included in the exported project. For each plugin, :ref:`_export_begin` is called at the beginning of the export process and then :ref:`_export_file` is called for each exported file. + +To use ``EditorExportPlugin``, register it using the :ref:`EditorPlugin.add_export_plugin` method first. + +Methods +------- + ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_export_begin` **(** :ref:`PoolStringArray` features, :ref:`bool` is_debug, :ref:`String` path, :ref:`int` flags **)** |virtual| | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_export_end` **(** **)** |virtual| | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_export_file` **(** :ref:`String` path, :ref:`String` type, :ref:`PoolStringArray` features **)** |virtual| | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_file` **(** :ref:`String` path, :ref:`PoolByteArray` file, :ref:`bool` remap **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_bundle_file` **(** :ref:`String` path **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_cpp_code` **(** :ref:`String` code **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_embedded_framework` **(** :ref:`String` path **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_framework` **(** :ref:`String` path **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_linker_flags` **(** :ref:`String` flags **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_plist_content` **(** :ref:`String` plist_content **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_ios_project_static_lib` **(** :ref:`String` path **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_shared_object` **(** :ref:`String` path, :ref:`PoolStringArray` tags **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`skip` **(** **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorExportPlugin_method__export_begin: + +- void **_export_begin** **(** :ref:`PoolStringArray` features, :ref:`bool` is_debug, :ref:`String` path, :ref:`int` flags **)** |virtual| + +Virtual method to be overridden by the user. It is called when the export starts and provides all information about the export. ``features`` is the list of features for the export, ``is_debug`` is ``true`` for debug builds, ``path`` is the target path for the exported project. ``flags`` is only used when running a runnable profile, e.g. when using native run on Android. + +---- + +.. _class_EditorExportPlugin_method__export_end: + +- void **_export_end** **(** **)** |virtual| + +Virtual method to be overridden by the user. Called when the export is finished. + +---- + +.. _class_EditorExportPlugin_method__export_file: + +- void **_export_file** **(** :ref:`String` path, :ref:`String` type, :ref:`PoolStringArray` features **)** |virtual| + +Virtual method to be overridden by the user. Called for each exported file, providing arguments that can be used to identify the file. ``path`` is the path of the file, ``type`` is the :ref:`Resource` represented by the file (e.g. :ref:`PackedScene`) and ``features`` is the list of features for the export. + +Calling :ref:`skip` inside this callback will make the file not included in the export. + +---- + +.. _class_EditorExportPlugin_method_add_file: + +- void **add_file** **(** :ref:`String` path, :ref:`PoolByteArray` file, :ref:`bool` remap **)** + +Adds a custom file to be exported. ``path`` is the virtual path that can be used to load the file, ``file`` is the binary data of the file. If ``remap`` is ``true``, file will not be exported, but instead remapped to the given ``path``. + +---- + +.. _class_EditorExportPlugin_method_add_ios_bundle_file: + +- void **add_ios_bundle_file** **(** :ref:`String` path **)** + +Adds an iOS bundle file from the given ``path`` to the exported project. + +---- + +.. _class_EditorExportPlugin_method_add_ios_cpp_code: + +- void **add_ios_cpp_code** **(** :ref:`String` code **)** + +Adds a C++ code to the iOS export. The final code is created from the code appended by each active export plugin. + +---- + +.. _class_EditorExportPlugin_method_add_ios_embedded_framework: + +- void **add_ios_embedded_framework** **(** :ref:`String` path **)** + +Adds a dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project and embeds it into resulting binary. + +**Note:** For static libraries (\*.a) works in same way as :ref:`add_ios_framework`. + +This method should not be used for System libraries as they are already present on the device. + +---- + +.. _class_EditorExportPlugin_method_add_ios_framework: + +- void **add_ios_framework** **(** :ref:`String` path **)** + +Adds a static library (\*.a) or dynamic library (\*.dylib, \*.framework) to Linking Phase in iOS's Xcode project. + +---- + +.. _class_EditorExportPlugin_method_add_ios_linker_flags: + +- void **add_ios_linker_flags** **(** :ref:`String` flags **)** + +Adds linker flags for the iOS export. + +---- + +.. _class_EditorExportPlugin_method_add_ios_plist_content: + +- void **add_ios_plist_content** **(** :ref:`String` plist_content **)** + +Adds content for iOS Property List files. + +---- + +.. _class_EditorExportPlugin_method_add_ios_project_static_lib: + +- void **add_ios_project_static_lib** **(** :ref:`String` path **)** + +Adds a static lib from the given ``path`` to the iOS project. + +---- + +.. _class_EditorExportPlugin_method_add_shared_object: + +- void **add_shared_object** **(** :ref:`String` path, :ref:`PoolStringArray` tags **)** + +Adds a shared object with the given ``tags`` and destination ``path``. + +---- + +.. _class_EditorExportPlugin_method_skip: + +- void **skip** **(** **)** + +To be called inside :ref:`_export_file`. Skips the current file, so it's not included in the export. + +.. |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.)` diff --git a/classes/class_editorfeatureprofile.rst b/classes/class_editorfeatureprofile.rst new file mode 100644 index 0000000..d51dda1 --- /dev/null +++ b/classes/class_editorfeatureprofile.rst @@ -0,0 +1,180 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorFeatureProfile.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorFeatureProfile: + +EditorFeatureProfile +==================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +An editor feature profile which can be used to disable specific features. + +Description +----------- + +An editor feature profile can be used to disable specific features of the Godot editor. When disabled, the features won't appear in the editor, which makes the editor less cluttered. This is useful in education settings to reduce confusion or when working in a team. For example, artists and level designers could use a feature profile that disables the script editor to avoid accidentally making changes to files they aren't supposed to edit. + +To manage editor feature profiles visually, use **Editor > Manage Feature Profiles...** at the top of the editor window. + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_feature_name` **(** :ref:`Feature` feature **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_class_disabled` **(** :ref:`String` class_name **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_class_editor_disabled` **(** :ref:`String` class_name **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_class_property_disabled` **(** :ref:`String` class_name, :ref:`String` property **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_feature_disabled` **(** :ref:`Feature` feature **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_from_file` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_to_file` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_class` **(** :ref:`String` class_name, :ref:`bool` disable **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_class_editor` **(** :ref:`String` class_name, :ref:`bool` disable **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_class_property` **(** :ref:`String` class_name, :ref:`String` property, :ref:`bool` disable **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_feature` **(** :ref:`Feature` feature, :ref:`bool` disable **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_EditorFeatureProfile_Feature: + +.. _class_EditorFeatureProfile_constant_FEATURE_3D: + +.. _class_EditorFeatureProfile_constant_FEATURE_SCRIPT: + +.. _class_EditorFeatureProfile_constant_FEATURE_ASSET_LIB: + +.. _class_EditorFeatureProfile_constant_FEATURE_SCENE_TREE: + +.. _class_EditorFeatureProfile_constant_FEATURE_NODE_DOCK: + +.. _class_EditorFeatureProfile_constant_FEATURE_FILESYSTEM_DOCK: + +.. _class_EditorFeatureProfile_constant_FEATURE_IMPORT_DOCK: + +.. _class_EditorFeatureProfile_constant_FEATURE_MAX: + +enum **Feature**: + +- **FEATURE_3D** = **0** --- The 3D editor. If this feature is disabled, the 3D editor won't display but 3D nodes will still display in the Create New Node dialog. + +- **FEATURE_SCRIPT** = **1** --- The Script tab, which contains the script editor and class reference browser. If this feature is disabled, the Script tab won't display. + +- **FEATURE_ASSET_LIB** = **2** --- The AssetLib tab. If this feature is disabled, the AssetLib tab won't display. + +- **FEATURE_SCENE_TREE** = **3** --- Scene tree editing. If this feature is disabled, the Scene tree dock will still be visible but will be read-only. + +- **FEATURE_NODE_DOCK** = **4** --- The Node dock. If this feature is disabled, signals and groups won't be visible and modifiable from the editor. + +- **FEATURE_FILESYSTEM_DOCK** = **5** --- The FileSystem dock. If this feature is disabled, the FileSystem dock won't be visible. + +- **FEATURE_IMPORT_DOCK** = **6** --- The Import dock. If this feature is disabled, the Import dock won't be visible. + +- **FEATURE_MAX** = **7** --- Represents the size of the :ref:`Feature` enum. + +Method Descriptions +------------------- + +.. _class_EditorFeatureProfile_method_get_feature_name: + +- :ref:`String` **get_feature_name** **(** :ref:`Feature` feature **)** + +Returns the specified ``feature``'s human-readable name. + +---- + +.. _class_EditorFeatureProfile_method_is_class_disabled: + +- :ref:`bool` **is_class_disabled** **(** :ref:`String` class_name **)** |const| + +Returns ``true`` if the class specified by ``class_name`` is disabled. When disabled, the class won't appear in the Create New Node dialog. + +---- + +.. _class_EditorFeatureProfile_method_is_class_editor_disabled: + +- :ref:`bool` **is_class_editor_disabled** **(** :ref:`String` class_name **)** |const| + +Returns ``true`` if editing for the class specified by ``class_name`` is disabled. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. + +---- + +.. _class_EditorFeatureProfile_method_is_class_property_disabled: + +- :ref:`bool` **is_class_property_disabled** **(** :ref:`String` class_name, :ref:`String` property **)** |const| + +Returns ``true`` if ``property`` is disabled in the class specified by ``class_name``. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by ``class_name``. + +---- + +.. _class_EditorFeatureProfile_method_is_feature_disabled: + +- :ref:`bool` **is_feature_disabled** **(** :ref:`Feature` feature **)** |const| + +Returns ``true`` if the ``feature`` is disabled. When a feature is disabled, it will disappear from the editor entirely. + +---- + +.. _class_EditorFeatureProfile_method_load_from_file: + +- :ref:`Error` **load_from_file** **(** :ref:`String` path **)** + +Loads an editor feature profile from a file. The file must follow the JSON format obtained by using the feature profile manager's **Export** button or the :ref:`save_to_file` method. + +---- + +.. _class_EditorFeatureProfile_method_save_to_file: + +- :ref:`Error` **save_to_file** **(** :ref:`String` path **)** + +Saves the editor feature profile to a file in JSON format. It can then be imported using the feature profile manager's **Import** button or the :ref:`load_from_file` button. + +---- + +.. _class_EditorFeatureProfile_method_set_disable_class: + +- void **set_disable_class** **(** :ref:`String` class_name, :ref:`bool` disable **)** + +If ``disable`` is ``true``, disables the class specified by ``class_name``. When disabled, the class won't appear in the Create New Node dialog. + +---- + +.. _class_EditorFeatureProfile_method_set_disable_class_editor: + +- void **set_disable_class_editor** **(** :ref:`String` class_name, :ref:`bool` disable **)** + +If ``disable`` is ``true``, disables editing for the class specified by ``class_name``. When disabled, the class will still appear in the Create New Node dialog but the inspector will be read-only when selecting a node that extends the class. + +---- + +.. _class_EditorFeatureProfile_method_set_disable_class_property: + +- void **set_disable_class_property** **(** :ref:`String` class_name, :ref:`String` property, :ref:`bool` disable **)** + +If ``disable`` is ``true``, disables editing for ``property`` in the class specified by ``class_name``. When a property is disabled, it won't appear in the inspector when selecting a node that extends the class specified by ``class_name``. + +---- + +.. _class_EditorFeatureProfile_method_set_disable_feature: + +- void **set_disable_feature** **(** :ref:`Feature` feature, :ref:`bool` disable **)** + +If ``disable`` is ``true``, disables the editor feature specified in ``feature``. When a feature is disabled, it will disappear from the editor entirely. + +.. |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.)` diff --git a/classes/class_editorfiledialog.rst b/classes/class_editorfiledialog.rst new file mode 100644 index 0000000..9fca9f3 --- /dev/null +++ b/classes/class_editorfiledialog.rst @@ -0,0 +1,308 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorFileDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorFileDialog: + +EditorFileDialog +================ + +**Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A modified version of :ref:`FileDialog` used by the editor. + +Properties +---------- + ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Access` | :ref:`access` | ``0`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_dir` | ``"res://"`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_file` | ``""`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_path` | ``"res://"`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | dialog_hide_on_ok | ``false`` *(parent override)* | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`disable_overwrite_warning` | ``false`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`DisplayMode` | :ref:`display_mode` | ``0`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Mode` | :ref:`mode` | ``4`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | resizable | ``true`` *(parent override)* | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`show_hidden_files` | ``false`` | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | window_title | ``"Save a File"`` *(parent override)* | ++-------------------------------------------------------+---------------------------------------------------------------------------------------------+---------------------------------------+ + +Methods +------- + ++-------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_filter` **(** :ref:`String` filter **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_filters` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`VBoxContainer` | :ref:`get_vbox` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invalidate` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorFileDialog_signal_dir_selected: + +- **dir_selected** **(** :ref:`String` dir **)** + +Emitted when a directory is selected. + +---- + +.. _class_EditorFileDialog_signal_file_selected: + +- **file_selected** **(** :ref:`String` path **)** + +Emitted when a file is selected. + +---- + +.. _class_EditorFileDialog_signal_files_selected: + +- **files_selected** **(** :ref:`PoolStringArray` paths **)** + +Emitted when multiple files are selected. + +Enumerations +------------ + +.. _enum_EditorFileDialog_Mode: + +.. _class_EditorFileDialog_constant_MODE_OPEN_FILE: + +.. _class_EditorFileDialog_constant_MODE_OPEN_FILES: + +.. _class_EditorFileDialog_constant_MODE_OPEN_DIR: + +.. _class_EditorFileDialog_constant_MODE_OPEN_ANY: + +.. _class_EditorFileDialog_constant_MODE_SAVE_FILE: + +enum **Mode**: + +- **MODE_OPEN_FILE** = **0** --- The ``EditorFileDialog`` can select only one file. Accepting the window will open the file. + +- **MODE_OPEN_FILES** = **1** --- The ``EditorFileDialog`` can select multiple files. Accepting the window will open all files. + +- **MODE_OPEN_DIR** = **2** --- The ``EditorFileDialog`` can select only one directory. Accepting the window will open the directory. + +- **MODE_OPEN_ANY** = **3** --- The ``EditorFileDialog`` can select a file or directory. Accepting the window will open it. + +- **MODE_SAVE_FILE** = **4** --- The ``EditorFileDialog`` can select only one file. Accepting the window will save the file. + +---- + +.. _enum_EditorFileDialog_Access: + +.. _class_EditorFileDialog_constant_ACCESS_RESOURCES: + +.. _class_EditorFileDialog_constant_ACCESS_USERDATA: + +.. _class_EditorFileDialog_constant_ACCESS_FILESYSTEM: + +enum **Access**: + +- **ACCESS_RESOURCES** = **0** --- The ``EditorFileDialog`` can only view ``res://`` directory contents. + +- **ACCESS_USERDATA** = **1** --- The ``EditorFileDialog`` can only view ``user://`` directory contents. + +- **ACCESS_FILESYSTEM** = **2** --- The ``EditorFileDialog`` can view the entire local file system. + +---- + +.. _enum_EditorFileDialog_DisplayMode: + +.. _class_EditorFileDialog_constant_DISPLAY_THUMBNAILS: + +.. _class_EditorFileDialog_constant_DISPLAY_LIST: + +enum **DisplayMode**: + +- **DISPLAY_THUMBNAILS** = **0** --- The ``EditorFileDialog`` displays resources as thumbnails. + +- **DISPLAY_LIST** = **1** --- The ``EditorFileDialog`` displays resources as a list of filenames. + +Property Descriptions +--------------------- + +.. _class_EditorFileDialog_property_access: + +- :ref:`Access` **access** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_access(value) | ++-----------+-------------------+ +| *Getter* | get_access() | ++-----------+-------------------+ + +The location from which the user may select a file, including ``res://``, ``user://``, and the local file system. + +---- + +.. _class_EditorFileDialog_property_current_dir: + +- :ref:`String` **current_dir** + ++-----------+------------------------+ +| *Default* | ``"res://"`` | ++-----------+------------------------+ +| *Setter* | set_current_dir(value) | ++-----------+------------------------+ +| *Getter* | get_current_dir() | ++-----------+------------------------+ + +The currently occupied directory. + +---- + +.. _class_EditorFileDialog_property_current_file: + +- :ref:`String` **current_file** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_current_file(value) | ++-----------+-------------------------+ +| *Getter* | get_current_file() | ++-----------+-------------------------+ + +The currently selected file. + +---- + +.. _class_EditorFileDialog_property_current_path: + +- :ref:`String` **current_path** + ++-----------+-------------------------+ +| *Default* | ``"res://"`` | ++-----------+-------------------------+ +| *Setter* | set_current_path(value) | ++-----------+-------------------------+ +| *Getter* | get_current_path() | ++-----------+-------------------------+ + +The file system path in the address bar. + +---- + +.. _class_EditorFileDialog_property_disable_overwrite_warning: + +- :ref:`bool` **disable_overwrite_warning** + ++-----------+--------------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------------+ +| *Setter* | set_disable_overwrite_warning(value) | ++-----------+--------------------------------------+ +| *Getter* | is_overwrite_warning_disabled() | ++-----------+--------------------------------------+ + +If ``true``, the ``EditorFileDialog`` will not warn the user before overwriting files. + +---- + +.. _class_EditorFileDialog_property_display_mode: + +- :ref:`DisplayMode` **display_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_display_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_display_mode() | ++-----------+-------------------------+ + +The view format in which the ``EditorFileDialog`` displays resources to the user. + +---- + +.. _class_EditorFileDialog_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``4`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The purpose of the ``EditorFileDialog``, which defines the allowed behaviors. + +---- + +.. _class_EditorFileDialog_property_show_hidden_files: + +- :ref:`bool` **show_hidden_files** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_show_hidden_files(value) | ++-----------+------------------------------+ +| *Getter* | is_showing_hidden_files() | ++-----------+------------------------------+ + +If ``true``, hidden files and directories will be visible in the ``EditorFileDialog``. + +Method Descriptions +------------------- + +.. _class_EditorFileDialog_method_add_filter: + +- void **add_filter** **(** :ref:`String` filter **)** + +Adds a comma-delimited file extension filter option to the ``EditorFileDialog`` with an optional semi-colon-delimited label. + +For example, ``"*.tscn, *.scn; Scenes"`` results in filter text "Scenes (\*.tscn, \*.scn)". + +---- + +.. _class_EditorFileDialog_method_clear_filters: + +- void **clear_filters** **(** **)** + +Removes all filters except for "All Files (\*)". + +---- + +.. _class_EditorFileDialog_method_get_vbox: + +- :ref:`VBoxContainer` **get_vbox** **(** **)** + +Returns the ``VBoxContainer`` used to display the file system. + +**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` property. + +---- + +.. _class_EditorFileDialog_method_invalidate: + +- void **invalidate** **(** **)** + +Notify the ``EditorFileDialog`` that its view of the data is no longer accurate. Updates the view contents on next view update. + +.. |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.)` diff --git a/classes/class_editorfilesystem.rst b/classes/class_editorfilesystem.rst new file mode 100644 index 0000000..7361229 --- /dev/null +++ b/classes/class_editorfilesystem.rst @@ -0,0 +1,154 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorFileSystem.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorFileSystem: + +EditorFileSystem +================ + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Resource filesystem, as the editor sees it. + +Description +----------- + +This object holds information of all resources in the filesystem, their types, etc. + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_filesystem`. + +Methods +------- + ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file_type` **(** :ref:`String` path **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystemDirectory` | :ref:`get_filesystem` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystemDirectory` | :ref:`get_filesystem_path` **(** :ref:`String` path **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_scanning_progress` **(** **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_scanning` **(** **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scan` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scan_sources` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_file` **(** :ref:`String` path **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_script_classes` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorFileSystem_signal_filesystem_changed: + +- **filesystem_changed** **(** **)** + +Emitted if the filesystem changed. + +---- + +.. _class_EditorFileSystem_signal_resources_reimported: + +- **resources_reimported** **(** :ref:`PoolStringArray` resources **)** + +Emitted if a resource is reimported. + +---- + +.. _class_EditorFileSystem_signal_resources_reload: + +- **resources_reload** **(** :ref:`PoolStringArray` resources **)** + +Emitted if at least one resource is reloaded when the filesystem is scanned. + +---- + +.. _class_EditorFileSystem_signal_sources_changed: + +- **sources_changed** **(** :ref:`bool` exist **)** + +Emitted if the source of any imported file changed. + +Method Descriptions +------------------- + +.. _class_EditorFileSystem_method_get_file_type: + +- :ref:`String` **get_file_type** **(** :ref:`String` path **)** |const| + +Returns the resource type of the file, given the full path. This returns a string such as ``"Resource"`` or ``"GDScript"``, *not* a file extension such as ``".gd"``. + +---- + +.. _class_EditorFileSystem_method_get_filesystem: + +- :ref:`EditorFileSystemDirectory` **get_filesystem** **(** **)** + +Gets the root directory object. + +---- + +.. _class_EditorFileSystem_method_get_filesystem_path: + +- :ref:`EditorFileSystemDirectory` **get_filesystem_path** **(** :ref:`String` path **)** + +Returns a view into the filesystem at ``path``. + +---- + +.. _class_EditorFileSystem_method_get_scanning_progress: + +- :ref:`float` **get_scanning_progress** **(** **)** |const| + +Returns the scan progress for 0 to 1 if the FS is being scanned. + +---- + +.. _class_EditorFileSystem_method_is_scanning: + +- :ref:`bool` **is_scanning** **(** **)** |const| + +Returns ``true`` of the filesystem is being scanned. + +---- + +.. _class_EditorFileSystem_method_scan: + +- void **scan** **(** **)** + +Scan the filesystem for changes. + +---- + +.. _class_EditorFileSystem_method_scan_sources: + +- void **scan_sources** **(** **)** + +Check if the source of any imported resource changed. + +---- + +.. _class_EditorFileSystem_method_update_file: + +- void **update_file** **(** :ref:`String` path **)** + +Update a file information. Call this if an external program (not Godot) modified the file. + +---- + +.. _class_EditorFileSystem_method_update_script_classes: + +- void **update_script_classes** **(** **)** + +Scans the script files and updates the list of custom class names. + +.. |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.)` diff --git a/classes/class_editorfilesystemdirectory.rst b/classes/class_editorfilesystemdirectory.rst new file mode 100644 index 0000000..98eec5c --- /dev/null +++ b/classes/class_editorfilesystemdirectory.rst @@ -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 EditorFileSystemDirectory.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorFileSystemDirectory: + +EditorFileSystemDirectory +========================= + +**Inherits:** :ref:`Object` + +A directory for the resource filesystem. + +Description +----------- + +A more generalized, low-level variation of the directory concept. + +Methods +------- + ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_dir_index` **(** :ref:`String` name **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_file_index` **(** :ref:`String` name **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_file_count` **(** **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_file_import_is_valid` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file_path` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file_script_class_extends` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file_script_class_name` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file_type` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystemDirectory` | :ref:`get_parent` **(** **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_path` **(** **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystemDirectory` | :ref:`get_subdir` **(** :ref:`int` idx **)** | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_subdir_count` **(** **)** |const| | ++-------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorFileSystemDirectory_method_find_dir_index: + +- :ref:`int` **find_dir_index** **(** :ref:`String` name **)** |const| + +Returns the index of the directory with name ``name`` or ``-1`` if not found. + +---- + +.. _class_EditorFileSystemDirectory_method_find_file_index: + +- :ref:`int` **find_file_index** **(** :ref:`String` name **)** |const| + +Returns the index of the file with name ``name`` or ``-1`` if not found. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file: + +- :ref:`String` **get_file** **(** :ref:`int` idx **)** |const| + +Returns the name of the file at index ``idx``. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_count: + +- :ref:`int` **get_file_count** **(** **)** |const| + +Returns the number of files in this directory. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_import_is_valid: + +- :ref:`bool` **get_file_import_is_valid** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the file at index ``idx`` imported properly. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_path: + +- :ref:`String` **get_file_path** **(** :ref:`int` idx **)** |const| + +Returns the path to the file at index ``idx``. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_script_class_extends: + +- :ref:`String` **get_file_script_class_extends** **(** :ref:`int` idx **)** |const| + +Returns the base class of the script class defined in the file at index ``idx``. If the file doesn't define a script class using the ``class_name`` syntax, this will return an empty string. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_script_class_name: + +- :ref:`String` **get_file_script_class_name** **(** :ref:`int` idx **)** |const| + +Returns the name of the script class defined in the file at index ``idx``. If the file doesn't define a script class using the ``class_name`` syntax, this will return an empty string. + +---- + +.. _class_EditorFileSystemDirectory_method_get_file_type: + +- :ref:`String` **get_file_type** **(** :ref:`int` idx **)** |const| + +Returns the resource type of the file at index ``idx``. This returns a string such as ``"Resource"`` or ``"GDScript"``, *not* a file extension such as ``".gd"``. + +---- + +.. _class_EditorFileSystemDirectory_method_get_name: + +- :ref:`String` **get_name** **(** **)** + +Returns the name of this directory. + +---- + +.. _class_EditorFileSystemDirectory_method_get_parent: + +- :ref:`EditorFileSystemDirectory` **get_parent** **(** **)** + +Returns the parent directory for this directory or ``null`` if called on a directory at ``res://`` or ``user://``. + +---- + +.. _class_EditorFileSystemDirectory_method_get_path: + +- :ref:`String` **get_path** **(** **)** |const| + +Returns the path to this directory. + +---- + +.. _class_EditorFileSystemDirectory_method_get_subdir: + +- :ref:`EditorFileSystemDirectory` **get_subdir** **(** :ref:`int` idx **)** + +Returns the subdirectory at index ``idx``. + +---- + +.. _class_EditorFileSystemDirectory_method_get_subdir_count: + +- :ref:`int` **get_subdir_count** **(** **)** |const| + +Returns the number of subdirectories in this directory. + +.. |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.)` diff --git a/classes/class_editorimportplugin.rst b/classes/class_editorimportplugin.rst new file mode 100644 index 0000000..b63c904 --- /dev/null +++ b/classes/class_editorimportplugin.rst @@ -0,0 +1,213 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorImportPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorImportPlugin: + +EditorImportPlugin +================== + +**Inherits:** :ref:`ResourceImporter` **<** :ref:`Reference` **<** :ref:`Object` + +Registers a custom resource importer in the editor. Use the class to parse any file and import it as a new resource type. + +Description +----------- + +``EditorImportPlugin``\ s provide a way to extend the editor's resource import functionality. Use them to import resources from custom files or to provide alternatives to the editor's existing importers. + +EditorImportPlugins work by associating with specific file extensions and a resource type. See :ref:`get_recognized_extensions` and :ref:`get_resource_type`. They may optionally specify some import presets that affect the import process. EditorImportPlugins are responsible for creating the resources and saving them in the ``.import`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory`). + +Below is an example EditorImportPlugin that imports a :ref:`Mesh` from a file with the extension ".special" or ".spec": + +:: + + tool + extends EditorImportPlugin + + func get_importer_name(): + return "my.special.plugin" + + func get_visible_name(): + return "Special Mesh" + + func get_recognized_extensions(): + return ["special", "spec"] + + func get_save_extension(): + return "mesh" + + func get_resource_type(): + return "Mesh" + + func get_preset_count(): + return 1 + + func get_preset_name(i): + return "Default" + + func get_import_options(i): + return [{"name": "my_option", "default_value": false}] + + func import(source_file, save_path, options, platform_variants, gen_files): + var file = File.new() + if file.open(source_file, File.READ) != OK: + return FAILED + + var mesh = Mesh.new() + # Fill the Mesh with data read in "file", left as an exercise to the reader + + var filename = save_path + "." + get_save_extension() + return ResourceSaver.save(filename, mesh) + +To use ``EditorImportPlugin``, register it using the :ref:`EditorPlugin.add_import_plugin` method first. + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/import_plugins` + +Methods +------- + ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_import_options` **(** :ref:`int` preset **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_import_order` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_importer_name` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_option_visibility` **(** :ref:`String` option, :ref:`Dictionary` options **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_preset_count` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_preset_name` **(** :ref:`int` preset **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_priority` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_recognized_extensions` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_resource_type` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_save_extension` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_visible_name` **(** **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`import` **(** :ref:`String` source_file, :ref:`String` save_path, :ref:`Dictionary` options, :ref:`Array` platform_variants, :ref:`Array` gen_files **)** |virtual| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorImportPlugin_method_get_import_options: + +- :ref:`Array` **get_import_options** **(** :ref:`int` preset **)** |virtual| + +Gets the options and default values for the preset at this index. Returns an Array of Dictionaries with the following keys: ``name``, ``default_value``, ``property_hint`` (optional), ``hint_string`` (optional), ``usage`` (optional). + +---- + +.. _class_EditorImportPlugin_method_get_import_order: + +- :ref:`int` **get_import_order** **(** **)** |virtual| + +Gets the order of this importer to be run when importing resources. Importers with *lower* import orders will be called first, and higher values will be called later. Use this to ensure the importer runs after the dependencies are already imported. The default import order is ``0`` unless overridden by a specific importer. See :ref:`ImportOrder` for some predefined values. + +---- + +.. _class_EditorImportPlugin_method_get_importer_name: + +- :ref:`String` **get_importer_name** **(** **)** |virtual| + +Gets the unique name of the importer. + +---- + +.. _class_EditorImportPlugin_method_get_option_visibility: + +- :ref:`bool` **get_option_visibility** **(** :ref:`String` option, :ref:`Dictionary` options **)** |virtual| + +This method can be overridden to hide specific import options if conditions are met. This is mainly useful for hiding options that depend on others if one of them is disabled. For example: + +:: + + func get_option_visibility(option, options): + # Only show the lossy quality setting if the compression mode is set to "Lossy". + if option == "compress/lossy_quality" and options.has("compress/mode"): + return int(options["compress/mode"]) == COMPRESS_LOSSY + + return true + +Return ``true`` to make all options always visible. + +---- + +.. _class_EditorImportPlugin_method_get_preset_count: + +- :ref:`int` **get_preset_count** **(** **)** |virtual| + +Gets the number of initial presets defined by the plugin. Use :ref:`get_import_options` to get the default options for the preset and :ref:`get_preset_name` to get the name of the preset. + +---- + +.. _class_EditorImportPlugin_method_get_preset_name: + +- :ref:`String` **get_preset_name** **(** :ref:`int` preset **)** |virtual| + +Gets the name of the options preset at this index. + +---- + +.. _class_EditorImportPlugin_method_get_priority: + +- :ref:`float` **get_priority** **(** **)** |virtual| + +Gets the priority of this plugin for the recognized extension. Higher priority plugins will be preferred. The default priority is ``1.0``. + +---- + +.. _class_EditorImportPlugin_method_get_recognized_extensions: + +- :ref:`Array` **get_recognized_extensions** **(** **)** |virtual| + +Gets the list of file extensions to associate with this loader (case-insensitive). e.g. ``["obj"]``. + +---- + +.. _class_EditorImportPlugin_method_get_resource_type: + +- :ref:`String` **get_resource_type** **(** **)** |virtual| + +Gets the Godot resource type associated with this loader. e.g. ``"Mesh"`` or ``"Animation"``. + +---- + +.. _class_EditorImportPlugin_method_get_save_extension: + +- :ref:`String` **get_save_extension** **(** **)** |virtual| + +Gets the extension used to save this resource in the ``.import`` directory (see :ref:`ProjectSettings.application/config/use_hidden_project_data_directory`). + +---- + +.. _class_EditorImportPlugin_method_get_visible_name: + +- :ref:`String` **get_visible_name** **(** **)** |virtual| + +Gets the name to display in the import window. You should choose this name as a continuation to "Import as", e.g. "Import as Special Mesh". + +---- + +.. _class_EditorImportPlugin_method_import: + +- :ref:`int` **import** **(** :ref:`String` source_file, :ref:`String` save_path, :ref:`Dictionary` options, :ref:`Array` platform_variants, :ref:`Array` gen_files **)** |virtual| + +Imports ``source_file`` into ``save_path`` with the import ``options`` specified. The ``platform_variants`` and ``gen_files`` arrays will be modified by this function. + +This method must be overridden to do the actual importing work. See this class' description for an example of overriding this method. + +.. |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.)` diff --git a/classes/class_editorinspector.rst b/classes/class_editorinspector.rst new file mode 100644 index 0000000..6bcc32d --- /dev/null +++ b/classes/class_editorinspector.rst @@ -0,0 +1,109 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorInspector.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorInspector: + +EditorInspector +=============== + +**Inherits:** :ref:`ScrollContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A tab used to edit properties of the selected node. + +Description +----------- + +The editor inspector is by default located on the right-hand side of the editor. It's used to edit the properties of the selected node. For example, you can select a node such as :ref:`Sprite` then edit its transform through the inspector tool. The editor inspector is an essential tool in the game development workflow. + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_inspector`. + +Properties +---------- + ++-------------------------+---------------------------+-------------------------------+ +| :ref:`bool` | scroll_horizontal_enabled | ``false`` *(parent override)* | ++-------------------------+---------------------------+-------------------------------+ + +Methods +------- + ++------+------------------------------------------------------------------+ +| void | :ref:`refresh` **(** **)** | ++------+------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorInspector_signal_object_id_selected: + +- **object_id_selected** **(** :ref:`int` id **)** + +Emitted when the Edit button of an :ref:`Object` has been pressed in the inspector. This is mainly used in the remote scene tree inspector. + +---- + +.. _class_EditorInspector_signal_property_edited: + +- **property_edited** **(** :ref:`String` property **)** + +Emitted when a property is edited in the inspector. + +---- + +.. _class_EditorInspector_signal_property_keyed: + +- **property_keyed** **(** :ref:`String` property **)** + +Emitted when a property is keyed in the inspector. Properties can be keyed by clicking the "key" icon next to a property when the Animation panel is toggled. + +---- + +.. _class_EditorInspector_signal_property_selected: + +- **property_selected** **(** :ref:`String` property **)** + +Emitted when a property is selected in the inspector. + +---- + +.. _class_EditorInspector_signal_property_toggled: + +- **property_toggled** **(** :ref:`String` property, :ref:`bool` checked **)** + +Emitted when a boolean property is toggled in the inspector. + +**Note:** This signal is never emitted if the internal ``autoclear`` property enabled. Since this property is always enabled in the editor inspector, this signal is never emitted by the editor itself. + +---- + +.. _class_EditorInspector_signal_resource_selected: + +- **resource_selected** **(** :ref:`Object` res, :ref:`String` prop **)** + +Emitted when a resource is selected in the inspector. + +---- + +.. _class_EditorInspector_signal_restart_requested: + +- **restart_requested** **(** **)** + +Emitted when a property that requires a restart to be applied is edited in the inspector. This is only used in the Project Settings and Editor Settings. + +Method Descriptions +------------------- + +.. _class_EditorInspector_method_refresh: + +- void **refresh** **(** **)** + +Refreshes the inspector. + +**Note:** To save on CPU resources, calling this method will do nothing if the time specified in ``docks/property_editor/auto_refresh_interval`` editor setting hasn't passed yet since this method was last called. (By default, this interval is set to 0.3 seconds.) + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_editorinspectorplugin.rst b/classes/class_editorinspectorplugin.rst new file mode 100644 index 0000000..dce3616 --- /dev/null +++ b/classes/class_editorinspectorplugin.rst @@ -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 EditorInspectorPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorInspectorPlugin: + +EditorInspectorPlugin +===================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Plugin for adding custom property editors on inspector. + +Description +----------- + +``EditorInspectorPlugin`` allows adding custom property editors to :ref:`EditorInspector`. + +When an object is edited, the :ref:`can_handle` function is called and must return ``true`` if the object type is supported. + +If supported, the function :ref:`parse_begin` will be called, allowing to place custom controls at the beginning of the class. + +Subsequently, the :ref:`parse_category` and :ref:`parse_property` are called for every category and property. They offer the ability to add custom controls to the inspector too. + +Finally, :ref:`parse_end` will be called. + +On each of these calls, the "add" functions can be called. + +To use ``EditorInspectorPlugin``, register it using the :ref:`EditorPlugin.add_inspector_plugin` method first. + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/inspector_plugins` + +Methods +------- + ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_custom_control` **(** :ref:`Control` control **)** | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_property_editor` **(** :ref:`String` property, :ref:`Control` editor **)** | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_property_editor_for_multiple_properties` **(** :ref:`String` label, :ref:`PoolStringArray` properties, :ref:`Control` editor **)** | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_handle` **(** :ref:`Object` object **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`parse_begin` **(** :ref:`Object` object **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`parse_category` **(** :ref:`Object` object, :ref:`String` category **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`parse_end` **(** **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`parse_property` **(** :ref:`Object` object, :ref:`int` type, :ref:`String` path, :ref:`int` hint, :ref:`String` hint_text, :ref:`int` usage **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorInspectorPlugin_method_add_custom_control: + +- void **add_custom_control** **(** :ref:`Control` control **)** + +Adds a custom control, which is not necessarily a property editor. + +---- + +.. _class_EditorInspectorPlugin_method_add_property_editor: + +- void **add_property_editor** **(** :ref:`String` property, :ref:`Control` editor **)** + +Adds a property editor for an individual property. The ``editor`` control must extend :ref:`EditorProperty`. + +---- + +.. _class_EditorInspectorPlugin_method_add_property_editor_for_multiple_properties: + +- void **add_property_editor_for_multiple_properties** **(** :ref:`String` label, :ref:`PoolStringArray` properties, :ref:`Control` editor **)** + +Adds an editor that allows modifying multiple properties. The ``editor`` control must extend :ref:`EditorProperty`. + +---- + +.. _class_EditorInspectorPlugin_method_can_handle: + +- :ref:`bool` **can_handle** **(** :ref:`Object` object **)** |virtual| + +Returns ``true`` if this object can be handled by this plugin. + +---- + +.. _class_EditorInspectorPlugin_method_parse_begin: + +- void **parse_begin** **(** :ref:`Object` object **)** |virtual| + +Called to allow adding controls at the beginning of the list. + +---- + +.. _class_EditorInspectorPlugin_method_parse_category: + +- void **parse_category** **(** :ref:`Object` object, :ref:`String` category **)** |virtual| + +Called to allow adding controls at the beginning of the category. + +---- + +.. _class_EditorInspectorPlugin_method_parse_end: + +- void **parse_end** **(** **)** |virtual| + +Called to allow adding controls at the end of the list. + +---- + +.. _class_EditorInspectorPlugin_method_parse_property: + +- :ref:`bool` **parse_property** **(** :ref:`Object` object, :ref:`int` type, :ref:`String` path, :ref:`int` hint, :ref:`String` hint_text, :ref:`int` usage **)** |virtual| + +Called to allow adding property specific editors to the inspector. Usually these inherit :ref:`EditorProperty`. Returning ``true`` removes the built-in editor for this property, otherwise allows to insert a custom editor before the built-in one. + +.. |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.)` diff --git a/classes/class_editorinterface.rst b/classes/class_editorinterface.rst new file mode 100644 index 0000000..e0a7c04 --- /dev/null +++ b/classes/class_editorinterface.rst @@ -0,0 +1,397 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorInterface.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorInterface: + +EditorInterface +=============== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Godot editor's interface. + +Description +----------- + +EditorInterface gives you control over Godot editor's window. It allows customizing the window, saving and (re-)loading scenes, rendering mesh previews, inspecting and editing resources and objects, and provides access to :ref:`EditorSettings`, :ref:`EditorFileSystem`, :ref:`EditorResourcePreview`, :ref:`ScriptEditor`, the editor viewport, and information about scenes. + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorPlugin.get_editor_interface`. + +Properties +---------- + ++-------------------------+------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`distraction_free_mode` | ++-------------------------+------------------------------------------------------------------------------------+ + +Methods +------- + ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`edit_node` **(** :ref:`Node` node **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`edit_resource` **(** :ref:`Resource` resource **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`edit_script` **(** :ref:`Script` script, :ref:`int` line=-1, :ref:`int` column=0, :ref:`bool` grab_focus=true **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_base_control` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_path` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_edited_scene_root` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_editor_scale` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSettings` | :ref:`get_editor_settings` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_editor_viewport` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`FileSystemDock` | :ref:`get_file_system_dock` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorInspector` | :ref:`get_inspector` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_open_scenes` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_playing_scene` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorFileSystem` | :ref:`get_resource_filesystem` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorResourcePreview` | :ref:`get_resource_previewer` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ScriptEditor` | :ref:`get_script_editor` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_selected_path` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSelection` | :ref:`get_selection` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`inspect_object` **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing_scene` **(** **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_plugin_enabled` **(** :ref:`String` plugin **)** |const| | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`make_mesh_previews` **(** :ref:`Array` meshes, :ref:`int` preview_size **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`open_scene_from_path` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_current_scene` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_custom_scene` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`play_main_scene` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reload_scene_from_path` **(** :ref:`String` scene_filepath **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_scene` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`save_scene_as` **(** :ref:`String` path, :ref:`bool` with_preview=true **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select_file` **(** :ref:`String` file **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_main_screen_editor` **(** :ref:`String` name **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_plugin_enabled` **(** :ref:`String` plugin, :ref:`bool` enabled **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop_playing_scene` **(** **)** | ++-----------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_EditorInterface_property_distraction_free_mode: + +- :ref:`bool` **distraction_free_mode** + ++----------+------------------------------------+ +| *Setter* | set_distraction_free_mode(value) | ++----------+------------------------------------+ +| *Getter* | is_distraction_free_mode_enabled() | ++----------+------------------------------------+ + +If ``true``, enables distraction-free mode which hides side docks to increase the space available for the main view. + +Method Descriptions +------------------- + +.. _class_EditorInterface_method_edit_node: + +- void **edit_node** **(** :ref:`Node` node **)** + +Edits the given :ref:`Node`. The node will be also selected if it's inside the scene tree. + +---- + +.. _class_EditorInterface_method_edit_resource: + +- void **edit_resource** **(** :ref:`Resource` resource **)** + +Edits the given :ref:`Resource`. If the resource is a :ref:`Script` you can also edit it with :ref:`edit_script` to specify the line and column position. + +---- + +.. _class_EditorInterface_method_edit_script: + +- void **edit_script** **(** :ref:`Script` script, :ref:`int` line=-1, :ref:`int` column=0, :ref:`bool` grab_focus=true **)** + +Edits the given :ref:`Script`. The line and column on which to open the script can also be specified. The script will be open with the user-configured editor for the script's language which may be an external editor. + +---- + +.. _class_EditorInterface_method_get_base_control: + +- :ref:`Control` **get_base_control** **(** **)** + +Returns the main container of Godot editor's window. For example, you can use it to retrieve the size of the container and place your controls accordingly. + +**Warning:** Removing and freeing this node will render the editor useless and may cause a crash. + +---- + +.. _class_EditorInterface_method_get_current_path: + +- :ref:`String` **get_current_path** **(** **)** |const| + +Returns the current path being viewed in the :ref:`FileSystemDock`. + +---- + +.. _class_EditorInterface_method_get_edited_scene_root: + +- :ref:`Node` **get_edited_scene_root** **(** **)** + +Returns the edited (current) scene's root :ref:`Node`. + +---- + +.. _class_EditorInterface_method_get_editor_scale: + +- :ref:`float` **get_editor_scale** **(** **)** |const| + +Returns the actual scale of the editor UI (``1.0`` being 100% scale). This can be used to adjust position and dimensions of the UI added by plugins. + +**Note:** This value is set via the ``interface/editor/display_scale`` and ``interface/editor/custom_display_scale`` editor settings. Editor must be restarted for changes to be properly applied. + +---- + +.. _class_EditorInterface_method_get_editor_settings: + +- :ref:`EditorSettings` **get_editor_settings** **(** **)** + +Returns the editor's :ref:`EditorSettings` instance. + +---- + +.. _class_EditorInterface_method_get_editor_viewport: + +- :ref:`Control` **get_editor_viewport** **(** **)** + +Returns the main editor control. Use this as a parent for main screens. + +**Note:** This returns the main editor control containing the whole editor, not the 2D or 3D viewports specifically. + +**Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + +---- + +.. _class_EditorInterface_method_get_file_system_dock: + +- :ref:`FileSystemDock` **get_file_system_dock** **(** **)** + +Returns the editor's :ref:`FileSystemDock` instance. + +**Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + +---- + +.. _class_EditorInterface_method_get_inspector: + +- :ref:`EditorInspector` **get_inspector** **(** **)** |const| + +Returns the editor's :ref:`EditorInspector` instance. + +**Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + +---- + +.. _class_EditorInterface_method_get_open_scenes: + +- :ref:`Array` **get_open_scenes** **(** **)** |const| + +Returns an :ref:`Array` with the file paths of the currently opened scenes. + +---- + +.. _class_EditorInterface_method_get_playing_scene: + +- :ref:`String` **get_playing_scene** **(** **)** |const| + +Returns the name of the scene that is being played. If no scene is currently being played, returns an empty string. + +---- + +.. _class_EditorInterface_method_get_resource_filesystem: + +- :ref:`EditorFileSystem` **get_resource_filesystem** **(** **)** + +Returns the editor's :ref:`EditorFileSystem` instance. + +---- + +.. _class_EditorInterface_method_get_resource_previewer: + +- :ref:`EditorResourcePreview` **get_resource_previewer** **(** **)** + +Returns the editor's :ref:`EditorResourcePreview` instance. + +---- + +.. _class_EditorInterface_method_get_script_editor: + +- :ref:`ScriptEditor` **get_script_editor** **(** **)** + +Returns the editor's :ref:`ScriptEditor` instance. + +**Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + +---- + +.. _class_EditorInterface_method_get_selected_path: + +- :ref:`String` **get_selected_path** **(** **)** |const| + +Returns the path of the directory currently selected in the :ref:`FileSystemDock`. If a file is selected, its base directory will be returned using :ref:`String.get_base_dir` instead. + +---- + +.. _class_EditorInterface_method_get_selection: + +- :ref:`EditorSelection` **get_selection** **(** **)** + +Returns the editor's :ref:`EditorSelection` instance. + +---- + +.. _class_EditorInterface_method_inspect_object: + +- void **inspect_object** **(** :ref:`Object` object, :ref:`String` for_property="", :ref:`bool` inspector_only=false **)** + +Shows the given property on the given ``object`` in the editor's Inspector dock. If ``inspector_only`` is ``true``, plugins will not attempt to edit ``object``. + +---- + +.. _class_EditorInterface_method_is_playing_scene: + +- :ref:`bool` **is_playing_scene** **(** **)** |const| + +Returns ``true`` if a scene is currently being played, ``false`` otherwise. Paused scenes are considered as being played. + +---- + +.. _class_EditorInterface_method_is_plugin_enabled: + +- :ref:`bool` **is_plugin_enabled** **(** :ref:`String` plugin **)** |const| + +Returns ``true`` if the specified ``plugin`` is enabled. The plugin name is the same as its directory name. + +---- + +.. _class_EditorInterface_method_make_mesh_previews: + +- :ref:`Array` **make_mesh_previews** **(** :ref:`Array` meshes, :ref:`int` preview_size **)** + +Returns mesh previews rendered at the given size as an :ref:`Array` of :ref:`Texture`\ s. + +---- + +.. _class_EditorInterface_method_open_scene_from_path: + +- void **open_scene_from_path** **(** :ref:`String` scene_filepath **)** + +Opens the scene at the given path. + +---- + +.. _class_EditorInterface_method_play_current_scene: + +- void **play_current_scene** **(** **)** + +Plays the currently active scene. + +---- + +.. _class_EditorInterface_method_play_custom_scene: + +- void **play_custom_scene** **(** :ref:`String` scene_filepath **)** + +Plays the scene specified by its filepath. + +---- + +.. _class_EditorInterface_method_play_main_scene: + +- void **play_main_scene** **(** **)** + +Plays the main scene. + +---- + +.. _class_EditorInterface_method_reload_scene_from_path: + +- void **reload_scene_from_path** **(** :ref:`String` scene_filepath **)** + +Reloads the scene at the given path. + +---- + +.. _class_EditorInterface_method_save_scene: + +- :ref:`Error` **save_scene** **(** **)** + +Saves the scene. Returns either ``OK`` or ``ERR_CANT_CREATE`` (see :ref:`@GlobalScope` constants). + +---- + +.. _class_EditorInterface_method_save_scene_as: + +- void **save_scene_as** **(** :ref:`String` path, :ref:`bool` with_preview=true **)** + +Saves the scene as a file at ``path``. + +---- + +.. _class_EditorInterface_method_select_file: + +- void **select_file** **(** :ref:`String` file **)** + +Selects the file, with the path provided by ``file``, in the FileSystem dock. + +---- + +.. _class_EditorInterface_method_set_main_screen_editor: + +- void **set_main_screen_editor** **(** :ref:`String` name **)** + +Sets the editor's current main screen to the one specified in ``name``. ``name`` must match the text of the tab in question exactly (``2D``, ``3D``, ``Script``, ``AssetLib``). + +---- + +.. _class_EditorInterface_method_set_plugin_enabled: + +- void **set_plugin_enabled** **(** :ref:`String` plugin, :ref:`bool` enabled **)** + +Sets the enabled status of a plugin. The plugin name is the same as its directory name. + +---- + +.. _class_EditorInterface_method_stop_playing_scene: + +- void **stop_playing_scene** **(** **)** + +Stops the scene that is currently playing. + +.. |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.)` diff --git a/classes/class_editornavigationmeshgenerator.rst b/classes/class_editornavigationmeshgenerator.rst new file mode 100644 index 0000000..836ef87 --- /dev/null +++ b/classes/class_editornavigationmeshgenerator.rst @@ -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 EditorNavigationMeshGenerator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorNavigationMeshGenerator: + +EditorNavigationMeshGenerator +============================= + +**Inherits:** :ref:`Object` + + + +Methods +------- + ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bake` **(** :ref:`NavigationMesh` nav_mesh, :ref:`Node` root_node **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** :ref:`NavigationMesh` nav_mesh **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorNavigationMeshGenerator_method_bake: + +- void **bake** **(** :ref:`NavigationMesh` nav_mesh, :ref:`Node` root_node **)** + +---- + +.. _class_EditorNavigationMeshGenerator_method_clear: + +- void **clear** **(** :ref:`NavigationMesh` nav_mesh **)** + +.. |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.)` diff --git a/classes/class_editorplugin.rst b/classes/class_editorplugin.rst new file mode 100644 index 0000000..acb2255 --- /dev/null +++ b/classes/class_editorplugin.rst @@ -0,0 +1,837 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorPlugin: + +EditorPlugin +============ + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Used by the editor to extend its functionality. + +Description +----------- + +Plugins are used by the editor to extend functionality. The most common types of plugins are those which edit a given node or resource type, import plugins and export plugins. See also :ref:`EditorScript` to add functions to the editor. + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/index` + +Methods +------- + ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_autoload_singleton` **(** :ref:`String` name, :ref:`String` path **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ToolButton` | :ref:`add_control_to_bottom_panel` **(** :ref:`Control` control, :ref:`String` title **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_control_to_container` **(** :ref:`CustomControlContainer` container, :ref:`Control` control **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_control_to_dock` **(** :ref:`DockSlot` slot, :ref:`Control` control **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_custom_type` **(** :ref:`String` type, :ref:`String` base, :ref:`Script` script, :ref:`Texture` icon **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_export_plugin` **(** :ref:`EditorExportPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_import_plugin` **(** :ref:`EditorImportPlugin` importer **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_inspector_plugin` **(** :ref:`EditorInspectorPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_scene_import_plugin` **(** :ref:`EditorSceneImporter` scene_importer **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_spatial_gizmo_plugin` **(** :ref:`EditorSpatialGizmoPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_tool_menu_item` **(** :ref:`String` name, :ref:`Object` handler, :ref:`String` callback, :ref:`Variant` ud=null **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_tool_submenu_item` **(** :ref:`String` name, :ref:`Object` submenu **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_changes` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`build` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disable_plugin` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`edit` **(** :ref:`Object` object **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`enable_plugin` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_canvas_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_canvas_force_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`forward_canvas_gui_input` **(** :ref:`InputEvent` event **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_spatial_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`forward_spatial_force_draw_over_viewport` **(** :ref:`Control` overlay **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`forward_spatial_gui_input` **(** :ref:`Camera` camera, :ref:`InputEvent` event **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_breakpoints` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorInterface` | :ref:`get_editor_interface` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_plugin_icon` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_plugin_name` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ScriptCreateDialog` | :ref:`get_script_create_dialog` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_state` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UndoRedo` | :ref:`get_undo_redo` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`get_window_layout` **(** :ref:`ConfigFile` layout **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`handles` **(** :ref:`Object` object **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_main_screen` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hide_bottom_panel` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_bottom_panel_item_visible` **(** :ref:`Control` item **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_visible` **(** :ref:`bool` visible **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_save_layout` **(** **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_autoload_singleton` **(** :ref:`String` name **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_control_from_bottom_panel` **(** :ref:`Control` control **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_control_from_container` **(** :ref:`CustomControlContainer` container, :ref:`Control` control **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_control_from_docks` **(** :ref:`Control` control **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_custom_type` **(** :ref:`String` type **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_export_plugin` **(** :ref:`EditorExportPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_import_plugin` **(** :ref:`EditorImportPlugin` importer **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_inspector_plugin` **(** :ref:`EditorInspectorPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_scene_import_plugin` **(** :ref:`EditorSceneImporter` scene_importer **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_spatial_gizmo_plugin` **(** :ref:`EditorSpatialGizmoPlugin` plugin **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_tool_menu_item` **(** :ref:`String` name **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`save_external_data` **(** **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_force_draw_over_forwarding_enabled` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_event_forwarding_always_enabled` **(** **)** | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_state` **(** :ref:`Dictionary` state **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_window_layout` **(** :ref:`ConfigFile` layout **)** |virtual| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`update_overlays` **(** **)** |const| | ++-----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorPlugin_signal_main_screen_changed: + +- **main_screen_changed** **(** :ref:`String` screen_name **)** + +Emitted when user changes the workspace (**2D**, **3D**, **Script**, **AssetLib**). Also works with custom screens defined by plugins. + +---- + +.. _class_EditorPlugin_signal_resource_saved: + +- **resource_saved** **(** :ref:`Resource` resource **)** + +---- + +.. _class_EditorPlugin_signal_scene_changed: + +- **scene_changed** **(** :ref:`Node` scene_root **)** + +Emitted when the scene is changed in the editor. The argument will return the root node of the scene that has just become active. If this scene is new and empty, the argument will be ``null``. + +---- + +.. _class_EditorPlugin_signal_scene_closed: + +- **scene_closed** **(** :ref:`String` filepath **)** + +Emitted when user closes a scene. The argument is file path to a closed scene. + +Enumerations +------------ + +.. _enum_EditorPlugin_CustomControlContainer: + +.. _class_EditorPlugin_constant_CONTAINER_TOOLBAR: + +.. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_MENU: + +.. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_SIDE_LEFT: + +.. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT: + +.. _class_EditorPlugin_constant_CONTAINER_SPATIAL_EDITOR_BOTTOM: + +.. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_MENU: + +.. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_SIDE_LEFT: + +.. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_SIDE_RIGHT: + +.. _class_EditorPlugin_constant_CONTAINER_CANVAS_EDITOR_BOTTOM: + +.. _class_EditorPlugin_constant_CONTAINER_PROPERTY_EDITOR_BOTTOM: + +.. _class_EditorPlugin_constant_CONTAINER_PROJECT_SETTING_TAB_LEFT: + +.. _class_EditorPlugin_constant_CONTAINER_PROJECT_SETTING_TAB_RIGHT: + +enum **CustomControlContainer**: + +- **CONTAINER_TOOLBAR** = **0** + +- **CONTAINER_SPATIAL_EDITOR_MENU** = **1** + +- **CONTAINER_SPATIAL_EDITOR_SIDE_LEFT** = **2** + +- **CONTAINER_SPATIAL_EDITOR_SIDE_RIGHT** = **3** + +- **CONTAINER_SPATIAL_EDITOR_BOTTOM** = **4** + +- **CONTAINER_CANVAS_EDITOR_MENU** = **5** + +- **CONTAINER_CANVAS_EDITOR_SIDE_LEFT** = **6** + +- **CONTAINER_CANVAS_EDITOR_SIDE_RIGHT** = **7** + +- **CONTAINER_CANVAS_EDITOR_BOTTOM** = **8** + +- **CONTAINER_PROPERTY_EDITOR_BOTTOM** = **9** + +- **CONTAINER_PROJECT_SETTING_TAB_LEFT** = **10** + +- **CONTAINER_PROJECT_SETTING_TAB_RIGHT** = **11** + +---- + +.. _enum_EditorPlugin_DockSlot: + +.. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_UL: + +.. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_BL: + +.. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_UR: + +.. _class_EditorPlugin_constant_DOCK_SLOT_LEFT_BR: + +.. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_UL: + +.. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_BL: + +.. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_UR: + +.. _class_EditorPlugin_constant_DOCK_SLOT_RIGHT_BR: + +.. _class_EditorPlugin_constant_DOCK_SLOT_MAX: + +enum **DockSlot**: + +- **DOCK_SLOT_LEFT_UL** = **0** + +- **DOCK_SLOT_LEFT_BL** = **1** + +- **DOCK_SLOT_LEFT_UR** = **2** + +- **DOCK_SLOT_LEFT_BR** = **3** + +- **DOCK_SLOT_RIGHT_UL** = **4** + +- **DOCK_SLOT_RIGHT_BL** = **5** + +- **DOCK_SLOT_RIGHT_UR** = **6** + +- **DOCK_SLOT_RIGHT_BR** = **7** + +- **DOCK_SLOT_MAX** = **8** --- Represents the size of the :ref:`DockSlot` enum. + +Method Descriptions +------------------- + +.. _class_EditorPlugin_method_add_autoload_singleton: + +- void **add_autoload_singleton** **(** :ref:`String` name, :ref:`String` path **)** + +Adds a script at ``path`` to the Autoload list as ``name``. + +---- + +.. _class_EditorPlugin_method_add_control_to_bottom_panel: + +- :ref:`ToolButton` **add_control_to_bottom_panel** **(** :ref:`Control` control, :ref:`String` title **)** + +Adds a control to the bottom panel (together with Output, Debug, Animation, etc). Returns a reference to the button added. It's up to you to hide/show the button when needed. When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_bottom_panel` and free it with :ref:`Node.queue_free`. + +---- + +.. _class_EditorPlugin_method_add_control_to_container: + +- void **add_control_to_container** **(** :ref:`CustomControlContainer` container, :ref:`Control` control **)** + +Adds a custom control to a container (see :ref:`CustomControlContainer`). There are many locations where custom controls can be added in the editor UI. + +Please remember that you have to manage the visibility of your custom controls yourself (and likely hide it after adding it). + +When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_container` and free it with :ref:`Node.queue_free`. + +---- + +.. _class_EditorPlugin_method_add_control_to_dock: + +- void **add_control_to_dock** **(** :ref:`DockSlot` slot, :ref:`Control` control **)** + +Adds the control to a specific dock slot (see :ref:`DockSlot` for options). + +If the dock is repositioned and as long as the plugin is active, the editor will save the dock position on further sessions. + +When your plugin is deactivated, make sure to remove your custom control with :ref:`remove_control_from_docks` and free it with :ref:`Node.queue_free`. + +---- + +.. _class_EditorPlugin_method_add_custom_type: + +- void **add_custom_type** **(** :ref:`String` type, :ref:`String` base, :ref:`Script` script, :ref:`Texture` icon **)** + +Adds a custom type, which will appear in the list of nodes or resources. An icon can be optionally passed. + +When given node or resource is selected, the base type will be instanced (ie, "Spatial", "Control", "Resource"), then the script will be loaded and set to this object. + +You can use the virtual method :ref:`handles` to check if your custom object is being edited by checking the script or using the ``is`` keyword. + +During run-time, this will be a simple object with a script so this function does not need to be called then. + +---- + +.. _class_EditorPlugin_method_add_export_plugin: + +- void **add_export_plugin** **(** :ref:`EditorExportPlugin` plugin **)** + +Registers a new :ref:`EditorExportPlugin`. Export plugins are used to perform tasks when the project is being exported. + +See :ref:`add_inspector_plugin` for an example of how to register a plugin. + +---- + +.. _class_EditorPlugin_method_add_import_plugin: + +- void **add_import_plugin** **(** :ref:`EditorImportPlugin` importer **)** + +Registers a new :ref:`EditorImportPlugin`. Import plugins are used to import custom and unsupported assets as a custom :ref:`Resource` type. + +**Note:** If you want to import custom 3D asset formats use :ref:`add_scene_import_plugin` instead. + +See :ref:`add_inspector_plugin` for an example of how to register a plugin. + +---- + +.. _class_EditorPlugin_method_add_inspector_plugin: + +- void **add_inspector_plugin** **(** :ref:`EditorInspectorPlugin` plugin **)** + +Registers a new :ref:`EditorInspectorPlugin`. Inspector plugins are used to extend :ref:`EditorInspector` and provide custom configuration tools for your object's properties. + +**Note:** Always use :ref:`remove_inspector_plugin` to remove the registered :ref:`EditorInspectorPlugin` when your ``EditorPlugin`` is disabled to prevent leaks and an unexpected behavior. + +:: + + const MyInspectorPlugin = preload("res://addons/your_addon/path/to/your/script.gd") + var inspector_plugin = MyInspectorPlugin.new() + + func _enter_tree(): + add_inspector_plugin(inspector_plugin) + + func _exit_tree(): + remove_inspector_plugin(inspector_plugin) + +---- + +.. _class_EditorPlugin_method_add_scene_import_plugin: + +- void **add_scene_import_plugin** **(** :ref:`EditorSceneImporter` scene_importer **)** + +Registers a new :ref:`EditorSceneImporter`. Scene importers are used to import custom 3D asset formats as scenes. + +---- + +.. _class_EditorPlugin_method_add_spatial_gizmo_plugin: + +- void **add_spatial_gizmo_plugin** **(** :ref:`EditorSpatialGizmoPlugin` plugin **)** + +Registers a new :ref:`EditorSpatialGizmoPlugin`. Gizmo plugins are used to add custom gizmos to the 3D preview viewport for a :ref:`Spatial`. + +See :ref:`add_inspector_plugin` for an example of how to register a plugin. + +---- + +.. _class_EditorPlugin_method_add_tool_menu_item: + +- void **add_tool_menu_item** **(** :ref:`String` name, :ref:`Object` handler, :ref:`String` callback, :ref:`Variant` ud=null **)** + +Adds a custom menu item to **Project > Tools** as ``name`` that calls ``callback`` on an instance of ``handler`` with a parameter ``ud`` when user activates it. + +---- + +.. _class_EditorPlugin_method_add_tool_submenu_item: + +- void **add_tool_submenu_item** **(** :ref:`String` name, :ref:`Object` submenu **)** + +Adds a custom submenu under **Project > Tools >** ``name``. ``submenu`` should be an object of class :ref:`PopupMenu`. This submenu should be cleaned up using ``remove_tool_menu_item(name)``. + +---- + +.. _class_EditorPlugin_method_apply_changes: + +- void **apply_changes** **(** **)** |virtual| + +This method is called when the editor is about to save the project, switch to another tab, etc. It asks the plugin to apply any pending state changes to ensure consistency. + +This is used, for example, in shader editors to let the plugin know that it must apply the shader code being written by the user to the object. + +---- + +.. _class_EditorPlugin_method_build: + +- :ref:`bool` **build** **(** **)** |virtual| + +This method is called when the editor is about to run the project. The plugin can then perform required operations before the project runs. + +This method must return a boolean. If this method returns ``false``, the project will not run. The run is aborted immediately, so this also prevents all other plugins' :ref:`build` methods from running. + +---- + +.. _class_EditorPlugin_method_clear: + +- void **clear** **(** **)** |virtual| + +Clear all the state and reset the object being edited to zero. This ensures your plugin does not keep editing a currently existing node, or a node from the wrong scene. + +---- + +.. _class_EditorPlugin_method_disable_plugin: + +- void **disable_plugin** **(** **)** |virtual| + +Called by the engine when the user disables the ``EditorPlugin`` in the Plugin tab of the project settings window. + +---- + +.. _class_EditorPlugin_method_edit: + +- void **edit** **(** :ref:`Object` object **)** |virtual| + +This function is used for plugins that edit specific object types (nodes or resources). It requests the editor to edit the given object. + +---- + +.. _class_EditorPlugin_method_enable_plugin: + +- void **enable_plugin** **(** **)** |virtual| + +Called by the engine when the user enables the ``EditorPlugin`` in the Plugin tab of the project settings window. + +---- + +.. _class_EditorPlugin_method_forward_canvas_draw_over_viewport: + +- void **forward_canvas_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +Called by the engine when the 2D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. + +:: + + func forward_canvas_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64, Color.white) + + func forward_canvas_gui_input(event): + if event is InputEventMouseMotion: + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + +---- + +.. _class_EditorPlugin_method_forward_canvas_force_draw_over_viewport: + +- void **forward_canvas_force_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +This method is the same as :ref:`forward_canvas_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. + +---- + +.. _class_EditorPlugin_method_forward_canvas_gui_input: + +- :ref:`bool` **forward_canvas_gui_input** **(** :ref:`InputEvent` event **)** |virtual| + +Called when there is a root node in the current edited scene, :ref:`handles` is implemented and an :ref:`InputEvent` happens in the 2D viewport. Intercepts the :ref:`InputEvent`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. Example: + +:: + + # Prevents the InputEvent to reach other Editor classes + func forward_canvas_gui_input(event): + var forward = true + return forward + +Must ``return false`` in order to forward the :ref:`InputEvent` to other Editor classes. Example: + +:: + + # Consumes InputEventMouseMotion and forwards other InputEvent types + func forward_canvas_gui_input(event): + var forward = false + if event is InputEventMouseMotion: + forward = true + return forward + +---- + +.. _class_EditorPlugin_method_forward_spatial_draw_over_viewport: + +- void **forward_spatial_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +Called by the engine when the 3D editor's viewport is updated. Use the ``overlay`` :ref:`Control` for drawing. You can update the viewport manually by calling :ref:`update_overlays`. + +:: + + func forward_spatial_draw_over_viewport(overlay): + # Draw a circle at cursor position. + overlay.draw_circle(overlay.get_local_mouse_position(), 64) + + func forward_spatial_gui_input(camera, event): + if event is InputEventMouseMotion: + # Redraw viewport when cursor is moved. + update_overlays() + return true + return false + +---- + +.. _class_EditorPlugin_method_forward_spatial_force_draw_over_viewport: + +- void **forward_spatial_force_draw_over_viewport** **(** :ref:`Control` overlay **)** |virtual| + +This method is the same as :ref:`forward_spatial_draw_over_viewport`, except it draws on top of everything. Useful when you need an extra layer that shows over anything else. + +You need to enable calling of this method by using :ref:`set_force_draw_over_forwarding_enabled`. + +---- + +.. _class_EditorPlugin_method_forward_spatial_gui_input: + +- :ref:`bool` **forward_spatial_gui_input** **(** :ref:`Camera` camera, :ref:`InputEvent` event **)** |virtual| + +Called when there is a root node in the current edited scene, :ref:`handles` is implemented and an :ref:`InputEvent` happens in the 3D viewport. Intercepts the :ref:`InputEvent`, if ``return true`` ``EditorPlugin`` consumes the ``event``, otherwise forwards ``event`` to other Editor classes. Example: + +:: + + # Prevents the InputEvent to reach other Editor classes + func forward_spatial_gui_input(camera, event): + var forward = true + return forward + +Must ``return false`` in order to forward the :ref:`InputEvent` to other Editor classes. Example: + +:: + + # Consumes InputEventMouseMotion and forwards other InputEvent types + func forward_spatial_gui_input(camera, event): + var forward = false + if event is InputEventMouseMotion: + forward = true + return forward + +---- + +.. _class_EditorPlugin_method_get_breakpoints: + +- :ref:`PoolStringArray` **get_breakpoints** **(** **)** |virtual| + +This is for editors that edit script-based objects. You can return a list of breakpoints in the format (``script:line``), for example: ``res://path_to_script.gd:25``. + +---- + +.. _class_EditorPlugin_method_get_editor_interface: + +- :ref:`EditorInterface` **get_editor_interface** **(** **)** + +Returns the :ref:`EditorInterface` object that gives you control over Godot editor's window and its functionalities. + +---- + +.. _class_EditorPlugin_method_get_plugin_icon: + +- :ref:`Texture` **get_plugin_icon** **(** **)** |virtual| + +Override this method in your plugin to return a :ref:`Texture` in order to give it an icon. + +For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + +Ideally, the plugin icon should be white with a transparent background and 16x16 pixels in size. + +:: + + func get_plugin_icon(): + # You can use a custom icon: + return preload("res://addons/my_plugin/my_plugin_icon.svg") + # Or use a built-in icon: + return get_editor_interface().get_base_control().get_icon("Node", "EditorIcons") + +---- + +.. _class_EditorPlugin_method_get_plugin_name: + +- :ref:`String` **get_plugin_name** **(** **)** |virtual| + +Override this method in your plugin to provide the name of the plugin when displayed in the Godot editor. + +For main screen plugins, this appears at the top of the screen, to the right of the "2D", "3D", "Script", and "AssetLib" buttons. + +---- + +.. _class_EditorPlugin_method_get_script_create_dialog: + +- :ref:`ScriptCreateDialog` **get_script_create_dialog** **(** **)** + +Gets the Editor's dialogue used for making scripts. + +**Note:** Users can configure it before use. + +**Warning:** Removing and freeing this node will render a part of the editor useless and may cause a crash. + +---- + +.. _class_EditorPlugin_method_get_state: + +- :ref:`Dictionary` **get_state** **(** **)** |virtual| + +Gets the state of your plugin editor. This is used when saving the scene (so state is kept when opening it again) and for switching tabs (so state can be restored when the tab returns). + +---- + +.. _class_EditorPlugin_method_get_undo_redo: + +- :ref:`UndoRedo` **get_undo_redo** **(** **)** + +Gets the undo/redo object. Most actions in the editor can be undoable, so use this object to make sure this happens when it's worth it. + +---- + +.. _class_EditorPlugin_method_get_window_layout: + +- void **get_window_layout** **(** :ref:`ConfigFile` layout **)** |virtual| + +Gets the GUI layout of the plugin. This is used to save the project's editor layout when :ref:`queue_save_layout` is called or the editor layout was changed(For example changing the position of a dock). + +---- + +.. _class_EditorPlugin_method_handles: + +- :ref:`bool` **handles** **(** :ref:`Object` object **)** |virtual| + +Implement this function if your plugin edits a specific type of object (Resource or Node). If you return ``true``, then you will get the functions :ref:`edit` and :ref:`make_visible` called when the editor requests them. If you have declared the methods :ref:`forward_canvas_gui_input` and :ref:`forward_spatial_gui_input` these will be called too. + +---- + +.. _class_EditorPlugin_method_has_main_screen: + +- :ref:`bool` **has_main_screen** **(** **)** |virtual| + +Returns ``true`` if this is a main screen editor plugin (it goes in the workspace selector together with **2D**, **3D**, **Script** and **AssetLib**). + +---- + +.. _class_EditorPlugin_method_hide_bottom_panel: + +- void **hide_bottom_panel** **(** **)** + +Minimizes the bottom panel. + +---- + +.. _class_EditorPlugin_method_make_bottom_panel_item_visible: + +- void **make_bottom_panel_item_visible** **(** :ref:`Control` item **)** + +Makes a specific item in the bottom panel visible. + +---- + +.. _class_EditorPlugin_method_make_visible: + +- void **make_visible** **(** :ref:`bool` visible **)** |virtual| + +This function will be called when the editor is requested to become visible. It is used for plugins that edit a specific object type. + +Remember that you have to manage the visibility of all your editor controls manually. + +---- + +.. _class_EditorPlugin_method_queue_save_layout: + +- void **queue_save_layout** **(** **)** |const| + +Queue save the project's editor layout. + +---- + +.. _class_EditorPlugin_method_remove_autoload_singleton: + +- void **remove_autoload_singleton** **(** :ref:`String` name **)** + +Removes an Autoload ``name`` from the list. + +---- + +.. _class_EditorPlugin_method_remove_control_from_bottom_panel: + +- void **remove_control_from_bottom_panel** **(** :ref:`Control` control **)** + +Removes the control from the bottom panel. You have to manually :ref:`Node.queue_free` the control. + +---- + +.. _class_EditorPlugin_method_remove_control_from_container: + +- void **remove_control_from_container** **(** :ref:`CustomControlContainer` container, :ref:`Control` control **)** + +Removes the control from the specified container. You have to manually :ref:`Node.queue_free` the control. + +---- + +.. _class_EditorPlugin_method_remove_control_from_docks: + +- void **remove_control_from_docks** **(** :ref:`Control` control **)** + +Removes the control from the dock. You have to manually :ref:`Node.queue_free` the control. + +---- + +.. _class_EditorPlugin_method_remove_custom_type: + +- void **remove_custom_type** **(** :ref:`String` type **)** + +Removes a custom type added by :ref:`add_custom_type`. + +---- + +.. _class_EditorPlugin_method_remove_export_plugin: + +- void **remove_export_plugin** **(** :ref:`EditorExportPlugin` plugin **)** + +Removes an export plugin registered by :ref:`add_export_plugin`. + +---- + +.. _class_EditorPlugin_method_remove_import_plugin: + +- void **remove_import_plugin** **(** :ref:`EditorImportPlugin` importer **)** + +Removes an import plugin registered by :ref:`add_import_plugin`. + +---- + +.. _class_EditorPlugin_method_remove_inspector_plugin: + +- void **remove_inspector_plugin** **(** :ref:`EditorInspectorPlugin` plugin **)** + +Removes an inspector plugin registered by :ref:`add_import_plugin` + +---- + +.. _class_EditorPlugin_method_remove_scene_import_plugin: + +- void **remove_scene_import_plugin** **(** :ref:`EditorSceneImporter` scene_importer **)** + +Removes a scene importer registered by :ref:`add_scene_import_plugin`. + +---- + +.. _class_EditorPlugin_method_remove_spatial_gizmo_plugin: + +- void **remove_spatial_gizmo_plugin** **(** :ref:`EditorSpatialGizmoPlugin` plugin **)** + +Removes a gizmo plugin registered by :ref:`add_spatial_gizmo_plugin`. + +---- + +.. _class_EditorPlugin_method_remove_tool_menu_item: + +- void **remove_tool_menu_item** **(** :ref:`String` name **)** + +Removes a menu ``name`` from **Project > Tools**. + +---- + +.. _class_EditorPlugin_method_save_external_data: + +- void **save_external_data** **(** **)** |virtual| + +This method is called after the editor saves the project or when it's closed. It asks the plugin to save edited external scenes/resources. + +---- + +.. _class_EditorPlugin_method_set_force_draw_over_forwarding_enabled: + +- void **set_force_draw_over_forwarding_enabled** **(** **)** + +Enables calling of :ref:`forward_canvas_force_draw_over_viewport` for the 2D editor and :ref:`forward_spatial_force_draw_over_viewport` for the 3D editor when their viewports are updated. You need to call this method only once and it will work permanently for this plugin. + +---- + +.. _class_EditorPlugin_method_set_input_event_forwarding_always_enabled: + +- void **set_input_event_forwarding_always_enabled** **(** **)** + +Use this method if you always want to receive inputs from 3D view screen inside :ref:`forward_spatial_gui_input`. It might be especially usable if your plugin will want to use raycast in the scene. + +---- + +.. _class_EditorPlugin_method_set_state: + +- void **set_state** **(** :ref:`Dictionary` state **)** |virtual| + +Restore the state saved by :ref:`get_state`. + +---- + +.. _class_EditorPlugin_method_set_window_layout: + +- void **set_window_layout** **(** :ref:`ConfigFile` layout **)** |virtual| + +Restore the plugin GUI layout saved by :ref:`get_window_layout`. + +---- + +.. _class_EditorPlugin_method_update_overlays: + +- :ref:`int` **update_overlays** **(** **)** |const| + +Updates the overlays of the 2D and 3D editor viewport. Causes methods :ref:`forward_canvas_draw_over_viewport`, :ref:`forward_canvas_force_draw_over_viewport`, :ref:`forward_spatial_draw_over_viewport` and :ref:`forward_spatial_force_draw_over_viewport` to be called. + +.. |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.)` diff --git a/classes/class_editorproperty.rst b/classes/class_editorproperty.rst new file mode 100644 index 0000000..79ebb26 --- /dev/null +++ b/classes/class_editorproperty.rst @@ -0,0 +1,278 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorProperty.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorProperty: + +EditorProperty +============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Custom control to edit properties for adding into the inspector. + +Description +----------- + +This control allows property editing for one or multiple properties into :ref:`EditorInspector`. It is added via :ref:`EditorInspectorPlugin`. + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`checkable` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`checked` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`draw_red` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`keying` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`label` | ``""`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`read_only` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_focusable` **(** :ref:`Control` control **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`emit_changed` **(** :ref:`String` property, :ref:`Variant` value, :ref:`String` field="", :ref:`bool` changing=false **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_edited_object` **(** **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_edited_property` **(** **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tooltip_text` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bottom_editor` **(** :ref:`Control` editor **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_property` **(** **)** |virtual| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorProperty_signal_multiple_properties_changed: + +- **multiple_properties_changed** **(** :ref:`PoolStringArray` properties, :ref:`Array` value **)** + +Emit it if you want multiple properties modified at the same time. Do not use if added via :ref:`EditorInspectorPlugin.parse_property`. + +---- + +.. _class_EditorProperty_signal_object_id_selected: + +- **object_id_selected** **(** :ref:`String` property, :ref:`int` id **)** + +Used by sub-inspectors. Emit it if what was selected was an Object ID. + +---- + +.. _class_EditorProperty_signal_property_changed: + +- **property_changed** **(** :ref:`String` property, :ref:`Variant` value **)** + +Do not emit this manually, use the :ref:`emit_changed` method instead. + +---- + +.. _class_EditorProperty_signal_property_checked: + +- **property_checked** **(** :ref:`String` property, :ref:`String` bool **)** + +Emitted when a property was checked. Used internally. + +---- + +.. _class_EditorProperty_signal_property_keyed: + +- **property_keyed** **(** :ref:`String` property **)** + +Emit it if you want to add this value as an animation key (check for keying being enabled first). + +---- + +.. _class_EditorProperty_signal_property_keyed_with_value: + +- **property_keyed_with_value** **(** :ref:`String` property, :ref:`Variant` value **)** + +Emit it if you want to key a property with a single value. + +---- + +.. _class_EditorProperty_signal_resource_selected: + +- **resource_selected** **(** :ref:`String` path, :ref:`Resource` resource **)** + +If you want a sub-resource to be edited, emit this signal with the resource. + +---- + +.. _class_EditorProperty_signal_selected: + +- **selected** **(** :ref:`String` path, :ref:`int` focusable_idx **)** + +Emitted when selected. Used internally. + +Property Descriptions +--------------------- + +.. _class_EditorProperty_property_checkable: + +- :ref:`bool` **checkable** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_checkable(value) | ++-----------+----------------------+ +| *Getter* | is_checkable() | ++-----------+----------------------+ + +Used by the inspector, set to ``true`` when the property is checkable. + +---- + +.. _class_EditorProperty_property_checked: + +- :ref:`bool` **checked** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_checked(value) | ++-----------+--------------------+ +| *Getter* | is_checked() | ++-----------+--------------------+ + +Used by the inspector, set to ``true`` when the property is checked. + +---- + +.. _class_EditorProperty_property_draw_red: + +- :ref:`bool` **draw_red** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_draw_red(value) | ++-----------+---------------------+ +| *Getter* | is_draw_red() | ++-----------+---------------------+ + +Used by the inspector, set to ``true`` when the property is drawn with the editor theme's warning color. This is used for editable children's properties. + +---- + +.. _class_EditorProperty_property_keying: + +- :ref:`bool` **keying** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_keying(value) | ++-----------+-------------------+ +| *Getter* | is_keying() | ++-----------+-------------------+ + +Used by the inspector, set to ``true`` when the property can add keys for animation. + +---- + +.. _class_EditorProperty_property_label: + +- :ref:`String` **label** + ++-----------+------------------+ +| *Default* | ``""`` | ++-----------+------------------+ +| *Setter* | set_label(value) | ++-----------+------------------+ +| *Getter* | get_label() | ++-----------+------------------+ + +Set this property to change the label (if you want to show one). + +---- + +.. _class_EditorProperty_property_read_only: + +- :ref:`bool` **read_only** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_read_only(value) | ++-----------+----------------------+ +| *Getter* | is_read_only() | ++-----------+----------------------+ + +Used by the inspector, set to ``true`` when the property is read-only. + +Method Descriptions +------------------- + +.. _class_EditorProperty_method_add_focusable: + +- void **add_focusable** **(** :ref:`Control` control **)** + +If any of the controls added can gain keyboard focus, add it here. This ensures that focus will be restored if the inspector is refreshed. + +---- + +.. _class_EditorProperty_method_emit_changed: + +- void **emit_changed** **(** :ref:`String` property, :ref:`Variant` value, :ref:`String` field="", :ref:`bool` changing=false **)** + +If one or several properties have changed, this must be called. ``field`` is used in case your editor can modify fields separately (as an example, Vector3.x). The ``changing`` argument avoids the editor requesting this property to be refreshed (leave as ``false`` if unsure). + +---- + +.. _class_EditorProperty_method_get_edited_object: + +- :ref:`Object` **get_edited_object** **(** **)** + +Gets the edited object. + +---- + +.. _class_EditorProperty_method_get_edited_property: + +- :ref:`String` **get_edited_property** **(** **)** + +Gets the edited property. If your editor is for a single property (added via :ref:`EditorInspectorPlugin.parse_property`), then this will return the property. + +---- + +.. _class_EditorProperty_method_get_tooltip_text: + +- :ref:`String` **get_tooltip_text** **(** **)** |const| + +Must be implemented to provide a custom tooltip to the property editor. + +---- + +.. _class_EditorProperty_method_set_bottom_editor: + +- void **set_bottom_editor** **(** :ref:`Control` editor **)** + +Puts the ``editor`` control below the property label. The control must be previously added using :ref:`Node.add_child`. + +---- + +.. _class_EditorProperty_method_update_property: + +- void **update_property** **(** **)** |virtual| + +When this virtual function is called, you must update your editor. + +.. |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.)` diff --git a/classes/class_editorresourceconversionplugin.rst b/classes/class_editorresourceconversionplugin.rst new file mode 100644 index 0000000..6a701ef --- /dev/null +++ b/classes/class_editorresourceconversionplugin.rst @@ -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 EditorResourceConversionPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorResourceConversionPlugin: + +EditorResourceConversionPlugin +============================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`_convert` **(** :ref:`Resource` resource **)** |virtual| | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_converts_to` **(** **)** |virtual| | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorResourceConversionPlugin_method__convert: + +- :ref:`Resource` **_convert** **(** :ref:`Resource` resource **)** |virtual| + +---- + +.. _class_EditorResourceConversionPlugin_method__converts_to: + +- :ref:`String` **_converts_to** **(** **)** |virtual| + +.. |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.)` diff --git a/classes/class_editorresourcepicker.rst b/classes/class_editorresourcepicker.rst new file mode 100644 index 0000000..9ac2e65 --- /dev/null +++ b/classes/class_editorresourcepicker.rst @@ -0,0 +1,192 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorResourcePicker.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorResourcePicker: + +EditorResourcePicker +==================== + +**Inherits:** :ref:`HBoxContainer` **<** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorScriptPicker` + +Godot editor's control for selecting :ref:`Resource` type properties. + +Description +----------- + +This :ref:`Control` node is used in the editor's Inspector dock to allow editing of :ref:`Resource` type properties. It provides options for creating, loading, saving and converting resources. Can be used with :ref:`EditorInspectorPlugin` to recreate the same behavior. + +**Note:** This :ref:`Control` does not include any editor for the resource, as editing is controlled by the Inspector dock itself or sub-Inspectors. + +Properties +---------- + ++---------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`base_type` | ``""`` | ++---------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`editable` | ``true`` | ++---------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`Resource` | :ref:`edited_resource` | | ++---------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`toggle_mode` | ``false`` | ++---------------------------------+-----------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_drop_data_fw` **(** :ref:`Vector2` position, :ref:`Variant` data, :ref:`Control` from **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`drop_data_fw` **(** :ref:`Vector2` position, :ref:`Variant` data, :ref:`Control` from **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_allowed_types` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_drag_data_fw` **(** :ref:`Vector2` position, :ref:`Control` from **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`handle_menu_selected` **(** :ref:`int` id **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_create_options` **(** :ref:`Object` menu_node **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_toggle_pressed` **(** :ref:`bool` pressed **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorResourcePicker_signal_resource_changed: + +- **resource_changed** **(** :ref:`Resource` resource **)** + +Emitted when the value of the edited resource was changed. + +---- + +.. _class_EditorResourcePicker_signal_resource_selected: + +- **resource_selected** **(** :ref:`Resource` resource, :ref:`bool` edit **)** + +Emitted when the resource value was set and user clicked to edit it. When ``edit`` is ``true``, the signal was caused by the context menu "Edit" option. + +Property Descriptions +--------------------- + +.. _class_EditorResourcePicker_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The base type of allowed resource types. Can be a comma-separated list of several options. + +---- + +.. _class_EditorResourcePicker_property_editable: + +- :ref:`bool` **editable** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_editable(value) | ++-----------+---------------------+ +| *Getter* | is_editable() | ++-----------+---------------------+ + +If ``true``, the value can be selected and edited. + +---- + +.. _class_EditorResourcePicker_property_edited_resource: + +- :ref:`Resource` **edited_resource** + ++----------+----------------------------+ +| *Setter* | set_edited_resource(value) | ++----------+----------------------------+ +| *Getter* | get_edited_resource() | ++----------+----------------------------+ + +The edited resource value. + +---- + +.. _class_EditorResourcePicker_property_toggle_mode: + +- :ref:`bool` **toggle_mode** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_toggle_mode(value) | ++-----------+------------------------+ +| *Getter* | is_toggle_mode() | ++-----------+------------------------+ + +If ``true``, the main button with the resource preview works in the toggle mode. Use :ref:`set_toggle_pressed` to manually set the state. + +Method Descriptions +------------------- + +.. _class_EditorResourcePicker_method_can_drop_data_fw: + +- :ref:`bool` **can_drop_data_fw** **(** :ref:`Vector2` position, :ref:`Variant` data, :ref:`Control` from **)** |const| + +---- + +.. _class_EditorResourcePicker_method_drop_data_fw: + +- void **drop_data_fw** **(** :ref:`Vector2` position, :ref:`Variant` data, :ref:`Control` from **)** + +---- + +.. _class_EditorResourcePicker_method_get_allowed_types: + +- :ref:`PoolStringArray` **get_allowed_types** **(** **)** |const| + +Returns a list of all allowed types and subtypes corresponding to the :ref:`base_type`. If the :ref:`base_type` is empty, an empty list is returned. + +---- + +.. _class_EditorResourcePicker_method_get_drag_data_fw: + +- :ref:`Variant` **get_drag_data_fw** **(** :ref:`Vector2` position, :ref:`Control` from **)** + +---- + +.. _class_EditorResourcePicker_method_handle_menu_selected: + +- void **handle_menu_selected** **(** :ref:`int` id **)** |virtual| + +This virtual method can be implemented to handle context menu items not handled by default. See :ref:`set_create_options`. + +---- + +.. _class_EditorResourcePicker_method_set_create_options: + +- void **set_create_options** **(** :ref:`Object` menu_node **)** |virtual| + +This virtual method is called when updating the context menu of ``EditorResourcePicker``. Implement this method to override the "New ..." items with your own options. ``menu_node`` is a reference to the :ref:`PopupMenu` node. + +**Note:** Implement :ref:`handle_menu_selected` to handle these custom items. + +---- + +.. _class_EditorResourcePicker_method_set_toggle_pressed: + +- void **set_toggle_pressed** **(** :ref:`bool` pressed **)** + +Sets the toggle mode state for the main button. Works only if :ref:`toggle_mode` is set to ``true``. + +.. |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.)` diff --git a/classes/class_editorresourcepreview.rst b/classes/class_editorresourcepreview.rst new file mode 100644 index 0000000..42c4dfe --- /dev/null +++ b/classes/class_editorresourcepreview.rst @@ -0,0 +1,94 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorResourcePreview.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorResourcePreview: + +EditorResourcePreview +===================== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Helper to generate previews of resources or files. + +Description +----------- + +This object is used to generate previews for resources of files. + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_resource_previewer`. + +Methods +------- + ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_preview_generator` **(** :ref:`EditorResourcePreviewGenerator` generator **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`check_for_invalidation` **(** :ref:`String` path **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_edited_resource_preview` **(** :ref:`Resource` resource, :ref:`Object` receiver, :ref:`String` receiver_func, :ref:`Variant` userdata **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_resource_preview` **(** :ref:`String` path, :ref:`Object` receiver, :ref:`String` receiver_func, :ref:`Variant` userdata **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_preview_generator` **(** :ref:`EditorResourcePreviewGenerator` generator **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorResourcePreview_signal_preview_invalidated: + +- **preview_invalidated** **(** :ref:`String` path **)** + +Emitted if a preview was invalidated (changed). ``path`` corresponds to the path of the preview. + +Method Descriptions +------------------- + +.. _class_EditorResourcePreview_method_add_preview_generator: + +- void **add_preview_generator** **(** :ref:`EditorResourcePreviewGenerator` generator **)** + +Create an own, custom preview generator. + +---- + +.. _class_EditorResourcePreview_method_check_for_invalidation: + +- void **check_for_invalidation** **(** :ref:`String` path **)** + +Check if the resource changed, if so, it will be invalidated and the corresponding signal emitted. + +---- + +.. _class_EditorResourcePreview_method_queue_edited_resource_preview: + +- void **queue_edited_resource_preview** **(** :ref:`Resource` resource, :ref:`Object` receiver, :ref:`String` receiver_func, :ref:`Variant` userdata **)** + +Queue the ``resource`` being edited for preview. Once the preview is ready, the ``receiver``'s ``receiver_func`` will be called. The ``receiver_func`` must take the following four arguments: :ref:`String` path, :ref:`Texture` preview, :ref:`Texture` thumbnail_preview, :ref:`Variant` userdata. ``userdata`` can be anything, and will be returned when ``receiver_func`` is called. + +**Note:** If it was not possible to create the preview the ``receiver_func`` will still be called, but the preview will be null. + +---- + +.. _class_EditorResourcePreview_method_queue_resource_preview: + +- void **queue_resource_preview** **(** :ref:`String` path, :ref:`Object` receiver, :ref:`String` receiver_func, :ref:`Variant` userdata **)** + +Queue a resource file located at ``path`` for preview. Once the preview is ready, the ``receiver``'s ``receiver_func`` will be called. The ``receiver_func`` must take the following four arguments: :ref:`String` path, :ref:`Texture` preview, :ref:`Texture` thumbnail_preview, :ref:`Variant` userdata. ``userdata`` can be anything, and will be returned when ``receiver_func`` is called. + +**Note:** If it was not possible to create the preview the ``receiver_func`` will still be called, but the preview will be null. + +---- + +.. _class_EditorResourcePreview_method_remove_preview_generator: + +- void **remove_preview_generator** **(** :ref:`EditorResourcePreviewGenerator` generator **)** + +Removes a custom preview generator. + +.. |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.)` diff --git a/classes/class_editorresourcepreviewgenerator.rst b/classes/class_editorresourcepreviewgenerator.rst new file mode 100644 index 0000000..1f7e32f --- /dev/null +++ b/classes/class_editorresourcepreviewgenerator.rst @@ -0,0 +1,91 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorResourcePreviewGenerator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorResourcePreviewGenerator: + +EditorResourcePreviewGenerator +============================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Custom generator of previews. + +Description +----------- + +Custom code to generate previews. Please check ``file_dialog/thumbnail_size`` in :ref:`EditorSettings` to find out the right size to do previews at. + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_generate_small_preview` **(** **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`generate` **(** :ref:`Resource` from, :ref:`Vector2` size **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`generate_from_path` **(** :ref:`String` path, :ref:`Vector2` size **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`generate_small_preview_automatically` **(** **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`handles` **(** :ref:`String` type **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorResourcePreviewGenerator_method_can_generate_small_preview: + +- :ref:`bool` **can_generate_small_preview** **(** **)** |virtual| + +If this function returns ``true``, the generator will call :ref:`generate` or :ref:`generate_from_path` for small previews as well. + +By default, it returns ``false``. + +---- + +.. _class_EditorResourcePreviewGenerator_method_generate: + +- :ref:`Texture` **generate** **(** :ref:`Resource` from, :ref:`Vector2` size **)** |virtual| + +Generate a preview from a given resource with the specified size. This must always be implemented. + +Returning an empty texture is an OK way to fail and let another generator take care. + +Care must be taken because this function is always called from a thread (not the main thread). + +---- + +.. _class_EditorResourcePreviewGenerator_method_generate_from_path: + +- :ref:`Texture` **generate_from_path** **(** :ref:`String` path, :ref:`Vector2` size **)** |virtual| + +Generate a preview directly from a path with the specified size. Implementing this is optional, as default code will load and call :ref:`generate`. + +Returning an empty texture is an OK way to fail and let another generator take care. + +Care must be taken because this function is always called from a thread (not the main thread). + +---- + +.. _class_EditorResourcePreviewGenerator_method_generate_small_preview_automatically: + +- :ref:`bool` **generate_small_preview_automatically** **(** **)** |virtual| + +If this function returns ``true``, the generator will automatically generate the small previews from the normal preview texture generated by the methods :ref:`generate` or :ref:`generate_from_path`. + +By default, it returns ``false``. + +---- + +.. _class_EditorResourcePreviewGenerator_method_handles: + +- :ref:`bool` **handles** **(** :ref:`String` type **)** |virtual| + +Returns ``true`` if your generator supports the resource of type ``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.)` diff --git a/classes/class_editorsceneimporter.rst b/classes/class_editorsceneimporter.rst new file mode 100644 index 0000000..d652df4 --- /dev/null +++ b/classes/class_editorsceneimporter.rst @@ -0,0 +1,120 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSceneImporter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSceneImporter: + +EditorSceneImporter +=================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorSceneImporterFBX`, :ref:`EditorSceneImporterGLTF` + +Imports scenes from third-parties' 3D files. + +Description +----------- + +``EditorSceneImporter`` allows to define an importer script for a third-party 3D format. + +To use ``EditorSceneImporter``, register it using the :ref:`EditorPlugin.add_scene_import_plugin` method first. + +Methods +------- + ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`_get_extensions` **(** **)** |virtual| | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_import_flags` **(** **)** |virtual| | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Animation` | :ref:`_import_animation` **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** |virtual| | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`_import_scene` **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** |virtual| | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Animation` | :ref:`import_animation_from_other_importer` **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`import_scene_from_other_importer` **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps, :ref:`int` compress_flags **)** | ++-----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_EditorSceneImporter_constant_IMPORT_SCENE: + +.. _class_EditorSceneImporter_constant_IMPORT_ANIMATION: + +.. _class_EditorSceneImporter_constant_IMPORT_ANIMATION_DETECT_LOOP: + +.. _class_EditorSceneImporter_constant_IMPORT_ANIMATION_OPTIMIZE: + +.. _class_EditorSceneImporter_constant_IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS: + +.. _class_EditorSceneImporter_constant_IMPORT_ANIMATION_KEEP_VALUE_TRACKS: + +.. _class_EditorSceneImporter_constant_IMPORT_GENERATE_TANGENT_ARRAYS: + +.. _class_EditorSceneImporter_constant_IMPORT_FAIL_ON_MISSING_DEPENDENCIES: + +.. _class_EditorSceneImporter_constant_IMPORT_MATERIALS_IN_INSTANCES: + +- **IMPORT_SCENE** = **1** + +- **IMPORT_ANIMATION** = **2** + +- **IMPORT_ANIMATION_DETECT_LOOP** = **4** + +- **IMPORT_ANIMATION_OPTIMIZE** = **8** + +- **IMPORT_ANIMATION_FORCE_ALL_TRACKS_IN_ALL_CLIPS** = **16** + +- **IMPORT_ANIMATION_KEEP_VALUE_TRACKS** = **32** + +- **IMPORT_GENERATE_TANGENT_ARRAYS** = **256** + +- **IMPORT_FAIL_ON_MISSING_DEPENDENCIES** = **512** + +- **IMPORT_MATERIALS_IN_INSTANCES** = **1024** + +Method Descriptions +------------------- + +.. _class_EditorSceneImporter_method__get_extensions: + +- :ref:`Array` **_get_extensions** **(** **)** |virtual| + +---- + +.. _class_EditorSceneImporter_method__get_import_flags: + +- :ref:`int` **_get_import_flags** **(** **)** |virtual| + +---- + +.. _class_EditorSceneImporter_method__import_animation: + +- :ref:`Animation` **_import_animation** **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** |virtual| + +---- + +.. _class_EditorSceneImporter_method__import_scene: + +- :ref:`Node` **_import_scene** **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** |virtual| + +---- + +.. _class_EditorSceneImporter_method_import_animation_from_other_importer: + +- :ref:`Animation` **import_animation_from_other_importer** **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps **)** + +---- + +.. _class_EditorSceneImporter_method_import_scene_from_other_importer: + +- :ref:`Node` **import_scene_from_other_importer** **(** :ref:`String` path, :ref:`int` flags, :ref:`int` bake_fps, :ref:`int` compress_flags **)** + +.. |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.)` diff --git a/classes/class_editorsceneimporterfbx.rst b/classes/class_editorsceneimporterfbx.rst new file mode 100644 index 0000000..ed49673 --- /dev/null +++ b/classes/class_editorsceneimporterfbx.rst @@ -0,0 +1,46 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSceneImporterFBX.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSceneImporterFBX: + +EditorSceneImporterFBX +====================== + +**Inherits:** :ref:`EditorSceneImporter` **<** :ref:`Reference` **<** :ref:`Object` + +FBX 3D asset importer. + +Description +----------- + +This is an FBX 3D asset importer with full support for most FBX features. + +If exporting a FBX scene from Autodesk Maya, use these FBX export settings: + +:: + + - Smoothing Groups + - Smooth Mesh + - Triangluate (for meshes with blend shapes) + - Bake Animation + - Resample All + - Deformed Models + - Skins + - Blend Shapes + - Curve Filters + - Constant Key Reducer + - Auto Tangents Only + - *Do not check* Constraints (as it will break the file) + - Can check Embed Media (embeds textures into the exported FBX file) + - Note that when importing embedded media, the texture and mesh will be a single immutable file. + - You will have to re-export then re-import the FBX if the texture has changed. + - Units: Centimeters + - Up Axis: Y + - Binary format in FBX 2017 + +.. |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.)` diff --git a/classes/class_editorsceneimportergltf.rst b/classes/class_editorsceneimportergltf.rst new file mode 100644 index 0000000..1a6f097 --- /dev/null +++ b/classes/class_editorsceneimportergltf.rst @@ -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 EditorSceneImporterGLTF.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSceneImporterGLTF: + +EditorSceneImporterGLTF +======================= + +**Inherits:** :ref:`EditorSceneImporter` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_editorscenepostimport.rst b/classes/class_editorscenepostimport.rst new file mode 100644 index 0000000..f1be8b2 --- /dev/null +++ b/classes/class_editorscenepostimport.rst @@ -0,0 +1,85 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorScenePostImport.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorScenePostImport: + +EditorScenePostImport +===================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Post-processes scenes after import. + +Description +----------- + +Imported scenes can be automatically modified right after import by setting their **Custom Script** Import property to a ``tool`` script that inherits from this class. + +The :ref:`post_import` callback receives the imported scene's root node and returns the modified version of the scene. Usage example: + +:: + + tool # Needed so it runs in editor + extends EditorScenePostImport + + # This sample changes all node names + + # Called right after the scene is imported and gets the root node + func post_import(scene): + # Change all node names to "modified_[oldnodename]" + iterate(scene) + return scene # Remember to return the imported scene + + func iterate(node): + if node != null: + node.name = "modified_" + node.name + for child in node.get_children(): + iterate(child) + +Tutorials +--------- + +- `#custom-script <../tutorials/assets_pipeline/importing_scenes.html#custom-script>`_ in :doc:`../tutorials/assets_pipeline/importing_scenes` + +Methods +------- + ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_source_file` **(** **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_source_folder` **(** **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`post_import` **(** :ref:`Object` scene **)** |virtual| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorScenePostImport_method_get_source_file: + +- :ref:`String` **get_source_file** **(** **)** |const| + +Returns the source file path which got imported (e.g. ``res://scene.dae``). + +---- + +.. _class_EditorScenePostImport_method_get_source_folder: + +- :ref:`String` **get_source_folder** **(** **)** |const| + +Returns the resource folder the imported scene file is located in. + +---- + +.. _class_EditorScenePostImport_method_post_import: + +- :ref:`Object` **post_import** **(** :ref:`Object` scene **)** |virtual| + +Called after the scene was imported. This method must return the modified version of the scene. + +.. |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.)` diff --git a/classes/class_editorscript.rst b/classes/class_editorscript.rst new file mode 100644 index 0000000..87ef3fa --- /dev/null +++ b/classes/class_editorscript.rst @@ -0,0 +1,85 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorScript: + +EditorScript +============ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Base script that can be used to add extension functions to the editor. + +Description +----------- + +Scripts extending this class and implementing its :ref:`_run` method can be executed from the Script Editor's **File > Run** menu option (or by pressing ``Ctrl+Shift+X``) while the editor is running. This is useful for adding custom in-editor functionality to Godot. For more complex additions, consider using :ref:`EditorPlugin`\ s instead. + +**Note:** Extending scripts need to have ``tool`` mode enabled. + +**Example script:** + +:: + + tool + extends EditorScript + + func _run(): + print("Hello from the Godot Editor!") + +**Note:** The script is run in the Editor context, which means the output is visible in the console window started with the Editor (stdout) instead of the usual Godot **Output** dock. + +Methods +------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| void | :ref:`_run` **(** **)** |virtual| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_root_node` **(** :ref:`Node` node **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`EditorInterface` | :ref:`get_editor_interface` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_scene` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorScript_method__run: + +- void **_run** **(** **)** |virtual| + +This method is executed by the Editor when **File > Run** is used. + +---- + +.. _class_EditorScript_method_add_root_node: + +- void **add_root_node** **(** :ref:`Node` node **)** + +Adds ``node`` as a child of the root node in the editor context. + +**Warning:** The implementation of this method is currently disabled. + +---- + +.. _class_EditorScript_method_get_editor_interface: + +- :ref:`EditorInterface` **get_editor_interface** **(** **)** + +Returns the :ref:`EditorInterface` singleton instance. + +---- + +.. _class_EditorScript_method_get_scene: + +- :ref:`Node` **get_scene** **(** **)** + +Returns the Editor's currently active scene. + +.. |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.)` diff --git a/classes/class_editorscriptpicker.rst b/classes/class_editorscriptpicker.rst new file mode 100644 index 0000000..269e4b8 --- /dev/null +++ b/classes/class_editorscriptpicker.rst @@ -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 EditorScriptPicker.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorScriptPicker: + +EditorScriptPicker +================== + +**Inherits:** :ref:`EditorResourcePicker` **<** :ref:`HBoxContainer` **<** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Godot editor's control for selecting the ``script`` property of a :ref:`Node`. + +Description +----------- + +Similar to :ref:`EditorResourcePicker` this :ref:`Control` node is used in the editor's Inspector dock, but only to edit the ``script`` property of a :ref:`Node`. Default options for creating new resources of all possible subtypes are replaced with dedicated buttons that open the "Attach Node Script" dialog. Can be used with :ref:`EditorInspectorPlugin` to recreate the same behavior. + +**Note:** You must set the :ref:`script_owner` for the custom context menu items to work. + +Properties +---------- + ++-------------------------+---------------------------------------------------------------------+ +| :ref:`Node` | :ref:`script_owner` | ++-------------------------+---------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_EditorScriptPicker_property_script_owner: + +- :ref:`Node` **script_owner** + ++----------+-------------------------+ +| *Setter* | set_script_owner(value) | ++----------+-------------------------+ +| *Getter* | get_script_owner() | ++----------+-------------------------+ + +The owner :ref:`Node` of the script property that holds the edited resource. + +.. |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.)` diff --git a/classes/class_editorselection.rst b/classes/class_editorselection.rst new file mode 100644 index 0000000..8c3dfbe --- /dev/null +++ b/classes/class_editorselection.rst @@ -0,0 +1,92 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSelection.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSelection: + +EditorSelection +=============== + +**Inherits:** :ref:`Object` + +Manages the SceneTree selection in the editor. + +Description +----------- + +This object manages the SceneTree selection in the editor. + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_selection`. + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`Node` node **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_selected_nodes` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_transformable_selected_nodes` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`Node` node **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorSelection_signal_selection_changed: + +- **selection_changed** **(** **)** + +Emitted when the selection changes. + +Method Descriptions +------------------- + +.. _class_EditorSelection_method_add_node: + +- void **add_node** **(** :ref:`Node` node **)** + +Adds a node to the selection. + +**Note:** The newly selected node will not be automatically edited in the inspector. If you want to edit a node, use :ref:`EditorInterface.edit_node`. + +---- + +.. _class_EditorSelection_method_clear: + +- void **clear** **(** **)** + +Clear the selection. + +---- + +.. _class_EditorSelection_method_get_selected_nodes: + +- :ref:`Array` **get_selected_nodes** **(** **)** + +Gets the list of selected nodes. + +---- + +.. _class_EditorSelection_method_get_transformable_selected_nodes: + +- :ref:`Array` **get_transformable_selected_nodes** **(** **)** + +Gets the list of selected nodes, optimized for transform operations (i.e. moving them, rotating, etc). This list avoids situations where a node is selected and also child/grandchild. + +---- + +.. _class_EditorSelection_method_remove_node: + +- void **remove_node** **(** :ref:`Node` node **)** + +Removes a node from the selection. + +.. |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.)` diff --git a/classes/class_editorsettings.rst b/classes/class_editorsettings.rst new file mode 100644 index 0000000..b361aef --- /dev/null +++ b/classes/class_editorsettings.rst @@ -0,0 +1,246 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSettings.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSettings: + +EditorSettings +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Object that holds the project-independent editor settings. + +Description +----------- + +Object that holds the project-independent editor settings. These settings are generally visible in the **Editor > Editor Settings** menu. + +Property names use slash delimiters to distinguish sections. Setting values can be of any :ref:`Variant` type. It's recommended to use ``snake_case`` for editor settings to be consistent with the Godot editor itself. + +Accessing the settings can be done using the following methods, such as: + +:: + + # `settings.set("some/property", value)` also works as this class overrides `_set()` internally. + settings.set_setting("some/property",value) + + # `settings.get("some/property", value)` also works as this class overrides `_get()` internally. + settings.get_setting("some/property") + + var list_of_settings = settings.get_property_list() + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_editor_settings`. + +Methods +------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_property_info` **(** :ref:`Dictionary` info **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase` **(** :ref:`String` property **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_favorites` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_project_metadata` **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` default=null **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_project_settings_dir` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_recent_dirs` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_setting` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_settings_dir` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_setting` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_favorites` **(** :ref:`PoolStringArray` dirs **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_initial_value` **(** :ref:`String` name, :ref:`Variant` value, :ref:`bool` update_current **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_project_metadata` **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` data **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_recent_dirs` **(** :ref:`PoolStringArray` dirs **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_setting` **(** :ref:`String` name, :ref:`Variant` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_EditorSettings_signal_settings_changed: + +- **settings_changed** **(** **)** + +Emitted after any editor setting has changed. + +Constants +--------- + +.. _class_EditorSettings_constant_NOTIFICATION_EDITOR_SETTINGS_CHANGED: + +- **NOTIFICATION_EDITOR_SETTINGS_CHANGED** = **10000** --- Emitted after any editor setting has changed. It's used by various editor plugins to update their visuals on theme changes or logic on configuration changes. + +Method Descriptions +------------------- + +.. _class_EditorSettings_method_add_property_info: + +- void **add_property_info** **(** :ref:`Dictionary` info **)** + +Adds a custom property info to a property. The dictionary must contain: + +- ``name``: :ref:`String` (the name of the property) + +- ``type``: :ref:`int` (see :ref:`Variant.Type`) + +- optionally ``hint``: :ref:`int` (see :ref:`PropertyHint`) and ``hint_string``: :ref:`String` + +**Example:** + +:: + + editor_settings.set("category/property_name", 0) + + var property_info = { + "name": "category/property_name", + "type": TYPE_INT, + "hint": PROPERTY_HINT_ENUM, + "hint_string": "one,two,three" + } + + editor_settings.add_property_info(property_info) + +---- + +.. _class_EditorSettings_method_erase: + +- void **erase** **(** :ref:`String` property **)** + +Erases the setting whose name is specified by ``property``. + +---- + +.. _class_EditorSettings_method_get_favorites: + +- :ref:`PoolStringArray` **get_favorites** **(** **)** |const| + +Returns the list of favorite files and directories for this project. + +---- + +.. _class_EditorSettings_method_get_project_metadata: + +- :ref:`Variant` **get_project_metadata** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` default=null **)** |const| + +Returns project-specific metadata for the ``section`` and ``key`` specified. If the metadata doesn't exist, ``default`` will be returned instead. See also :ref:`set_project_metadata`. + +---- + +.. _class_EditorSettings_method_get_project_settings_dir: + +- :ref:`String` **get_project_settings_dir** **(** **)** |const| + +Returns the project-specific settings path. Projects all have a unique subdirectory inside the settings path where project-specific settings are saved. + +---- + +.. _class_EditorSettings_method_get_recent_dirs: + +- :ref:`PoolStringArray` **get_recent_dirs** **(** **)** |const| + +Returns the list of recently visited folders in the file dialog for this project. + +---- + +.. _class_EditorSettings_method_get_setting: + +- :ref:`Variant` **get_setting** **(** :ref:`String` name **)** |const| + +Returns the value of the setting specified by ``name``. This is equivalent to using :ref:`Object.get` on the EditorSettings instance. + +---- + +.. _class_EditorSettings_method_get_settings_dir: + +- :ref:`String` **get_settings_dir** **(** **)** |const| + +Gets the global settings path for the engine. Inside this path, you can find some standard paths such as: + +``settings/tmp`` - Used for temporary storage of files + +``settings/templates`` - Where export templates are located + +---- + +.. _class_EditorSettings_method_has_setting: + +- :ref:`bool` **has_setting** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the setting specified by ``name`` exists, ``false`` otherwise. + +---- + +.. _class_EditorSettings_method_property_can_revert: + +- :ref:`bool` **property_can_revert** **(** :ref:`String` name **)** + +Returns ``true`` if the setting specified by ``name`` can have its value reverted to the default value, ``false`` otherwise. When this method returns ``true``, a Revert button will display next to the setting in the Editor Settings. + +---- + +.. _class_EditorSettings_method_property_get_revert: + +- :ref:`Variant` **property_get_revert** **(** :ref:`String` name **)** + +Returns the default value of the setting specified by ``name``. This is the value that would be applied when clicking the Revert button in the Editor Settings. + +---- + +.. _class_EditorSettings_method_set_favorites: + +- void **set_favorites** **(** :ref:`PoolStringArray` dirs **)** + +Sets the list of favorite files and directories for this project. + +---- + +.. _class_EditorSettings_method_set_initial_value: + +- void **set_initial_value** **(** :ref:`String` name, :ref:`Variant` value, :ref:`bool` update_current **)** + +Sets the initial value of the setting specified by ``name`` to ``value``. This is used to provide a value for the Revert button in the Editor Settings. If ``update_current`` is true, the current value of the setting will be set to ``value`` as well. + +---- + +.. _class_EditorSettings_method_set_project_metadata: + +- void **set_project_metadata** **(** :ref:`String` section, :ref:`String` key, :ref:`Variant` data **)** + +Sets project-specific metadata with the ``section``, ``key`` and ``data`` specified. This metadata is stored outside the project folder and therefore won't be checked into version control. See also :ref:`get_project_metadata`. + +---- + +.. _class_EditorSettings_method_set_recent_dirs: + +- void **set_recent_dirs** **(** :ref:`PoolStringArray` dirs **)** + +Sets the list of recently visited folders in the file dialog for this project. + +---- + +.. _class_EditorSettings_method_set_setting: + +- void **set_setting** **(** :ref:`String` name, :ref:`Variant` value **)** + +Sets the ``value`` of the setting specified by ``name``. This is equivalent to using :ref:`Object.set` on the EditorSettings instance. + +.. |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.)` diff --git a/classes/class_editorspatialgizmo.rst b/classes/class_editorspatialgizmo.rst new file mode 100644 index 0000000..05977a1 --- /dev/null +++ b/classes/class_editorspatialgizmo.rst @@ -0,0 +1,207 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSpatialGizmo.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSpatialGizmo: + +EditorSpatialGizmo +================== + +**Inherits:** :ref:`SpatialGizmo` **<** :ref:`Reference` **<** :ref:`Object` + +Custom gizmo for editing Spatial objects. + +Description +----------- + +Custom gizmo that is used for providing custom visualization and editing (handles) for 3D Spatial objects. See :ref:`EditorSpatialGizmoPlugin` for more information. + +Methods +------- + ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_collision_segments` **(** :ref:`PoolVector3Array` segments **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_collision_triangles` **(** :ref:`TriangleMesh` triangles **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_handles` **(** :ref:`PoolVector3Array` handles, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`bool` secondary=false **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_lines` **(** :ref:`PoolVector3Array` lines, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_mesh` **(** :ref:`Mesh` mesh, :ref:`bool` billboard=false, :ref:`SkinReference` skeleton=null, :ref:`Material` material=null **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_unscaled_billboard` **(** :ref:`Material` material, :ref:`float` default_scale=1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`commit_handle` **(** :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_handle_name` **(** :ref:`int` index **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_handle_value` **(** :ref:`int` index **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSpatialGizmoPlugin` | :ref:`get_plugin` **(** **)** |const| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Spatial` | :ref:`get_spatial_node` **(** **)** |const| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_handle_highlighted` **(** :ref:`int` index **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`redraw` **(** **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_handle` **(** :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** |virtual| | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_hidden` **(** :ref:`bool` hidden **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_spatial_node` **(** :ref:`Node` node **)** | ++-----------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorSpatialGizmo_method_add_collision_segments: + +- void **add_collision_segments** **(** :ref:`PoolVector3Array` segments **)** + +Adds the specified ``segments`` to the gizmo's collision shape for picking. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_add_collision_triangles: + +- void **add_collision_triangles** **(** :ref:`TriangleMesh` triangles **)** + +Adds collision triangles to the gizmo for picking. A :ref:`TriangleMesh` can be generated from a regular :ref:`Mesh` too. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_add_handles: + +- void **add_handles** **(** :ref:`PoolVector3Array` handles, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`bool` secondary=false **)** + +Adds a list of handles (points) which can be used to deform the object being edited. + +There are virtual functions which will be called upon editing of these handles. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_add_lines: + +- void **add_lines** **(** :ref:`PoolVector3Array` lines, :ref:`Material` material, :ref:`bool` billboard=false, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** + +Adds lines to the gizmo (as sets of 2 points), with a given material. The lines are used for visualizing the gizmo. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_add_mesh: + +- void **add_mesh** **(** :ref:`Mesh` mesh, :ref:`bool` billboard=false, :ref:`SkinReference` skeleton=null, :ref:`Material` material=null **)** + +Adds a mesh to the gizmo with the specified ``billboard`` state, ``skeleton`` and ``material``. If ``billboard`` is ``true``, the mesh will rotate to always face the camera. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_add_unscaled_billboard: + +- void **add_unscaled_billboard** **(** :ref:`Material` material, :ref:`float` default_scale=1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ) **)** + +Adds an unscaled billboard for visualization. Call this function during :ref:`redraw`. + +---- + +.. _class_EditorSpatialGizmo_method_clear: + +- void **clear** **(** **)** + +Removes everything in the gizmo including meshes, collisions and handles. + +---- + +.. _class_EditorSpatialGizmo_method_commit_handle: + +- void **commit_handle** **(** :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** |virtual| + +Commit a handle being edited (handles must have been previously added by :ref:`add_handles`). + +If the ``cancel`` parameter is ``true``, an option to restore the edited value to the original is provided. + +---- + +.. _class_EditorSpatialGizmo_method_get_handle_name: + +- :ref:`String` **get_handle_name** **(** :ref:`int` index **)** |virtual| + +Gets the name of an edited handle (handles must have been previously added by :ref:`add_handles`). + +Handles can be named for reference to the user when editing. + +---- + +.. _class_EditorSpatialGizmo_method_get_handle_value: + +- :ref:`Variant` **get_handle_value** **(** :ref:`int` index **)** |virtual| + +Gets actual value of a handle. This value can be anything and used for eventually undoing the motion when calling :ref:`commit_handle`. + +---- + +.. _class_EditorSpatialGizmo_method_get_plugin: + +- :ref:`EditorSpatialGizmoPlugin` **get_plugin** **(** **)** |const| + +Returns the :ref:`EditorSpatialGizmoPlugin` that owns this gizmo. It's useful to retrieve materials using :ref:`EditorSpatialGizmoPlugin.get_material`. + +---- + +.. _class_EditorSpatialGizmo_method_get_spatial_node: + +- :ref:`Spatial` **get_spatial_node** **(** **)** |const| + +Returns the Spatial node associated with this gizmo. + +---- + +.. _class_EditorSpatialGizmo_method_is_handle_highlighted: + +- :ref:`bool` **is_handle_highlighted** **(** :ref:`int` index **)** |virtual| + +Returns ``true`` if the handle at index ``index`` is highlighted by being hovered with the mouse. + +---- + +.. _class_EditorSpatialGizmo_method_redraw: + +- void **redraw** **(** **)** |virtual| + +This function is called when the :ref:`Spatial` this gizmo refers to changes (the :ref:`Spatial.update_gizmo` is called). + +---- + +.. _class_EditorSpatialGizmo_method_set_handle: + +- void **set_handle** **(** :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** |virtual| + +This function is used when the user drags a gizmo handle (previously added with :ref:`add_handles`) in screen coordinates. + +The :ref:`Camera` is also provided so screen coordinates can be converted to raycasts. + +---- + +.. _class_EditorSpatialGizmo_method_set_hidden: + +- void **set_hidden** **(** :ref:`bool` hidden **)** + +Sets the gizmo's hidden state. If ``true``, the gizmo will be hidden. If ``false``, it will be shown. + +---- + +.. _class_EditorSpatialGizmo_method_set_spatial_node: + +- void **set_spatial_node** **(** :ref:`Node` node **)** + +Sets the reference :ref:`Spatial` node for the gizmo. ``node`` must inherit from :ref:`Spatial`. + +.. |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.)` diff --git a/classes/class_editorspatialgizmoplugin.rst b/classes/class_editorspatialgizmoplugin.rst new file mode 100644 index 0000000..f5b8031 --- /dev/null +++ b/classes/class_editorspatialgizmoplugin.rst @@ -0,0 +1,210 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSpatialGizmoPlugin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSpatialGizmoPlugin: + +EditorSpatialGizmoPlugin +======================== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Used by the editor to define Spatial gizmo types. + +Description +----------- + +``EditorSpatialGizmoPlugin`` allows you to define a new type of Gizmo. There are two main ways to do so: extending ``EditorSpatialGizmoPlugin`` for the simpler gizmos, or creating a new :ref:`EditorSpatialGizmo` type. See the tutorial in the documentation for more info. + +To use ``EditorSpatialGizmoPlugin``, register it using the :ref:`EditorPlugin.add_spatial_gizmo_plugin` method first. + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/spatial_gizmos` + +Methods +------- + ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_material` **(** :ref:`String` name, :ref:`SpatialMaterial` material **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_be_hidden` **(** **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`commit_handle` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`EditorSpatialGizmo` | :ref:`create_gizmo` **(** :ref:`Spatial` spatial **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_handle_material` **(** :ref:`String` name, :ref:`bool` billboard=false, :ref:`Texture` texture=null **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_icon_material` **(** :ref:`String` name, :ref:`Texture` texture, :ref:`bool` on_top=false, :ref:`Color` color=Color( 1, 1, 1, 1 ) **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_material` **(** :ref:`String` name, :ref:`Color` color, :ref:`bool` billboard=false, :ref:`bool` on_top=false, :ref:`bool` use_vertex_color=false **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_handle_name` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_handle_value` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SpatialMaterial` | :ref:`get_material` **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo=null **)** | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_priority` **(** **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_gizmo` **(** :ref:`Spatial` spatial **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_handle_highlighted` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_selectable_when_hidden` **(** **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`redraw` **(** :ref:`EditorSpatialGizmo` gizmo **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_handle` **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** |virtual| | ++-----------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorSpatialGizmoPlugin_method_add_material: + +- void **add_material** **(** :ref:`String` name, :ref:`SpatialMaterial` material **)** + +Adds a new material to the internal material list for the plugin. It can then be accessed with :ref:`get_material`. Should not be overridden. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_can_be_hidden: + +- :ref:`bool` **can_be_hidden** **(** **)** |virtual| + +Override this method to define whether the gizmo can be hidden or not. Returns ``true`` if not overridden. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_commit_handle: + +- void **commit_handle** **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index, :ref:`Variant` restore, :ref:`bool` cancel=false **)** |virtual| + +Override this method to commit gizmo handles. Called for this plugin's active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_create_gizmo: + +- :ref:`EditorSpatialGizmo` **create_gizmo** **(** :ref:`Spatial` spatial **)** |virtual| + +Override this method to return a custom :ref:`EditorSpatialGizmo` for the spatial nodes of your choice, return ``null`` for the rest of nodes. See also :ref:`has_gizmo`. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_create_handle_material: + +- void **create_handle_material** **(** :ref:`String` name, :ref:`bool` billboard=false, :ref:`Texture` texture=null **)** + +Creates a handle material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorSpatialGizmo.add_handles`. Should not be overridden. + +You can optionally provide a texture to use instead of the default icon. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_create_icon_material: + +- void **create_icon_material** **(** :ref:`String` name, :ref:`Texture` texture, :ref:`bool` on_top=false, :ref:`Color` color=Color( 1, 1, 1, 1 ) **)** + +Creates an icon material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorSpatialGizmo.add_unscaled_billboard`. Should not be overridden. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_create_material: + +- void **create_material** **(** :ref:`String` name, :ref:`Color` color, :ref:`bool` billboard=false, :ref:`bool` on_top=false, :ref:`bool` use_vertex_color=false **)** + +Creates an unshaded material with its variants (selected and/or editable) and adds them to the internal material list. They can then be accessed with :ref:`get_material` and used in :ref:`EditorSpatialGizmo.add_mesh` and :ref:`EditorSpatialGizmo.add_lines`. Should not be overridden. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_get_handle_name: + +- :ref:`String` **get_handle_name** **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| + +Override this method to provide gizmo's handle names. Called for this plugin's active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_get_handle_value: + +- :ref:`Variant` **get_handle_value** **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| + +Gets actual value of a handle from gizmo. Called for this plugin's active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_get_material: + +- :ref:`SpatialMaterial` **get_material** **(** :ref:`String` name, :ref:`EditorSpatialGizmo` gizmo=null **)** + +Gets material from the internal list of materials. If an :ref:`EditorSpatialGizmo` is provided, it will try to get the corresponding variant (selected and/or editable). + +---- + +.. _class_EditorSpatialGizmoPlugin_method_get_name: + +- :ref:`String` **get_name** **(** **)** |virtual| + +Override this method to provide the name that will appear in the gizmo visibility menu. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_get_priority: + +- :ref:`int` **get_priority** **(** **)** |virtual| + +Override this method to set the gizmo's priority. Higher values correspond to higher priority. If a gizmo with higher priority conflicts with another gizmo, only the gizmo with higher priority will be used. + +All built-in editor gizmos return a priority of ``-1``. If not overridden, this method will return ``0``, which means custom gizmos will automatically override built-in gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_has_gizmo: + +- :ref:`bool` **has_gizmo** **(** :ref:`Spatial` spatial **)** |virtual| + +Override this method to define which Spatial nodes have a gizmo from this plugin. Whenever a :ref:`Spatial` node is added to a scene this method is called, if it returns ``true`` the node gets a generic :ref:`EditorSpatialGizmo` assigned and is added to this plugin's list of active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_is_handle_highlighted: + +- :ref:`bool` **is_handle_highlighted** **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index **)** |virtual| + +Gets whether a handle is highlighted or not. Called for this plugin's active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_is_selectable_when_hidden: + +- :ref:`bool` **is_selectable_when_hidden** **(** **)** |virtual| + +Override this method to define whether a Spatial with this gizmo should be selectable even when the gizmo is hidden. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_redraw: + +- void **redraw** **(** :ref:`EditorSpatialGizmo` gizmo **)** |virtual| + +Callback to redraw the provided gizmo. Called for this plugin's active gizmos. + +---- + +.. _class_EditorSpatialGizmoPlugin_method_set_handle: + +- void **set_handle** **(** :ref:`EditorSpatialGizmo` gizmo, :ref:`int` index, :ref:`Camera` camera, :ref:`Vector2` point **)** |virtual| + +Update the value of a handle after it has been updated. Called for this plugin's active gizmos. + +.. |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.)` diff --git a/classes/class_editorspinslider.rst b/classes/class_editorspinslider.rst new file mode 100644 index 0000000..ab6298d --- /dev/null +++ b/classes/class_editorspinslider.rst @@ -0,0 +1,79 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorSpinSlider.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorSpinSlider: + +EditorSpinSlider +================ + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Godot editor's control for editing numeric values. + +Description +----------- + +This :ref:`Control` node is used in the editor's Inspector dock to allow editing of numeric values. Can be used with :ref:`EditorInspectorPlugin` to recreate the same behavior. + +Properties +---------- + ++------------------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flat` | ``false`` | ++------------------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++------------------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`label` | ``""`` | ++------------------------------------------+-------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`read_only` | ``false`` | ++------------------------------------------+-------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_EditorSpinSlider_property_flat: + +- :ref:`bool` **flat** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flat(value) | ++-----------+-----------------+ +| *Getter* | is_flat() | ++-----------+-----------------+ + +---- + +.. _class_EditorSpinSlider_property_label: + +- :ref:`String` **label** + ++-----------+------------------+ +| *Default* | ``""`` | ++-----------+------------------+ +| *Setter* | set_label(value) | ++-----------+------------------+ +| *Getter* | get_label() | ++-----------+------------------+ + +---- + +.. _class_EditorSpinSlider_property_read_only: + +- :ref:`bool` **read_only** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_read_only(value) | ++-----------+----------------------+ +| *Getter* | is_read_only() | ++-----------+----------------------+ + +.. |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.)` diff --git a/classes/class_editorvcsinterface.rst b/classes/class_editorvcsinterface.rst new file mode 100644 index 0000000..f7ab2fa --- /dev/null +++ b/classes/class_editorvcsinterface.rst @@ -0,0 +1,165 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the EditorVCSInterface.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EditorVCSInterface: + +EditorVCSInterface +================== + +**Inherits:** :ref:`Object` + +Version Control System (VCS) interface which reads and writes to the local VCS in use. + +Description +----------- + +Used by the editor to display VCS extracted information in the editor. The implementation of this API is included in VCS addons, which are essentially GDNative plugins that need to be put into the project folder. These VCS addons are scripts which are attached (on demand) to the object instance of ``EditorVCSInterface``. All the functions listed below, instead of performing the task themselves, they call the internally defined functions in the VCS addons to provide a plug-n-play experience. + +Methods +------- + ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`commit` **(** :ref:`String` msg **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_file_diff` **(** :ref:`String` file_path **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_modified_files_data` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_project_name` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_vcs_name` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`initialize` **(** :ref:`String` project_root_path **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_addon_ready` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_vcs_initialized` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`shut_down` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stage_file` **(** :ref:`String` file_path **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unstage_file` **(** :ref:`String` file_path **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_EditorVCSInterface_method_commit: + +- void **commit** **(** :ref:`String` msg **)** + +Creates a version commit if the addon is initialized, else returns without doing anything. Uses the files which have been staged previously, with the commit message set to a value as provided as in the argument. + +---- + +.. _class_EditorVCSInterface_method_get_file_diff: + +- :ref:`Array` **get_file_diff** **(** :ref:`String` file_path **)** + +Returns an :ref:`Array` of :ref:`Dictionary` objects containing the diff output from the VCS in use, if a VCS addon is initialized, else returns an empty :ref:`Array` object. The diff contents also consist of some contextual lines which provide context to the observed line change in the file. + +Each :ref:`Dictionary` object has the line diff contents under the keys: + +- ``"content"`` to store a :ref:`String` containing the line contents + +- ``"status"`` to store a :ref:`String` which contains ``"+"`` in case the content is a line addition but it stores a ``"-"`` in case of deletion and an empty string in the case the line content is neither an addition nor a deletion. + +- ``"new_line_number"`` to store an integer containing the new line number of the line content. + +- ``"line_count"`` to store an integer containing the number of lines in the line content. + +- ``"old_line_number"`` to store an integer containing the old line number of the line content. + +- ``"offset"`` to store the offset of the line change since the first contextual line content. + +---- + +.. _class_EditorVCSInterface_method_get_modified_files_data: + +- :ref:`Dictionary` **get_modified_files_data** **(** **)** + +Returns a :ref:`Dictionary` containing the path of the detected file change mapped to an integer signifying what kind of change the corresponding file has experienced. + +The following integer values are being used to signify that the detected file is: + +- ``0``: New to the VCS working directory + +- ``1``: Modified + +- ``2``: Renamed + +- ``3``: Deleted + +- ``4``: Typechanged + +---- + +.. _class_EditorVCSInterface_method_get_project_name: + +- :ref:`String` **get_project_name** **(** **)** + +Returns the project name of the VCS working directory. + +---- + +.. _class_EditorVCSInterface_method_get_vcs_name: + +- :ref:`String` **get_vcs_name** **(** **)** + +Returns the name of the VCS if the VCS has been initialized, else return an empty string. + +---- + +.. _class_EditorVCSInterface_method_initialize: + +- :ref:`bool` **initialize** **(** :ref:`String` project_root_path **)** + +Initializes the VCS addon if not already. Uses the argument value as the path to the working directory of the project. Creates the initial commit if required. Returns ``true`` if no failure occurs, else returns ``false``. + +---- + +.. _class_EditorVCSInterface_method_is_addon_ready: + +- :ref:`bool` **is_addon_ready** **(** **)** + +Returns ``true`` if the addon is ready to respond to function calls, else returns ``false``. + +---- + +.. _class_EditorVCSInterface_method_is_vcs_initialized: + +- :ref:`bool` **is_vcs_initialized** **(** **)** + +Returns ``true`` if the VCS addon has been initialized, else returns ``false``. + +---- + +.. _class_EditorVCSInterface_method_shut_down: + +- :ref:`bool` **shut_down** **(** **)** + +Shuts down the VCS addon to allow cleanup code to run on call. Returns ``true`` is no failure occurs, else returns ``false``. + +---- + +.. _class_EditorVCSInterface_method_stage_file: + +- void **stage_file** **(** :ref:`String` file_path **)** + +Stages the file which should be committed when :ref:`commit` is called. Argument should contain the absolute path. + +---- + +.. _class_EditorVCSInterface_method_unstage_file: + +- void **unstage_file** **(** :ref:`String` file_path **)** + +Unstages the file which was staged previously to be committed, so that it is no longer committed when :ref:`commit` is called. Argument should contain the absolute 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.)` diff --git a/classes/class_encodedobjectasid.rst b/classes/class_encodedobjectasid.rst new file mode 100644 index 0000000..113b1fa --- /dev/null +++ b/classes/class_encodedobjectasid.rst @@ -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 EncodedObjectAsID.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_EncodedObjectAsID: + +EncodedObjectAsID +================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Holds a reference to an :ref:`Object`'s instance ID. + +Description +----------- + +Utility class which holds a reference to the internal identifier of an :ref:`Object` instance, as given by :ref:`Object.get_instance_id`. This ID can then be used to retrieve the object instance with :ref:`@GDScript.instance_from_id`. + +This class is used internally by the editor inspector and script debugger, but can also be used in plugins to pass and display objects as their IDs. + +Properties +---------- + ++-----------------------+--------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`object_id` | ``0`` | ++-----------------------+--------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_EncodedObjectAsID_property_object_id: + +- :ref:`int` **object_id** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_object_id(value) | ++-----------+----------------------+ +| *Getter* | get_object_id() | ++-----------+----------------------+ + +The :ref:`Object` identifier stored in this ``EncodedObjectAsID`` instance. The object instance can be retrieved with :ref:`@GDScript.instance_from_id`. + +.. |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.)` diff --git a/classes/class_engine.rst b/classes/class_engine.rst new file mode 100644 index 0000000..6484bb4 --- /dev/null +++ b/classes/class_engine.rst @@ -0,0 +1,369 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Engine.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Engine: + +Engine +====== + +**Inherits:** :ref:`Object` + +Access to engine properties. + +Description +----------- + +The ``Engine`` singleton allows you to query and modify the project's run-time parameters, such as frames per second, time scale, and others. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`editor_hint` | ``true`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`iterations_per_second` | ``60`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`physics_jitter_fix` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`print_error_messages` | ``true`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`target_fps` | ``0`` | ++---------------------------+---------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`time_scale` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------+----------+ + +Methods +------- + ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_author_info` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_copyright_info` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_donor_info` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frames_drawn` **(** **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_frames_per_second` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_idle_frames` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_license_info` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_license_text` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`MainLoop` | :ref:`get_main_loop` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_physics_frames` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_physics_interpolation_fraction` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_singleton` **(** :ref:`String` name **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_version_info` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_singleton` **(** :ref:`String` name **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_in_physics_frame` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Engine_property_editor_hint: + +- :ref:`bool` **editor_hint** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_editor_hint(value) | ++-----------+------------------------+ +| *Getter* | is_editor_hint() | ++-----------+------------------------+ + +If ``true``, the script is currently running inside the editor. This is useful for ``tool`` scripts to conditionally draw editor helpers, or prevent accidentally running "game" code that would affect the scene state while in the editor: + +:: + + if Engine.editor_hint: + draw_gizmos() + else: + simulate_physics() + +See `Running code in the editor `__ in the documentation for more information. + +**Note:** To detect whether the script is run from an editor *build* (e.g. when pressing ``F5``), use :ref:`OS.has_feature` with the ``"editor"`` argument instead. ``OS.has_feature("editor")`` will evaluate to ``true`` both when the code is running in the editor and when running the project from the editor, but it will evaluate to ``false`` when the code is run from an exported project. + +---- + +.. _class_Engine_property_iterations_per_second: + +- :ref:`int` **iterations_per_second** + ++-----------+----------------------------------+ +| *Default* | ``60`` | ++-----------+----------------------------------+ +| *Setter* | set_iterations_per_second(value) | ++-----------+----------------------------------+ +| *Getter* | get_iterations_per_second() | ++-----------+----------------------------------+ + +The number of fixed iterations per second. This controls how often physics simulation and :ref:`Node._physics_process` methods are run. This value should generally always be set to ``60`` or above, as Godot doesn't interpolate the physics step. As a result, values lower than ``60`` will look stuttery. This value can be increased to make input more reactive or work around collision tunneling issues, but keep in mind doing so will increase CPU usage. See also :ref:`target_fps` and :ref:`ProjectSettings.physics/common/physics_fps`. + +**Note:** Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if ``delta`` is used consistently in physics calculations). Therefore, it is recommended not to increase :ref:`iterations_per_second` above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. + +---- + +.. _class_Engine_property_physics_jitter_fix: + +- :ref:`float` **physics_jitter_fix** + ++-----------+-------------------------------+ +| *Default* | ``0.5`` | ++-----------+-------------------------------+ +| *Setter* | set_physics_jitter_fix(value) | ++-----------+-------------------------------+ +| *Getter* | get_physics_jitter_fix() | ++-----------+-------------------------------+ + +Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of the in-game clock and real clock but smooth out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + +**Note:** For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting :ref:`physics_jitter_fix` to ``0``. + +---- + +.. _class_Engine_property_print_error_messages: + +- :ref:`bool` **print_error_messages** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_print_error_messages(value) | ++-----------+---------------------------------+ +| *Getter* | is_printing_error_messages() | ++-----------+---------------------------------+ + +If ``false``, stops printing error and warning messages to the console and editor Output log. This can be used to hide error and warning messages during unit test suite runs. This property is equivalent to the :ref:`ProjectSettings.application/run/disable_stderr` project setting. + +**Warning:** If you set this to ``false`` anywhere in the project, important error messages may be hidden even if they are emitted from other scripts. If this is set to ``false`` in a ``tool`` script, this will also impact the editor itself. Do *not* report bugs before ensuring error messages are enabled (as they are by default). + +**Note:** This property does not impact the editor's Errors tab when running a project from the editor. + +---- + +.. _class_Engine_property_target_fps: + +- :ref:`int` **target_fps** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_target_fps(value) | ++-----------+-----------------------+ +| *Getter* | get_target_fps() | ++-----------+-----------------------+ + +The desired frames per second. If the hardware cannot keep up, this setting may not be respected. A value of 0 means no limit. + +---- + +.. _class_Engine_property_time_scale: + +- :ref:`float` **time_scale** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_time_scale(value) | ++-----------+-----------------------+ +| *Getter* | get_time_scale() | ++-----------+-----------------------+ + +Controls how fast or slow the in-game clock ticks versus the real life one. It defaults to 1.0. A value of 2.0 means the game moves twice as fast as real life, whilst a value of 0.5 means the game moves at half the regular speed. + +Method Descriptions +------------------- + +.. _class_Engine_method_get_author_info: + +- :ref:`Dictionary` **get_author_info** **(** **)** |const| + +Returns engine author information in a Dictionary. + +``lead_developers`` - Array of Strings, lead developer names + +``founders`` - Array of Strings, founder names + +``project_managers`` - Array of Strings, project manager names + +``developers`` - Array of Strings, developer names + +---- + +.. _class_Engine_method_get_copyright_info: + +- :ref:`Array` **get_copyright_info** **(** **)** |const| + +Returns an Array of copyright information Dictionaries. + +``name`` - String, component name + +``parts`` - Array of Dictionaries {``files``, ``copyright``, ``license``} describing subsections of the component + +---- + +.. _class_Engine_method_get_donor_info: + +- :ref:`Dictionary` **get_donor_info** **(** **)** |const| + +Returns a Dictionary of Arrays of donor names. + +{``platinum_sponsors``, ``gold_sponsors``, ``silver_sponsors``, ``bronze_sponsors``, ``mini_sponsors``, ``gold_donors``, ``silver_donors``, ``bronze_donors``} + +---- + +.. _class_Engine_method_get_frames_drawn: + +- :ref:`int` **get_frames_drawn** **(** **)** + +Returns the total number of frames drawn. On headless platforms, or if the render loop is disabled with ``--disable-render-loop`` via command line, :ref:`get_frames_drawn` always returns ``0``. See :ref:`get_idle_frames`. + +---- + +.. _class_Engine_method_get_frames_per_second: + +- :ref:`float` **get_frames_per_second** **(** **)** |const| + +Returns the frames per second of the running game. + +---- + +.. _class_Engine_method_get_idle_frames: + +- :ref:`int` **get_idle_frames** **(** **)** |const| + +Returns the total number of frames passed since engine initialization which is advanced on each **idle frame**, regardless of whether the render loop is enabled. See also :ref:`get_frames_drawn` and :ref:`get_physics_frames`. + +:ref:`get_idle_frames` can be used to run expensive logic less often without relying on a :ref:`Timer`: + +:: + + func _process(_delta): + if Engine.get_idle_frames() % 2 == 0: + pass # Run expensive logic only once every 2 idle (render) frames here. + +---- + +.. _class_Engine_method_get_license_info: + +- :ref:`Dictionary` **get_license_info** **(** **)** |const| + +Returns Dictionary of licenses used by Godot and included third party components. + +---- + +.. _class_Engine_method_get_license_text: + +- :ref:`String` **get_license_text** **(** **)** |const| + +Returns Godot license text. + +---- + +.. _class_Engine_method_get_main_loop: + +- :ref:`MainLoop` **get_main_loop** **(** **)** |const| + +Returns the main loop object (see :ref:`MainLoop` and :ref:`SceneTree`). + +---- + +.. _class_Engine_method_get_physics_frames: + +- :ref:`int` **get_physics_frames** **(** **)** |const| + +Returns the total number of frames passed since engine initialization which is advanced on each **physics frame**. See also :ref:`get_idle_frames`. + +:ref:`get_physics_frames` can be used to run expensive logic less often without relying on a :ref:`Timer`: + +:: + + func _physics_process(_delta): + if Engine.get_physics_frames() % 2 == 0: + pass # Run expensive logic only once every 2 physics frames here. + +---- + +.. _class_Engine_method_get_physics_interpolation_fraction: + +- :ref:`float` **get_physics_interpolation_fraction** **(** **)** |const| + +Returns the fraction through the current physics tick we are at the time of rendering the frame. This can be used to implement fixed timestep interpolation. + +---- + +.. _class_Engine_method_get_singleton: + +- :ref:`Object` **get_singleton** **(** :ref:`String` name **)** |const| + +Returns a global singleton with given ``name``. Often used for plugins, e.g. ``GodotPayment`` on Android. + +---- + +.. _class_Engine_method_get_version_info: + +- :ref:`Dictionary` **get_version_info** **(** **)** |const| + +Returns the current engine version information in a Dictionary. + +``major`` - Holds the major version number as an int + +``minor`` - Holds the minor version number as an int + +``patch`` - Holds the patch version number as an int + +``hex`` - Holds the full version number encoded as a hexadecimal int with one byte (2 places) per number (see example below) + +``status`` - Holds the status (e.g. "beta", "rc1", "rc2", ... "stable") as a String + +``build`` - Holds the build name (e.g. "custom_build") as a String + +``hash`` - Holds the full Git commit hash as a String + +``year`` - Holds the year the version was released in as an int + +``string`` - ``major`` + ``minor`` + ``patch`` + ``status`` + ``build`` in a single String + +The ``hex`` value is encoded as follows, from left to right: one byte for the major, one byte for the minor, one byte for the patch version. For example, "3.1.12" would be ``0x03010C``. **Note:** It's still an int internally, and printing it will give you its decimal representation, which is not particularly meaningful. Use hexadecimal literals for easy version comparisons from code: + +:: + + if Engine.get_version_info().hex >= 0x030200: + # Do things specific to version 3.2 or later + else: + # Do things specific to versions before 3.2 + +---- + +.. _class_Engine_method_has_singleton: + +- :ref:`bool` **has_singleton** **(** :ref:`String` name **)** |const| + +Returns ``true`` if a singleton with given ``name`` exists in global scope. + +---- + +.. _class_Engine_method_is_in_physics_frame: + +- :ref:`bool` **is_in_physics_frame** **(** **)** |const| + +Returns ``true`` if the game is inside the fixed process and physics phase of the game loop. + +.. |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.)` diff --git a/classes/class_environment.rst b/classes/class_environment.rst new file mode 100644 index 0000000..e212785 --- /dev/null +++ b/classes/class_environment.rst @@ -0,0 +1,1761 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Environment.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Environment: + +Environment +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Resource for environment nodes (like :ref:`WorldEnvironment`) that define multiple rendering options. + +Description +----------- + +Resource for environment nodes (like :ref:`WorldEnvironment`) that define multiple environment operations (such as background :ref:`Sky` or :ref:`Color`, ambient light, fog, depth-of-field...). These parameters affect the final render of the scene. The order of these operations is: + +- Depth of Field Blur + +- Glow + +- Tonemap (Auto Exposure) + +- Adjustments + +If the target :ref:`Viewport` is set to "2D Without Sampling", all post-processing effects will be unavailable. With "3D Without Effects", the following options will be unavailable: + +- Ssao + +- Ss Reflections + +This can be configured for the root Viewport with :ref:`ProjectSettings.rendering/quality/intended_usage/framebuffer_allocation`, or for specific Viewports via the :ref:`Viewport.usage` property. + +Note that :ref:`ProjectSettings.rendering/quality/intended_usage/framebuffer_allocation` has a mobile platform override to use "3D Without Effects" by default. It improves the performance on mobile devices, but at the same time affects the screen display on mobile devices. + +Tutorials +--------- + +- :doc:`../tutorials/3d/environment_and_post_processing` + +- :doc:`../tutorials/3d/high_dynamic_range` + +- `3D Material Testers Demo `__ + +- `2D HDR Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`adjustment_brightness` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Texture` | :ref:`adjustment_color_correction` | | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`adjustment_contrast` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`adjustment_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`adjustment_saturation` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Color` | :ref:`ambient_light_color` | ``Color( 0, 0, 0, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ambient_light_energy` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ambient_light_sky_contribution` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`auto_exposure_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`auto_exposure_max_luma` | ``8.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`auto_exposure_min_luma` | ``0.05`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`auto_exposure_scale` | ``0.4`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`auto_exposure_speed` | ``0.5`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`int` | :ref:`background_camera_feed_id` | ``1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`int` | :ref:`background_canvas_max_layer` | ``0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Color` | :ref:`background_color` | ``Color( 0, 0, 0, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`background_energy` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`BGMode` | :ref:`background_mode` | ``0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Sky` | :ref:`background_sky` | | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`background_sky_custom_fov` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Basis` | :ref:`background_sky_orientation` | ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Vector3` | :ref:`background_sky_rotation` | ``Vector3( 0, 0, 0 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Vector3` | :ref:`background_sky_rotation_degrees` | ``Vector3( 0, 0, 0 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_far_amount` | ``0.1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_far_distance` | ``10.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`dof_blur_far_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`DOFBlurQuality` | :ref:`dof_blur_far_quality` | ``1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_far_transition` | ``5.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_near_amount` | ``0.1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_near_distance` | ``2.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`dof_blur_near_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`DOFBlurQuality` | :ref:`dof_blur_near_quality` | ``1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`dof_blur_near_transition` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Color` | :ref:`fog_color` | ``Color( 0.5, 0.6, 0.7, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_depth_begin` | ``10.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_depth_curve` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`fog_depth_enabled` | ``true`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_depth_end` | ``100.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`fog_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_height_curve` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`fog_height_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_height_max` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_height_min` | ``10.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_sun_amount` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Color` | :ref:`fog_sun_color` | ``Color( 1, 0.9, 0.7, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`fog_transmit_curve` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`fog_transmit_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_bicubic_upscale` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`GlowBlendMode` | :ref:`glow_blend_mode` | ``2`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_bloom` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_hdr_luminance_cap` | ``12.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_hdr_scale` | ``2.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_hdr_threshold` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_high_quality` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_intensity` | ``0.8`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/1` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/2` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/3` | ``true`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/4` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/5` | ``true`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/6` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`glow_levels/7` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`glow_strength` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ss_reflections_depth_tolerance` | ``0.2`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`ss_reflections_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ss_reflections_fade_in` | ``0.15`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ss_reflections_fade_out` | ``2.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`int` | :ref:`ss_reflections_max_steps` | ``64`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`ss_reflections_roughness` | ``true`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_ao_channel_affect` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_bias` | ``0.01`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`SSAOBlur` | :ref:`ssao_blur` | ``3`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`Color` | :ref:`ssao_color` | ``Color( 0, 0, 0, 1 )`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_edge_sharpness` | ``4.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`bool` | :ref:`ssao_enabled` | ``false`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_intensity` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_intensity2` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_light_affect` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`SSAOQuality` | :ref:`ssao_quality` | ``1`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_radius` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`ssao_radius2` | ``0.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`tonemap_exposure` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`ToneMapper` | :ref:`tonemap_mode` | ``0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ +| :ref:`float` | :ref:`tonemap_white` | ``1.0`` | ++--------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------------------------------------+ + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_glow_level_enabled` **(** :ref:`int` idx **)** |const| | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_glow_level` **(** :ref:`int` idx, :ref:`bool` enabled **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Environment_BGMode: + +.. _class_Environment_constant_BG_KEEP: + +.. _class_Environment_constant_BG_CLEAR_COLOR: + +.. _class_Environment_constant_BG_COLOR: + +.. _class_Environment_constant_BG_SKY: + +.. _class_Environment_constant_BG_COLOR_SKY: + +.. _class_Environment_constant_BG_CANVAS: + +.. _class_Environment_constant_BG_CAMERA_FEED: + +.. _class_Environment_constant_BG_MAX: + +enum **BGMode**: + +- **BG_KEEP** = **5** --- Keeps on screen every pixel drawn in the background. This is the fastest background mode, but it can only be safely used in fully-interior scenes (no visible sky or sky reflections). If enabled in a scene where the background is visible, "ghost trail" artifacts will be visible when moving the camera. + +- **BG_CLEAR_COLOR** = **0** --- Clears the background using the clear color defined in :ref:`ProjectSettings.rendering/environment/default_clear_color`. + +- **BG_COLOR** = **1** --- Clears the background using a custom clear color. + +- **BG_SKY** = **2** --- Displays a user-defined sky in the background. + +- **BG_COLOR_SKY** = **3** --- Clears the background using a custom clear color and allows defining a sky for shading and reflection. This mode is slightly faster than :ref:`BG_SKY` and should be preferred in scenes where reflections can be visible, but the sky itself never is (e.g. top-down camera). + +- **BG_CANVAS** = **4** --- Displays a :ref:`CanvasLayer` in the background. + +- **BG_CAMERA_FEED** = **6** --- Displays a camera feed in the background. + +- **BG_MAX** = **7** --- Represents the size of the :ref:`BGMode` enum. + +---- + +.. _enum_Environment_GlowBlendMode: + +.. _class_Environment_constant_GLOW_BLEND_MODE_ADDITIVE: + +.. _class_Environment_constant_GLOW_BLEND_MODE_SCREEN: + +.. _class_Environment_constant_GLOW_BLEND_MODE_SOFTLIGHT: + +.. _class_Environment_constant_GLOW_BLEND_MODE_REPLACE: + +enum **GlowBlendMode**: + +- **GLOW_BLEND_MODE_ADDITIVE** = **0** --- Additive glow blending mode. Mostly used for particles, glows (bloom), lens flare, bright sources. + +- **GLOW_BLEND_MODE_SCREEN** = **1** --- Screen glow blending mode. Increases brightness, used frequently with bloom. + +- **GLOW_BLEND_MODE_SOFTLIGHT** = **2** --- Soft light glow blending mode. Modifies contrast, exposes shadows and highlights (vivid bloom). + +- **GLOW_BLEND_MODE_REPLACE** = **3** --- Replace glow blending mode. Replaces all pixels' color by the glow value. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness. + +---- + +.. _enum_Environment_ToneMapper: + +.. _class_Environment_constant_TONE_MAPPER_LINEAR: + +.. _class_Environment_constant_TONE_MAPPER_REINHARDT: + +.. _class_Environment_constant_TONE_MAPPER_FILMIC: + +.. _class_Environment_constant_TONE_MAPPER_ACES: + +.. _class_Environment_constant_TONE_MAPPER_ACES_FITTED: + +enum **ToneMapper**: + +- **TONE_MAPPER_LINEAR** = **0** --- Linear tonemapper operator. Reads the linear data and passes it on unmodified. + +- **TONE_MAPPER_REINHARDT** = **1** --- Reinhardt tonemapper operator. Performs a variation on rendered pixels' colors by this formula: ``color = color / (1 + color)``. + +- **TONE_MAPPER_FILMIC** = **2** --- Filmic tonemapper operator. + +- **TONE_MAPPER_ACES** = **3** --- Academy Color Encoding System tonemapper operator. Performs an approximation of the ACES tonemapping curve. + +- **TONE_MAPPER_ACES_FITTED** = **4** --- High quality Academy Color Encoding System tonemapper operator that matches the industry standard. Performs a more physically accurate curve fit which better simulates how light works in the real world. The color of lights and emissive materials will become lighter as the emissive energy increases, and will eventually become white if the light is bright enough to saturate the camera sensor. + +---- + +.. _enum_Environment_DOFBlurQuality: + +.. _class_Environment_constant_DOF_BLUR_QUALITY_LOW: + +.. _class_Environment_constant_DOF_BLUR_QUALITY_MEDIUM: + +.. _class_Environment_constant_DOF_BLUR_QUALITY_HIGH: + +enum **DOFBlurQuality**: + +- **DOF_BLUR_QUALITY_LOW** = **0** --- Low depth-of-field blur quality (fastest). + +- **DOF_BLUR_QUALITY_MEDIUM** = **1** --- Medium depth-of-field blur quality. + +- **DOF_BLUR_QUALITY_HIGH** = **2** --- High depth-of-field blur quality (slowest). + +---- + +.. _enum_Environment_SSAOBlur: + +.. _class_Environment_constant_SSAO_BLUR_DISABLED: + +.. _class_Environment_constant_SSAO_BLUR_1x1: + +.. _class_Environment_constant_SSAO_BLUR_2x2: + +.. _class_Environment_constant_SSAO_BLUR_3x3: + +enum **SSAOBlur**: + +- **SSAO_BLUR_DISABLED** = **0** --- No blur for the screen-space ambient occlusion effect (fastest). + +- **SSAO_BLUR_1x1** = **1** --- 1×1 blur for the screen-space ambient occlusion effect. + +- **SSAO_BLUR_2x2** = **2** --- 2×2 blur for the screen-space ambient occlusion effect. + +- **SSAO_BLUR_3x3** = **3** --- 3×3 blur for the screen-space ambient occlusion effect (slowest). + +---- + +.. _enum_Environment_SSAOQuality: + +.. _class_Environment_constant_SSAO_QUALITY_LOW: + +.. _class_Environment_constant_SSAO_QUALITY_MEDIUM: + +.. _class_Environment_constant_SSAO_QUALITY_HIGH: + +enum **SSAOQuality**: + +- **SSAO_QUALITY_LOW** = **0** --- Low quality for the screen-space ambient occlusion effect (fastest). + +- **SSAO_QUALITY_MEDIUM** = **1** --- Low quality for the screen-space ambient occlusion effect. + +- **SSAO_QUALITY_HIGH** = **2** --- Low quality for the screen-space ambient occlusion effect (slowest). + +Property Descriptions +--------------------- + +.. _class_Environment_property_adjustment_brightness: + +- :ref:`float` **adjustment_brightness** + ++-----------+----------------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------------+ +| *Setter* | set_adjustment_brightness(value) | ++-----------+----------------------------------+ +| *Getter* | get_adjustment_brightness() | ++-----------+----------------------------------+ + +The global brightness value of the rendered scene. Effective only if ``adjustment_enabled`` is ``true``. + +---- + +.. _class_Environment_property_adjustment_color_correction: + +- :ref:`Texture` **adjustment_color_correction** + ++----------+----------------------------------------+ +| *Setter* | set_adjustment_color_correction(value) | ++----------+----------------------------------------+ +| *Getter* | get_adjustment_color_correction() | ++----------+----------------------------------------+ + +Applies the provided :ref:`Texture` resource to affect the global color aspect of the rendered scene. Effective only if ``adjustment_enabled`` is ``true``. + +---- + +.. _class_Environment_property_adjustment_contrast: + +- :ref:`float` **adjustment_contrast** + ++-----------+--------------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------------+ +| *Setter* | set_adjustment_contrast(value) | ++-----------+--------------------------------+ +| *Getter* | get_adjustment_contrast() | ++-----------+--------------------------------+ + +The global contrast value of the rendered scene (default value is 1). Effective only if ``adjustment_enabled`` is ``true``. + +---- + +.. _class_Environment_property_adjustment_enabled: + +- :ref:`bool` **adjustment_enabled** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_adjustment_enable(value) | ++-----------+------------------------------+ +| *Getter* | is_adjustment_enabled() | ++-----------+------------------------------+ + +If ``true``, enables the ``adjustment_*`` properties provided by this resource. If ``false``, modifications to the ``adjustment_*`` properties will have no effect on the rendered scene. + +---- + +.. _class_Environment_property_adjustment_saturation: + +- :ref:`float` **adjustment_saturation** + ++-----------+----------------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------------+ +| *Setter* | set_adjustment_saturation(value) | ++-----------+----------------------------------+ +| *Getter* | get_adjustment_saturation() | ++-----------+----------------------------------+ + +The global color saturation value of the rendered scene (default value is 1). Effective only if ``adjustment_enabled`` is ``true``. + +---- + +.. _class_Environment_property_ambient_light_color: + +- :ref:`Color` **ambient_light_color** + ++-----------+--------------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+--------------------------------+ +| *Setter* | set_ambient_light_color(value) | ++-----------+--------------------------------+ +| *Getter* | get_ambient_light_color() | ++-----------+--------------------------------+ + +The ambient light's :ref:`Color`. + +---- + +.. _class_Environment_property_ambient_light_energy: + +- :ref:`float` **ambient_light_energy** + ++-----------+---------------------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------------------+ +| *Setter* | set_ambient_light_energy(value) | ++-----------+---------------------------------+ +| *Getter* | get_ambient_light_energy() | ++-----------+---------------------------------+ + +The ambient light's energy. The higher the value, the stronger the light. + +---- + +.. _class_Environment_property_ambient_light_sky_contribution: + +- :ref:`float` **ambient_light_sky_contribution** + ++-----------+-------------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------------+ +| *Setter* | set_ambient_light_sky_contribution(value) | ++-----------+-------------------------------------------+ +| *Getter* | get_ambient_light_sky_contribution() | ++-----------+-------------------------------------------+ + +Defines the amount of light that the sky brings on the scene. A value of ``0.0`` means that the sky's light emission has no effect on the scene illumination, thus all ambient illumination is provided by the ambient light. On the contrary, a value of ``1.0`` means that *all* the light that affects the scene is provided by the sky, thus the ambient light parameter has no effect on the scene. + +**Note:** :ref:`ambient_light_sky_contribution` is internally clamped between ``0.0`` and ``1.0`` (inclusive). + +---- + +.. _class_Environment_property_auto_exposure_enabled: + +- :ref:`bool` **auto_exposure_enabled** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_tonemap_auto_exposure(value) | ++-----------+----------------------------------+ +| *Getter* | get_tonemap_auto_exposure() | ++-----------+----------------------------------+ + +If ``true``, enables the tonemapping auto exposure mode of the scene renderer. If ``true``, the renderer will automatically determine the exposure setting to adapt to the scene's illumination and the observed light. + +---- + +.. _class_Environment_property_auto_exposure_max_luma: + +- :ref:`float` **auto_exposure_max_luma** + ++-----------+--------------------------------------+ +| *Default* | ``8.0`` | ++-----------+--------------------------------------+ +| *Setter* | set_tonemap_auto_exposure_max(value) | ++-----------+--------------------------------------+ +| *Getter* | get_tonemap_auto_exposure_max() | ++-----------+--------------------------------------+ + +The maximum luminance value for the auto exposure. + +---- + +.. _class_Environment_property_auto_exposure_min_luma: + +- :ref:`float` **auto_exposure_min_luma** + ++-----------+--------------------------------------+ +| *Default* | ``0.05`` | ++-----------+--------------------------------------+ +| *Setter* | set_tonemap_auto_exposure_min(value) | ++-----------+--------------------------------------+ +| *Getter* | get_tonemap_auto_exposure_min() | ++-----------+--------------------------------------+ + +The minimum luminance value for the auto exposure. + +---- + +.. _class_Environment_property_auto_exposure_scale: + +- :ref:`float` **auto_exposure_scale** + ++-----------+---------------------------------------+ +| *Default* | ``0.4`` | ++-----------+---------------------------------------+ +| *Setter* | set_tonemap_auto_exposure_grey(value) | ++-----------+---------------------------------------+ +| *Getter* | get_tonemap_auto_exposure_grey() | ++-----------+---------------------------------------+ + +The scale of the auto exposure effect. Affects the intensity of auto exposure. + +---- + +.. _class_Environment_property_auto_exposure_speed: + +- :ref:`float` **auto_exposure_speed** + ++-----------+----------------------------------------+ +| *Default* | ``0.5`` | ++-----------+----------------------------------------+ +| *Setter* | set_tonemap_auto_exposure_speed(value) | ++-----------+----------------------------------------+ +| *Getter* | get_tonemap_auto_exposure_speed() | ++-----------+----------------------------------------+ + +The speed of the auto exposure effect. Affects the time needed for the camera to perform auto exposure. + +---- + +.. _class_Environment_property_background_camera_feed_id: + +- :ref:`int` **background_camera_feed_id** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_camera_feed_id(value) | ++-----------+---------------------------+ +| *Getter* | get_camera_feed_id() | ++-----------+---------------------------+ + +The ID of the camera feed to show in the background. + +---- + +.. _class_Environment_property_background_canvas_max_layer: + +- :ref:`int` **background_canvas_max_layer** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_canvas_max_layer(value) | ++-----------+-----------------------------+ +| *Getter* | get_canvas_max_layer() | ++-----------+-----------------------------+ + +The maximum layer ID to display. Only effective when using the :ref:`BG_CANVAS` background mode. + +---- + +.. _class_Environment_property_background_color: + +- :ref:`Color` **background_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_bg_color(value) | ++-----------+-------------------------+ +| *Getter* | get_bg_color() | ++-----------+-------------------------+ + +The :ref:`Color` displayed for clear areas of the scene. Only effective when using the :ref:`BG_COLOR` or :ref:`BG_COLOR_SKY` background modes). + +---- + +.. _class_Environment_property_background_energy: + +- :ref:`float` **background_energy** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_bg_energy(value) | ++-----------+----------------------+ +| *Getter* | get_bg_energy() | ++-----------+----------------------+ + +The power of the light emitted by the background. + +---- + +.. _class_Environment_property_background_mode: + +- :ref:`BGMode` **background_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_background(value) | ++-----------+-----------------------+ +| *Getter* | get_background() | ++-----------+-----------------------+ + +The background mode. See :ref:`BGMode` for possible values. + +---- + +.. _class_Environment_property_background_sky: + +- :ref:`Sky` **background_sky** + ++----------+----------------+ +| *Setter* | set_sky(value) | ++----------+----------------+ +| *Getter* | get_sky() | ++----------+----------------+ + +The :ref:`Sky` resource defined as background. + +---- + +.. _class_Environment_property_background_sky_custom_fov: + +- :ref:`float` **background_sky_custom_fov** + ++-----------+---------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------+ +| *Setter* | set_sky_custom_fov(value) | ++-----------+---------------------------+ +| *Getter* | get_sky_custom_fov() | ++-----------+---------------------------+ + +The :ref:`Sky` resource's custom field of view. + +---- + +.. _class_Environment_property_background_sky_orientation: + +- :ref:`Basis` **background_sky_orientation** + ++-----------+----------------------------------------+ +| *Default* | ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )`` | ++-----------+----------------------------------------+ +| *Setter* | set_sky_orientation(value) | ++-----------+----------------------------------------+ +| *Getter* | get_sky_orientation() | ++-----------+----------------------------------------+ + +The :ref:`Sky` resource's rotation expressed as a :ref:`Basis`. + +---- + +.. _class_Environment_property_background_sky_rotation: + +- :ref:`Vector3` **background_sky_rotation** + ++-----------+-------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_sky_rotation(value) | ++-----------+-------------------------+ +| *Getter* | get_sky_rotation() | ++-----------+-------------------------+ + +The :ref:`Sky` resource's rotation expressed as Euler angles in radians. + +---- + +.. _class_Environment_property_background_sky_rotation_degrees: + +- :ref:`Vector3` **background_sky_rotation_degrees** + ++-----------+---------------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+---------------------------------+ +| *Setter* | set_sky_rotation_degrees(value) | ++-----------+---------------------------------+ +| *Getter* | get_sky_rotation_degrees() | ++-----------+---------------------------------+ + +The :ref:`Sky` resource's rotation expressed as Euler angles in degrees. + +---- + +.. _class_Environment_property_dof_blur_far_amount: + +- :ref:`float` **dof_blur_far_amount** + ++-----------+--------------------------------+ +| *Default* | ``0.1`` | ++-----------+--------------------------------+ +| *Setter* | set_dof_blur_far_amount(value) | ++-----------+--------------------------------+ +| *Getter* | get_dof_blur_far_amount() | ++-----------+--------------------------------+ + +The amount of far blur for the depth-of-field effect. + +---- + +.. _class_Environment_property_dof_blur_far_distance: + +- :ref:`float` **dof_blur_far_distance** + ++-----------+----------------------------------+ +| *Default* | ``10.0`` | ++-----------+----------------------------------+ +| *Setter* | set_dof_blur_far_distance(value) | ++-----------+----------------------------------+ +| *Getter* | get_dof_blur_far_distance() | ++-----------+----------------------------------+ + +The distance from the camera where the far blur effect affects the rendering. + +---- + +.. _class_Environment_property_dof_blur_far_enabled: + +- :ref:`bool` **dof_blur_far_enabled** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_dof_blur_far_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_dof_blur_far_enabled() | ++-----------+---------------------------------+ + +If ``true``, enables the depth-of-field far blur effect. + +---- + +.. _class_Environment_property_dof_blur_far_quality: + +- :ref:`DOFBlurQuality` **dof_blur_far_quality** + ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_dof_blur_far_quality(value) | ++-----------+---------------------------------+ +| *Getter* | get_dof_blur_far_quality() | ++-----------+---------------------------------+ + +The depth-of-field far blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. + +---- + +.. _class_Environment_property_dof_blur_far_transition: + +- :ref:`float` **dof_blur_far_transition** + ++-----------+------------------------------------+ +| *Default* | ``5.0`` | ++-----------+------------------------------------+ +| *Setter* | set_dof_blur_far_transition(value) | ++-----------+------------------------------------+ +| *Getter* | get_dof_blur_far_transition() | ++-----------+------------------------------------+ + +The length of the transition between the no-blur area and far blur. + +---- + +.. _class_Environment_property_dof_blur_near_amount: + +- :ref:`float` **dof_blur_near_amount** + ++-----------+---------------------------------+ +| *Default* | ``0.1`` | ++-----------+---------------------------------+ +| *Setter* | set_dof_blur_near_amount(value) | ++-----------+---------------------------------+ +| *Getter* | get_dof_blur_near_amount() | ++-----------+---------------------------------+ + +The amount of near blur for the depth-of-field effect. + +---- + +.. _class_Environment_property_dof_blur_near_distance: + +- :ref:`float` **dof_blur_near_distance** + ++-----------+-----------------------------------+ +| *Default* | ``2.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_dof_blur_near_distance(value) | ++-----------+-----------------------------------+ +| *Getter* | get_dof_blur_near_distance() | ++-----------+-----------------------------------+ + +Distance from the camera where the near blur effect affects the rendering. + +---- + +.. _class_Environment_property_dof_blur_near_enabled: + +- :ref:`bool` **dof_blur_near_enabled** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_dof_blur_near_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_dof_blur_near_enabled() | ++-----------+----------------------------------+ + +If ``true``, enables the depth-of-field near blur effect. + +---- + +.. _class_Environment_property_dof_blur_near_quality: + +- :ref:`DOFBlurQuality` **dof_blur_near_quality** + ++-----------+----------------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------------+ +| *Setter* | set_dof_blur_near_quality(value) | ++-----------+----------------------------------+ +| *Getter* | get_dof_blur_near_quality() | ++-----------+----------------------------------+ + +The depth-of-field near blur's quality. Higher values can mitigate the visible banding effect seen at higher strengths, but are much slower. + +---- + +.. _class_Environment_property_dof_blur_near_transition: + +- :ref:`float` **dof_blur_near_transition** + ++-----------+-------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_dof_blur_near_transition(value) | ++-----------+-------------------------------------+ +| *Getter* | get_dof_blur_near_transition() | ++-----------+-------------------------------------+ + +The length of the transition between the near blur and no-blur area. + +---- + +.. _class_Environment_property_fog_color: + +- :ref:`Color` **fog_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.5, 0.6, 0.7, 1 )`` | ++-----------+-------------------------------+ +| *Setter* | set_fog_color(value) | ++-----------+-------------------------------+ +| *Getter* | get_fog_color() | ++-----------+-------------------------------+ + +The fog's :ref:`Color`. + +---- + +.. _class_Environment_property_fog_depth_begin: + +- :ref:`float` **fog_depth_begin** + ++-----------+----------------------------+ +| *Default* | ``10.0`` | ++-----------+----------------------------+ +| *Setter* | set_fog_depth_begin(value) | ++-----------+----------------------------+ +| *Getter* | get_fog_depth_begin() | ++-----------+----------------------------+ + +The fog's depth starting distance from the camera. + +---- + +.. _class_Environment_property_fog_depth_curve: + +- :ref:`float` **fog_depth_curve** + ++-----------+----------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------+ +| *Setter* | set_fog_depth_curve(value) | ++-----------+----------------------------+ +| *Getter* | get_fog_depth_curve() | ++-----------+----------------------------+ + +The fog depth's intensity curve. A number of presets are available in the **Inspector** by right-clicking the curve. + +---- + +.. _class_Environment_property_fog_depth_enabled: + +- :ref:`bool` **fog_depth_enabled** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_fog_depth_enabled(value) | ++-----------+------------------------------+ +| *Getter* | is_fog_depth_enabled() | ++-----------+------------------------------+ + +If ``true``, the depth fog effect is enabled. When enabled, fog will appear in the distance (relative to the camera). + +---- + +.. _class_Environment_property_fog_depth_end: + +- :ref:`float` **fog_depth_end** + ++-----------+--------------------------+ +| *Default* | ``100.0`` | ++-----------+--------------------------+ +| *Setter* | set_fog_depth_end(value) | ++-----------+--------------------------+ +| *Getter* | get_fog_depth_end() | ++-----------+--------------------------+ + +The fog's depth end distance from the camera. If this value is set to 0, it will be equal to the current camera's :ref:`Camera.far` value. + +---- + +.. _class_Environment_property_fog_enabled: + +- :ref:`bool` **fog_enabled** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_fog_enabled(value) | ++-----------+------------------------+ +| *Getter* | is_fog_enabled() | ++-----------+------------------------+ + +If ``true``, fog effects are enabled. :ref:`fog_height_enabled` and/or :ref:`fog_depth_enabled` must be set to ``true`` to actually display fog. + +---- + +.. _class_Environment_property_fog_height_curve: + +- :ref:`float` **fog_height_curve** + ++-----------+-----------------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------------+ +| *Setter* | set_fog_height_curve(value) | ++-----------+-----------------------------+ +| *Getter* | get_fog_height_curve() | ++-----------+-----------------------------+ + +The height fog's intensity. A number of presets are available in the **Inspector** by right-clicking the curve. + +---- + +.. _class_Environment_property_fog_height_enabled: + +- :ref:`bool` **fog_height_enabled** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_fog_height_enabled(value) | ++-----------+-------------------------------+ +| *Getter* | is_fog_height_enabled() | ++-----------+-------------------------------+ + +If ``true``, the height fog effect is enabled. When enabled, fog will appear in a defined height range, regardless of the distance from the camera. This can be used to simulate "deep water" effects with a lower performance cost compared to a dedicated shader. + +---- + +.. _class_Environment_property_fog_height_max: + +- :ref:`float` **fog_height_max** + ++-----------+---------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------+ +| *Setter* | set_fog_height_max(value) | ++-----------+---------------------------+ +| *Getter* | get_fog_height_max() | ++-----------+---------------------------+ + +The Y coordinate where the height fog will be the most intense. If this value is greater than :ref:`fog_height_min`, fog will be displayed from bottom to top. Otherwise, it will be displayed from top to bottom. + +---- + +.. _class_Environment_property_fog_height_min: + +- :ref:`float` **fog_height_min** + ++-----------+---------------------------+ +| *Default* | ``10.0`` | ++-----------+---------------------------+ +| *Setter* | set_fog_height_min(value) | ++-----------+---------------------------+ +| *Getter* | get_fog_height_min() | ++-----------+---------------------------+ + +The Y coordinate where the height fog will be the least intense. If this value is greater than :ref:`fog_height_max`, fog will be displayed from top to bottom. Otherwise, it will be displayed from bottom to top. + +---- + +.. _class_Environment_property_fog_sun_amount: + +- :ref:`float` **fog_sun_amount** + ++-----------+---------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------+ +| *Setter* | set_fog_sun_amount(value) | ++-----------+---------------------------+ +| *Getter* | get_fog_sun_amount() | ++-----------+---------------------------+ + +The intensity of the depth fog color transition when looking towards the sun. The sun's direction is determined automatically using the DirectionalLight node in the scene. + +---- + +.. _class_Environment_property_fog_sun_color: + +- :ref:`Color` **fog_sun_color** + ++-----------+-----------------------------+ +| *Default* | ``Color( 1, 0.9, 0.7, 1 )`` | ++-----------+-----------------------------+ +| *Setter* | set_fog_sun_color(value) | ++-----------+-----------------------------+ +| *Getter* | get_fog_sun_color() | ++-----------+-----------------------------+ + +The depth fog's :ref:`Color` when looking towards the sun. + +---- + +.. _class_Environment_property_fog_transmit_curve: + +- :ref:`float` **fog_transmit_curve** + ++-----------+-------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------+ +| *Setter* | set_fog_transmit_curve(value) | ++-----------+-------------------------------+ +| *Getter* | get_fog_transmit_curve() | ++-----------+-------------------------------+ + +The intensity of the fog light transmittance effect. Amount of light that the fog transmits. + +---- + +.. _class_Environment_property_fog_transmit_enabled: + +- :ref:`bool` **fog_transmit_enabled** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_fog_transmit_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_fog_transmit_enabled() | ++-----------+---------------------------------+ + +Enables fog's light transmission effect. If ``true``, light will be more visible in the fog to simulate light scattering as in real life. + +---- + +.. _class_Environment_property_glow_bicubic_upscale: + +- :ref:`bool` **glow_bicubic_upscale** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_glow_bicubic_upscale(value) | ++-----------+-----------------------------------+ +| *Getter* | is_glow_bicubic_upscale_enabled() | ++-----------+-----------------------------------+ + +Smooths out the blockiness created by sampling higher levels, at the cost of performance. + +**Note:** When using the GLES2 renderer, this is only available if the GPU supports the ``GL_EXT_gpu_shader4`` extension. + +---- + +.. _class_Environment_property_glow_blend_mode: + +- :ref:`GlowBlendMode` **glow_blend_mode** + ++-----------+----------------------------+ +| *Default* | ``2`` | ++-----------+----------------------------+ +| *Setter* | set_glow_blend_mode(value) | ++-----------+----------------------------+ +| *Getter* | get_glow_blend_mode() | ++-----------+----------------------------+ + +The glow blending mode. + +---- + +.. _class_Environment_property_glow_bloom: + +- :ref:`float` **glow_bloom** + ++-----------+-----------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------+ +| *Setter* | set_glow_bloom(value) | ++-----------+-----------------------+ +| *Getter* | get_glow_bloom() | ++-----------+-----------------------+ + +The bloom's intensity. If set to a value higher than ``0``, this will make glow visible in areas darker than the :ref:`glow_hdr_threshold`. + +---- + +.. _class_Environment_property_glow_enabled: + +- :ref:`bool` **glow_enabled** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_enabled() | ++-----------+-------------------------+ + +If ``true``, the glow effect is enabled. + +---- + +.. _class_Environment_property_glow_hdr_luminance_cap: + +- :ref:`float` **glow_hdr_luminance_cap** + ++-----------+-----------------------------------+ +| *Default* | ``12.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_glow_hdr_luminance_cap(value) | ++-----------+-----------------------------------+ +| *Getter* | get_glow_hdr_luminance_cap() | ++-----------+-----------------------------------+ + +The higher threshold of the HDR glow. Areas brighter than this threshold will be clamped for the purposes of the glow effect. + +---- + +.. _class_Environment_property_glow_hdr_scale: + +- :ref:`float` **glow_hdr_scale** + ++-----------+---------------------------------+ +| *Default* | ``2.0`` | ++-----------+---------------------------------+ +| *Setter* | set_glow_hdr_bleed_scale(value) | ++-----------+---------------------------------+ +| *Getter* | get_glow_hdr_bleed_scale() | ++-----------+---------------------------------+ + +The bleed scale of the HDR glow. + +---- + +.. _class_Environment_property_glow_hdr_threshold: + +- :ref:`float` **glow_hdr_threshold** + ++-----------+-------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_glow_hdr_bleed_threshold(value) | ++-----------+-------------------------------------+ +| *Getter* | get_glow_hdr_bleed_threshold() | ++-----------+-------------------------------------+ + +The lower threshold of the HDR glow. When using the GLES2 renderer (which doesn't support HDR), this needs to be below ``1.0`` for glow to be visible. A value of ``0.9`` works well in this case. + +---- + +.. _class_Environment_property_glow_high_quality: + +- :ref:`bool` **glow_high_quality** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_glow_high_quality(value) | ++-----------+--------------------------------+ +| *Getter* | is_glow_high_quality_enabled() | ++-----------+--------------------------------+ + +Takes more samples during downsample pass of glow. This ensures that single pixels are captured by glow which makes the glow look smoother and more stable during movement. However, it is very expensive and makes the glow post process take twice as long. + +---- + +.. _class_Environment_property_glow_intensity: + +- :ref:`float` **glow_intensity** + ++-----------+---------------------------+ +| *Default* | ``0.8`` | ++-----------+---------------------------+ +| *Setter* | set_glow_intensity(value) | ++-----------+---------------------------+ +| *Getter* | get_glow_intensity() | ++-----------+---------------------------+ + +The glow intensity. When using the GLES2 renderer, this should be increased to 1.5 to compensate for the lack of HDR rendering. + +---- + +.. _class_Environment_property_glow_levels/1: + +- :ref:`bool` **glow_levels/1** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 1st level of glow is enabled. This is the most "local" level (least blurry). + +---- + +.. _class_Environment_property_glow_levels/2: + +- :ref:`bool` **glow_levels/2** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 2th level of glow is enabled. + +---- + +.. _class_Environment_property_glow_levels/3: + +- :ref:`bool` **glow_levels/3** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 3th level of glow is enabled. + +---- + +.. _class_Environment_property_glow_levels/4: + +- :ref:`bool` **glow_levels/4** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 4th level of glow is enabled. + +---- + +.. _class_Environment_property_glow_levels/5: + +- :ref:`bool` **glow_levels/5** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 5th level of glow is enabled. + +---- + +.. _class_Environment_property_glow_levels/6: + +- :ref:`bool` **glow_levels/6** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 6th level of glow is enabled. + +---- + +.. _class_Environment_property_glow_levels/7: + +- :ref:`bool` **glow_levels/7** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_glow_level(value) | ++-----------+-------------------------+ +| *Getter* | is_glow_level_enabled() | ++-----------+-------------------------+ + +If ``true``, the 7th level of glow is enabled. This is the most "global" level (blurriest). + +---- + +.. _class_Environment_property_glow_strength: + +- :ref:`float` **glow_strength** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_glow_strength(value) | ++-----------+--------------------------+ +| *Getter* | get_glow_strength() | ++-----------+--------------------------+ + +The glow strength. When using the GLES2 renderer, this should be increased to 1.3 to compensate for the lack of HDR rendering. + +---- + +.. _class_Environment_property_ss_reflections_depth_tolerance: + +- :ref:`float` **ss_reflections_depth_tolerance** + ++-----------+--------------------------------+ +| *Default* | ``0.2`` | ++-----------+--------------------------------+ +| *Setter* | set_ssr_depth_tolerance(value) | ++-----------+--------------------------------+ +| *Getter* | get_ssr_depth_tolerance() | ++-----------+--------------------------------+ + +The depth tolerance for screen-space reflections. + +---- + +.. _class_Environment_property_ss_reflections_enabled: + +- :ref:`bool` **ss_reflections_enabled** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_ssr_enabled(value) | ++-----------+------------------------+ +| *Getter* | is_ssr_enabled() | ++-----------+------------------------+ + +If ``true``, screen-space reflections are enabled. Screen-space reflections are more accurate than reflections from :ref:`GIProbe`\ s or :ref:`ReflectionProbe`\ s, but are slower and can't reflect surfaces occluded by others. + +---- + +.. _class_Environment_property_ss_reflections_fade_in: + +- :ref:`float` **ss_reflections_fade_in** + ++-----------+------------------------+ +| *Default* | ``0.15`` | ++-----------+------------------------+ +| *Setter* | set_ssr_fade_in(value) | ++-----------+------------------------+ +| *Getter* | get_ssr_fade_in() | ++-----------+------------------------+ + +The fade-in distance for screen-space reflections. Affects the area from the reflected material to the screen-space reflection). + +---- + +.. _class_Environment_property_ss_reflections_fade_out: + +- :ref:`float` **ss_reflections_fade_out** + ++-----------+-------------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------------+ +| *Setter* | set_ssr_fade_out(value) | ++-----------+-------------------------+ +| *Getter* | get_ssr_fade_out() | ++-----------+-------------------------+ + +The fade-out distance for screen-space reflections. Affects the area from the screen-space reflection to the "global" reflection. + +---- + +.. _class_Environment_property_ss_reflections_max_steps: + +- :ref:`int` **ss_reflections_max_steps** + ++-----------+--------------------------+ +| *Default* | ``64`` | ++-----------+--------------------------+ +| *Setter* | set_ssr_max_steps(value) | ++-----------+--------------------------+ +| *Getter* | get_ssr_max_steps() | ++-----------+--------------------------+ + +The maximum number of steps for screen-space reflections. Higher values are slower. + +---- + +.. _class_Environment_property_ss_reflections_roughness: + +- :ref:`bool` **ss_reflections_roughness** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_ssr_rough(value) | ++-----------+----------------------+ +| *Getter* | is_ssr_rough() | ++-----------+----------------------+ + +If ``true``, screen-space reflections will take the material roughness into account. + +---- + +.. _class_Environment_property_ssao_ao_channel_affect: + +- :ref:`float` **ssao_ao_channel_affect** + ++-----------+-----------------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_ssao_ao_channel_affect(value) | ++-----------+-----------------------------------+ +| *Getter* | get_ssao_ao_channel_affect() | ++-----------+-----------------------------------+ + +The screen-space ambient occlusion intensity on materials that have an AO texture defined. Values higher than ``0`` will make the SSAO effect visible in areas darkened by AO textures. + +---- + +.. _class_Environment_property_ssao_bias: + +- :ref:`float` **ssao_bias** + ++-----------+----------------------+ +| *Default* | ``0.01`` | ++-----------+----------------------+ +| *Setter* | set_ssao_bias(value) | ++-----------+----------------------+ +| *Getter* | get_ssao_bias() | ++-----------+----------------------+ + +The screen-space ambient occlusion bias. This should be kept high enough to prevent "smooth" curves from being affected by ambient occlusion. + +---- + +.. _class_Environment_property_ssao_blur: + +- :ref:`SSAOBlur` **ssao_blur** + ++-----------+----------------------+ +| *Default* | ``3`` | ++-----------+----------------------+ +| *Setter* | set_ssao_blur(value) | ++-----------+----------------------+ +| *Getter* | get_ssao_blur() | ++-----------+----------------------+ + +The screen-space ambient occlusion blur quality. See :ref:`SSAOBlur` for possible values. + +---- + +.. _class_Environment_property_ssao_color: + +- :ref:`Color` **ssao_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_ssao_color(value) | ++-----------+-------------------------+ +| *Getter* | get_ssao_color() | ++-----------+-------------------------+ + +The screen-space ambient occlusion color. + +---- + +.. _class_Environment_property_ssao_edge_sharpness: + +- :ref:`float` **ssao_edge_sharpness** + ++-----------+--------------------------------+ +| *Default* | ``4.0`` | ++-----------+--------------------------------+ +| *Setter* | set_ssao_edge_sharpness(value) | ++-----------+--------------------------------+ +| *Getter* | get_ssao_edge_sharpness() | ++-----------+--------------------------------+ + +The screen-space ambient occlusion edge sharpness. + +---- + +.. _class_Environment_property_ssao_enabled: + +- :ref:`bool` **ssao_enabled** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_ssao_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_ssao_enabled() | ++-----------+-------------------------+ + +If ``true``, the screen-space ambient occlusion effect is enabled. This darkens objects' corners and cavities to simulate ambient light not reaching the entire object as in real life. This works well for small, dynamic objects, but baked lighting or ambient occlusion textures will do a better job at displaying ambient occlusion on large static objects. This is a costly effect and should be disabled first when running into performance issues. + +---- + +.. _class_Environment_property_ssao_intensity: + +- :ref:`float` **ssao_intensity** + ++-----------+---------------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------------+ +| *Setter* | set_ssao_intensity(value) | ++-----------+---------------------------+ +| *Getter* | get_ssao_intensity() | ++-----------+---------------------------+ + +The primary screen-space ambient occlusion intensity. See also :ref:`ssao_radius`. + +---- + +.. _class_Environment_property_ssao_intensity2: + +- :ref:`float` **ssao_intensity2** + ++-----------+----------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------+ +| *Setter* | set_ssao_intensity2(value) | ++-----------+----------------------------+ +| *Getter* | get_ssao_intensity2() | ++-----------+----------------------------+ + +The secondary screen-space ambient occlusion intensity. See also :ref:`ssao_radius2`. + +---- + +.. _class_Environment_property_ssao_light_affect: + +- :ref:`float` **ssao_light_affect** + ++-----------+-------------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_ssao_direct_light_affect(value) | ++-----------+-------------------------------------+ +| *Getter* | get_ssao_direct_light_affect() | ++-----------+-------------------------------------+ + +The screen-space ambient occlusion intensity in direct light. In real life, ambient occlusion only applies to indirect light, which means its effects can't be seen in direct light. Values higher than ``0`` will make the SSAO effect visible in direct light. + +---- + +.. _class_Environment_property_ssao_quality: + +- :ref:`SSAOQuality` **ssao_quality** + ++-----------+-------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------+ +| *Setter* | set_ssao_quality(value) | ++-----------+-------------------------+ +| *Getter* | get_ssao_quality() | ++-----------+-------------------------+ + +The screen-space ambient occlusion quality. Higher qualities will make better use of small objects for ambient occlusion, but are slower. + +---- + +.. _class_Environment_property_ssao_radius: + +- :ref:`float` **ssao_radius** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_ssao_radius(value) | ++-----------+------------------------+ +| *Getter* | get_ssao_radius() | ++-----------+------------------------+ + +The primary screen-space ambient occlusion radius. + +---- + +.. _class_Environment_property_ssao_radius2: + +- :ref:`float` **ssao_radius2** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_ssao_radius2(value) | ++-----------+-------------------------+ +| *Getter* | get_ssao_radius2() | ++-----------+-------------------------+ + +The secondary screen-space ambient occlusion radius. If set to a value higher than ``0``, enables the secondary screen-space ambient occlusion effect which can be used to improve the effect's appearance (at the cost of performance). + +---- + +.. _class_Environment_property_tonemap_exposure: + +- :ref:`float` **tonemap_exposure** + ++-----------+-----------------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------------+ +| *Setter* | set_tonemap_exposure(value) | ++-----------+-----------------------------+ +| *Getter* | get_tonemap_exposure() | ++-----------+-----------------------------+ + +The default exposure used for tonemapping. + +---- + +.. _class_Environment_property_tonemap_mode: + +- :ref:`ToneMapper` **tonemap_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_tonemapper(value) | ++-----------+-----------------------+ +| *Getter* | get_tonemapper() | ++-----------+-----------------------+ + +The tonemapping mode to use. Tonemapping is the process that "converts" HDR values to be suitable for rendering on a LDR display. (Godot doesn't support rendering on HDR displays yet.) + +---- + +.. _class_Environment_property_tonemap_white: + +- :ref:`float` **tonemap_white** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_tonemap_white(value) | ++-----------+--------------------------+ +| *Getter* | get_tonemap_white() | ++-----------+--------------------------+ + +The white reference value for tonemapping. Only effective if the :ref:`tonemap_mode` isn't set to :ref:`TONE_MAPPER_LINEAR`. + +Method Descriptions +------------------- + +.. _class_Environment_method_is_glow_level_enabled: + +- :ref:`bool` **is_glow_level_enabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the glow level ``idx`` is specified, ``false`` otherwise. + +---- + +.. _class_Environment_method_set_glow_level: + +- void **set_glow_level** **(** :ref:`int` idx, :ref:`bool` enabled **)** + +Enables or disables the glow level at index ``idx``. Each level relies on the previous level. This means that enabling higher glow levels will slow down the glow effect rendering, even if previous levels aren't enabled. + +.. |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.)` diff --git a/classes/class_expression.rst b/classes/class_expression.rst new file mode 100644 index 0000000..1b10e9c --- /dev/null +++ b/classes/class_expression.rst @@ -0,0 +1,93 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Expression.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Expression: + +Expression +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A class that stores an expression you can execute. + +Description +----------- + +An expression can be made of any arithmetic operation, built-in math function call, method call of a passed instance, or built-in type construction call. + +An example expression text using the built-in math functions could be ``sqrt(pow(3,2) + pow(4,2))``. + +In the following example we use a :ref:`LineEdit` node to write our expression and show the result. + +:: + + onready var expression = Expression.new() + + func _ready(): + $LineEdit.connect("text_entered", self, "_on_text_entered") + + func _on_text_entered(command): + var error = expression.parse(command, []) + if error != OK: + print(expression.get_error_text()) + return + var result = expression.execute([], null, true) + if not expression.has_execute_failed(): + $LineEdit.text = str(result) + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`execute` **(** :ref:`Array` inputs=[ ], :ref:`Object` base_instance=null, :ref:`bool` show_error=true **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_error_text` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_execute_failed` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`parse` **(** :ref:`String` expression, :ref:`PoolStringArray` input_names=PoolStringArray( ) **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Expression_method_execute: + +- :ref:`Variant` **execute** **(** :ref:`Array` inputs=[ ], :ref:`Object` base_instance=null, :ref:`bool` show_error=true **)** + +Executes the expression that was previously parsed by :ref:`parse` and returns the result. Before you use the returned object, you should check if the method failed by calling :ref:`has_execute_failed`. + +If you defined input variables in :ref:`parse`, you can specify their values in the inputs array, in the same order. + +---- + +.. _class_Expression_method_get_error_text: + +- :ref:`String` **get_error_text** **(** **)** |const| + +Returns the error text if :ref:`parse` has failed. + +---- + +.. _class_Expression_method_has_execute_failed: + +- :ref:`bool` **has_execute_failed** **(** **)** |const| + +Returns ``true`` if :ref:`execute` has failed. + +---- + +.. _class_Expression_method_parse: + +- :ref:`Error` **parse** **(** :ref:`String` expression, :ref:`PoolStringArray` input_names=PoolStringArray( ) **)** + +Parses the expression and returns an :ref:`Error` code. + +You can optionally specify names of variables that may appear in the expression with ``input_names``, so that you can bind them when it gets executed. + +.. |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.)` diff --git a/classes/class_externaltexture.rst b/classes/class_externaltexture.rst new file mode 100644 index 0000000..15be32c --- /dev/null +++ b/classes/class_externaltexture.rst @@ -0,0 +1,67 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ExternalTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ExternalTexture: + +ExternalTexture +=============== + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Enable OpenGL ES external texture extension. + +Description +----------- + +Enable support for the OpenGL ES external texture extension as defined by `OES_EGL_image_external `__. + +**Note:** This is only supported for Android platforms. + +Properties +---------- + ++-------------------------------+--------------------------------------------------+------------------------------+ +| :ref:`int` | flags | ``2048`` *(parent override)* | ++-------------------------------+--------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 1, 1 )`` | ++-------------------------------+--------------------------------------------------+------------------------------+ + +Methods +------- + ++-----------------------+--------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_external_texture_id` **(** **)** | ++-----------------------+--------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ExternalTexture_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_size(value) | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +External texture size. + +Method Descriptions +------------------- + +.. _class_ExternalTexture_method_get_external_texture_id: + +- :ref:`int` **get_external_texture_id** **(** **)** + +Returns the external texture 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.)` diff --git a/classes/class_file.rst b/classes/class_file.rst new file mode 100644 index 0000000..3f349d6 --- /dev/null +++ b/classes/class_file.rst @@ -0,0 +1,660 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the File.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_File: + +File +==== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Type to handle file reading and writing operations. + +Description +----------- + +File type. This is used to permanently store data into the user device's file system and to read from it. This can be used to store game save data or player configuration files, for example. + +Here's a sample on how to write and read from a file: + +:: + + func save(content): + var file = File.new() + file.open("user://save_game.dat", File.WRITE) + file.store_string(content) + file.close() + + func load(): + var file = File.new() + file.open("user://save_game.dat", File.READ) + var content = file.get_as_text() + file.close() + return content + +In the example above, the file will be saved in the user data folder as specified in the `Data paths `__ documentation. + +**Note:** To access project resources once exported, it is recommended to use :ref:`ResourceLoader` instead of the ``File`` API, as some files are converted to engine-specific formats and their original source files might not be present in the exported PCK package. + +**Note:** Files are automatically closed only if the process exits "normally" (such as by clicking the window manager's close button or pressing **Alt + F4**). If you stop the project execution by pressing **F8** while the project is running, the file won't be closed as the game process will be killed. You can work around this by calling :ref:`flush` at regular intervals. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/filesystem` + +- `3D Voxel Demo `__ + +Properties +---------- + ++-------------------------+-----------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`endian_swap` | ``false`` | ++-------------------------+-----------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`eof_reached` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`file_exists` **(** :ref:`String` path **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flush` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_16` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_32` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_64` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_8` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_as_text` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`get_buffer` **(** :ref:`int` len **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_csv_line` **(** :ref:`String` delim="," **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_double` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`get_error` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_float` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_len` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_line` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_md5` **(** :ref:`String` path **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_modified_time` **(** :ref:`String` file **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_pascal_string` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_path` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_path_absolute` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_position` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_real` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_sha256` **(** :ref:`String` path **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_var` **(** :ref:`bool` allow_objects=false **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_open` **(** **)** |const| | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open` **(** :ref:`String` path, :ref:`ModeFlags` flags **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open_compressed` **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`CompressionMode` compression_mode=0 **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open_encrypted` **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`PoolByteArray` key **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open_encrypted_with_pass` **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`String` pass **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`int` position **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`seek_end` **(** :ref:`int` position=0 **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_16` **(** :ref:`int` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_32` **(** :ref:`int` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_64` **(** :ref:`int` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_8` **(** :ref:`int` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_csv_line` **(** :ref:`PoolStringArray` values, :ref:`String` delim="," **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_double` **(** :ref:`float` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_float` **(** :ref:`float` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_line` **(** :ref:`String` line **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_pascal_string` **(** :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_real` **(** :ref:`float` value **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_string` **(** :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`store_var` **(** :ref:`Variant` value, :ref:`bool` full_objects=false **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_File_ModeFlags: + +.. _class_File_constant_READ: + +.. _class_File_constant_WRITE: + +.. _class_File_constant_READ_WRITE: + +.. _class_File_constant_WRITE_READ: + +enum **ModeFlags**: + +- **READ** = **1** --- Opens the file for read operations. The cursor is positioned at the beginning of the file. + +- **WRITE** = **2** --- Opens the file for write operations. The file is created if it does not exist, and truncated if it does. + +- **READ_WRITE** = **3** --- Opens the file for read and write operations. Does not truncate the file. The cursor is positioned at the beginning of the file. + +- **WRITE_READ** = **7** --- Opens the file for read and write operations. The file is created if it does not exist, and truncated if it does. The cursor is positioned at the beginning of the file. + +---- + +.. _enum_File_CompressionMode: + +.. _class_File_constant_COMPRESSION_FASTLZ: + +.. _class_File_constant_COMPRESSION_DEFLATE: + +.. _class_File_constant_COMPRESSION_ZSTD: + +.. _class_File_constant_COMPRESSION_GZIP: + +enum **CompressionMode**: + +- **COMPRESSION_FASTLZ** = **0** --- Uses the `FastLZ `__ compression method. + +- **COMPRESSION_DEFLATE** = **1** --- Uses the `DEFLATE `__ compression method. + +- **COMPRESSION_ZSTD** = **2** --- Uses the `Zstandard `__ compression method. + +- **COMPRESSION_GZIP** = **3** --- Uses the `gzip `__ compression method. + +Property Descriptions +--------------------- + +.. _class_File_property_endian_swap: + +- :ref:`bool` **endian_swap** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_endian_swap(value) | ++-----------+------------------------+ +| *Getter* | get_endian_swap() | ++-----------+------------------------+ + +If ``true``, the file is read with big-endian `endianness `__. If ``false``, the file is read with little-endian endianness. If in doubt, leave this to ``false`` as most files are written with little-endian endianness. + +**Note:** :ref:`endian_swap` is only about the file format, not the CPU type. The CPU endianness doesn't affect the default endianness for files written. + +**Note:** This is always reset to ``false`` whenever you open the file. Therefore, you must set :ref:`endian_swap` *after* opening the file, not before. + +Method Descriptions +------------------- + +.. _class_File_method_close: + +- void **close** **(** **)** + +Closes the currently opened file and prevents subsequent read/write operations. Use :ref:`flush` to persist the data to disk without closing the file. + +---- + +.. _class_File_method_eof_reached: + +- :ref:`bool` **eof_reached** **(** **)** |const| + +Returns ``true`` if the file cursor has already read past the end of the file. + +**Note:** ``eof_reached() == false`` cannot be used to check whether there is more data available. To loop while there is more data available, use: + +:: + + while file.get_position() < file.get_len(): + # Read data + +---- + +.. _class_File_method_file_exists: + +- :ref:`bool` **file_exists** **(** :ref:`String` path **)** |const| + +Returns ``true`` if the file exists in the given path. + +**Note:** Many resources types are imported (e.g. textures or sound files), and their source asset will not be included in the exported game, as only the imported version is used. See :ref:`ResourceLoader.exists` for an alternative approach that takes resource remapping into account. + +---- + +.. _class_File_method_flush: + +- void **flush** **(** **)** + +Writes the file's buffer to disk. Flushing is automatically performed when the file is closed. This means you don't need to call :ref:`flush` manually before closing a file using :ref:`close`. Still, calling :ref:`flush` can be used to ensure the data is safe even if the project crashes instead of being closed gracefully. + +**Note:** Only call :ref:`flush` when you actually need it. Otherwise, it will decrease performance due to constant disk writes. + +---- + +.. _class_File_method_get_16: + +- :ref:`int` **get_16** **(** **)** |const| + +Returns the next 16 bits from the file as an integer. See :ref:`store_16` for details on what values can be stored and retrieved this way. + +---- + +.. _class_File_method_get_32: + +- :ref:`int` **get_32** **(** **)** |const| + +Returns the next 32 bits from the file as an integer. See :ref:`store_32` for details on what values can be stored and retrieved this way. + +---- + +.. _class_File_method_get_64: + +- :ref:`int` **get_64** **(** **)** |const| + +Returns the next 64 bits from the file as an integer. See :ref:`store_64` for details on what values can be stored and retrieved this way. + +---- + +.. _class_File_method_get_8: + +- :ref:`int` **get_8** **(** **)** |const| + +Returns the next 8 bits from the file as an integer. See :ref:`store_8` for details on what values can be stored and retrieved this way. + +---- + +.. _class_File_method_get_as_text: + +- :ref:`String` **get_as_text** **(** **)** |const| + +Returns the whole file as a :ref:`String`. + +Text is interpreted as being UTF-8 encoded. + +---- + +.. _class_File_method_get_buffer: + +- :ref:`PoolByteArray` **get_buffer** **(** :ref:`int` len **)** |const| + +Returns next ``len`` bytes of the file as a :ref:`PoolByteArray`. + +---- + +.. _class_File_method_get_csv_line: + +- :ref:`PoolStringArray` **get_csv_line** **(** :ref:`String` delim="," **)** |const| + +Returns the next value of the file in CSV (Comma-Separated Values) format. You can pass a different delimiter ``delim`` to use other than the default ``","`` (comma). This delimiter must be one-character long, and cannot be a double quotation mark. + +Text is interpreted as being UTF-8 encoded. Text values must be enclosed in double quotes if they include the delimiter character. Double quotes within a text value can be escaped by doubling their occurrence. + +For example, the following CSV lines are valid and will be properly parsed as two strings each: + +:: + + Alice,"Hello, Bob!" + Bob,Alice! What a surprise! + Alice,"I thought you'd reply with ""Hello, world""." + +Note how the second line can omit the enclosing quotes as it does not include the delimiter. However it *could* very well use quotes, it was only written without for demonstration purposes. The third line must use ``""`` for each quotation mark that needs to be interpreted as such instead of the end of a text value. + +---- + +.. _class_File_method_get_double: + +- :ref:`float` **get_double** **(** **)** |const| + +Returns the next 64 bits from the file as a floating-point number. + +---- + +.. _class_File_method_get_error: + +- :ref:`Error` **get_error** **(** **)** |const| + +Returns the last error that happened when trying to perform operations. Compare with the ``ERR_FILE_*`` constants from :ref:`Error`. + +---- + +.. _class_File_method_get_float: + +- :ref:`float` **get_float** **(** **)** |const| + +Returns the next 32 bits from the file as a floating-point number. + +---- + +.. _class_File_method_get_len: + +- :ref:`int` **get_len** **(** **)** |const| + +Returns the size of the file in bytes. + +---- + +.. _class_File_method_get_line: + +- :ref:`String` **get_line** **(** **)** |const| + +Returns the next line of the file as a :ref:`String`. + +Text is interpreted as being UTF-8 encoded. + +---- + +.. _class_File_method_get_md5: + +- :ref:`String` **get_md5** **(** :ref:`String` path **)** |const| + +Returns an MD5 String representing the file at the given path or an empty :ref:`String` on failure. + +---- + +.. _class_File_method_get_modified_time: + +- :ref:`int` **get_modified_time** **(** :ref:`String` file **)** |const| + +Returns the last time the ``file`` was modified in unix timestamp format or returns a :ref:`String` "ERROR IN ``file``". This unix timestamp can be converted to datetime by using :ref:`OS.get_datetime_from_unix_time`. + +---- + +.. _class_File_method_get_pascal_string: + +- :ref:`String` **get_pascal_string** **(** **)** + +Returns a :ref:`String` saved in Pascal format from the file. + +Text is interpreted as being UTF-8 encoded. + +---- + +.. _class_File_method_get_path: + +- :ref:`String` **get_path** **(** **)** |const| + +Returns the path as a :ref:`String` for the current open file. + +---- + +.. _class_File_method_get_path_absolute: + +- :ref:`String` **get_path_absolute** **(** **)** |const| + +Returns the absolute path as a :ref:`String` for the current open file. + +---- + +.. _class_File_method_get_position: + +- :ref:`int` **get_position** **(** **)** |const| + +Returns the file cursor's position. + +---- + +.. _class_File_method_get_real: + +- :ref:`float` **get_real** **(** **)** |const| + +Returns the next bits from the file as a floating-point number. + +---- + +.. _class_File_method_get_sha256: + +- :ref:`String` **get_sha256** **(** :ref:`String` path **)** |const| + +Returns a SHA-256 :ref:`String` representing the file at the given path or an empty :ref:`String` on failure. + +---- + +.. _class_File_method_get_var: + +- :ref:`Variant` **get_var** **(** :ref:`bool` allow_objects=false **)** |const| + +Returns the next :ref:`Variant` value from the file. If ``allow_objects`` is ``true``, decoding objects is allowed. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_File_method_is_open: + +- :ref:`bool` **is_open** **(** **)** |const| + +Returns ``true`` if the file is currently opened. + +---- + +.. _class_File_method_open: + +- :ref:`Error` **open** **(** :ref:`String` path, :ref:`ModeFlags` flags **)** + +Opens the file for writing or reading, depending on the flags. + +---- + +.. _class_File_method_open_compressed: + +- :ref:`Error` **open_compressed** **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`CompressionMode` compression_mode=0 **)** + +Opens a compressed file for reading or writing. + +**Note:** :ref:`open_compressed` can only read files that were saved by Godot, not third-party compression formats. See `GitHub issue #28999 `__ for a workaround. + +---- + +.. _class_File_method_open_encrypted: + +- :ref:`Error` **open_encrypted** **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`PoolByteArray` key **)** + +Opens an encrypted file in write or read mode. You need to pass a binary key to encrypt/decrypt it. + +**Note:** The provided key must be 32 bytes long. + +---- + +.. _class_File_method_open_encrypted_with_pass: + +- :ref:`Error` **open_encrypted_with_pass** **(** :ref:`String` path, :ref:`ModeFlags` mode_flags, :ref:`String` pass **)** + +Opens an encrypted file in write or read mode. You need to pass a password to encrypt/decrypt it. + +---- + +.. _class_File_method_seek: + +- void **seek** **(** :ref:`int` position **)** + +Changes the file reading/writing cursor to the specified position (in bytes from the beginning of the file). + +---- + +.. _class_File_method_seek_end: + +- void **seek_end** **(** :ref:`int` position=0 **)** + +Changes the file reading/writing cursor to the specified position (in bytes from the end of the file). + +**Note:** This is an offset, so you should use negative numbers or the cursor will be at the end of the file. + +---- + +.. _class_File_method_store_16: + +- void **store_16** **(** :ref:`int` value **)** + +Stores an integer as 16 bits in the file. + +**Note:** The ``value`` should lie in the interval ``[0, 2^16 - 1]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64` or store a signed integer from the interval ``[-2^15, 2^15 - 1]`` (i.e. keeping one bit for the signedness) and compute its sign manually when reading. For example: + +:: + + const MAX_15B = 1 << 15 + const MAX_16B = 1 << 16 + + func unsigned16_to_signed(unsigned): + return (unsigned + MAX_15B) % MAX_16B - MAX_15B + + func _ready(): + var f = File.new() + f.open("user://file.dat", File.WRITE_READ) + f.store_16(-42) # This wraps around and stores 65494 (2^16 - 42). + f.store_16(121) # In bounds, will store 121. + f.seek(0) # Go back to start to read the stored value. + var read1 = f.get_16() # 65494 + var read2 = f.get_16() # 121 + var converted1 = unsigned16_to_signed(read1) # -42 + var converted2 = unsigned16_to_signed(read2) # 121 + +---- + +.. _class_File_method_store_32: + +- void **store_32** **(** :ref:`int` value **)** + +Stores an integer as 32 bits in the file. + +**Note:** The ``value`` should lie in the interval ``[0, 2^32 - 1]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64`, or convert it manually (see :ref:`store_16` for an example). + +---- + +.. _class_File_method_store_64: + +- void **store_64** **(** :ref:`int` value **)** + +Stores an integer as 64 bits in the file. + +**Note:** The ``value`` must lie in the interval ``[-2^63, 2^63 - 1]`` (i.e. be a valid :ref:`int` value). + +---- + +.. _class_File_method_store_8: + +- void **store_8** **(** :ref:`int` value **)** + +Stores an integer as 8 bits in the file. + +**Note:** The ``value`` should lie in the interval ``[0, 255]``. Any other value will overflow and wrap around. + +To store a signed integer, use :ref:`store_64`, or convert it manually (see :ref:`store_16` for an example). + +---- + +.. _class_File_method_store_buffer: + +- void **store_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Stores the given array of bytes in the file. + +---- + +.. _class_File_method_store_csv_line: + +- void **store_csv_line** **(** :ref:`PoolStringArray` values, :ref:`String` delim="," **)** + +Store the given :ref:`PoolStringArray` in the file as a line formatted in the CSV (Comma-Separated Values) format. You can pass a different delimiter ``delim`` to use other than the default ``","`` (comma). This delimiter must be one-character long. + +Text will be encoded as UTF-8. + +---- + +.. _class_File_method_store_double: + +- void **store_double** **(** :ref:`float` value **)** + +Stores a floating-point number as 64 bits in the file. + +---- + +.. _class_File_method_store_float: + +- void **store_float** **(** :ref:`float` value **)** + +Stores a floating-point number as 32 bits in the file. + +---- + +.. _class_File_method_store_line: + +- void **store_line** **(** :ref:`String` line **)** + +Appends ``line`` to the file followed by a line return character (``\n``), encoding the text as UTF-8. + +---- + +.. _class_File_method_store_pascal_string: + +- void **store_pascal_string** **(** :ref:`String` string **)** + +Stores the given :ref:`String` as a line in the file in Pascal format (i.e. also store the length of the string). + +Text will be encoded as UTF-8. + +---- + +.. _class_File_method_store_real: + +- void **store_real** **(** :ref:`float` value **)** + +Stores a floating-point number in the file. + +---- + +.. _class_File_method_store_string: + +- void **store_string** **(** :ref:`String` string **)** + +Appends ``string`` to the file without a line return, encoding the text as UTF-8. + +**Note:** This method is intended to be used to write text files. The string is stored as a UTF-8 encoded buffer without string length or terminating zero, which means that it can't be loaded back easily. If you want to store a retrievable string in a binary file, consider using :ref:`store_pascal_string` instead. For retrieving strings from a text file, you can use ``get_buffer(length).get_string_from_utf8()`` (if you know the length) or :ref:`get_as_text`. + +---- + +.. _class_File_method_store_var: + +- void **store_var** **(** :ref:`Variant` value, :ref:`bool` full_objects=false **)** + +Stores any Variant value in the file. If ``full_objects`` is ``true``, encoding objects is allowed (and can potentially include code). + +**Note:** Not all properties are included. Only properties that are configured with the :ref:`@GlobalScope.PROPERTY_USAGE_STORAGE` flag set will be serialized. You can add a new usage flag to a property by overriding the :ref:`Object._get_property_list` method in your class. You can also check how property usage is configured by calling :ref:`Object._get_property_list`. See :ref:`PropertyUsageFlags` for the possible usage flags. + +.. |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.)` diff --git a/classes/class_filedialog.rst b/classes/class_filedialog.rst new file mode 100644 index 0000000..d33dcbd --- /dev/null +++ b/classes/class_filedialog.rst @@ -0,0 +1,421 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the FileDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_FileDialog: + +FileDialog +========== + +**Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Dialog for selecting files or directories in the filesystem. + +Description +----------- + +FileDialog is a preset dialog used to choose files and directories in the filesystem. It supports filter masks. The FileDialog automatically sets its window title according to the :ref:`mode`. If you want to use a custom title, disable this by setting :ref:`mode_overrides_title` to ``false``. + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Access` | :ref:`access` | ``0`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_dir` | ``"res://"`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_file` | ``""`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | :ref:`current_path` | ``"res://"`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | dialog_hide_on_ok | ``false`` *(parent override)* | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`PoolStringArray` | :ref:`filters` | ``PoolStringArray( )`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Mode` | :ref:`mode` | ``4`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`mode_overrides_title` | ``true`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`show_hidden_files` | ``false`` | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ +| :ref:`String` | window_title | ``"Save a File"`` *(parent override)* | ++-----------------------------------------------+-----------------------------------------------------------------------------+---------------------------------------+ + +Methods +------- + ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_filter` **(** :ref:`String` filter **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_filters` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| void | :ref:`deselect_items` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| :ref:`LineEdit` | :ref:`get_line_edit` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| :ref:`VBoxContainer` | :ref:`get_vbox` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ +| void | :ref:`invalidate` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`file_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`files_disabled` | ``Color( 0, 0, 0, 0.7 )`` | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`folder_icon_modulate` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`file` | | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`folder` | | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`parent_folder` | | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`reload` | | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`toggle_hidden` | | ++-------------------------------+--------------------------------------------------------------------------------+---------------------------+ + +Signals +------- + +.. _class_FileDialog_signal_dir_selected: + +- **dir_selected** **(** :ref:`String` dir **)** + +Emitted when the user selects a directory. + +---- + +.. _class_FileDialog_signal_file_selected: + +- **file_selected** **(** :ref:`String` path **)** + +Emitted when the user selects a file by double-clicking it or pressing the **OK** button. + +---- + +.. _class_FileDialog_signal_files_selected: + +- **files_selected** **(** :ref:`PoolStringArray` paths **)** + +Emitted when the user selects multiple files. + +Enumerations +------------ + +.. _enum_FileDialog_Mode: + +.. _class_FileDialog_constant_MODE_OPEN_FILE: + +.. _class_FileDialog_constant_MODE_OPEN_FILES: + +.. _class_FileDialog_constant_MODE_OPEN_DIR: + +.. _class_FileDialog_constant_MODE_OPEN_ANY: + +.. _class_FileDialog_constant_MODE_SAVE_FILE: + +enum **Mode**: + +- **MODE_OPEN_FILE** = **0** --- The dialog allows selecting one, and only one file. + +- **MODE_OPEN_FILES** = **1** --- The dialog allows selecting multiple files. + +- **MODE_OPEN_DIR** = **2** --- The dialog only allows selecting a directory, disallowing the selection of any file. + +- **MODE_OPEN_ANY** = **3** --- The dialog allows selecting one file or directory. + +- **MODE_SAVE_FILE** = **4** --- The dialog will warn when a file exists. + +---- + +.. _enum_FileDialog_Access: + +.. _class_FileDialog_constant_ACCESS_RESOURCES: + +.. _class_FileDialog_constant_ACCESS_USERDATA: + +.. _class_FileDialog_constant_ACCESS_FILESYSTEM: + +enum **Access**: + +- **ACCESS_RESOURCES** = **0** --- The dialog only allows accessing files under the :ref:`Resource` path (``res://``). + +- **ACCESS_USERDATA** = **1** --- The dialog only allows accessing files under user data path (``user://``). + +- **ACCESS_FILESYSTEM** = **2** --- The dialog allows accessing files on the whole file system. + +Property Descriptions +--------------------- + +.. _class_FileDialog_property_access: + +- :ref:`Access` **access** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_access(value) | ++-----------+-------------------+ +| *Getter* | get_access() | ++-----------+-------------------+ + +The file system access scope. See enum ``Access`` constants. + +**Warning:** Currently, in sandboxed environments such as HTML5 builds or sandboxed macOS apps, FileDialog cannot access the host file system. See `godot-proposals#1123 `__. + +---- + +.. _class_FileDialog_property_current_dir: + +- :ref:`String` **current_dir** + ++-----------+------------------------+ +| *Default* | ``"res://"`` | ++-----------+------------------------+ +| *Setter* | set_current_dir(value) | ++-----------+------------------------+ +| *Getter* | get_current_dir() | ++-----------+------------------------+ + +The current working directory of the file dialog. + +---- + +.. _class_FileDialog_property_current_file: + +- :ref:`String` **current_file** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_current_file(value) | ++-----------+-------------------------+ +| *Getter* | get_current_file() | ++-----------+-------------------------+ + +The currently selected file of the file dialog. + +---- + +.. _class_FileDialog_property_current_path: + +- :ref:`String` **current_path** + ++-----------+-------------------------+ +| *Default* | ``"res://"`` | ++-----------+-------------------------+ +| *Setter* | set_current_path(value) | ++-----------+-------------------------+ +| *Getter* | get_current_path() | ++-----------+-------------------------+ + +The currently selected file path of the file dialog. + +---- + +.. _class_FileDialog_property_filters: + +- :ref:`PoolStringArray` **filters** + ++-----------+-------------------------+ +| *Default* | ``PoolStringArray( )`` | ++-----------+-------------------------+ +| *Setter* | set_filters(value) | ++-----------+-------------------------+ +| *Getter* | get_filters() | ++-----------+-------------------------+ + +The available file type filters. For example, this shows only ``.png`` and ``.gd`` files: ``set_filters(PoolStringArray(["*.png ; PNG Images","*.gd ; GDScript Files"]))``. Multiple file types can also be specified in a single filter. ``"*.png, *.jpg, *.jpeg ; Supported Images"`` will show both PNG and JPEG files when selected. + +---- + +.. _class_FileDialog_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``4`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The dialog's open or save mode, which affects the selection behavior. See enum ``Mode`` constants. + +---- + +.. _class_FileDialog_property_mode_overrides_title: + +- :ref:`bool` **mode_overrides_title** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_mode_overrides_title(value) | ++-----------+---------------------------------+ +| *Getter* | is_mode_overriding_title() | ++-----------+---------------------------------+ + +If ``true``, changing the ``Mode`` property will set the window title accordingly (e.g. setting mode to :ref:`MODE_OPEN_FILE` will change the window title to "Open a File"). + +---- + +.. _class_FileDialog_property_show_hidden_files: + +- :ref:`bool` **show_hidden_files** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_show_hidden_files(value) | ++-----------+------------------------------+ +| *Getter* | is_showing_hidden_files() | ++-----------+------------------------------+ + +If ``true``, the dialog will show hidden files. + +Method Descriptions +------------------- + +.. _class_FileDialog_method_add_filter: + +- void **add_filter** **(** :ref:`String` filter **)** + +Adds ``filter`` to the list of filters, which restricts what files can be picked. + +A ``filter`` should be of the form ``"filename.extension ; Description"``, where filename and extension can be ``*`` to match any string. Filters starting with ``.`` (i.e. empty filenames) are not allowed. + +Example filters: ``"*.png ; PNG Images"``, ``"project.godot ; Godot Project"``. + +---- + +.. _class_FileDialog_method_clear_filters: + +- void **clear_filters** **(** **)** + +Clear all the added filters in the dialog. + +---- + +.. _class_FileDialog_method_deselect_items: + +- void **deselect_items** **(** **)** + +Clear currently selected items in the dialog. + +---- + +.. _class_FileDialog_method_get_line_edit: + +- :ref:`LineEdit` **get_line_edit** **(** **)** + +Returns the LineEdit for the selected file. + +**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` property. + +---- + +.. _class_FileDialog_method_get_vbox: + +- :ref:`VBoxContainer` **get_vbox** **(** **)** + +Returns the vertical box container of the dialog, custom controls can be added to it. + +**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` property. + +---- + +.. _class_FileDialog_method_invalidate: + +- void **invalidate** **(** **)** + +Invalidate and update the current dialog content list. + +Theme Property Descriptions +--------------------------- + +.. _class_FileDialog_theme_color_file_icon_modulate: + +- :ref:`Color` **file_icon_modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The color modulation applied to the file icon. + +---- + +.. _class_FileDialog_theme_color_files_disabled: + +- :ref:`Color` **files_disabled** + ++-----------+---------------------------+ +| *Default* | ``Color( 0, 0, 0, 0.7 )`` | ++-----------+---------------------------+ + +The color tint for disabled files (when the ``FileDialog`` is used in open folder mode). + +---- + +.. _class_FileDialog_theme_color_folder_icon_modulate: + +- :ref:`Color` **folder_icon_modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The color modulation applied to the folder icon. + +---- + +.. _class_FileDialog_theme_icon_file: + +- :ref:`Texture` **file** + +Custom icon for files. + +---- + +.. _class_FileDialog_theme_icon_folder: + +- :ref:`Texture` **folder** + +Custom icon for folders. + +---- + +.. _class_FileDialog_theme_icon_parent_folder: + +- :ref:`Texture` **parent_folder** + +Custom icon for the parent folder arrow. + +---- + +.. _class_FileDialog_theme_icon_reload: + +- :ref:`Texture` **reload** + +Custom icon for the reload button. + +---- + +.. _class_FileDialog_theme_icon_toggle_hidden: + +- :ref:`Texture` **toggle_hidden** + +Custom icon for the toggle hidden button. + +.. |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.)` diff --git a/classes/class_filesystemdock.rst b/classes/class_filesystemdock.rst new file mode 100644 index 0000000..72dcee0 --- /dev/null +++ b/classes/class_filesystemdock.rst @@ -0,0 +1,99 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the FileSystemDock.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_FileSystemDock: + +FileSystemDock +============== + +**Inherits:** :ref:`VBoxContainer` **<** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + + + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_drop_data_fw` **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`drop_data_fw` **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_drag_data_fw` **(** :ref:`Vector2` point, :ref:`Control` from **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`navigate_to_path` **(** :ref:`String` path **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_FileSystemDock_signal_display_mode_changed: + +- **display_mode_changed** **(** **)** + +---- + +.. _class_FileSystemDock_signal_file_removed: + +- **file_removed** **(** :ref:`String` file **)** + +---- + +.. _class_FileSystemDock_signal_files_moved: + +- **files_moved** **(** :ref:`String` old_file, :ref:`String` new_file **)** + +---- + +.. _class_FileSystemDock_signal_folder_moved: + +- **folder_moved** **(** :ref:`String` old_folder, :ref:`String` new_file **)** + +---- + +.. _class_FileSystemDock_signal_folder_removed: + +- **folder_removed** **(** :ref:`String` folder **)** + +---- + +.. _class_FileSystemDock_signal_inherit: + +- **inherit** **(** :ref:`String` file **)** + +---- + +.. _class_FileSystemDock_signal_instance: + +- **instance** **(** :ref:`PoolStringArray` files **)** + +Method Descriptions +------------------- + +.. _class_FileSystemDock_method_can_drop_data_fw: + +- :ref:`bool` **can_drop_data_fw** **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** |const| + +---- + +.. _class_FileSystemDock_method_drop_data_fw: + +- void **drop_data_fw** **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** + +---- + +.. _class_FileSystemDock_method_get_drag_data_fw: + +- :ref:`Variant` **get_drag_data_fw** **(** :ref:`Vector2` point, :ref:`Control` from **)** + +---- + +.. _class_FileSystemDock_method_navigate_to_path: + +- void **navigate_to_path** **(** :ref:`String` 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.)` diff --git a/classes/class_float.rst b/classes/class_float.rst new file mode 100644 index 0000000..d53f4e6 --- /dev/null +++ b/classes/class_float.rst @@ -0,0 +1,64 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the float.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_float: + +float +===== + +Float built-in type. + +Description +----------- + +The ``float`` built-in type is a 64-bit double-precision floating-point number, equivalent to ``double`` in C++. This type has 14 reliable decimal digits of precision. The ``float`` type can be stored in :ref:`Variant`, which is the generic type used by the engine. The maximum value of ``float`` is approximately ``1.79769e308``, and the minimum is approximately ``-1.79769e308``. + +Most methods and properties in the engine use 32-bit single-precision floating-point numbers instead, equivalent to ``float`` in C++, which have 6 reliable decimal digits of precision. For data structures such as :ref:`Vector2` and :ref:`Vector3`, Godot uses 32-bit floating-point numbers. + +Math done using the ``float`` type is not guaranteed to be exact or deterministic, and will often result in small errors. You should usually use the :ref:`@GDScript.is_equal_approx` and :ref:`@GDScript.is_zero_approx` methods instead of ``==`` to compare ``float`` values for equality. + +Tutorials +--------- + +- `Wikipedia: Double-precision floating-point format `__ + +- `Wikipedia: Single-precision floating-point format `__ + +Methods +------- + ++---------------------------+-------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`float` **(** :ref:`bool` from **)** | ++---------------------------+-------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`float` **(** :ref:`int` from **)** | ++---------------------------+-------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`float` **(** :ref:`String` from **)** | ++---------------------------+-------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_float_method_float: + +- :ref:`float` **float** **(** :ref:`bool` from **)** + +Cast a :ref:`bool` value to a floating-point value, ``float(true)`` will be equal to 1.0 and ``float(false)`` will be equal to 0.0. + +---- + +- :ref:`float` **float** **(** :ref:`int` from **)** + +Cast an :ref:`int` value to a floating-point value, ``float(1)`` will be equal to 1.0. + +---- + +- :ref:`float` **float** **(** :ref:`String` from **)** + +Cast a :ref:`String` value to a floating-point value. This method accepts float value strings like ``"1.23"`` and exponential notation strings for its parameter so calling ``float("1e3")`` will return 1000.0 and calling ``float("1e-3")`` will return 0.001. Calling this method with an invalid float string will return 0. This method stops parsing at the first invalid character and will return the parsed result so far, so calling ``float("1a3")`` will return 1 while calling ``float("1e3a2")`` will return 1000.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.)` diff --git a/classes/class_font.rst b/classes/class_font.rst new file mode 100644 index 0000000..6a4ae59 --- /dev/null +++ b/classes/class_font.rst @@ -0,0 +1,147 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Font.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Font: + +Font +==== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`BitmapFont`, :ref:`DynamicFont` + +Internationalized font and text drawing support. + +Description +----------- + +Font contains a Unicode-compatible character set, as well as the ability to draw it with variable width, ascent, descent and kerning. For creating fonts from TTF files (or other font formats), see the editor support for fonts. + +**Note:** If a :ref:`DynamicFont` doesn't contain a character used in a string, the character in question will be replaced with codepoint ``0xfffd`` if it's available in the :ref:`DynamicFont`. If this replacement character isn't available in the DynamicFont, the character will be hidden without displaying any replacement character in the string. + +**Note:** If a :ref:`BitmapFont` doesn't contain a character used in a string, the character in question will be hidden without displaying any replacement character in the string. + +**Note:** Unicode characters after ``0xffff`` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0. + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`String` string, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1, :ref:`Color` outline_modulate=Color( 1, 1, 1, 1 ) **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`draw_char` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`int` char, :ref:`int` next=-1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` outline=false **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_ascent` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_char_size` **(** :ref:`int` char, :ref:`int` next=0 **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_descent` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_height` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_string_size` **(** :ref:`String` string **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_wordwrap_string_size` **(** :ref:`String` string, :ref:`float` width **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_outline` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_distance_field_hint` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_changes` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Font_method_draw: + +- void **draw** **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`String` string, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`int` clip_w=-1, :ref:`Color` outline_modulate=Color( 1, 1, 1, 1 ) **)** |const| + +Draw ``string`` into a canvas item using the font at a given position, with ``modulate`` color, and optionally clipping the width. ``position`` specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. + +See also :ref:`CanvasItem.draw_string`. + +---- + +.. _class_Font_method_draw_char: + +- :ref:`float` **draw_char** **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`int` char, :ref:`int` next=-1, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` outline=false **)** |const| + +Draw character ``char`` into a canvas item using the font at a given position, with ``modulate`` color, and optionally kerning if ``next`` is passed. clipping the width. ``position`` specifies the baseline, not the top. To draw from the top, *ascent* must be added to the Y axis. The width used by the character is returned, making this function useful for drawing strings character by character. + +---- + +.. _class_Font_method_get_ascent: + +- :ref:`float` **get_ascent** **(** **)** |const| + +Returns the font ascent (number of pixels above the baseline). + +---- + +.. _class_Font_method_get_char_size: + +- :ref:`Vector2` **get_char_size** **(** :ref:`int` char, :ref:`int` next=0 **)** |const| + +Returns the size of a character, optionally taking kerning into account if the next character is provided. Note that the height returned is the font height (see :ref:`get_height`) and has no relation to the glyph height. + +---- + +.. _class_Font_method_get_descent: + +- :ref:`float` **get_descent** **(** **)** |const| + +Returns the font descent (number of pixels below the baseline). + +---- + +.. _class_Font_method_get_height: + +- :ref:`float` **get_height** **(** **)** |const| + +Returns the total font height (ascent plus descent) in pixels. + +---- + +.. _class_Font_method_get_string_size: + +- :ref:`Vector2` **get_string_size** **(** :ref:`String` string **)** |const| + +Returns the size of a string, taking kerning and advance into account. Note that the height returned is the font height (see :ref:`get_height`) and has no relation to the string. + +---- + +.. _class_Font_method_get_wordwrap_string_size: + +- :ref:`Vector2` **get_wordwrap_string_size** **(** :ref:`String` string, :ref:`float` width **)** |const| + +Returns the size that the string would have with word wrapping enabled with a fixed ``width``. + +---- + +.. _class_Font_method_has_outline: + +- :ref:`bool` **has_outline** **(** **)** |const| + +Returns ``true`` if the font has an outline. + +---- + +.. _class_Font_method_is_distance_field_hint: + +- :ref:`bool` **is_distance_field_hint** **(** **)** |const| + +---- + +.. _class_Font_method_update_changes: + +- void **update_changes** **(** **)** + +After editing a font (changing size, ascent, char rects, etc.). Call this function to propagate changes to controls that might use it. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_funcref.rst b/classes/class_funcref.rst new file mode 100644 index 0000000..92ca4ac --- /dev/null +++ b/classes/class_funcref.rst @@ -0,0 +1,95 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the FuncRef.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_FuncRef: + +FuncRef +======= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Reference to a function in an object. + +Description +----------- + +In GDScript, functions are not *first-class objects*. This means it is impossible to store them directly as variables, return them from another function, or pass them as arguments. + +However, by creating a ``FuncRef`` using the :ref:`@GDScript.funcref` function, a reference to a function in a given object can be created, passed around and called. + +Properties +---------- + ++-----------------------------+--------------------------------------------------+--------+ +| :ref:`String` | :ref:`function` | ``""`` | ++-----------------------------+--------------------------------------------------+--------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_func` **(** ... **)** |vararg| | ++-------------------------------+---------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_funcv` **(** :ref:`Array` arg_array **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance` **(** :ref:`Object` instance **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_FuncRef_property_function: + +- :ref:`String` **function** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The name of the referenced function. + +Method Descriptions +------------------- + +.. _class_FuncRef_method_call_func: + +- :ref:`Variant` **call_func** **(** ... **)** |vararg| + +Calls the referenced function previously set in :ref:`function` or :ref:`@GDScript.funcref`. + +---- + +.. _class_FuncRef_method_call_funcv: + +- :ref:`Variant` **call_funcv** **(** :ref:`Array` arg_array **)** + +Calls the referenced function previously set in :ref:`function` or :ref:`@GDScript.funcref`. Contrarily to :ref:`call_func`, this method does not support a variable number of arguments but expects all parameters to be passed via a single :ref:`Array`. + +---- + +.. _class_FuncRef_method_is_valid: + +- :ref:`bool` **is_valid** **(** **)** |const| + +Returns whether the object still exists and has the function assigned. + +---- + +.. _class_FuncRef_method_set_instance: + +- void **set_instance** **(** :ref:`Object` instance **)** + +The object containing the referenced function. This object must be of a type actually inheriting from :ref:`Object`, not a built-in type such as :ref:`int`, :ref:`Vector2` or :ref:`Dictionary`. + +.. |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.)` diff --git a/classes/class_gdnative.rst b/classes/class_gdnative.rst new file mode 100644 index 0000000..57f5ba7 --- /dev/null +++ b/classes/class_gdnative.rst @@ -0,0 +1,68 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GDNative: + +GDNative +======== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------------+-------------------------------------------------+ +| :ref:`GDNativeLibrary` | :ref:`library` | ++-----------------------------------------------+-------------------------------------------------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_native` **(** :ref:`String` calling_type, :ref:`String` procedure_name, :ref:`Array` arguments **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`initialize` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`terminate` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GDNative_property_library: + +- :ref:`GDNativeLibrary` **library** + ++----------+--------------------+ +| *Setter* | set_library(value) | ++----------+--------------------+ +| *Getter* | get_library() | ++----------+--------------------+ + +Method Descriptions +------------------- + +.. _class_GDNative_method_call_native: + +- :ref:`Variant` **call_native** **(** :ref:`String` calling_type, :ref:`String` procedure_name, :ref:`Array` arguments **)** + +---- + +.. _class_GDNative_method_initialize: + +- :ref:`bool` **initialize** **(** **)** + +---- + +.. _class_GDNative_method_terminate: + +- :ref:`bool` **terminate** **(** **)** + +.. |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.)` diff --git a/classes/class_gdnativelibrary.rst b/classes/class_gdnativelibrary.rst new file mode 100644 index 0000000..b0eabeb --- /dev/null +++ b/classes/class_gdnativelibrary.rst @@ -0,0 +1,158 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GDNativeLibrary.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GDNativeLibrary: + +GDNativeLibrary +=============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +An external library containing functions or script classes to use in Godot. + +Description +----------- + +A GDNative library can implement :ref:`NativeScript`\ s, global functions to call with the :ref:`GDNative` class, or low-level engine extensions through interfaces such as :ref:`ARVRInterfaceGDNative`. The library must be compiled for each platform and architecture that the project will run on. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/gdnative/gdnative_c_example` + +- :doc:`../tutorials/scripting/gdnative/gdnative_cpp_example` + +Properties +---------- + ++-------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`ConfigFile` | :ref:`config_file` | | ++-------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`load_once` | ``true`` | ++-------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`reloadable` | ``true`` | ++-------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`singleton` | ``false`` | ++-------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`symbol_prefix` | ``"godot_"`` | ++-------------------------------------+--------------------------------------------------------------------+--------------+ + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_current_dependencies` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_library_path` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GDNativeLibrary_property_config_file: + +- :ref:`ConfigFile` **config_file** + ++----------+------------------------+ +| *Setter* | set_config_file(value) | ++----------+------------------------+ +| *Getter* | get_config_file() | ++----------+------------------------+ + +This resource in INI-style :ref:`ConfigFile` format, as in ``.gdnlib`` files. + +---- + +.. _class_GDNativeLibrary_property_load_once: + +- :ref:`bool` **load_once** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_load_once(value) | ++-----------+----------------------+ +| *Getter* | should_load_once() | ++-----------+----------------------+ + +If ``true``, Godot loads only one copy of the library and each script that references the library will share static data like static or global variables. + +If ``false``, Godot loads a separate copy of the library into memory for each script that references it. + +---- + +.. _class_GDNativeLibrary_property_reloadable: + +- :ref:`bool` **reloadable** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_reloadable(value) | ++-----------+-----------------------+ +| *Getter* | is_reloadable() | ++-----------+-----------------------+ + +If ``true``, the editor will temporarily unload the library whenever the user switches away from the editor window, allowing the user to recompile the library without restarting Godot. + +**Note:** If the library defines tool scripts that run inside the editor, ``reloadable`` must be ``false``. Otherwise, the editor will attempt to unload the tool scripts while they're in use and crash. + +---- + +.. _class_GDNativeLibrary_property_singleton: + +- :ref:`bool` **singleton** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_singleton(value) | ++-----------+----------------------+ +| *Getter* | is_singleton() | ++-----------+----------------------+ + +If ``true``, Godot loads the library at startup rather than the first time a script uses the library, calling ``{prefix}gdnative_singleton`` after initializing the library (where ``{prefix}`` is the value of :ref:`symbol_prefix`). The library remains loaded as long as Godot is running. + +**Note:** A singleton library cannot be :ref:`reloadable`. + +---- + +.. _class_GDNativeLibrary_property_symbol_prefix: + +- :ref:`String` **symbol_prefix** + ++-----------+--------------------------+ +| *Default* | ``"godot_"`` | ++-----------+--------------------------+ +| *Setter* | set_symbol_prefix(value) | ++-----------+--------------------------+ +| *Getter* | get_symbol_prefix() | ++-----------+--------------------------+ + +The prefix this library's entry point functions begin with. For example, a GDNativeLibrary would declare its ``gdnative_init`` function as ``godot_gdnative_init`` by default. + +On platforms that require statically linking libraries (currently only iOS), each library must have a different ``symbol_prefix``. + +Method Descriptions +------------------- + +.. _class_GDNativeLibrary_method_get_current_dependencies: + +- :ref:`PoolStringArray` **get_current_dependencies** **(** **)** |const| + +Returns paths to all dependency libraries for the current platform and architecture. + +---- + +.. _class_GDNativeLibrary_method_get_current_library_path: + +- :ref:`String` **get_current_library_path** **(** **)** |const| + +Returns the path to the dynamic library file for the current platform and architecture. + +.. |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.)` diff --git a/classes/class_gdscript.rst b/classes/class_gdscript.rst new file mode 100644 index 0000000..2a4066e --- /dev/null +++ b/classes/class_gdscript.rst @@ -0,0 +1,64 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GDScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GDScript: + +GDScript +======== + +**Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A script implemented in the GDScript programming language. + +Description +----------- + +A script implemented in the GDScript programming language. The script extends the functionality of all objects that instance it. + +:ref:`new` creates a new instance of the script. :ref:`Object.set_script` extends an existing object, if that object's class matches one of the script's base classes. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/gdscript/index` + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`get_as_byte_code` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`new` **(** ... **)** |vararg| | ++-------------------------------------------+-------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_GDScript_method_get_as_byte_code: + +- :ref:`PoolByteArray` **get_as_byte_code** **(** **)** |const| + +Returns byte code for the script source code. + +---- + +.. _class_GDScript_method_new: + +- :ref:`Variant` **new** **(** ... **)** |vararg| + +Returns a new instance of the script. + +For example: + +:: + + var MyClass = load("myclass.gd") + var instance = MyClass.new() + assert(instance.get_script() == MyClass) + +.. |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.)` diff --git a/classes/class_gdscriptfunctionstate.rst b/classes/class_gdscriptfunctionstate.rst new file mode 100644 index 0000000..12e6434 --- /dev/null +++ b/classes/class_gdscriptfunctionstate.rst @@ -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 GDScriptFunctionState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GDScriptFunctionState: + +GDScriptFunctionState +===================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +State of a function call after yielding. + +Description +----------- + +Calling :ref:`@GDScript.yield` within a function will cause that function to yield and return its current state as an object of this type. The yielded function call can then be resumed later by calling :ref:`resume` on this state object. + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid` **(** :ref:`bool` extended_check=false **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`resume` **(** :ref:`Variant` arg=null **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_GDScriptFunctionState_signal_completed: + +- **completed** **(** :ref:`Variant` result **)** + +Method Descriptions +------------------- + +.. _class_GDScriptFunctionState_method_is_valid: + +- :ref:`bool` **is_valid** **(** :ref:`bool` extended_check=false **)** |const| + +Check whether the function call may be resumed. This is not the case if the function state was already resumed. + +If ``extended_check`` is enabled, it also checks if the associated script and object still exist. The extended check is done in debug mode as part of :ref:`resume`, but you can use this if you know you may be trying to resume without knowing for sure the object and/or script have survived up to that point. + +---- + +.. _class_GDScriptFunctionState_method_resume: + +- :ref:`Variant` **resume** **(** :ref:`Variant` arg=null **)** + +Resume execution of the yielded function call. + +If handed an argument, return the argument from the :ref:`@GDScript.yield` call in the yielded function call. You can pass e.g. an :ref:`Array` to hand multiple arguments. + +This function returns what the resumed function call returns, possibly another function state if yielded again. + +.. |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.)` diff --git a/classes/class_generic6dofjoint.rst b/classes/class_generic6dofjoint.rst new file mode 100644 index 0000000..e6a4258 --- /dev/null +++ b/classes/class_generic6dofjoint.rst @@ -0,0 +1,1706 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Generic6DOFJoint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Generic6DOFJoint: + +Generic6DOFJoint +================ + +**Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +The generic 6-degrees-of-freedom joint can implement a variety of joint types by locking certain axes' rotation or translation. + +Description +----------- + +The first 3 DOF axes are linear axes, which represent translation of Bodies, and the latter 3 DOF axes represent the angular motion. Each axis can be either locked, or limited. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_limit_x/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/erp` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/lower_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/restitution` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/softness` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_x/upper_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_limit_y/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/erp` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/lower_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/restitution` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/softness` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_y/upper_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_limit_z/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/erp` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/lower_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/restitution` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/softness` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit_z/upper_angle` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_motor_x/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_x/force_limit` | ``300.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_x/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_motor_y/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_y/force_limit` | ``300.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_y/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_motor_z/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_z/force_limit` | ``300.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_motor_z/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_x/damping` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_spring_x/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_x/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_x/stiffness` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_y/damping` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_spring_y/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_y/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_y/stiffness` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_z/damping` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_spring_z/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_z/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_spring_z/stiffness` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_x/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_limit_x/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_x/lower_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_x/restitution` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_x/softness` | ``0.7`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_x/upper_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_y/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_limit_y/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_y/lower_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_y/restitution` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_y/softness` | ``0.7`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_y/upper_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_z/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_limit_z/enabled` | ``true`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_z/lower_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_z/restitution` | ``0.5`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_z/softness` | ``0.7`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_limit_z/upper_distance` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_motor_x/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_x/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_x/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_motor_y/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_y/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_y/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_motor_z/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_z/force_limit` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_motor_z/target_velocity` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_x/damping` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_spring_x/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_x/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_x/stiffness` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_y/damping` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_spring_y/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_y/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_y/stiffness` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_z/damping` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`linear_spring_z/enabled` | ``false`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_z/equilibrium_point` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`linear_spring_z/stiffness` | ``0.01`` | ++---------------------------+---------------------------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag_x` **(** :ref:`Flag` flag **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag_y` **(** :ref:`Flag` flag **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag_z` **(** :ref:`Flag` flag **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_x` **(** :ref:`Param` param **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_y` **(** :ref:`Param` param **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_z` **(** :ref:`Param` param **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag_x` **(** :ref:`Flag` flag, :ref:`bool` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag_y` **(** :ref:`Flag` flag, :ref:`bool` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag_z` **(** :ref:`Flag` flag, :ref:`bool` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_x` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_y` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_z` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Generic6DOFJoint_Param: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_LOWER_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_UPPER_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_LIMIT_SOFTNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_RESTITUTION: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_MOTOR_TARGET_VELOCITY: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_MOTOR_FORCE_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_STIFFNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_LOWER_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_UPPER_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_LIMIT_SOFTNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_RESTITUTION: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_FORCE_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_ERP: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_MOTOR_TARGET_VELOCITY: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_MOTOR_FORCE_LIMIT: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_STIFFNESS: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_DAMPING: + +.. _class_Generic6DOFJoint_constant_PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT: + +.. _class_Generic6DOFJoint_constant_PARAM_MAX: + +enum **Param**: + +- **PARAM_LINEAR_LOWER_LIMIT** = **0** --- The minimum difference between the pivot points' axes. + +- **PARAM_LINEAR_UPPER_LIMIT** = **1** --- The maximum difference between the pivot points' axes. + +- **PARAM_LINEAR_LIMIT_SOFTNESS** = **2** --- A factor applied to the movement across the axes. The lower, the slower the movement. + +- **PARAM_LINEAR_RESTITUTION** = **3** --- The amount of restitution on the axes' movement. The lower, the more momentum gets lost. + +- **PARAM_LINEAR_DAMPING** = **4** --- The amount of damping that happens at the linear motion across the axes. + +- **PARAM_LINEAR_MOTOR_TARGET_VELOCITY** = **5** --- The velocity the linear motor will try to reach. + +- **PARAM_LINEAR_MOTOR_FORCE_LIMIT** = **6** --- The maximum force the linear motor will apply while trying to reach the velocity target. + +- **PARAM_LINEAR_SPRING_STIFFNESS** = **7** + +- **PARAM_LINEAR_SPRING_DAMPING** = **8** + +- **PARAM_LINEAR_SPRING_EQUILIBRIUM_POINT** = **9** + +- **PARAM_ANGULAR_LOWER_LIMIT** = **10** --- The minimum rotation in negative direction to break loose and rotate around the axes. + +- **PARAM_ANGULAR_UPPER_LIMIT** = **11** --- The minimum rotation in positive direction to break loose and rotate around the axes. + +- **PARAM_ANGULAR_LIMIT_SOFTNESS** = **12** --- The speed of all rotations across the axes. + +- **PARAM_ANGULAR_DAMPING** = **13** --- The amount of rotational damping across the axes. The lower, the more dampening occurs. + +- **PARAM_ANGULAR_RESTITUTION** = **14** --- The amount of rotational restitution across the axes. The lower, the more restitution occurs. + +- **PARAM_ANGULAR_FORCE_LIMIT** = **15** --- The maximum amount of force that can occur, when rotating around the axes. + +- **PARAM_ANGULAR_ERP** = **16** --- When rotating across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + +- **PARAM_ANGULAR_MOTOR_TARGET_VELOCITY** = **17** --- Target speed for the motor at the axes. + +- **PARAM_ANGULAR_MOTOR_FORCE_LIMIT** = **18** --- Maximum acceleration for the motor at the axes. + +- **PARAM_ANGULAR_SPRING_STIFFNESS** = **19** + +- **PARAM_ANGULAR_SPRING_DAMPING** = **20** + +- **PARAM_ANGULAR_SPRING_EQUILIBRIUM_POINT** = **21** + +- **PARAM_MAX** = **22** --- Represents the size of the :ref:`Param` enum. + +---- + +.. _enum_Generic6DOFJoint_Flag: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_LINEAR_LIMIT: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_ANGULAR_LIMIT: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_LINEAR_SPRING: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_ANGULAR_SPRING: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_MOTOR: + +.. _class_Generic6DOFJoint_constant_FLAG_ENABLE_LINEAR_MOTOR: + +.. _class_Generic6DOFJoint_constant_FLAG_MAX: + +enum **Flag**: + +- **FLAG_ENABLE_LINEAR_LIMIT** = **0** --- If enabled, linear motion is possible within the given limits. + +- **FLAG_ENABLE_ANGULAR_LIMIT** = **1** --- If enabled, rotational motion is possible within the given limits. + +- **FLAG_ENABLE_LINEAR_SPRING** = **3** + +- **FLAG_ENABLE_ANGULAR_SPRING** = **2** + +- **FLAG_ENABLE_MOTOR** = **4** --- If enabled, there is a rotational motor across these axes. + +- **FLAG_ENABLE_LINEAR_MOTOR** = **5** --- If enabled, there is a linear motor across these axes. + +- **FLAG_MAX** = **6** --- Represents the size of the :ref:`Flag` enum. + +Property Descriptions +--------------------- + +.. _class_Generic6DOFJoint_property_angular_limit_x/damping: + +- :ref:`float` **angular_limit_x/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The amount of rotational damping across the X axis. + +The lower, the longer an impulse from one side takes to travel to the other side. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/enabled: + +- :ref:`bool` **angular_limit_x/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +If ``true``, rotation across the X axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/erp: + +- :ref:`float` **angular_limit_x/erp** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +When rotating across the X axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/force_limit: + +- :ref:`float` **angular_limit_x/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The maximum amount of force that can occur, when rotating around the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/lower_angle: + +- :ref:`float` **angular_limit_x/lower_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in negative direction to break loose and rotate around the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/restitution: + +- :ref:`float` **angular_limit_x/restitution** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The amount of rotational restitution across the X axis. The lower, the more restitution occurs. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/softness: + +- :ref:`float` **angular_limit_x/softness** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The speed of all rotations across the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_x/upper_angle: + +- :ref:`float` **angular_limit_x/upper_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in positive direction to break loose and rotate around the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/damping: + +- :ref:`float` **angular_limit_y/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The amount of rotational damping across the Y axis. The lower, the more dampening occurs. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/enabled: + +- :ref:`bool` **angular_limit_y/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +If ``true``, rotation across the Y axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/erp: + +- :ref:`float` **angular_limit_y/erp** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +When rotating across the Y axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/force_limit: + +- :ref:`float` **angular_limit_y/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The maximum amount of force that can occur, when rotating around the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/lower_angle: + +- :ref:`float` **angular_limit_y/lower_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in negative direction to break loose and rotate around the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/restitution: + +- :ref:`float` **angular_limit_y/restitution** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The amount of rotational restitution across the Y axis. The lower, the more restitution occurs. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/softness: + +- :ref:`float` **angular_limit_y/softness** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The speed of all rotations across the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_y/upper_angle: + +- :ref:`float` **angular_limit_y/upper_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in positive direction to break loose and rotate around the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/damping: + +- :ref:`float` **angular_limit_z/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The amount of rotational damping across the Z axis. The lower, the more dampening occurs. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/enabled: + +- :ref:`bool` **angular_limit_z/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +If ``true``, rotation across the Z axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/erp: + +- :ref:`float` **angular_limit_z/erp** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +When rotating across the Z axis, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/force_limit: + +- :ref:`float` **angular_limit_z/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The maximum amount of force that can occur, when rotating around the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/lower_angle: + +- :ref:`float` **angular_limit_z/lower_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in negative direction to break loose and rotate around the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/restitution: + +- :ref:`float` **angular_limit_z/restitution** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The amount of rotational restitution across the Z axis. The lower, the more restitution occurs. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/softness: + +- :ref:`float` **angular_limit_z/softness** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The speed of all rotations across the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_limit_z/upper_angle: + +- :ref:`float` **angular_limit_z/upper_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The minimum rotation in positive direction to break loose and rotate around the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_x/enabled: + +- :ref:`bool` **angular_motor_x/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +If ``true``, a rotating motor at the X axis is enabled. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_x/force_limit: + +- :ref:`float` **angular_motor_x/force_limit** + ++-----------+--------------------+ +| *Default* | ``300.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +Maximum acceleration for the motor at the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_x/target_velocity: + +- :ref:`float` **angular_motor_x/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +Target speed for the motor at the X axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_y/enabled: + +- :ref:`bool` **angular_motor_y/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +If ``true``, a rotating motor at the Y axis is enabled. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_y/force_limit: + +- :ref:`float` **angular_motor_y/force_limit** + ++-----------+--------------------+ +| *Default* | ``300.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +Maximum acceleration for the motor at the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_y/target_velocity: + +- :ref:`float` **angular_motor_y/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +Target speed for the motor at the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_z/enabled: + +- :ref:`bool` **angular_motor_z/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +If ``true``, a rotating motor at the Z axis is enabled. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_z/force_limit: + +- :ref:`float` **angular_motor_z/force_limit** + ++-----------+--------------------+ +| *Default* | ``300.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +Maximum acceleration for the motor at the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_motor_z/target_velocity: + +- :ref:`float` **angular_motor_z/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +Target speed for the motor at the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_x/damping: + +- :ref:`float` **angular_spring_x/damping** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_x/enabled: + +- :ref:`bool` **angular_spring_x/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_x/equilibrium_point: + +- :ref:`float` **angular_spring_x/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_x/stiffness: + +- :ref:`float` **angular_spring_x/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_y/damping: + +- :ref:`float` **angular_spring_y/damping** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_y/enabled: + +- :ref:`bool` **angular_spring_y/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_y/equilibrium_point: + +- :ref:`float` **angular_spring_y/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_y/stiffness: + +- :ref:`float` **angular_spring_y/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_z/damping: + +- :ref:`float` **angular_spring_z/damping** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_z/enabled: + +- :ref:`bool` **angular_spring_z/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_z/equilibrium_point: + +- :ref:`float` **angular_spring_z/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_angular_spring_z/stiffness: + +- :ref:`float` **angular_spring_z/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/damping: + +- :ref:`float` **linear_limit_x/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The amount of damping that happens at the X motion. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/enabled: + +- :ref:`bool` **linear_limit_x/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +If ``true``, the linear motion across the X axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/lower_distance: + +- :ref:`float` **linear_limit_x/lower_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The minimum difference between the pivot points' X axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/restitution: + +- :ref:`float` **linear_limit_x/restitution** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The amount of restitution on the X axis movement. The lower, the more momentum gets lost. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/softness: + +- :ref:`float` **linear_limit_x/softness** + ++-----------+--------------------+ +| *Default* | ``0.7`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +A factor applied to the movement across the X axis. The lower, the slower the movement. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_x/upper_distance: + +- :ref:`float` **linear_limit_x/upper_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The maximum difference between the pivot points' X axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/damping: + +- :ref:`float` **linear_limit_y/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The amount of damping that happens at the Y motion. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/enabled: + +- :ref:`bool` **linear_limit_y/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +If ``true``, the linear motion across the Y axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/lower_distance: + +- :ref:`float` **linear_limit_y/lower_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The minimum difference between the pivot points' Y axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/restitution: + +- :ref:`float` **linear_limit_y/restitution** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The amount of restitution on the Y axis movement. The lower, the more momentum gets lost. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/softness: + +- :ref:`float` **linear_limit_y/softness** + ++-----------+--------------------+ +| *Default* | ``0.7`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +A factor applied to the movement across the Y axis. The lower, the slower the movement. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_y/upper_distance: + +- :ref:`float` **linear_limit_y/upper_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The maximum difference between the pivot points' Y axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/damping: + +- :ref:`float` **linear_limit_z/damping** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The amount of damping that happens at the Z motion. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/enabled: + +- :ref:`bool` **linear_limit_z/enabled** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +If ``true``, the linear motion across the Z axis is limited. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/lower_distance: + +- :ref:`float` **linear_limit_z/lower_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The minimum difference between the pivot points' Z axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/restitution: + +- :ref:`float` **linear_limit_z/restitution** + ++-----------+--------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The amount of restitution on the Z axis movement. The lower, the more momentum gets lost. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/softness: + +- :ref:`float` **linear_limit_z/softness** + ++-----------+--------------------+ +| *Default* | ``0.7`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +A factor applied to the movement across the Z axis. The lower, the slower the movement. + +---- + +.. _class_Generic6DOFJoint_property_linear_limit_z/upper_distance: + +- :ref:`float` **linear_limit_z/upper_distance** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The maximum difference between the pivot points' Z axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_x/enabled: + +- :ref:`bool` **linear_motor_x/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +If ``true``, then there is a linear motor on the X axis. It will attempt to reach the target velocity while staying within the force limits. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_x/force_limit: + +- :ref:`float` **linear_motor_x/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The maximum force the linear motor can apply on the X axis while trying to reach the target velocity. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_x/target_velocity: + +- :ref:`float` **linear_motor_x/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +The speed that the linear motor will attempt to reach on the X axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_y/enabled: + +- :ref:`bool` **linear_motor_y/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +If ``true``, then there is a linear motor on the Y axis. It will attempt to reach the target velocity while staying within the force limits. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_y/force_limit: + +- :ref:`float` **linear_motor_y/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The maximum force the linear motor can apply on the Y axis while trying to reach the target velocity. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_y/target_velocity: + +- :ref:`float` **linear_motor_y/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +The speed that the linear motor will attempt to reach on the Y axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_z/enabled: + +- :ref:`bool` **linear_motor_z/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +If ``true``, then there is a linear motor on the Z axis. It will attempt to reach the target velocity while staying within the force limits. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_z/force_limit: + +- :ref:`float` **linear_motor_z/force_limit** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The maximum force the linear motor can apply on the Z axis while trying to reach the target velocity. + +---- + +.. _class_Generic6DOFJoint_property_linear_motor_z/target_velocity: + +- :ref:`float` **linear_motor_z/target_velocity** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +The speed that the linear motor will attempt to reach on the Z axis. + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_x/damping: + +- :ref:`float` **linear_spring_x/damping** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_x/enabled: + +- :ref:`bool` **linear_spring_x/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_x(value) | ++-----------+-------------------+ +| *Getter* | get_flag_x() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_x/equilibrium_point: + +- :ref:`float` **linear_spring_x/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_x/stiffness: + +- :ref:`float` **linear_spring_x/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_x(value) | ++-----------+--------------------+ +| *Getter* | get_param_x() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_y/damping: + +- :ref:`float` **linear_spring_y/damping** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_y/enabled: + +- :ref:`bool` **linear_spring_y/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_y(value) | ++-----------+-------------------+ +| *Getter* | get_flag_y() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_y/equilibrium_point: + +- :ref:`float` **linear_spring_y/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_y/stiffness: + +- :ref:`float` **linear_spring_y/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_y(value) | ++-----------+--------------------+ +| *Getter* | get_param_y() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_z/damping: + +- :ref:`float` **linear_spring_z/damping** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_z/enabled: + +- :ref:`bool` **linear_spring_z/enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flag_z(value) | ++-----------+-------------------+ +| *Getter* | get_flag_z() | ++-----------+-------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_z/equilibrium_point: + +- :ref:`float` **linear_spring_z/equilibrium_point** + ++-----------+--------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +---- + +.. _class_Generic6DOFJoint_property_linear_spring_z/stiffness: + +- :ref:`float` **linear_spring_z/stiffness** + ++-----------+--------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------+ +| *Setter* | set_param_z(value) | ++-----------+--------------------+ +| *Getter* | get_param_z() | ++-----------+--------------------+ + +Method Descriptions +------------------- + +.. _class_Generic6DOFJoint_method_get_flag_x: + +- :ref:`bool` **get_flag_x** **(** :ref:`Flag` flag **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_get_flag_y: + +- :ref:`bool` **get_flag_y** **(** :ref:`Flag` flag **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_get_flag_z: + +- :ref:`bool` **get_flag_z** **(** :ref:`Flag` flag **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_get_param_x: + +- :ref:`float` **get_param_x** **(** :ref:`Param` param **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_get_param_y: + +- :ref:`float` **get_param_y** **(** :ref:`Param` param **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_get_param_z: + +- :ref:`float` **get_param_z** **(** :ref:`Param` param **)** |const| + +---- + +.. _class_Generic6DOFJoint_method_set_flag_x: + +- void **set_flag_x** **(** :ref:`Flag` flag, :ref:`bool` value **)** + +---- + +.. _class_Generic6DOFJoint_method_set_flag_y: + +- void **set_flag_y** **(** :ref:`Flag` flag, :ref:`bool` value **)** + +---- + +.. _class_Generic6DOFJoint_method_set_flag_z: + +- void **set_flag_z** **(** :ref:`Flag` flag, :ref:`bool` value **)** + +---- + +.. _class_Generic6DOFJoint_method_set_param_x: + +- void **set_param_x** **(** :ref:`Param` param, :ref:`float` value **)** + +---- + +.. _class_Generic6DOFJoint_method_set_param_y: + +- void **set_param_y** **(** :ref:`Param` param, :ref:`float` value **)** + +---- + +.. _class_Generic6DOFJoint_method_set_param_z: + +- void **set_param_z** **(** :ref:`Param` param, :ref:`float` value **)** + +.. |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.)` diff --git a/classes/class_geometry.rst b/classes/class_geometry.rst new file mode 100644 index 0000000..7d3f393 --- /dev/null +++ b/classes/class_geometry.rst @@ -0,0 +1,475 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Geometry.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Geometry: + +Geometry +======== + +**Inherits:** :ref:`Object` + +Helper node to calculate generic geometry operations. + +Description +----------- + +Geometry provides users with a set of helper functions to create geometric shapes, compute intersections between shapes, and process various other geometric operations. + +Methods +------- + ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`build_box_planes` **(** :ref:`Vector3` extents **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`build_capsule_planes` **(** :ref:`float` radius, :ref:`float` height, :ref:`int` sides, :ref:`int` lats, Vector3.Axis axis=2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`build_cylinder_planes` **(** :ref:`float` radius, :ref:`float` height, :ref:`int` sides, Vector3.Axis axis=2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`clip_polygon` **(** :ref:`PoolVector3Array` points, :ref:`Plane` plane **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`clip_polygons_2d` **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`clip_polyline_with_polygon_2d` **(** :ref:`PoolVector2Array` polyline, :ref:`PoolVector2Array` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`convex_hull_2d` **(** :ref:`PoolVector2Array` points **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`exclude_polygons_2d` **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point_to_segment` **(** :ref:`Vector3` point, :ref:`Vector3` s1, :ref:`Vector3` s2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point_to_segment_2d` **(** :ref:`Vector2` point, :ref:`Vector2` s1, :ref:`Vector2` s2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point_to_segment_uncapped` **(** :ref:`Vector3` point, :ref:`Vector3` s1, :ref:`Vector3` s2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point_to_segment_uncapped_2d` **(** :ref:`Vector2` point, :ref:`Vector2` s1, :ref:`Vector2` s2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_closest_points_between_segments` **(** :ref:`Vector3` p1, :ref:`Vector3` p2, :ref:`Vector3` q1, :ref:`Vector3` q2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_closest_points_between_segments_2d` **(** :ref:`Vector2` p1, :ref:`Vector2` q1, :ref:`Vector2` p2, :ref:`Vector2` q2 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_uv84_normal_bit` **(** :ref:`Vector3` normal **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_polygons_2d` **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_polyline_with_polygon_2d` **(** :ref:`PoolVector2Array` polyline, :ref:`PoolVector2Array` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_in_circle` **(** :ref:`Vector2` point, :ref:`Vector2` circle_position, :ref:`float` circle_radius **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_in_polygon` **(** :ref:`Vector2` point, :ref:`PoolVector2Array` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_polygon_clockwise` **(** :ref:`PoolVector2Array` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`line_intersects_line_2d` **(** :ref:`Vector2` from_a, :ref:`Vector2` dir_a, :ref:`Vector2` from_b, :ref:`Vector2` dir_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`make_atlas` **(** :ref:`PoolVector2Array` sizes **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`merge_polygons_2d` **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`offset_polygon_2d` **(** :ref:`PoolVector2Array` polygon, :ref:`float` delta, :ref:`PolyJoinType` join_type=0 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`offset_polyline_2d` **(** :ref:`PoolVector2Array` polyline, :ref:`float` delta, :ref:`PolyJoinType` join_type=0, :ref:`PolyEndType` end_type=3 **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`point_is_inside_triangle` **(** :ref:`Vector2` point, :ref:`Vector2` a, :ref:`Vector2` b, :ref:`Vector2` c **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`ray_intersects_triangle` **(** :ref:`Vector3` from, :ref:`Vector3` dir, :ref:`Vector3` a, :ref:`Vector3` b, :ref:`Vector3` c **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`segment_intersects_circle` **(** :ref:`Vector2` segment_from, :ref:`Vector2` segment_to, :ref:`Vector2` circle_position, :ref:`float` circle_radius **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`segment_intersects_convex` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Array` planes **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`segment_intersects_cylinder` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`float` height, :ref:`float` radius **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`segment_intersects_segment_2d` **(** :ref:`Vector2` from_a, :ref:`Vector2` to_a, :ref:`Vector2` from_b, :ref:`Vector2` to_b **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`segment_intersects_sphere` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Vector3` sphere_position, :ref:`float` sphere_radius **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`segment_intersects_triangle` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Vector3` a, :ref:`Vector3` b, :ref:`Vector3` c **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`triangulate_delaunay_2d` **(** :ref:`PoolVector2Array` points **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`triangulate_polygon` **(** :ref:`PoolVector2Array` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Geometry_PolyBooleanOperation: + +.. _class_Geometry_constant_OPERATION_UNION: + +.. _class_Geometry_constant_OPERATION_DIFFERENCE: + +.. _class_Geometry_constant_OPERATION_INTERSECTION: + +.. _class_Geometry_constant_OPERATION_XOR: + +enum **PolyBooleanOperation**: + +- **OPERATION_UNION** = **0** --- Create regions where either subject or clip polygons (or both) are filled. + +- **OPERATION_DIFFERENCE** = **1** --- Create regions where subject polygons are filled except where clip polygons are filled. + +- **OPERATION_INTERSECTION** = **2** --- Create regions where both subject and clip polygons are filled. + +- **OPERATION_XOR** = **3** --- Create regions where either subject or clip polygons are filled but not where both are filled. + +---- + +.. _enum_Geometry_PolyJoinType: + +.. _class_Geometry_constant_JOIN_SQUARE: + +.. _class_Geometry_constant_JOIN_ROUND: + +.. _class_Geometry_constant_JOIN_MITER: + +enum **PolyJoinType**: + +- **JOIN_SQUARE** = **0** --- Squaring is applied uniformally at all convex edge joins at ``1 * delta``. + +- **JOIN_ROUND** = **1** --- While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords. + +- **JOIN_MITER** = **2** --- There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow "spikes". For any given edge join, when miter offsetting would exceed that maximum distance, "square" joining is applied. + +---- + +.. _enum_Geometry_PolyEndType: + +.. _class_Geometry_constant_END_POLYGON: + +.. _class_Geometry_constant_END_JOINED: + +.. _class_Geometry_constant_END_BUTT: + +.. _class_Geometry_constant_END_SQUARE: + +.. _class_Geometry_constant_END_ROUND: + +enum **PolyEndType**: + +- **END_POLYGON** = **0** --- Endpoints are joined using the :ref:`PolyJoinType` value and the path filled as a polygon. + +- **END_JOINED** = **1** --- Endpoints are joined using the :ref:`PolyJoinType` value and the path filled as a polyline. + +- **END_BUTT** = **2** --- Endpoints are squared off with no extension. + +- **END_SQUARE** = **3** --- Endpoints are squared off and extended by ``delta`` units. + +- **END_ROUND** = **4** --- Endpoints are rounded off and extended by ``delta`` units. + +Method Descriptions +------------------- + +.. _class_Geometry_method_build_box_planes: + +- :ref:`Array` **build_box_planes** **(** :ref:`Vector3` extents **)** + +Returns an array with 6 :ref:`Plane`\ s that describe the sides of a box centered at the origin. The box size is defined by ``extents``, which represents one (positive) corner of the box (i.e. half its actual size). + +---- + +.. _class_Geometry_method_build_capsule_planes: + +- :ref:`Array` **build_capsule_planes** **(** :ref:`float` radius, :ref:`float` height, :ref:`int` sides, :ref:`int` lats, Vector3.Axis axis=2 **)** + +Returns an array of :ref:`Plane`\ s closely bounding a faceted capsule centered at the origin with radius ``radius`` and height ``height``. The parameter ``sides`` defines how many planes will be generated for the side part of the capsule, whereas ``lats`` gives the number of latitudinal steps at the bottom and top of the capsule. The parameter ``axis`` describes the axis along which the capsule is oriented (0 for X, 1 for Y, 2 for Z). + +---- + +.. _class_Geometry_method_build_cylinder_planes: + +- :ref:`Array` **build_cylinder_planes** **(** :ref:`float` radius, :ref:`float` height, :ref:`int` sides, Vector3.Axis axis=2 **)** + +Returns an array of :ref:`Plane`\ s closely bounding a faceted cylinder centered at the origin with radius ``radius`` and height ``height``. The parameter ``sides`` defines how many planes will be generated for the round part of the cylinder. The parameter ``axis`` describes the axis along which the cylinder is oriented (0 for X, 1 for Y, 2 for Z). + +---- + +.. _class_Geometry_method_clip_polygon: + +- :ref:`PoolVector3Array` **clip_polygon** **(** :ref:`PoolVector3Array` points, :ref:`Plane` plane **)** + +Clips the polygon defined by the points in ``points`` against the ``plane`` and returns the points of the clipped polygon. + +---- + +.. _class_Geometry_method_clip_polygons_2d: + +- :ref:`Array` **clip_polygons_2d** **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** + +Clips ``polygon_a`` against ``polygon_b`` and returns an array of clipped polygons. This performs :ref:`OPERATION_DIFFERENCE` between polygons. Returns an empty array if ``polygon_b`` completely overlaps ``polygon_a``. + +If ``polygon_b`` is enclosed by ``polygon_a``, returns an outer polygon (boundary) and inner polygon (hole) which could be distinguished by calling :ref:`is_polygon_clockwise`. + +---- + +.. _class_Geometry_method_clip_polyline_with_polygon_2d: + +- :ref:`Array` **clip_polyline_with_polygon_2d** **(** :ref:`PoolVector2Array` polyline, :ref:`PoolVector2Array` polygon **)** + +Clips ``polyline`` against ``polygon`` and returns an array of clipped polylines. This performs :ref:`OPERATION_DIFFERENCE` between the polyline and the polygon. This operation can be thought of as cutting a line with a closed shape. + +---- + +.. _class_Geometry_method_convex_hull_2d: + +- :ref:`PoolVector2Array` **convex_hull_2d** **(** :ref:`PoolVector2Array` points **)** + +Given an array of :ref:`Vector2`\ s, returns the convex hull as a list of points in counterclockwise order. The last point is the same as the first one. + +---- + +.. _class_Geometry_method_exclude_polygons_2d: + +- :ref:`Array` **exclude_polygons_2d** **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** + +Mutually excludes common area defined by intersection of ``polygon_a`` and ``polygon_b`` (see :ref:`intersect_polygons_2d`) and returns an array of excluded polygons. This performs :ref:`OPERATION_XOR` between polygons. In other words, returns all but common area between polygons. + +The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling :ref:`is_polygon_clockwise`. + +---- + +.. _class_Geometry_method_get_closest_point_to_segment: + +- :ref:`Vector3` **get_closest_point_to_segment** **(** :ref:`Vector3` point, :ref:`Vector3` s1, :ref:`Vector3` s2 **)** + +Returns the 3D point on the 3D segment (``s1``, ``s2``) that is closest to ``point``. The returned point will always be inside the specified segment. + +---- + +.. _class_Geometry_method_get_closest_point_to_segment_2d: + +- :ref:`Vector2` **get_closest_point_to_segment_2d** **(** :ref:`Vector2` point, :ref:`Vector2` s1, :ref:`Vector2` s2 **)** + +Returns the 2D point on the 2D segment (``s1``, ``s2``) that is closest to ``point``. The returned point will always be inside the specified segment. + +---- + +.. _class_Geometry_method_get_closest_point_to_segment_uncapped: + +- :ref:`Vector3` **get_closest_point_to_segment_uncapped** **(** :ref:`Vector3` point, :ref:`Vector3` s1, :ref:`Vector3` s2 **)** + +Returns the 3D point on the 3D line defined by (``s1``, ``s2``) that is closest to ``point``. The returned point can be inside the segment (``s1``, ``s2``) or outside of it, i.e. somewhere on the line extending from the segment. + +---- + +.. _class_Geometry_method_get_closest_point_to_segment_uncapped_2d: + +- :ref:`Vector2` **get_closest_point_to_segment_uncapped_2d** **(** :ref:`Vector2` point, :ref:`Vector2` s1, :ref:`Vector2` s2 **)** + +Returns the 2D point on the 2D line defined by (``s1``, ``s2``) that is closest to ``point``. The returned point can be inside the segment (``s1``, ``s2``) or outside of it, i.e. somewhere on the line extending from the segment. + +---- + +.. _class_Geometry_method_get_closest_points_between_segments: + +- :ref:`PoolVector3Array` **get_closest_points_between_segments** **(** :ref:`Vector3` p1, :ref:`Vector3` p2, :ref:`Vector3` q1, :ref:`Vector3` q2 **)** + +Given the two 3D segments (``p1``, ``p2``) and (``q1``, ``q2``), finds those two points on the two segments that are closest to each other. Returns a :ref:`PoolVector3Array` that contains this point on (``p1``, ``p2``) as well the accompanying point on (``q1``, ``q2``). + +---- + +.. _class_Geometry_method_get_closest_points_between_segments_2d: + +- :ref:`PoolVector2Array` **get_closest_points_between_segments_2d** **(** :ref:`Vector2` p1, :ref:`Vector2` q1, :ref:`Vector2` p2, :ref:`Vector2` q2 **)** + +Given the two 2D segments (``p1``, ``q1``) and (``p2``, ``q2``), finds those two points on the two segments that are closest to each other. Returns a :ref:`PoolVector2Array` that contains this point on (``p1``, ``q1``) as well the accompanying point on (``p2``, ``q2``). + +---- + +.. _class_Geometry_method_get_uv84_normal_bit: + +- :ref:`int` **get_uv84_normal_bit** **(** :ref:`Vector3` normal **)** + +Used internally by the engine. + +---- + +.. _class_Geometry_method_intersect_polygons_2d: + +- :ref:`Array` **intersect_polygons_2d** **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** + +Intersects ``polygon_a`` with ``polygon_b`` and returns an array of intersected polygons. This performs :ref:`OPERATION_INTERSECTION` between polygons. In other words, returns common area shared by polygons. Returns an empty array if no intersection occurs. + +The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling :ref:`is_polygon_clockwise`. + +---- + +.. _class_Geometry_method_intersect_polyline_with_polygon_2d: + +- :ref:`Array` **intersect_polyline_with_polygon_2d** **(** :ref:`PoolVector2Array` polyline, :ref:`PoolVector2Array` polygon **)** + +Intersects ``polyline`` with ``polygon`` and returns an array of intersected polylines. This performs :ref:`OPERATION_INTERSECTION` between the polyline and the polygon. This operation can be thought of as chopping a line with a closed shape. + +---- + +.. _class_Geometry_method_is_point_in_circle: + +- :ref:`bool` **is_point_in_circle** **(** :ref:`Vector2` point, :ref:`Vector2` circle_position, :ref:`float` circle_radius **)** + +Returns ``true`` if ``point`` is inside the circle or if it's located exactly *on* the circle's boundary, otherwise returns ``false``. + +---- + +.. _class_Geometry_method_is_point_in_polygon: + +- :ref:`bool` **is_point_in_polygon** **(** :ref:`Vector2` point, :ref:`PoolVector2Array` polygon **)** + +Returns ``true`` if ``point`` is inside ``polygon`` or if it's located exactly *on* polygon's boundary, otherwise returns ``false``. + +---- + +.. _class_Geometry_method_is_polygon_clockwise: + +- :ref:`bool` **is_polygon_clockwise** **(** :ref:`PoolVector2Array` polygon **)** + +Returns ``true`` if ``polygon``'s vertices are ordered in clockwise order, otherwise returns ``false``. + +---- + +.. _class_Geometry_method_line_intersects_line_2d: + +- :ref:`Variant` **line_intersects_line_2d** **(** :ref:`Vector2` from_a, :ref:`Vector2` dir_a, :ref:`Vector2` from_b, :ref:`Vector2` dir_b **)** + +Checks if the two lines (``from_a``, ``dir_a``) and (``from_b``, ``dir_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns an empty :ref:`Variant`. + +**Note:** The lines are specified using direction vectors, not end points. + +---- + +.. _class_Geometry_method_make_atlas: + +- :ref:`Dictionary` **make_atlas** **(** :ref:`PoolVector2Array` sizes **)** + +Given an array of :ref:`Vector2`\ s representing tiles, builds an atlas. The returned dictionary has two keys: ``points`` is a vector of :ref:`Vector2` that specifies the positions of each tile, ``size`` contains the overall size of the whole atlas as :ref:`Vector2`. + +---- + +.. _class_Geometry_method_merge_polygons_2d: + +- :ref:`Array` **merge_polygons_2d** **(** :ref:`PoolVector2Array` polygon_a, :ref:`PoolVector2Array` polygon_b **)** + +Merges (combines) ``polygon_a`` and ``polygon_b`` and returns an array of merged polygons. This performs :ref:`OPERATION_UNION` between polygons. + +The operation may result in an outer polygon (boundary) and multiple inner polygons (holes) produced which could be distinguished by calling :ref:`is_polygon_clockwise`. + +---- + +.. _class_Geometry_method_offset_polygon_2d: + +- :ref:`Array` **offset_polygon_2d** **(** :ref:`PoolVector2Array` polygon, :ref:`float` delta, :ref:`PolyJoinType` join_type=0 **)** + +Inflates or deflates ``polygon`` by ``delta`` units (pixels). If ``delta`` is positive, makes the polygon grow outward. If ``delta`` is negative, shrinks the polygon inward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. Returns an empty array if ``delta`` is negative and the absolute value of it approximately exceeds the minimum bounding rectangle dimensions of the polygon. + +Each polygon's vertices will be rounded as determined by ``join_type``, see :ref:`PolyJoinType`. + +The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling :ref:`is_polygon_clockwise`. + +**Note:** To translate the polygon's vertices specifically, use the :ref:`Transform2D.xform` method: + +:: + + var polygon = PoolVector2Array([Vector2(0, 0), Vector2(100, 0), Vector2(100, 100), Vector2(0, 100)]) + var offset = Vector2(50, 50) + polygon = Transform2D(0, offset).xform(polygon) + print(polygon) # prints [Vector2(50, 50), Vector2(150, 50), Vector2(150, 150), Vector2(50, 150)] + +---- + +.. _class_Geometry_method_offset_polyline_2d: + +- :ref:`Array` **offset_polyline_2d** **(** :ref:`PoolVector2Array` polyline, :ref:`float` delta, :ref:`PolyJoinType` join_type=0, :ref:`PolyEndType` end_type=3 **)** + +Inflates or deflates ``polyline`` by ``delta`` units (pixels), producing polygons. If ``delta`` is positive, makes the polyline grow outward. Returns an array of polygons because inflating/deflating may result in multiple discrete polygons. If ``delta`` is negative, returns an empty array. + +Each polygon's vertices will be rounded as determined by ``join_type``, see :ref:`PolyJoinType`. + +Each polygon's endpoints will be rounded as determined by ``end_type``, see :ref:`PolyEndType`. + +The operation may result in an outer polygon (boundary) and inner polygon (hole) produced which could be distinguished by calling :ref:`is_polygon_clockwise`. + +---- + +.. _class_Geometry_method_point_is_inside_triangle: + +- :ref:`bool` **point_is_inside_triangle** **(** :ref:`Vector2` point, :ref:`Vector2` a, :ref:`Vector2` b, :ref:`Vector2` c **)** |const| + +Returns if ``point`` is inside the triangle specified by ``a``, ``b`` and ``c``. + +---- + +.. _class_Geometry_method_ray_intersects_triangle: + +- :ref:`Variant` **ray_intersects_triangle** **(** :ref:`Vector3` from, :ref:`Vector3` dir, :ref:`Vector3` a, :ref:`Vector3` b, :ref:`Vector3` c **)** + +Tests if the 3D ray starting at ``from`` with the direction of ``dir`` intersects the triangle specified by ``a``, ``b`` and ``c``. If yes, returns the point of intersection as :ref:`Vector3`. If no intersection takes place, an empty :ref:`Variant` is returned. + +---- + +.. _class_Geometry_method_segment_intersects_circle: + +- :ref:`float` **segment_intersects_circle** **(** :ref:`Vector2` segment_from, :ref:`Vector2` segment_to, :ref:`Vector2` circle_position, :ref:`float` circle_radius **)** + +Given the 2D segment (``segment_from``, ``segment_to``), returns the position on the segment (as a number between 0 and 1) at which the segment hits the circle that is located at position ``circle_position`` and has radius ``circle_radius``. If the segment does not intersect the circle, -1 is returned (this is also the case if the line extending the segment would intersect the circle, but the segment does not). + +---- + +.. _class_Geometry_method_segment_intersects_convex: + +- :ref:`PoolVector3Array` **segment_intersects_convex** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Array` planes **)** + +Given a convex hull defined though the :ref:`Plane`\ s in the array ``planes``, tests if the segment (``from``, ``to``) intersects with that hull. If an intersection is found, returns a :ref:`PoolVector3Array` containing the point the intersection and the hull's normal. If no intersecion is found, an the returned array is empty. + +---- + +.. _class_Geometry_method_segment_intersects_cylinder: + +- :ref:`PoolVector3Array` **segment_intersects_cylinder** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`float` height, :ref:`float` radius **)** + +Checks if the segment (``from``, ``to``) intersects the cylinder with height ``height`` that is centered at the origin and has radius ``radius``. If no, returns an empty :ref:`PoolVector3Array`. If an intersection takes place, the returned array contains the point of intersection and the cylinder's normal at the point of intersection. + +---- + +.. _class_Geometry_method_segment_intersects_segment_2d: + +- :ref:`Variant` **segment_intersects_segment_2d** **(** :ref:`Vector2` from_a, :ref:`Vector2` to_a, :ref:`Vector2` from_b, :ref:`Vector2` to_b **)** + +Checks if the two segments (``from_a``, ``to_a``) and (``from_b``, ``to_b``) intersect. If yes, return the point of intersection as :ref:`Vector2`. If no intersection takes place, returns an empty :ref:`Variant`. + +---- + +.. _class_Geometry_method_segment_intersects_sphere: + +- :ref:`PoolVector3Array` **segment_intersects_sphere** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Vector3` sphere_position, :ref:`float` sphere_radius **)** + +Checks if the segment (``from``, ``to``) intersects the sphere that is located at ``sphere_position`` and has radius ``sphere_radius``. If no, returns an empty :ref:`PoolVector3Array`. If yes, returns a :ref:`PoolVector3Array` containing the point of intersection and the sphere's normal at the point of intersection. + +---- + +.. _class_Geometry_method_segment_intersects_triangle: + +- :ref:`Variant` **segment_intersects_triangle** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Vector3` a, :ref:`Vector3` b, :ref:`Vector3` c **)** + +Tests if the segment (``from``, ``to``) intersects the triangle ``a``, ``b``, ``c``. If yes, returns the point of intersection as :ref:`Vector3`. If no intersection takes place, an empty :ref:`Variant` is returned. + +---- + +.. _class_Geometry_method_triangulate_delaunay_2d: + +- :ref:`PoolIntArray` **triangulate_delaunay_2d** **(** :ref:`PoolVector2Array` points **)** + +Triangulates the area specified by discrete set of ``points`` such that no point is inside the circumcircle of any resulting triangle. Returns a :ref:`PoolIntArray` where each triangle consists of three consecutive point indices into ``points`` (i.e. the returned array will have ``n * 3`` elements, with ``n`` being the number of found triangles). If the triangulation did not succeed, an empty :ref:`PoolIntArray` is returned. + +---- + +.. _class_Geometry_method_triangulate_polygon: + +- :ref:`PoolIntArray` **triangulate_polygon** **(** :ref:`PoolVector2Array` polygon **)** + +Triangulates the polygon specified by the points in ``polygon``. Returns a :ref:`PoolIntArray` where each triangle consists of three consecutive point indices into ``polygon`` (i.e. the returned array will have ``n * 3`` elements, with ``n`` being the number of found triangles). If the triangulation did not succeed, an empty :ref:`PoolIntArray` is returned. + +.. |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.)` diff --git a/classes/class_geometryinstance.rst b/classes/class_geometryinstance.rst new file mode 100644 index 0000000..09e03fc --- /dev/null +++ b/classes/class_geometryinstance.rst @@ -0,0 +1,328 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GeometryInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GeometryInstance: + +GeometryInstance +================ + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`CPUParticles`, :ref:`CSGShape`, :ref:`ImmediateGeometry`, :ref:`MeshInstance`, :ref:`MultiMeshInstance`, :ref:`Particles`, :ref:`SpriteBase3D` + +Base node for geometry-based visual instances. + +Description +----------- + +Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials. + +Properties +---------- + ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`ShadowCastingSetting` | :ref:`cast_shadow` | ``1`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`extra_cull_margin` | ``0.0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`generate_lightmap` | ``true`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`LightmapScale` | :ref:`lightmap_scale` | ``0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`lod_max_distance` | ``0.0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`lod_max_hysteresis` | ``0.0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`lod_min_distance` | ``0.0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`lod_min_hysteresis` | ``0.0`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`Material` | :ref:`material_override` | | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_in_baked_light` | ``false`` | ++-------------------------------------------------------------------------+-------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag` **(** :ref:`Flags` flag **)** |const| | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_aabb` **(** :ref:`AABB` aabb **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag` **(** :ref:`Flags` flag, :ref:`bool` value **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_GeometryInstance_LightmapScale: + +.. _class_GeometryInstance_constant_LIGHTMAP_SCALE_1X: + +.. _class_GeometryInstance_constant_LIGHTMAP_SCALE_2X: + +.. _class_GeometryInstance_constant_LIGHTMAP_SCALE_4X: + +.. _class_GeometryInstance_constant_LIGHTMAP_SCALE_8X: + +.. _class_GeometryInstance_constant_LIGHTMAP_SCALE_MAX: + +enum **LightmapScale**: + +- **LIGHTMAP_SCALE_1X** = **0** --- The generated lightmap texture will have the original size. + +- **LIGHTMAP_SCALE_2X** = **1** --- The generated lightmap texture will be twice as large, on each axis. + +- **LIGHTMAP_SCALE_4X** = **2** --- The generated lightmap texture will be 4 times as large, on each axis. + +- **LIGHTMAP_SCALE_8X** = **3** --- The generated lightmap texture will be 8 times as large, on each axis. + +- **LIGHTMAP_SCALE_MAX** = **4** + +---- + +.. _enum_GeometryInstance_ShadowCastingSetting: + +.. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_OFF: + +.. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_ON: + +.. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED: + +.. _class_GeometryInstance_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY: + +enum **ShadowCastingSetting**: + +- **SHADOW_CASTING_SETTING_OFF** = **0** --- Will not cast any shadows. + +- **SHADOW_CASTING_SETTING_ON** = **1** --- Will cast shadows from all visible faces in the GeometryInstance. + +Will take culling into account, so faces not being rendered will not be taken into account when shadow casting. + +- **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = **2** --- Will cast shadows from all visible faces in the GeometryInstance. + +Will not take culling into account, so all faces will be taken into account when shadow casting. + +- **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = **3** --- Will only show the shadows casted from this object. + +In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be. + +---- + +.. _enum_GeometryInstance_Flags: + +.. _class_GeometryInstance_constant_FLAG_USE_BAKED_LIGHT: + +.. _class_GeometryInstance_constant_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE: + +.. _class_GeometryInstance_constant_FLAG_MAX: + +enum **Flags**: + +- **FLAG_USE_BAKED_LIGHT** = **0** --- Will allow the GeometryInstance to be used when baking lights using a :ref:`GIProbe` or :ref:`BakedLightmap`. + +- **FLAG_DRAW_NEXT_FRAME_IF_VISIBLE** = **1** --- Unused in this class, exposed for consistency with :ref:`InstanceFlags`. + +- **FLAG_MAX** = **2** --- Represents the size of the :ref:`Flags` enum. + +Property Descriptions +--------------------- + +.. _class_GeometryInstance_property_cast_shadow: + +- :ref:`ShadowCastingSetting` **cast_shadow** + ++-----------+---------------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------------+ +| *Setter* | set_cast_shadows_setting(value) | ++-----------+---------------------------------+ +| *Getter* | get_cast_shadows_setting() | ++-----------+---------------------------------+ + +The selected shadow casting flag. See :ref:`ShadowCastingSetting` for possible values. + +---- + +.. _class_GeometryInstance_property_extra_cull_margin: + +- :ref:`float` **extra_cull_margin** + ++-----------+------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------+ +| *Setter* | set_extra_cull_margin(value) | ++-----------+------------------------------+ +| *Getter* | get_extra_cull_margin() | ++-----------+------------------------------+ + +The extra distance added to the GeometryInstance's bounding box (:ref:`AABB`) to increase its cull box. + +---- + +.. _class_GeometryInstance_property_generate_lightmap: + +- :ref:`bool` **generate_lightmap** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_generate_lightmap(value) | ++-----------+------------------------------+ +| *Getter* | get_generate_lightmap() | ++-----------+------------------------------+ + +When disabled, the mesh will be taken into account when computing indirect lighting, but the resulting lightmap will not be saved. Useful for emissive only materials or shadow casters. + +---- + +.. _class_GeometryInstance_property_lightmap_scale: + +- :ref:`LightmapScale` **lightmap_scale** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_lightmap_scale(value) | ++-----------+---------------------------+ +| *Getter* | get_lightmap_scale() | ++-----------+---------------------------+ + +Scale factor for the generated baked lightmap. Useful for adding detail to certain mesh instances. + +---- + +.. _class_GeometryInstance_property_lod_max_distance: + +- :ref:`float` **lod_max_distance** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_lod_max_distance(value) | ++-----------+-----------------------------+ +| *Getter* | get_lod_max_distance() | ++-----------+-----------------------------+ + +The GeometryInstance's max LOD distance. + +**Note:** This property currently has no effect. + +---- + +.. _class_GeometryInstance_property_lod_max_hysteresis: + +- :ref:`float` **lod_max_hysteresis** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_lod_max_hysteresis(value) | ++-----------+-------------------------------+ +| *Getter* | get_lod_max_hysteresis() | ++-----------+-------------------------------+ + +The GeometryInstance's max LOD margin. + +**Note:** This property currently has no effect. + +---- + +.. _class_GeometryInstance_property_lod_min_distance: + +- :ref:`float` **lod_min_distance** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_lod_min_distance(value) | ++-----------+-----------------------------+ +| *Getter* | get_lod_min_distance() | ++-----------+-----------------------------+ + +The GeometryInstance's min LOD distance. + +**Note:** This property currently has no effect. + +---- + +.. _class_GeometryInstance_property_lod_min_hysteresis: + +- :ref:`float` **lod_min_hysteresis** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_lod_min_hysteresis(value) | ++-----------+-------------------------------+ +| *Getter* | get_lod_min_hysteresis() | ++-----------+-------------------------------+ + +The GeometryInstance's min LOD margin. + +**Note:** This property currently has no effect. + +---- + +.. _class_GeometryInstance_property_material_override: + +- :ref:`Material` **material_override** + ++----------+------------------------------+ +| *Setter* | set_material_override(value) | ++----------+------------------------------+ +| *Getter* | get_material_override() | ++----------+------------------------------+ + +The material override for the whole geometry. + +If a material is assigned to this property, it will be used instead of any material set in any material slot of the mesh. + +---- + +.. _class_GeometryInstance_property_use_in_baked_light: + +- :ref:`bool` **use_in_baked_light** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, this GeometryInstance will be used when baking lights using a :ref:`GIProbe` or :ref:`BakedLightmap`. + +Method Descriptions +------------------- + +.. _class_GeometryInstance_method_get_flag: + +- :ref:`bool` **get_flag** **(** :ref:`Flags` flag **)** |const| + +Returns the :ref:`Flags` that have been set for this object. + +---- + +.. _class_GeometryInstance_method_set_custom_aabb: + +- void **set_custom_aabb** **(** :ref:`AABB` aabb **)** + +Overrides the bounding box of this node with a custom one. To remove it, set an :ref:`AABB` with all fields set to zero. + +---- + +.. _class_GeometryInstance_method_set_flag: + +- void **set_flag** **(** :ref:`Flags` flag, :ref:`bool` value **)** + +Sets the :ref:`Flags` specified. See :ref:`Flags` for options. + +.. |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.)` diff --git a/classes/class_giprobe.rst b/classes/class_giprobe.rst new file mode 100644 index 0000000..be000ef --- /dev/null +++ b/classes/class_giprobe.rst @@ -0,0 +1,281 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GIProbe.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GIProbe: + +GIProbe +======= + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Real-time global illumination (GI) probe. + +Description +----------- + +``GIProbe``\ s are used to provide high-quality real-time indirect light to scenes. They precompute the effect of objects that emit light and the effect of static geometry to simulate the behavior of complex light in real-time. ``GIProbe``\ s need to be baked before using, however, once baked, dynamic objects will receive light from them. Further, lights can be fully dynamic or baked. + +Having ``GIProbe``\ s in a scene can be expensive, the quality of the probe can be turned down in exchange for better performance in the :ref:`ProjectSettings` using :ref:`ProjectSettings.rendering/quality/voxel_cone_tracing/high_quality`. + +**Procedural generation:** ``GIProbe`` can be baked in an exported project, which makes it suitable for procedurally generated or user-built levels as long as all the geometry is generated in advance. + +**Performance:** ``GIProbe`` is relatively demanding on the GPU and is not suited to low-end hardware such as integrated graphics (consider :ref:`BakedLightmap` instead). To provide a fallback for low-end hardware, consider adding an option to disable ``GIProbe`` in your project's options menus. A ``GIProbe`` node can be disabled by hiding it. + +**Note:** Meshes should have sufficiently thick walls to avoid light leaks (avoid one-sided walls). For interior levels, enclose your level geometry in a sufficiently large box and bridge the loops to close the mesh. To further prevent light leaks, you can also strategically place temporary :ref:`MeshInstance` nodes with :ref:`GeometryInstance.use_in_baked_light` enabled. These temporary nodes can then be hidden after baking the ``GIProbe`` node. + +**Note:** Due to a renderer limitation, emissive :ref:`ShaderMaterial`\ s cannot emit light when used in a ``GIProbe``. Only emissive :ref:`SpatialMaterial`\ s can emit light in a ``GIProbe``. + +Tutorials +--------- + +- :doc:`../tutorials/3d/gi_probes` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`bias` | ``1.5`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`compress` | ``false`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`GIProbeData` | :ref:`data` | | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`dynamic_range` | ``4`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`energy` | ``1.0`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`extents` | ``Vector3( 10, 10, 10 )`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`interior` | ``false`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`normal_bias` | ``0.0`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`propagation` | ``0.7`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ +| :ref:`Subdiv` | :ref:`subdiv` | ``1`` | ++---------------------------------------+------------------------------------------------------------+---------------------------+ + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bake` **(** :ref:`Node` from_node=null, :ref:`bool` create_visual_debug=false **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`debug_bake` **(** **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_GIProbe_Subdiv: + +.. _class_GIProbe_constant_SUBDIV_64: + +.. _class_GIProbe_constant_SUBDIV_128: + +.. _class_GIProbe_constant_SUBDIV_256: + +.. _class_GIProbe_constant_SUBDIV_512: + +.. _class_GIProbe_constant_SUBDIV_MAX: + +enum **Subdiv**: + +- **SUBDIV_64** = **0** --- Use 64 subdivisions. This is the lowest quality setting, but the fastest. Use it if you can, but especially use it on lower-end hardware. + +- **SUBDIV_128** = **1** --- Use 128 subdivisions. This is the default quality setting. + +- **SUBDIV_256** = **2** --- Use 256 subdivisions. + +- **SUBDIV_512** = **3** --- Use 512 subdivisions. This is the highest quality setting, but the slowest. On lower-end hardware, this could cause the GPU to stall. + +- **SUBDIV_MAX** = **4** --- Represents the size of the :ref:`Subdiv` enum. + +Property Descriptions +--------------------- + +.. _class_GIProbe_property_bias: + +- :ref:`float` **bias** + ++-----------+-----------------+ +| *Default* | ``1.5`` | ++-----------+-----------------+ +| *Setter* | set_bias(value) | ++-----------+-----------------+ +| *Getter* | get_bias() | ++-----------+-----------------+ + +Offsets the lookup of the light contribution from the ``GIProbe``. This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and :ref:`normal_bias` should be played around with to minimize self-shadowing and light leaking. + +**Note:** ``bias`` should usually be above 1.0 as that is the size of the voxels. + +---- + +.. _class_GIProbe_property_compress: + +- :ref:`bool` **compress** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_compress(value) | ++-----------+---------------------+ +| *Getter* | is_compressed() | ++-----------+---------------------+ + +*Deprecated.* This property has been deprecated due to known bugs and no longer has any effect when enabled. + +---- + +.. _class_GIProbe_property_data: + +- :ref:`GIProbeData` **data** + ++----------+-----------------------+ +| *Setter* | set_probe_data(value) | ++----------+-----------------------+ +| *Getter* | get_probe_data() | ++----------+-----------------------+ + +The :ref:`GIProbeData` resource that holds the data for this ``GIProbe``. + +---- + +.. _class_GIProbe_property_dynamic_range: + +- :ref:`int` **dynamic_range** + ++-----------+--------------------------+ +| *Default* | ``4`` | ++-----------+--------------------------+ +| *Setter* | set_dynamic_range(value) | ++-----------+--------------------------+ +| *Getter* | get_dynamic_range() | ++-----------+--------------------------+ + +The maximum brightness that the ``GIProbe`` will recognize. Brightness will be scaled within this range. + +---- + +.. _class_GIProbe_property_energy: + +- :ref:`float` **energy** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_energy(value) | ++-----------+-------------------+ +| *Getter* | get_energy() | ++-----------+-------------------+ + +Energy multiplier. Makes the lighting contribution from the ``GIProbe`` brighter. + +---- + +.. _class_GIProbe_property_extents: + +- :ref:`Vector3` **extents** + ++-----------+---------------------------+ +| *Default* | ``Vector3( 10, 10, 10 )`` | ++-----------+---------------------------+ +| *Setter* | set_extents(value) | ++-----------+---------------------------+ +| *Getter* | get_extents() | ++-----------+---------------------------+ + +The size of the area covered by the ``GIProbe``. If you make the extents larger without increasing the subdivisions with :ref:`subdiv`, the size of each cell will increase and result in lower detailed lighting. + +---- + +.. _class_GIProbe_property_interior: + +- :ref:`bool` **interior** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_interior(value) | ++-----------+---------------------+ +| *Getter* | is_interior() | ++-----------+---------------------+ + +If ``true``, ignores the sky contribution when calculating lighting. + +---- + +.. _class_GIProbe_property_normal_bias: + +- :ref:`float` **normal_bias** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_normal_bias(value) | ++-----------+------------------------+ +| *Getter* | get_normal_bias() | ++-----------+------------------------+ + +Offsets the lookup into the ``GIProbe`` based on the object's normal direction. Can be used to reduce some self-shadowing artifacts. + +---- + +.. _class_GIProbe_property_propagation: + +- :ref:`float` **propagation** + ++-----------+------------------------+ +| *Default* | ``0.7`` | ++-----------+------------------------+ +| *Setter* | set_propagation(value) | ++-----------+------------------------+ +| *Getter* | get_propagation() | ++-----------+------------------------+ + +How much light propagates through the probe internally. A higher value allows light to spread further. + +---- + +.. _class_GIProbe_property_subdiv: + +- :ref:`Subdiv` **subdiv** + ++-----------+-------------------+ +| *Default* | ``1`` | ++-----------+-------------------+ +| *Setter* | set_subdiv(value) | ++-----------+-------------------+ +| *Getter* | get_subdiv() | ++-----------+-------------------+ + +Number of times to subdivide the grid that the ``GIProbe`` operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance. + +Method Descriptions +------------------- + +.. _class_GIProbe_method_bake: + +- void **bake** **(** :ref:`Node` from_node=null, :ref:`bool` create_visual_debug=false **)** + +Bakes the effect from all :ref:`GeometryInstance`\ s marked with :ref:`GeometryInstance.use_in_baked_light` and :ref:`Light`\ s marked with either :ref:`Light.BAKE_INDIRECT` or :ref:`Light.BAKE_ALL`. If ``create_visual_debug`` is ``true``, after baking the light, this will generate a :ref:`MultiMesh` that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the ``GIProbe``'s data and debug any issues that may be occurring. + +**Note:** :ref:`bake` works from the editor and in exported projects. This makes it suitable for procedurally generated or user-built levels. Baking a ``GIProbe`` generally takes from 5 to 20 seconds in most scenes. Reducing :ref:`subdiv` can speed up baking. + +---- + +.. _class_GIProbe_method_debug_bake: + +- void **debug_bake** **(** **)** + +Calls :ref:`bake` with ``create_visual_debug`` enabled. + +.. |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.)` diff --git a/classes/class_giprobedata.rst b/classes/class_giprobedata.rst new file mode 100644 index 0000000..7583aa8 --- /dev/null +++ b/classes/class_giprobedata.rst @@ -0,0 +1,205 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GIProbeData.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GIProbeData: + +GIProbeData +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Tutorials +--------- + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`bias` | ``0.4`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`AABB` | :ref:`bounds` | ``AABB( 0, 0, 0, 1, 1, 1 )`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`cell_size` | ``1.0`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`compress` | ``false`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`dynamic_data` | ``PoolIntArray( )`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`dynamic_range` | ``1`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`energy` | ``1.0`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`interior` | ``false`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`normal_bias` | ``0.4`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`propagation` | ``1.0`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`to_cell_xform` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------------+----------------------------------------------------------------+-----------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GIProbeData_property_bias: + +- :ref:`float` **bias** + ++-----------+-----------------+ +| *Default* | ``0.4`` | ++-----------+-----------------+ +| *Setter* | set_bias(value) | ++-----------+-----------------+ +| *Getter* | get_bias() | ++-----------+-----------------+ + +---- + +.. _class_GIProbeData_property_bounds: + +- :ref:`AABB` **bounds** + ++-----------+------------------------------+ +| *Default* | ``AABB( 0, 0, 0, 1, 1, 1 )`` | ++-----------+------------------------------+ +| *Setter* | set_bounds(value) | ++-----------+------------------------------+ +| *Getter* | get_bounds() | ++-----------+------------------------------+ + +---- + +.. _class_GIProbeData_property_cell_size: + +- :ref:`float` **cell_size** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_cell_size(value) | ++-----------+----------------------+ +| *Getter* | get_cell_size() | ++-----------+----------------------+ + +---- + +.. _class_GIProbeData_property_compress: + +- :ref:`bool` **compress** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_compress(value) | ++-----------+---------------------+ +| *Getter* | is_compressed() | ++-----------+---------------------+ + +---- + +.. _class_GIProbeData_property_dynamic_data: + +- :ref:`PoolIntArray` **dynamic_data** + ++-----------+-------------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+-------------------------+ +| *Setter* | set_dynamic_data(value) | ++-----------+-------------------------+ +| *Getter* | get_dynamic_data() | ++-----------+-------------------------+ + +---- + +.. _class_GIProbeData_property_dynamic_range: + +- :ref:`int` **dynamic_range** + ++-----------+--------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------+ +| *Setter* | set_dynamic_range(value) | ++-----------+--------------------------+ +| *Getter* | get_dynamic_range() | ++-----------+--------------------------+ + +---- + +.. _class_GIProbeData_property_energy: + +- :ref:`float` **energy** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_energy(value) | ++-----------+-------------------+ +| *Getter* | get_energy() | ++-----------+-------------------+ + +---- + +.. _class_GIProbeData_property_interior: + +- :ref:`bool` **interior** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_interior(value) | ++-----------+---------------------+ +| *Getter* | is_interior() | ++-----------+---------------------+ + +---- + +.. _class_GIProbeData_property_normal_bias: + +- :ref:`float` **normal_bias** + ++-----------+------------------------+ +| *Default* | ``0.4`` | ++-----------+------------------------+ +| *Setter* | set_normal_bias(value) | ++-----------+------------------------+ +| *Getter* | get_normal_bias() | ++-----------+------------------------+ + +---- + +.. _class_GIProbeData_property_propagation: + +- :ref:`float` **propagation** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_propagation(value) | ++-----------+------------------------+ +| *Getter* | get_propagation() | ++-----------+------------------------+ + +---- + +.. _class_GIProbeData_property_to_cell_xform: + +- :ref:`Transform` **to_cell_xform** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_to_cell_xform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_to_cell_xform() | ++-----------+-----------------------------------------------------+ + +.. |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.)` diff --git a/classes/class_gltfaccessor.rst b/classes/class_gltfaccessor.rst new file mode 100644 index 0000000..388c1a9 --- /dev/null +++ b/classes/class_gltfaccessor.rst @@ -0,0 +1,248 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFAccessor.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFAccessor: + +GLTFAccessor +============ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`buffer_view` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`byte_offset` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`component_type` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`count` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`PoolRealArray` | :ref:`max` | ``PoolRealArray( )`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`PoolRealArray` | :ref:`min` | ``PoolRealArray( )`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`normalized` | ``false`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_count` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_indices_buffer_view` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_indices_byte_offset` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_indices_component_type` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_values_buffer_view` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`sparse_values_byte_offset` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`type` | ``0`` | ++-------------------------------------------+-------------------------------------------------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFAccessor_property_buffer_view: + +- :ref:`int` **buffer_view** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_buffer_view(value) | ++-----------+------------------------+ +| *Getter* | get_buffer_view() | ++-----------+------------------------+ + +---- + +.. _class_GLTFAccessor_property_byte_offset: + +- :ref:`int` **byte_offset** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_byte_offset(value) | ++-----------+------------------------+ +| *Getter* | get_byte_offset() | ++-----------+------------------------+ + +---- + +.. _class_GLTFAccessor_property_component_type: + +- :ref:`int` **component_type** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_component_type(value) | ++-----------+---------------------------+ +| *Getter* | get_component_type() | ++-----------+---------------------------+ + +---- + +.. _class_GLTFAccessor_property_count: + +- :ref:`int` **count** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_count(value) | ++-----------+------------------+ +| *Getter* | get_count() | ++-----------+------------------+ + +---- + +.. _class_GLTFAccessor_property_max: + +- :ref:`PoolRealArray` **max** + ++-----------+-----------------------+ +| *Default* | ``PoolRealArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_max(value) | ++-----------+-----------------------+ +| *Getter* | get_max() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFAccessor_property_min: + +- :ref:`PoolRealArray` **min** + ++-----------+-----------------------+ +| *Default* | ``PoolRealArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_min(value) | ++-----------+-----------------------+ +| *Getter* | get_min() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFAccessor_property_normalized: + +- :ref:`bool` **normalized** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_normalized(value) | ++-----------+-----------------------+ +| *Getter* | get_normalized() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_count: + +- :ref:`int` **sparse_count** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_sparse_count(value) | ++-----------+-------------------------+ +| *Getter* | get_sparse_count() | ++-----------+-------------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_indices_buffer_view: + +- :ref:`int` **sparse_indices_buffer_view** + ++-----------+---------------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------------+ +| *Setter* | set_sparse_indices_buffer_view(value) | ++-----------+---------------------------------------+ +| *Getter* | get_sparse_indices_buffer_view() | ++-----------+---------------------------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_indices_byte_offset: + +- :ref:`int` **sparse_indices_byte_offset** + ++-----------+---------------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------------+ +| *Setter* | set_sparse_indices_byte_offset(value) | ++-----------+---------------------------------------+ +| *Getter* | get_sparse_indices_byte_offset() | ++-----------+---------------------------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_indices_component_type: + +- :ref:`int` **sparse_indices_component_type** + ++-----------+------------------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------------------+ +| *Setter* | set_sparse_indices_component_type(value) | ++-----------+------------------------------------------+ +| *Getter* | get_sparse_indices_component_type() | ++-----------+------------------------------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_values_buffer_view: + +- :ref:`int` **sparse_values_buffer_view** + ++-----------+--------------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------------+ +| *Setter* | set_sparse_values_buffer_view(value) | ++-----------+--------------------------------------+ +| *Getter* | get_sparse_values_buffer_view() | ++-----------+--------------------------------------+ + +---- + +.. _class_GLTFAccessor_property_sparse_values_byte_offset: + +- :ref:`int` **sparse_values_byte_offset** + ++-----------+--------------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------------+ +| *Setter* | set_sparse_values_byte_offset(value) | ++-----------+--------------------------------------+ +| *Getter* | get_sparse_values_byte_offset() | ++-----------+--------------------------------------+ + +---- + +.. _class_GLTFAccessor_property_type: + +- :ref:`int` **type** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_type(value) | ++-----------+-----------------+ +| *Getter* | get_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.)` diff --git a/classes/class_gltfanimation.rst b/classes/class_gltfanimation.rst new file mode 100644 index 0000000..268c9be --- /dev/null +++ b/classes/class_gltfanimation.rst @@ -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 GLTFAnimation.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFAnimation: + +GLTFAnimation +============= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------+------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`loop` | ``false`` | ++-------------------------+------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_GLTFAnimation_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | get_loop() | ++-----------+-----------------+ + +.. |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.)` diff --git a/classes/class_gltfbufferview.rst b/classes/class_gltfbufferview.rst new file mode 100644 index 0000000..4461fdf --- /dev/null +++ b/classes/class_gltfbufferview.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFBufferView.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFBufferView: + +GLTFBufferView +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`buffer` | ``-1`` | ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`byte_length` | ``0`` | ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`byte_offset` | ``0`` | ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`byte_stride` | ``-1`` | ++-------------------------+---------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`indices` | ``false`` | ++-------------------------+---------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_GLTFBufferView_property_buffer: + +- :ref:`int` **buffer** + ++-----------+-------------------+ +| *Default* | ``-1`` | ++-----------+-------------------+ +| *Setter* | set_buffer(value) | ++-----------+-------------------+ +| *Getter* | get_buffer() | ++-----------+-------------------+ + +---- + +.. _class_GLTFBufferView_property_byte_length: + +- :ref:`int` **byte_length** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_byte_length(value) | ++-----------+------------------------+ +| *Getter* | get_byte_length() | ++-----------+------------------------+ + +---- + +.. _class_GLTFBufferView_property_byte_offset: + +- :ref:`int` **byte_offset** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_byte_offset(value) | ++-----------+------------------------+ +| *Getter* | get_byte_offset() | ++-----------+------------------------+ + +---- + +.. _class_GLTFBufferView_property_byte_stride: + +- :ref:`int` **byte_stride** + ++-----------+------------------------+ +| *Default* | ``-1`` | ++-----------+------------------------+ +| *Setter* | set_byte_stride(value) | ++-----------+------------------------+ +| *Getter* | get_byte_stride() | ++-----------+------------------------+ + +---- + +.. _class_GLTFBufferView_property_indices: + +- :ref:`bool` **indices** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_indices(value) | ++-----------+--------------------+ +| *Getter* | get_indices() | ++-----------+--------------------+ + +.. |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.)` diff --git a/classes/class_gltfcamera.rst b/classes/class_gltfcamera.rst new file mode 100644 index 0000000..5a2349a --- /dev/null +++ b/classes/class_gltfcamera.rst @@ -0,0 +1,88 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFCamera.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFCamera: + +GLTFCamera +========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------+-----------------------------------------------------------+------------+ +| :ref:`float` | :ref:`fov_size` | ``75.0`` | ++---------------------------+-----------------------------------------------------------+------------+ +| :ref:`bool` | :ref:`perspective` | ``true`` | ++---------------------------+-----------------------------------------------------------+------------+ +| :ref:`float` | :ref:`zfar` | ``4000.0`` | ++---------------------------+-----------------------------------------------------------+------------+ +| :ref:`float` | :ref:`znear` | ``0.05`` | ++---------------------------+-----------------------------------------------------------+------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFCamera_property_fov_size: + +- :ref:`float` **fov_size** + ++-----------+---------------------+ +| *Default* | ``75.0`` | ++-----------+---------------------+ +| *Setter* | set_fov_size(value) | ++-----------+---------------------+ +| *Getter* | get_fov_size() | ++-----------+---------------------+ + +---- + +.. _class_GLTFCamera_property_perspective: + +- :ref:`bool` **perspective** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_perspective(value) | ++-----------+------------------------+ +| *Getter* | get_perspective() | ++-----------+------------------------+ + +---- + +.. _class_GLTFCamera_property_zfar: + +- :ref:`float` **zfar** + ++-----------+-----------------+ +| *Default* | ``4000.0`` | ++-----------+-----------------+ +| *Setter* | set_zfar(value) | ++-----------+-----------------+ +| *Getter* | get_zfar() | ++-----------+-----------------+ + +---- + +.. _class_GLTFCamera_property_znear: + +- :ref:`float` **znear** + ++-----------+------------------+ +| *Default* | ``0.05`` | ++-----------+------------------+ +| *Setter* | set_znear(value) | ++-----------+------------------+ +| *Getter* | get_znear() | ++-----------+------------------+ + +.. |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.)` diff --git a/classes/class_gltfdocument.rst b/classes/class_gltfdocument.rst new file mode 100644 index 0000000..94d7e6b --- /dev/null +++ b/classes/class_gltfdocument.rst @@ -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 GLTFDocument.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFDocument: + +GLTFDocument +============ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_gltflight.rst b/classes/class_gltflight.rst new file mode 100644 index 0000000..0fc942a --- /dev/null +++ b/classes/class_gltflight.rst @@ -0,0 +1,136 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFLight.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFLight: + +GLTFLight +========= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`inner_cone_angle` | ``0.0`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`intensity` | ``1.0`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`outer_cone_angle` | ``0.785398`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`range` | ``inf`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`type` | ``""`` | ++-----------------------------+--------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFLight_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The :ref:`Color` of the light. Defaults to white. A black color causes the light to have no effect. + +---- + +.. _class_GLTFLight_property_inner_cone_angle: + +- :ref:`float` **inner_cone_angle** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_inner_cone_angle(value) | ++-----------+-----------------------------+ +| *Getter* | get_inner_cone_angle() | ++-----------+-----------------------------+ + +The inner angle of the cone in a spotlight. Must be less than or equal to the outer cone angle. + +Within this angle, the light is at full brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. When creating a Godot :ref:`SpotLight`, the ratio between the inner and outer cone angles is used to calculate the attenuation of the light. + +---- + +.. _class_GLTFLight_property_intensity: + +- :ref:`float` **intensity** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_intensity(value) | ++-----------+----------------------+ +| *Getter* | get_intensity() | ++-----------+----------------------+ + +The intensity of the light. This is expressed in candelas (lumens per steradian) for point and spot lights, and lux (lumens per m²) for directional lights. When creating a Godot light, this value is converted to a unitless multiplier. + +---- + +.. _class_GLTFLight_property_outer_cone_angle: + +- :ref:`float` **outer_cone_angle** + ++-----------+-----------------------------+ +| *Default* | ``0.785398`` | ++-----------+-----------------------------+ +| *Setter* | set_outer_cone_angle(value) | ++-----------+-----------------------------+ +| *Getter* | get_outer_cone_angle() | ++-----------+-----------------------------+ + +The outer angle of the cone in a spotlight. Must be greater than or equal to the inner angle. + +At this angle, the light drops off to zero brightness. Between the inner and outer cone angles, there is a transition from full brightness to zero brightness. If this angle is a half turn, then the spotlight emits in all directions. When creating a Godot :ref:`SpotLight`, the outer cone angle is used as the angle of the spotlight. + +---- + +.. _class_GLTFLight_property_range: + +- :ref:`float` **range** + ++-----------+------------------+ +| *Default* | ``inf`` | ++-----------+------------------+ +| *Setter* | set_range(value) | ++-----------+------------------+ +| *Getter* | get_range() | ++-----------+------------------+ + +The range of the light, beyond which the light has no effect. GLTF lights with no range defined behave like physical lights (which have infinite range). When creating a Godot light, the range is clamped to 4096. + +---- + +.. _class_GLTFLight_property_type: + +- :ref:`String` **type** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_type(value) | ++-----------+-----------------+ +| *Getter* | get_type() | ++-----------+-----------------+ + +The type of the light. The values accepted by Godot are "point", "spot", and "directional", which correspond to Godot's :ref:`OmniLight`, :ref:`SpotLight`, and :ref:`DirectionalLight` respectively. + +.. |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.)` diff --git a/classes/class_gltfmesh.rst b/classes/class_gltfmesh.rst new file mode 100644 index 0000000..ba2a51f --- /dev/null +++ b/classes/class_gltfmesh.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFMesh: + +GLTFMesh +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+-----------------------------------------------------------------------+-----------------------+ +| :ref:`PoolRealArray` | :ref:`blend_weights` | ``PoolRealArray( )`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------------------+ +| :ref:`Array` | :ref:`instance_materials` | ``[ ]`` | ++-------------------------------------------+-----------------------------------------------------------------------+-----------------------+ +| :ref:`ArrayMesh` | :ref:`mesh` | | ++-------------------------------------------+-----------------------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFMesh_property_blend_weights: + +- :ref:`PoolRealArray` **blend_weights** + ++-----------+--------------------------+ +| *Default* | ``PoolRealArray( )`` | ++-----------+--------------------------+ +| *Setter* | set_blend_weights(value) | ++-----------+--------------------------+ +| *Getter* | get_blend_weights() | ++-----------+--------------------------+ + +---- + +.. _class_GLTFMesh_property_instance_materials: + +- :ref:`Array` **instance_materials** + ++-----------+-------------------------------+ +| *Default* | ``[ ]`` | ++-----------+-------------------------------+ +| *Setter* | set_instance_materials(value) | ++-----------+-------------------------------+ +| *Getter* | get_instance_materials() | ++-----------+-------------------------------+ + +---- + +.. _class_GLTFMesh_property_mesh: + +- :ref:`ArrayMesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +.. |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.)` diff --git a/classes/class_gltfnode.rst b/classes/class_gltfnode.rst new file mode 100644 index 0000000..00a4ed1 --- /dev/null +++ b/classes/class_gltfnode.rst @@ -0,0 +1,232 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFNode: + +GLTFNode +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`camera` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`children` | ``PoolIntArray( )`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`height` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`joint` | ``false`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`light` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`mesh` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`parent` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Quat` | :ref:`rotation` | ``Quat( 0, 0, 0, 1 )`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`scale` | ``Vector3( 1, 1, 1 )`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`skeleton` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`skin` | ``-1`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`translation` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`xform` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------------+---------------------------------------------------------+-----------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFNode_property_camera: + +- :ref:`int` **camera** + ++-----------+-------------------+ +| *Default* | ``-1`` | ++-----------+-------------------+ +| *Setter* | set_camera(value) | ++-----------+-------------------+ +| *Getter* | get_camera() | ++-----------+-------------------+ + +---- + +.. _class_GLTFNode_property_children: + +- :ref:`PoolIntArray` **children** + ++-----------+----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------+ +| *Setter* | set_children(value) | ++-----------+----------------------+ +| *Getter* | get_children() | ++-----------+----------------------+ + +---- + +.. _class_GLTFNode_property_height: + +- :ref:`int` **height** + ++-----------+-------------------+ +| *Default* | ``-1`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +---- + +.. _class_GLTFNode_property_joint: + +- :ref:`bool` **joint** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_joint(value) | ++-----------+------------------+ +| *Getter* | get_joint() | ++-----------+------------------+ + +---- + +.. _class_GLTFNode_property_light: + +- :ref:`int` **light** + ++-----------+------------------+ +| *Default* | ``-1`` | ++-----------+------------------+ +| *Setter* | set_light(value) | ++-----------+------------------+ +| *Getter* | get_light() | ++-----------+------------------+ + +---- + +.. _class_GLTFNode_property_mesh: + +- :ref:`int` **mesh** + ++-----------+-----------------+ +| *Default* | ``-1`` | ++-----------+-----------------+ +| *Setter* | set_mesh(value) | ++-----------+-----------------+ +| *Getter* | get_mesh() | ++-----------+-----------------+ + +---- + +.. _class_GLTFNode_property_parent: + +- :ref:`int` **parent** + ++-----------+-------------------+ +| *Default* | ``-1`` | ++-----------+-------------------+ +| *Setter* | set_parent(value) | ++-----------+-------------------+ +| *Getter* | get_parent() | ++-----------+-------------------+ + +---- + +.. _class_GLTFNode_property_rotation: + +- :ref:`Quat` **rotation** + ++-----------+------------------------+ +| *Default* | ``Quat( 0, 0, 0, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_rotation(value) | ++-----------+------------------------+ +| *Getter* | get_rotation() | ++-----------+------------------------+ + +---- + +.. _class_GLTFNode_property_scale: + +- :ref:`Vector3` **scale** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_scale(value) | ++-----------+------------------------+ +| *Getter* | get_scale() | ++-----------+------------------------+ + +---- + +.. _class_GLTFNode_property_skeleton: + +- :ref:`int` **skeleton** + ++-----------+---------------------+ +| *Default* | ``-1`` | ++-----------+---------------------+ +| *Setter* | set_skeleton(value) | ++-----------+---------------------+ +| *Getter* | get_skeleton() | ++-----------+---------------------+ + +---- + +.. _class_GLTFNode_property_skin: + +- :ref:`int` **skin** + ++-----------+-----------------+ +| *Default* | ``-1`` | ++-----------+-----------------+ +| *Setter* | set_skin(value) | ++-----------+-----------------+ +| *Getter* | get_skin() | ++-----------+-----------------+ + +---- + +.. _class_GLTFNode_property_translation: + +- :ref:`Vector3` **translation** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_translation(value) | ++-----------+------------------------+ +| *Getter* | get_translation() | ++-----------+------------------------+ + +---- + +.. _class_GLTFNode_property_xform: + +- :ref:`Transform` **xform** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_xform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_xform() | ++-----------+-----------------------------------------------------+ + +.. |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.)` diff --git a/classes/class_gltfskeleton.rst b/classes/class_gltfskeleton.rst new file mode 100644 index 0000000..85ffa42 --- /dev/null +++ b/classes/class_gltfskeleton.rst @@ -0,0 +1,118 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFSkeleton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFSkeleton: + +GLTFSkeleton +============ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------+---------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`joints` | ``PoolIntArray( )`` | ++-----------------------------------------+---------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`roots` | ``PoolIntArray( )`` | ++-----------------------------------------+---------------------------------------------------+----------------------+ + +Methods +------- + ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BoneAttachment` | :ref:`get_bone_attachment` **(** :ref:`int` idx **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_attachment_count` **(** **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_godot_bone_node` **(** **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Skeleton` | :ref:`get_godot_skeleton` **(** **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_unique_names` **(** **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_godot_bone_node` **(** :ref:`Dictionary` godot_bone_node **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_unique_names` **(** :ref:`Array` unique_names **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFSkeleton_property_joints: + +- :ref:`PoolIntArray` **joints** + ++-----------+----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------+ +| *Setter* | set_joints(value) | ++-----------+----------------------+ +| *Getter* | get_joints() | ++-----------+----------------------+ + +---- + +.. _class_GLTFSkeleton_property_roots: + +- :ref:`PoolIntArray` **roots** + ++-----------+----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------+ +| *Setter* | set_roots(value) | ++-----------+----------------------+ +| *Getter* | get_roots() | ++-----------+----------------------+ + +Method Descriptions +------------------- + +.. _class_GLTFSkeleton_method_get_bone_attachment: + +- :ref:`BoneAttachment` **get_bone_attachment** **(** :ref:`int` idx **)** + +---- + +.. _class_GLTFSkeleton_method_get_bone_attachment_count: + +- :ref:`int` **get_bone_attachment_count** **(** **)** + +---- + +.. _class_GLTFSkeleton_method_get_godot_bone_node: + +- :ref:`Dictionary` **get_godot_bone_node** **(** **)** + +---- + +.. _class_GLTFSkeleton_method_get_godot_skeleton: + +- :ref:`Skeleton` **get_godot_skeleton** **(** **)** + +---- + +.. _class_GLTFSkeleton_method_get_unique_names: + +- :ref:`Array` **get_unique_names** **(** **)** + +---- + +.. _class_GLTFSkeleton_method_set_godot_bone_node: + +- void **set_godot_bone_node** **(** :ref:`Dictionary` godot_bone_node **)** + +---- + +.. _class_GLTFSkeleton_method_set_unique_names: + +- void **set_unique_names** **(** :ref:`Array` unique_names **)** + +.. |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.)` diff --git a/classes/class_gltfskin.rst b/classes/class_gltfskin.rst new file mode 100644 index 0000000..18ea5e0 --- /dev/null +++ b/classes/class_gltfskin.rst @@ -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 GLTFSkin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFSkin: + +GLTFSkin +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`Skin` | :ref:`godot_skin` | | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`joints` | ``PoolIntArray( )`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`joints_original` | ``PoolIntArray( )`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`non_joints` | ``PoolIntArray( )`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`PoolIntArray` | :ref:`roots` | ``PoolIntArray( )`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`int` | :ref:`skeleton` | ``-1`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ +| :ref:`int` | :ref:`skin_root` | ``-1`` | ++-----------------------------------------+-----------------------------------------------------------------+----------------------+ + +Methods +------- + ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_inverse_binds` **(** **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_joint_i_to_bone_i` **(** **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_joint_i_to_name` **(** **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_inverse_binds` **(** :ref:`Array` inverse_binds **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_joint_i_to_bone_i` **(** :ref:`Dictionary` joint_i_to_bone_i **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_joint_i_to_name` **(** :ref:`Dictionary` joint_i_to_name **)** | ++-------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFSkin_property_godot_skin: + +- :ref:`Skin` **godot_skin** + ++----------+-----------------------+ +| *Setter* | set_godot_skin(value) | ++----------+-----------------------+ +| *Getter* | get_godot_skin() | ++----------+-----------------------+ + +---- + +.. _class_GLTFSkin_property_joints: + +- :ref:`PoolIntArray` **joints** + ++-----------+----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------+ +| *Setter* | set_joints(value) | ++-----------+----------------------+ +| *Getter* | get_joints() | ++-----------+----------------------+ + +---- + +.. _class_GLTFSkin_property_joints_original: + +- :ref:`PoolIntArray` **joints_original** + ++-----------+----------------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------------+ +| *Setter* | set_joints_original(value) | ++-----------+----------------------------+ +| *Getter* | get_joints_original() | ++-----------+----------------------------+ + +---- + +.. _class_GLTFSkin_property_non_joints: + +- :ref:`PoolIntArray` **non_joints** + ++-----------+-----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_non_joints(value) | ++-----------+-----------------------+ +| *Getter* | get_non_joints() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFSkin_property_roots: + +- :ref:`PoolIntArray` **roots** + ++-----------+----------------------+ +| *Default* | ``PoolIntArray( )`` | ++-----------+----------------------+ +| *Setter* | set_roots(value) | ++-----------+----------------------+ +| *Getter* | get_roots() | ++-----------+----------------------+ + +---- + +.. _class_GLTFSkin_property_skeleton: + +- :ref:`int` **skeleton** + ++-----------+---------------------+ +| *Default* | ``-1`` | ++-----------+---------------------+ +| *Setter* | set_skeleton(value) | ++-----------+---------------------+ +| *Getter* | get_skeleton() | ++-----------+---------------------+ + +---- + +.. _class_GLTFSkin_property_skin_root: + +- :ref:`int` **skin_root** + ++-----------+----------------------+ +| *Default* | ``-1`` | ++-----------+----------------------+ +| *Setter* | set_skin_root(value) | ++-----------+----------------------+ +| *Getter* | get_skin_root() | ++-----------+----------------------+ + +Method Descriptions +------------------- + +.. _class_GLTFSkin_method_get_inverse_binds: + +- :ref:`Array` **get_inverse_binds** **(** **)** + +---- + +.. _class_GLTFSkin_method_get_joint_i_to_bone_i: + +- :ref:`Dictionary` **get_joint_i_to_bone_i** **(** **)** + +---- + +.. _class_GLTFSkin_method_get_joint_i_to_name: + +- :ref:`Dictionary` **get_joint_i_to_name** **(** **)** + +---- + +.. _class_GLTFSkin_method_set_inverse_binds: + +- void **set_inverse_binds** **(** :ref:`Array` inverse_binds **)** + +---- + +.. _class_GLTFSkin_method_set_joint_i_to_bone_i: + +- void **set_joint_i_to_bone_i** **(** :ref:`Dictionary` joint_i_to_bone_i **)** + +---- + +.. _class_GLTFSkin_method_set_joint_i_to_name: + +- void **set_joint_i_to_name** **(** :ref:`Dictionary` joint_i_to_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.)` diff --git a/classes/class_gltfspecgloss.rst b/classes/class_gltfspecgloss.rst new file mode 100644 index 0000000..e0edccc --- /dev/null +++ b/classes/class_gltfspecgloss.rst @@ -0,0 +1,100 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFSpecGloss.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFSpecGloss: + +GLTFSpecGloss +============= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`diffuse_factor` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Image` | :ref:`diffuse_img` | | ++---------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`gloss_factor` | ``1.0`` | ++---------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Image` | :ref:`spec_gloss_img` | | ++---------------------------+----------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`specular_factor` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+----------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFSpecGloss_property_diffuse_factor: + +- :ref:`Color` **diffuse_factor** + ++-----------+---------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+---------------------------+ +| *Setter* | set_diffuse_factor(value) | ++-----------+---------------------------+ +| *Getter* | get_diffuse_factor() | ++-----------+---------------------------+ + +---- + +.. _class_GLTFSpecGloss_property_diffuse_img: + +- :ref:`Image` **diffuse_img** + ++----------+------------------------+ +| *Setter* | set_diffuse_img(value) | ++----------+------------------------+ +| *Getter* | get_diffuse_img() | ++----------+------------------------+ + +---- + +.. _class_GLTFSpecGloss_property_gloss_factor: + +- :ref:`float` **gloss_factor** + ++-----------+-------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------+ +| *Setter* | set_gloss_factor(value) | ++-----------+-------------------------+ +| *Getter* | get_gloss_factor() | ++-----------+-------------------------+ + +---- + +.. _class_GLTFSpecGloss_property_spec_gloss_img: + +- :ref:`Image` **spec_gloss_img** + ++----------+---------------------------+ +| *Setter* | set_spec_gloss_img(value) | ++----------+---------------------------+ +| *Getter* | get_spec_gloss_img() | ++----------+---------------------------+ + +---- + +.. _class_GLTFSpecGloss_property_specular_factor: + +- :ref:`Color` **specular_factor** + ++-----------+----------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+----------------------------+ +| *Setter* | set_specular_factor(value) | ++-----------+----------------------------+ +| *Getter* | get_specular_factor() | ++-----------+----------------------------+ + +.. |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.)` diff --git a/classes/class_gltfstate.rst b/classes/class_gltfstate.rst new file mode 100644 index 0000000..7e5d686 --- /dev/null +++ b/classes/class_gltfstate.rst @@ -0,0 +1,422 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GLTFState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFState: + +GLTFState +========= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`Array` | :ref:`buffers` | ``[ ]`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`glb_data` | ``PoolByteArray( )`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`Dictionary` | :ref:`json` | ``{}`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`major_version` | ``0`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`int` | :ref:`minor_version` | ``0`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`Array` | :ref:`root_nodes` | ``[ ]`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`String` | :ref:`scene_name` | ``""`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ +| :ref:`bool` | :ref:`use_named_skin_binds` | ``false`` | ++-------------------------------------------+----------------------------------------------------------------------------+-----------------------+ + +Methods +------- + ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_accessors` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AnimationPlayer` | :ref:`get_animation_player` **(** :ref:`int` idx **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_animation_players_count` **(** :ref:`int` idx **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_animations` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_buffer_views` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_cameras` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_images` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_lights` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_materials` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_meshes` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_nodes` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_scene_node` **(** :ref:`int` idx **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_skeleton_to_node` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_skeletons` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_skins` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_textures` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_unique_animation_names` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_unique_names` **(** **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_accessors` **(** :ref:`Array` accessors **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_animations` **(** :ref:`Array` animations **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_buffer_views` **(** :ref:`Array` buffer_views **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cameras` **(** :ref:`Array` cameras **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_images` **(** :ref:`Array` images **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_lights` **(** :ref:`Array` lights **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_materials` **(** :ref:`Array` materials **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_meshes` **(** :ref:`Array` meshes **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_nodes` **(** :ref:`Array` nodes **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skeleton_to_node` **(** :ref:`Dictionary` skeleton_to_node **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skeletons` **(** :ref:`Array` skeletons **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_skins` **(** :ref:`Array` skins **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_textures` **(** :ref:`Array` textures **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_unique_animation_names` **(** :ref:`Array` unique_animation_names **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_unique_names` **(** :ref:`Array` unique_names **)** | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_GLTFState_property_buffers: + +- :ref:`Array` **buffers** + ++-----------+--------------------+ +| *Default* | ``[ ]`` | ++-----------+--------------------+ +| *Setter* | set_buffers(value) | ++-----------+--------------------+ +| *Getter* | get_buffers() | ++-----------+--------------------+ + +---- + +.. _class_GLTFState_property_glb_data: + +- :ref:`PoolByteArray` **glb_data** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_glb_data(value) | ++-----------+-----------------------+ +| *Getter* | get_glb_data() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFState_property_json: + +- :ref:`Dictionary` **json** + ++-----------+-----------------+ +| *Default* | ``{}`` | ++-----------+-----------------+ +| *Setter* | set_json(value) | ++-----------+-----------------+ +| *Getter* | get_json() | ++-----------+-----------------+ + +---- + +.. _class_GLTFState_property_major_version: + +- :ref:`int` **major_version** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_major_version(value) | ++-----------+--------------------------+ +| *Getter* | get_major_version() | ++-----------+--------------------------+ + +---- + +.. _class_GLTFState_property_minor_version: + +- :ref:`int` **minor_version** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_minor_version(value) | ++-----------+--------------------------+ +| *Getter* | get_minor_version() | ++-----------+--------------------------+ + +---- + +.. _class_GLTFState_property_root_nodes: + +- :ref:`Array` **root_nodes** + ++-----------+-----------------------+ +| *Default* | ``[ ]`` | ++-----------+-----------------------+ +| *Setter* | set_root_nodes(value) | ++-----------+-----------------------+ +| *Getter* | get_root_nodes() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFState_property_scene_name: + +- :ref:`String` **scene_name** + ++-----------+-----------------------+ +| *Default* | ``""`` | ++-----------+-----------------------+ +| *Setter* | set_scene_name(value) | ++-----------+-----------------------+ +| *Getter* | get_scene_name() | ++-----------+-----------------------+ + +---- + +.. _class_GLTFState_property_use_named_skin_binds: + +- :ref:`bool` **use_named_skin_binds** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_use_named_skin_binds(value) | ++-----------+---------------------------------+ +| *Getter* | get_use_named_skin_binds() | ++-----------+---------------------------------+ + +Method Descriptions +------------------- + +.. _class_GLTFState_method_get_accessors: + +- :ref:`Array` **get_accessors** **(** **)** + +---- + +.. _class_GLTFState_method_get_animation_player: + +- :ref:`AnimationPlayer` **get_animation_player** **(** :ref:`int` idx **)** + +---- + +.. _class_GLTFState_method_get_animation_players_count: + +- :ref:`int` **get_animation_players_count** **(** :ref:`int` idx **)** + +---- + +.. _class_GLTFState_method_get_animations: + +- :ref:`Array` **get_animations** **(** **)** + +---- + +.. _class_GLTFState_method_get_buffer_views: + +- :ref:`Array` **get_buffer_views** **(** **)** + +---- + +.. _class_GLTFState_method_get_cameras: + +- :ref:`Array` **get_cameras** **(** **)** + +---- + +.. _class_GLTFState_method_get_images: + +- :ref:`Array` **get_images** **(** **)** + +---- + +.. _class_GLTFState_method_get_lights: + +- :ref:`Array` **get_lights** **(** **)** + +---- + +.. _class_GLTFState_method_get_materials: + +- :ref:`Array` **get_materials** **(** **)** + +---- + +.. _class_GLTFState_method_get_meshes: + +- :ref:`Array` **get_meshes** **(** **)** + +---- + +.. _class_GLTFState_method_get_nodes: + +- :ref:`Array` **get_nodes** **(** **)** + +---- + +.. _class_GLTFState_method_get_scene_node: + +- :ref:`Node` **get_scene_node** **(** :ref:`int` idx **)** + +---- + +.. _class_GLTFState_method_get_skeleton_to_node: + +- :ref:`Dictionary` **get_skeleton_to_node** **(** **)** + +---- + +.. _class_GLTFState_method_get_skeletons: + +- :ref:`Array` **get_skeletons** **(** **)** + +---- + +.. _class_GLTFState_method_get_skins: + +- :ref:`Array` **get_skins** **(** **)** + +---- + +.. _class_GLTFState_method_get_textures: + +- :ref:`Array` **get_textures** **(** **)** + +---- + +.. _class_GLTFState_method_get_unique_animation_names: + +- :ref:`Array` **get_unique_animation_names** **(** **)** + +---- + +.. _class_GLTFState_method_get_unique_names: + +- :ref:`Array` **get_unique_names** **(** **)** + +---- + +.. _class_GLTFState_method_set_accessors: + +- void **set_accessors** **(** :ref:`Array` accessors **)** + +---- + +.. _class_GLTFState_method_set_animations: + +- void **set_animations** **(** :ref:`Array` animations **)** + +---- + +.. _class_GLTFState_method_set_buffer_views: + +- void **set_buffer_views** **(** :ref:`Array` buffer_views **)** + +---- + +.. _class_GLTFState_method_set_cameras: + +- void **set_cameras** **(** :ref:`Array` cameras **)** + +---- + +.. _class_GLTFState_method_set_images: + +- void **set_images** **(** :ref:`Array` images **)** + +---- + +.. _class_GLTFState_method_set_lights: + +- void **set_lights** **(** :ref:`Array` lights **)** + +---- + +.. _class_GLTFState_method_set_materials: + +- void **set_materials** **(** :ref:`Array` materials **)** + +---- + +.. _class_GLTFState_method_set_meshes: + +- void **set_meshes** **(** :ref:`Array` meshes **)** + +---- + +.. _class_GLTFState_method_set_nodes: + +- void **set_nodes** **(** :ref:`Array` nodes **)** + +---- + +.. _class_GLTFState_method_set_skeleton_to_node: + +- void **set_skeleton_to_node** **(** :ref:`Dictionary` skeleton_to_node **)** + +---- + +.. _class_GLTFState_method_set_skeletons: + +- void **set_skeletons** **(** :ref:`Array` skeletons **)** + +---- + +.. _class_GLTFState_method_set_skins: + +- void **set_skins** **(** :ref:`Array` skins **)** + +---- + +.. _class_GLTFState_method_set_textures: + +- void **set_textures** **(** :ref:`Array` textures **)** + +---- + +.. _class_GLTFState_method_set_unique_animation_names: + +- void **set_unique_animation_names** **(** :ref:`Array` unique_animation_names **)** + +---- + +.. _class_GLTFState_method_set_unique_names: + +- void **set_unique_names** **(** :ref:`Array` unique_names **)** + +.. |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.)` diff --git a/classes/class_gltftexture.rst b/classes/class_gltftexture.rst new file mode 100644 index 0000000..49e38ee --- /dev/null +++ b/classes/class_gltftexture.rst @@ -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 GLTFTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GLTFTexture: + +GLTFTexture +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------+--------------------------------------------------------+-------+ +| :ref:`int` | :ref:`src_image` | ``0`` | ++-----------------------+--------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_GLTFTexture_property_src_image: + +- :ref:`int` **src_image** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_src_image(value) | ++-----------+----------------------+ +| *Getter* | get_src_image() | ++-----------+----------------------+ + +.. |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.)` diff --git a/classes/class_godotsharp.rst b/classes/class_godotsharp.rst new file mode 100644 index 0000000..d4b316d --- /dev/null +++ b/classes/class_godotsharp.rst @@ -0,0 +1,115 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GodotSharp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GodotSharp: + +GodotSharp +========== + +**Inherits:** :ref:`Object` + +Bridge between Godot and the Mono runtime (Mono-enabled builds only). + +Description +----------- + +This class is a bridge between Godot and the Mono runtime. It exposes several low-level operations and is only available in Mono-enabled Godot builds. + +See also :ref:`CSharpScript`. + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`attach_thread` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`detach_thread` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_domain_id` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_scripts_domain_id` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_domain_finalizing_for_unload` **(** :ref:`int` domain_id **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_runtime_initialized` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_runtime_shutting_down` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_scripts_domain_loaded` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_GodotSharp_method_attach_thread: + +- void **attach_thread** **(** **)** + +Attaches the current thread to the Mono runtime. + +---- + +.. _class_GodotSharp_method_detach_thread: + +- void **detach_thread** **(** **)** + +Detaches the current thread from the Mono runtime. + +---- + +.. _class_GodotSharp_method_get_domain_id: + +- :ref:`int` **get_domain_id** **(** **)** + +Returns the current MonoDomain ID. + +**Note:** The Mono runtime must be initialized for this method to work (use :ref:`is_runtime_initialized` to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. + +---- + +.. _class_GodotSharp_method_get_scripts_domain_id: + +- :ref:`int` **get_scripts_domain_id** **(** **)** + +Returns the scripts MonoDomain's ID. This will be the same MonoDomain ID as :ref:`get_domain_id`, unless the scripts domain isn't loaded. + +**Note:** The Mono runtime must be initialized for this method to work (use :ref:`is_runtime_initialized` to check). If the Mono runtime isn't initialized at the time this method is called, the engine will crash. + +---- + +.. _class_GodotSharp_method_is_domain_finalizing_for_unload: + +- :ref:`bool` **is_domain_finalizing_for_unload** **(** :ref:`int` domain_id **)** + +Returns ``true`` if the domain is being finalized, ``false`` otherwise. + +---- + +.. _class_GodotSharp_method_is_runtime_initialized: + +- :ref:`bool` **is_runtime_initialized** **(** **)** + +Returns ``true`` if the Mono runtime is initialized, ``false`` otherwise. + +---- + +.. _class_GodotSharp_method_is_runtime_shutting_down: + +- :ref:`bool` **is_runtime_shutting_down** **(** **)** + +Returns ``true`` if the Mono runtime is shutting down, ``false`` otherwise. + +---- + +.. _class_GodotSharp_method_is_scripts_domain_loaded: + +- :ref:`bool` **is_scripts_domain_loaded** **(** **)** + +Returns ``true`` if the scripts domain is loaded, ``false`` otherwise. + +.. |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.)` diff --git a/classes/class_gradient.rst b/classes/class_gradient.rst new file mode 100644 index 0000000..5fa7d68 --- /dev/null +++ b/classes/class_gradient.rst @@ -0,0 +1,151 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Gradient.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Gradient: + +Gradient +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A color interpolator resource which can be used to generate colors between user-defined color points. + +Description +----------- + +Given a set of colors, this resource will interpolate them in order. This means that if you have color 1, color 2 and color 3, the ramp will interpolate from color 1 to color 2 and from color 2 to color 3. The ramp will initially have 2 colors (black and white), one (black) at ramp lower offset 0 and the other (white) at the ramp higher offset 1. + +Properties +---------- + ++---------------------------------------------+-------------------------------------------------+----------------------------------------------+ +| :ref:`PoolColorArray` | :ref:`colors` | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` | ++---------------------------------------------+-------------------------------------------------+----------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`offsets` | ``PoolRealArray( 0, 1 )`` | ++---------------------------------------------+-------------------------------------------------+----------------------------------------------+ + +Methods +------- + ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`float` offset, :ref:`Color` color **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_color` **(** :ref:`int` point **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_offset` **(** :ref:`int` point **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`interpolate` **(** :ref:`float` offset **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` point **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_color` **(** :ref:`int` point, :ref:`Color` color **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_offset` **(** :ref:`int` point, :ref:`float` offset **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Gradient_property_colors: + +- :ref:`PoolColorArray` **colors** + ++-----------+----------------------------------------------+ +| *Default* | ``PoolColorArray( 0, 0, 0, 1, 1, 1, 1, 1 )`` | ++-----------+----------------------------------------------+ +| *Setter* | set_colors(value) | ++-----------+----------------------------------------------+ +| *Getter* | get_colors() | ++-----------+----------------------------------------------+ + +Gradient's colors returned as a :ref:`PoolColorArray`. + +---- + +.. _class_Gradient_property_offsets: + +- :ref:`PoolRealArray` **offsets** + ++-----------+---------------------------+ +| *Default* | ``PoolRealArray( 0, 1 )`` | ++-----------+---------------------------+ +| *Setter* | set_offsets(value) | ++-----------+---------------------------+ +| *Getter* | get_offsets() | ++-----------+---------------------------+ + +Gradient's offsets returned as a :ref:`PoolRealArray`. + +Method Descriptions +------------------- + +.. _class_Gradient_method_add_point: + +- void **add_point** **(** :ref:`float` offset, :ref:`Color` color **)** + +Adds the specified color to the end of the ramp, with the specified offset. + +---- + +.. _class_Gradient_method_get_color: + +- :ref:`Color` **get_color** **(** :ref:`int` point **)** + +Returns the color of the ramp color at index ``point``. + +---- + +.. _class_Gradient_method_get_offset: + +- :ref:`float` **get_offset** **(** :ref:`int` point **)** + +Returns the offset of the ramp color at index ``point``. + +---- + +.. _class_Gradient_method_get_point_count: + +- :ref:`int` **get_point_count** **(** **)** |const| + +Returns the number of colors in the ramp. + +---- + +.. _class_Gradient_method_interpolate: + +- :ref:`Color` **interpolate** **(** :ref:`float` offset **)** + +Returns the interpolated color specified by ``offset``. + +---- + +.. _class_Gradient_method_remove_point: + +- void **remove_point** **(** :ref:`int` point **)** + +Removes the color at the index ``point``. + +---- + +.. _class_Gradient_method_set_color: + +- void **set_color** **(** :ref:`int` point, :ref:`Color` color **)** + +Sets the color of the ramp color at index ``point``. + +---- + +.. _class_Gradient_method_set_offset: + +- void **set_offset** **(** :ref:`int` point, :ref:`float` offset **)** + +Sets the offset for the ramp color at index ``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.)` diff --git a/classes/class_gradienttexture.rst b/classes/class_gradienttexture.rst new file mode 100644 index 0000000..849ae2c --- /dev/null +++ b/classes/class_gradienttexture.rst @@ -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 GradientTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GradientTexture: + +GradientTexture +=============== + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Gradient-filled texture. + +Description +----------- + +GradientTexture uses a :ref:`Gradient` to fill the texture data. The gradient will be filled from left to right using colors obtained from the gradient. This means the texture does not necessarily represent an exact copy of the gradient, but instead an interpolation of samples obtained from the gradient at fixed steps (see :ref:`width`). + +Properties +---------- + ++---------------------------------+----------------------------------------------------------+----------+ +| :ref:`Gradient` | :ref:`gradient` | | ++---------------------------------+----------------------------------------------------------+----------+ +| :ref:`int` | :ref:`width` | ``2048`` | ++---------------------------------+----------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_GradientTexture_property_gradient: + +- :ref:`Gradient` **gradient** + ++----------+---------------------+ +| *Setter* | set_gradient(value) | ++----------+---------------------+ +| *Getter* | get_gradient() | ++----------+---------------------+ + +The :ref:`Gradient` that will be used to fill the texture. + +---- + +.. _class_GradientTexture_property_width: + +- :ref:`int` **width** + ++-----------+------------------+ +| *Default* | ``2048`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +The number of color samples that will be obtained from the :ref:`Gradient`. + +.. |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.)` diff --git a/classes/class_graphedit.rst b/classes/class_graphedit.rst new file mode 100644 index 0000000..269d849 --- /dev/null +++ b/classes/class_graphedit.rst @@ -0,0 +1,704 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GraphEdit.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GraphEdit: + +GraphEdit +========= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +GraphEdit is an area capable of showing various GraphNodes. It manages connection events between them. + +Description +----------- + +GraphEdit manages the showing of GraphNodes it contains, as well as connections and disconnections between them. Signals are sent for each of these two events. Disconnection between GraphNode slots is disabled by default. + +It is greatly advised to enable low-processor usage mode (see :ref:`OS.low_processor_usage_mode`) when using GraphEdits. + +Properties +---------- + ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`minimap_enabled` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`minimap_opacity` | ``0.65`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`minimap_size` | ``Vector2( 240, 160 )`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`right_disconnects` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_offset` | ``Vector2( 0, 0 )`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`show_zoom_label` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`snap_distance` | ``20`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`use_snap` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`zoom` | ``1.0`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`zoom_max` | ``2.0736`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`zoom_min` | ``0.232568`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`zoom_step` | ``1.2`` | ++------------------------------------------+----------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_valid_connection_type` **(** :ref:`int` from_type, :ref:`int` to_type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_valid_left_disconnect_type` **(** :ref:`int` type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_valid_right_disconnect_type` **(** :ref:`int` type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_connections` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_node` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_node` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_connection_list` **(** **)** |const| | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`HBoxContainer` | :ref:`get_zoom_hbox` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_node_connected` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_connection_type` **(** :ref:`int` from_type, :ref:`int` to_type **)** |const| | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_valid_connection_type` **(** :ref:`int` from_type, :ref:`int` to_type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_valid_left_disconnect_type` **(** :ref:`int` type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_valid_right_disconnect_type` **(** :ref:`int` type **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_connection_activity` **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port, :ref:`float` amount **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_selected` **(** :ref:`Node` node **)** | ++-------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`activity` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`grid_major` | ``Color( 1, 1, 1, 0.2 )`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`grid_minor` | ``Color( 1, 1, 1, 0.05 )`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`selection_fill` | ``Color( 1, 1, 1, 0.3 )`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Color` | :ref:`selection_stroke` | ``Color( 1, 1, 1, 0.8 )`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`int` | :ref:`bezier_len_neg` | ``160`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`int` | :ref:`bezier_len_pos` | ``80`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`int` | :ref:`port_grab_distance_horizontal` | ``24`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`int` | :ref:`port_grab_distance_vertical` | ``26`` | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`minimap` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`minus` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`more` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`reset` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`Texture` | :ref:`snap` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+----------------------------------------------------------------------------------------------------+----------------------------+ + +Signals +------- + +.. _class_GraphEdit_signal__begin_node_move: + +- **_begin_node_move** **(** **)** + +Emitted at the beginning of a GraphNode movement. + +---- + +.. _class_GraphEdit_signal__end_node_move: + +- **_end_node_move** **(** **)** + +Emitted at the end of a GraphNode movement. + +---- + +.. _class_GraphEdit_signal_connection_from_empty: + +- **connection_from_empty** **(** :ref:`String` to, :ref:`int` to_slot, :ref:`Vector2` release_position **)** + +Emitted when user dragging connection from input port into empty space of the graph. + +---- + +.. _class_GraphEdit_signal_connection_request: + +- **connection_request** **(** :ref:`String` from, :ref:`int` from_slot, :ref:`String` to, :ref:`int` to_slot **)** + +Emitted to the GraphEdit when the connection between the ``from_slot`` slot of the ``from`` GraphNode and the ``to_slot`` slot of the ``to`` GraphNode is attempted to be created. + +---- + +.. _class_GraphEdit_signal_connection_to_empty: + +- **connection_to_empty** **(** :ref:`String` from, :ref:`int` from_slot, :ref:`Vector2` release_position **)** + +Emitted when user dragging connection from output port into empty space of the graph. + +---- + +.. _class_GraphEdit_signal_copy_nodes_request: + +- **copy_nodes_request** **(** **)** + +Emitted when the user presses ``Ctrl + C``. + +---- + +.. _class_GraphEdit_signal_delete_nodes_request: + +- **delete_nodes_request** **(** **)** + +Emitted when a GraphNode is attempted to be removed from the GraphEdit. + +---- + +.. _class_GraphEdit_signal_disconnection_request: + +- **disconnection_request** **(** :ref:`String` from, :ref:`int` from_slot, :ref:`String` to, :ref:`int` to_slot **)** + +Emitted to the GraphEdit when the connection between ``from_slot`` slot of ``from`` GraphNode and ``to_slot`` slot of ``to`` GraphNode is attempted to be removed. + +---- + +.. _class_GraphEdit_signal_duplicate_nodes_request: + +- **duplicate_nodes_request** **(** **)** + +Emitted when a GraphNode is attempted to be duplicated in the GraphEdit. + +---- + +.. _class_GraphEdit_signal_node_selected: + +- **node_selected** **(** :ref:`Node` node **)** + +Emitted when a GraphNode is selected. + +---- + +.. _class_GraphEdit_signal_node_unselected: + +- **node_unselected** **(** :ref:`Node` node **)** + +---- + +.. _class_GraphEdit_signal_paste_nodes_request: + +- **paste_nodes_request** **(** **)** + +Emitted when the user presses ``Ctrl + V``. + +---- + +.. _class_GraphEdit_signal_popup_request: + +- **popup_request** **(** :ref:`Vector2` position **)** + +Emitted when a popup is requested. Happens on right-clicking in the GraphEdit. ``position`` is the position of the mouse pointer when the signal is sent. + +---- + +.. _class_GraphEdit_signal_scroll_offset_changed: + +- **scroll_offset_changed** **(** :ref:`Vector2` ofs **)** + +Emitted when the scroll offset is changed by the user. It will not be emitted when changed in code. + +Property Descriptions +--------------------- + +.. _class_GraphEdit_property_minimap_enabled: + +- :ref:`bool` **minimap_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_minimap_enabled(value) | ++-----------+----------------------------+ +| *Getter* | is_minimap_enabled() | ++-----------+----------------------------+ + +If ``true``, the minimap is visible. + +---- + +.. _class_GraphEdit_property_minimap_opacity: + +- :ref:`float` **minimap_opacity** + ++-----------+----------------------------+ +| *Default* | ``0.65`` | ++-----------+----------------------------+ +| *Setter* | set_minimap_opacity(value) | ++-----------+----------------------------+ +| *Getter* | get_minimap_opacity() | ++-----------+----------------------------+ + +The opacity of the minimap rectangle. + +---- + +.. _class_GraphEdit_property_minimap_size: + +- :ref:`Vector2` **minimap_size** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 240, 160 )`` | ++-----------+-------------------------+ +| *Setter* | set_minimap_size(value) | ++-----------+-------------------------+ +| *Getter* | get_minimap_size() | ++-----------+-------------------------+ + +The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. + +---- + +.. _class_GraphEdit_property_right_disconnects: + +- :ref:`bool` **right_disconnects** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_right_disconnects(value) | ++-----------+--------------------------------+ +| *Getter* | is_right_disconnects_enabled() | ++-----------+--------------------------------+ + +If ``true``, enables disconnection of existing connections in the GraphEdit by dragging the right end. + +---- + +.. _class_GraphEdit_property_scroll_offset: + +- :ref:`Vector2` **scroll_offset** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-----------------------+ +| *Setter* | set_scroll_ofs(value) | ++-----------+-----------------------+ +| *Getter* | get_scroll_ofs() | ++-----------+-----------------------+ + +The scroll offset. + +---- + +.. _class_GraphEdit_property_show_zoom_label: + +- :ref:`bool` **show_zoom_label** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_show_zoom_label(value) | ++-----------+----------------------------+ +| *Getter* | is_showing_zoom_label() | ++-----------+----------------------------+ + +If ``true``, makes a label with the current zoom level visible. The zoom value is displayed in percents. + +---- + +.. _class_GraphEdit_property_snap_distance: + +- :ref:`int` **snap_distance** + ++-----------+-----------------+ +| *Default* | ``20`` | ++-----------+-----------------+ +| *Setter* | set_snap(value) | ++-----------+-----------------+ +| *Getter* | get_snap() | ++-----------+-----------------+ + +The snapping distance in pixels. + +---- + +.. _class_GraphEdit_property_use_snap: + +- :ref:`bool` **use_snap** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_use_snap(value) | ++-----------+---------------------+ +| *Getter* | is_using_snap() | ++-----------+---------------------+ + +If ``true``, enables snapping. + +---- + +.. _class_GraphEdit_property_zoom: + +- :ref:`float` **zoom** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_zoom(value) | ++-----------+-----------------+ +| *Getter* | get_zoom() | ++-----------+-----------------+ + +The current zoom value. + +---- + +.. _class_GraphEdit_property_zoom_max: + +- :ref:`float` **zoom_max** + ++-----------+---------------------+ +| *Default* | ``2.0736`` | ++-----------+---------------------+ +| *Setter* | set_zoom_max(value) | ++-----------+---------------------+ +| *Getter* | get_zoom_max() | ++-----------+---------------------+ + +The upper zoom limit. + +---- + +.. _class_GraphEdit_property_zoom_min: + +- :ref:`float` **zoom_min** + ++-----------+---------------------+ +| *Default* | ``0.232568`` | ++-----------+---------------------+ +| *Setter* | set_zoom_min(value) | ++-----------+---------------------+ +| *Getter* | get_zoom_min() | ++-----------+---------------------+ + +The lower zoom limit. + +---- + +.. _class_GraphEdit_property_zoom_step: + +- :ref:`float` **zoom_step** + ++-----------+----------------------+ +| *Default* | ``1.2`` | ++-----------+----------------------+ +| *Setter* | set_zoom_step(value) | ++-----------+----------------------+ +| *Getter* | get_zoom_step() | ++-----------+----------------------+ + +The step of each zoom level. + +Method Descriptions +------------------- + +.. _class_GraphEdit_method_add_valid_connection_type: + +- void **add_valid_connection_type** **(** :ref:`int` from_type, :ref:`int` to_type **)** + +Makes possible the connection between two different slot types. The type is defined with the :ref:`GraphNode.set_slot` method. + +---- + +.. _class_GraphEdit_method_add_valid_left_disconnect_type: + +- void **add_valid_left_disconnect_type** **(** :ref:`int` type **)** + +Makes possible to disconnect nodes when dragging from the slot at the left if it has the specified type. + +---- + +.. _class_GraphEdit_method_add_valid_right_disconnect_type: + +- void **add_valid_right_disconnect_type** **(** :ref:`int` type **)** + +Makes possible to disconnect nodes when dragging from the slot at the right if it has the specified type. + +---- + +.. _class_GraphEdit_method_clear_connections: + +- void **clear_connections** **(** **)** + +Removes all connections between nodes. + +---- + +.. _class_GraphEdit_method_connect_node: + +- :ref:`Error` **connect_node** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** + +Create a connection between the ``from_port`` slot of the ``from`` GraphNode and the ``to_port`` slot of the ``to`` GraphNode. If the connection already exists, no connection is created. + +---- + +.. _class_GraphEdit_method_disconnect_node: + +- void **disconnect_node** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** + +Removes the connection between the ``from_port`` slot of the ``from`` GraphNode and the ``to_port`` slot of the ``to`` GraphNode. If the connection does not exist, no connection is removed. + +---- + +.. _class_GraphEdit_method_get_connection_list: + +- :ref:`Array` **get_connection_list** **(** **)** |const| + +Returns an Array containing the list of connections. A connection consists in a structure of the form ``{ from_port: 0, from: "GraphNode name 0", to_port: 1, to: "GraphNode name 1" }``. + +---- + +.. _class_GraphEdit_method_get_zoom_hbox: + +- :ref:`HBoxContainer` **get_zoom_hbox** **(** **)** + +Gets the :ref:`HBoxContainer` that contains the zooming and grid snap controls in the top left of the graph. You can use this method to reposition the toolbar or to add your own custom controls to it. + +**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` property. + +---- + +.. _class_GraphEdit_method_is_node_connected: + +- :ref:`bool` **is_node_connected** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port **)** + +Returns ``true`` if the ``from_port`` slot of the ``from`` GraphNode is connected to the ``to_port`` slot of the ``to`` GraphNode. + +---- + +.. _class_GraphEdit_method_is_valid_connection_type: + +- :ref:`bool` **is_valid_connection_type** **(** :ref:`int` from_type, :ref:`int` to_type **)** |const| + +Returns whether it's possible to connect slots of the specified types. + +---- + +.. _class_GraphEdit_method_remove_valid_connection_type: + +- void **remove_valid_connection_type** **(** :ref:`int` from_type, :ref:`int` to_type **)** + +Makes it not possible to connect between two different slot types. The type is defined with the :ref:`GraphNode.set_slot` method. + +---- + +.. _class_GraphEdit_method_remove_valid_left_disconnect_type: + +- void **remove_valid_left_disconnect_type** **(** :ref:`int` type **)** + +Removes the possibility to disconnect nodes when dragging from the slot at the left if it has the specified type. + +---- + +.. _class_GraphEdit_method_remove_valid_right_disconnect_type: + +- void **remove_valid_right_disconnect_type** **(** :ref:`int` type **)** + +Removes the possibility to disconnect nodes when dragging from the slot at the right if it has the specified type. + +---- + +.. _class_GraphEdit_method_set_connection_activity: + +- void **set_connection_activity** **(** :ref:`String` from, :ref:`int` from_port, :ref:`String` to, :ref:`int` to_port, :ref:`float` amount **)** + +Sets the coloration of the connection between ``from``'s ``from_port`` and ``to``'s ``to_port`` with the color provided in the ``activity`` theme property. + +---- + +.. _class_GraphEdit_method_set_selected: + +- void **set_selected** **(** :ref:`Node` node **)** + +Sets the specified ``node`` as the one selected. + +Theme Property Descriptions +--------------------------- + +.. _class_GraphEdit_theme_color_activity: + +- :ref:`Color` **activity** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +---- + +.. _class_GraphEdit_theme_color_grid_major: + +- :ref:`Color` **grid_major** + ++-----------+---------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.2 )`` | ++-----------+---------------------------+ + +Color of major grid lines. + +---- + +.. _class_GraphEdit_theme_color_grid_minor: + +- :ref:`Color` **grid_minor** + ++-----------+----------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.05 )`` | ++-----------+----------------------------+ + +Color of minor grid lines. + +---- + +.. _class_GraphEdit_theme_color_selection_fill: + +- :ref:`Color` **selection_fill** + ++-----------+---------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.3 )`` | ++-----------+---------------------------+ + +The fill color of the selection rectangle. + +---- + +.. _class_GraphEdit_theme_color_selection_stroke: + +- :ref:`Color` **selection_stroke** + ++-----------+---------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.8 )`` | ++-----------+---------------------------+ + +The outline color of the selection rectangle. + +---- + +.. _class_GraphEdit_theme_constant_bezier_len_neg: + +- :ref:`int` **bezier_len_neg** + ++-----------+---------+ +| *Default* | ``160`` | ++-----------+---------+ + +---- + +.. _class_GraphEdit_theme_constant_bezier_len_pos: + +- :ref:`int` **bezier_len_pos** + ++-----------+--------+ +| *Default* | ``80`` | ++-----------+--------+ + +---- + +.. _class_GraphEdit_theme_constant_port_grab_distance_horizontal: + +- :ref:`int` **port_grab_distance_horizontal** + ++-----------+--------+ +| *Default* | ``24`` | ++-----------+--------+ + +The horizontal range within which a port can be grabbed (on both sides). + +---- + +.. _class_GraphEdit_theme_constant_port_grab_distance_vertical: + +- :ref:`int` **port_grab_distance_vertical** + ++-----------+--------+ +| *Default* | ``26`` | ++-----------+--------+ + +The vertical range within which a port can be grabbed (on both sides). + +---- + +.. _class_GraphEdit_theme_icon_minimap: + +- :ref:`Texture` **minimap** + +---- + +.. _class_GraphEdit_theme_icon_minus: + +- :ref:`Texture` **minus** + +The icon for the zoom out button. + +---- + +.. _class_GraphEdit_theme_icon_more: + +- :ref:`Texture` **more** + +The icon for the zoom in button. + +---- + +.. _class_GraphEdit_theme_icon_reset: + +- :ref:`Texture` **reset** + +The icon for the zoom reset button. + +---- + +.. _class_GraphEdit_theme_icon_snap: + +- :ref:`Texture` **snap** + +The icon for the snap toggle button. + +---- + +.. _class_GraphEdit_theme_style_bg: + +- :ref:`StyleBox` **bg** + +The background drawn under the grid. + +.. |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.)` diff --git a/classes/class_graphnode.rst b/classes/class_graphnode.rst new file mode 100644 index 0000000..bdb5e98 --- /dev/null +++ b/classes/class_graphnode.rst @@ -0,0 +1,701 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GraphNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GraphNode: + +GraphNode +========= + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A GraphNode is a container with potentially several input and output slots allowing connections between GraphNodes. Slots can have different, incompatible types. + +Description +----------- + +A GraphNode is a container. Each GraphNode can have several input and output slots, sometimes referred to as ports, allowing connections between GraphNodes. To add a slot to GraphNode, add any :ref:`Control`-derived child node to it. + +After adding at least one child to GraphNode new sections will be automatically created in the Inspector called 'Slot'. When 'Slot' is expanded you will see list with index number for each slot. You can click on each of them to expand further. + +In the Inspector you can enable (show) or disable (hide) slots. By default, all slots are disabled so you may not see any slots on your GraphNode initially. You can assign a type to each slot. Only slots of the same type will be able to connect to each other. You can also assign colors to slots. A tuple of input and output slots is defined for each GUI element included in the GraphNode. Input connections are on the left and output connections are on the right side of GraphNode. Only enabled slots are counted as connections. + +Properties +---------- + ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`comment` | ``false`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`Overlay` | :ref:`overlay` | ``0`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`resizable` | ``false`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`selected` | ``false`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`show_close` | ``false`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`title` | ``""`` | ++----------------------------------------+--------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_all_slots` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_slot` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_connection_input_color` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_input_count` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_connection_input_position` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_input_type` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_connection_output_color` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_output_count` **(** **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_connection_output_position` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_output_type` **(** :ref:`int` idx **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_slot_color_left` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_slot_color_right` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_slot_type_left` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_slot_type_right` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_slot_enabled_left` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_slot_enabled_right` **(** :ref:`int` idx **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot` **(** :ref:`int` idx, :ref:`bool` enable_left, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture` custom_left=null, :ref:`Texture` custom_right=null **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_color_left` **(** :ref:`int` idx, :ref:`Color` color_left **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_color_right` **(** :ref:`int` idx, :ref:`Color` color_right **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_enabled_left` **(** :ref:`int` idx, :ref:`bool` enable_left **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_enabled_right` **(** :ref:`int` idx, :ref:`bool` enable_right **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_type_left` **(** :ref:`int` idx, :ref:`int` type_left **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_slot_type_right` **(** :ref:`int` idx, :ref:`int` type_right **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`close_color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`resizer_color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`title_color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`close_offset` | ``18`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`port_offset` | ``3`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`separation` | ``1`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`title_offset` | ``20`` | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Font` | :ref:`title_font` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`close` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`port` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`resizer` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`breakpoint` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`comment` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`commentfocus` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`defaultfocus` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`defaultframe` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`frame` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`position` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`selectedframe` | | ++---------------------------------+------------------------------------------------------------------+-------------------------+ + +Signals +------- + +.. _class_GraphNode_signal_close_request: + +- **close_request** **(** **)** + +Emitted when the GraphNode is requested to be closed. Happens on clicking the close button (see :ref:`show_close`). + +---- + +.. _class_GraphNode_signal_dragged: + +- **dragged** **(** :ref:`Vector2` from, :ref:`Vector2` to **)** + +Emitted when the GraphNode is dragged. + +---- + +.. _class_GraphNode_signal_offset_changed: + +- **offset_changed** **(** **)** + +Emitted when the GraphNode is moved. + +---- + +.. _class_GraphNode_signal_raise_request: + +- **raise_request** **(** **)** + +Emitted when the GraphNode is requested to be displayed over other ones. Happens on focusing (clicking into) the GraphNode. + +---- + +.. _class_GraphNode_signal_resize_request: + +- **resize_request** **(** :ref:`Vector2` new_minsize **)** + +Emitted when the GraphNode is requested to be resized. Happens on dragging the resizer handle (see :ref:`resizable`). + +---- + +.. _class_GraphNode_signal_slot_updated: + +- **slot_updated** **(** :ref:`int` idx **)** + +Emitted when any GraphNode's slot is updated. + +Enumerations +------------ + +.. _enum_GraphNode_Overlay: + +.. _class_GraphNode_constant_OVERLAY_DISABLED: + +.. _class_GraphNode_constant_OVERLAY_BREAKPOINT: + +.. _class_GraphNode_constant_OVERLAY_POSITION: + +enum **Overlay**: + +- **OVERLAY_DISABLED** = **0** --- No overlay is shown. + +- **OVERLAY_BREAKPOINT** = **1** --- Show overlay set in the ``breakpoint`` theme property. + +- **OVERLAY_POSITION** = **2** --- Show overlay set in the ``position`` theme property. + +Property Descriptions +--------------------- + +.. _class_GraphNode_property_comment: + +- :ref:`bool` **comment** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_comment(value) | ++-----------+--------------------+ +| *Getter* | is_comment() | ++-----------+--------------------+ + +If ``true``, the GraphNode is a comment node. + +---- + +.. _class_GraphNode_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The offset of the GraphNode, relative to the scroll offset of the :ref:`GraphEdit`. + +**Note:** You cannot use position directly, as :ref:`GraphEdit` is a :ref:`Container`. + +---- + +.. _class_GraphNode_property_overlay: + +- :ref:`Overlay` **overlay** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_overlay(value) | ++-----------+--------------------+ +| *Getter* | get_overlay() | ++-----------+--------------------+ + +Sets the overlay shown above the GraphNode. See :ref:`Overlay`. + +---- + +.. _class_GraphNode_property_resizable: + +- :ref:`bool` **resizable** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_resizable(value) | ++-----------+----------------------+ +| *Getter* | is_resizable() | ++-----------+----------------------+ + +If ``true``, the user can resize the GraphNode. + +**Note:** Dragging the handle will only emit the :ref:`resize_request` signal, the GraphNode needs to be resized manually. + +---- + +.. _class_GraphNode_property_selected: + +- :ref:`bool` **selected** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_selected(value) | ++-----------+---------------------+ +| *Getter* | is_selected() | ++-----------+---------------------+ + +If ``true``, the GraphNode is selected. + +---- + +.. _class_GraphNode_property_show_close: + +- :ref:`bool` **show_close** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_show_close_button(value) | ++-----------+------------------------------+ +| *Getter* | is_close_button_visible() | ++-----------+------------------------------+ + +If ``true``, the close button will be visible. + +**Note:** Pressing it will only emit the :ref:`close_request` signal, the GraphNode needs to be removed manually. + +---- + +.. _class_GraphNode_property_title: + +- :ref:`String` **title** + ++-----------+------------------+ +| *Default* | ``""`` | ++-----------+------------------+ +| *Setter* | set_title(value) | ++-----------+------------------+ +| *Getter* | get_title() | ++-----------+------------------+ + +The text displayed in the GraphNode's title bar. + +Method Descriptions +------------------- + +.. _class_GraphNode_method_clear_all_slots: + +- void **clear_all_slots** **(** **)** + +Disables all input and output slots of the GraphNode. + +---- + +.. _class_GraphNode_method_clear_slot: + +- void **clear_slot** **(** :ref:`int` idx **)** + +Disables input and output slot whose index is ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_input_color: + +- :ref:`Color` **get_connection_input_color** **(** :ref:`int` idx **)** + +Returns the :ref:`Color` of the input connection ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_input_count: + +- :ref:`int` **get_connection_input_count** **(** **)** + +Returns the number of enabled input slots (connections) to the GraphNode. + +---- + +.. _class_GraphNode_method_get_connection_input_position: + +- :ref:`Vector2` **get_connection_input_position** **(** :ref:`int` idx **)** + +Returns the position of the input connection ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_input_type: + +- :ref:`int` **get_connection_input_type** **(** :ref:`int` idx **)** + +Returns the type of the input connection ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_output_color: + +- :ref:`Color` **get_connection_output_color** **(** :ref:`int` idx **)** + +Returns the :ref:`Color` of the output connection ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_output_count: + +- :ref:`int` **get_connection_output_count** **(** **)** + +Returns the number of enabled output slots (connections) of the GraphNode. + +---- + +.. _class_GraphNode_method_get_connection_output_position: + +- :ref:`Vector2` **get_connection_output_position** **(** :ref:`int` idx **)** + +Returns the position of the output connection ``idx``. + +---- + +.. _class_GraphNode_method_get_connection_output_type: + +- :ref:`int` **get_connection_output_type** **(** :ref:`int` idx **)** + +Returns the type of the output connection ``idx``. + +---- + +.. _class_GraphNode_method_get_slot_color_left: + +- :ref:`Color` **get_slot_color_left** **(** :ref:`int` idx **)** |const| + +Returns the left (input) :ref:`Color` of the slot ``idx``. + +---- + +.. _class_GraphNode_method_get_slot_color_right: + +- :ref:`Color` **get_slot_color_right** **(** :ref:`int` idx **)** |const| + +Returns the right (output) :ref:`Color` of the slot ``idx``. + +---- + +.. _class_GraphNode_method_get_slot_type_left: + +- :ref:`int` **get_slot_type_left** **(** :ref:`int` idx **)** |const| + +Returns the left (input) type of the slot ``idx``. + +---- + +.. _class_GraphNode_method_get_slot_type_right: + +- :ref:`int` **get_slot_type_right** **(** :ref:`int` idx **)** |const| + +Returns the right (output) type of the slot ``idx``. + +---- + +.. _class_GraphNode_method_is_slot_enabled_left: + +- :ref:`bool` **is_slot_enabled_left** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if left (input) side of the slot ``idx`` is enabled. + +---- + +.. _class_GraphNode_method_is_slot_enabled_right: + +- :ref:`bool` **is_slot_enabled_right** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if right (output) side of the slot ``idx`` is enabled. + +---- + +.. _class_GraphNode_method_set_slot: + +- void **set_slot** **(** :ref:`int` idx, :ref:`bool` enable_left, :ref:`int` type_left, :ref:`Color` color_left, :ref:`bool` enable_right, :ref:`int` type_right, :ref:`Color` color_right, :ref:`Texture` custom_left=null, :ref:`Texture` custom_right=null **)** + +Sets properties of the slot with ID ``idx``. + +If ``enable_left``/``right``, a port will appear and the slot will be able to be connected from this side. + +``type_left``/``right`` is an arbitrary type of the port. Only ports with the same type values can be connected. + +``color_left``/``right`` is the tint of the port's icon on this side. + +``custom_left``/``right`` is a custom texture for this side's port. + +**Note:** This method only sets properties of the slot. To create the slot, add a :ref:`Control`-derived child to the GraphNode. + +Individual properties can be set using one of the ``set_slot_*`` methods. You must enable at least one side of the slot to do so. + +---- + +.. _class_GraphNode_method_set_slot_color_left: + +- void **set_slot_color_left** **(** :ref:`int` idx, :ref:`Color` color_left **)** + +Sets the :ref:`Color` of the left (input) side of the slot ``idx`` to ``color_left``. + +---- + +.. _class_GraphNode_method_set_slot_color_right: + +- void **set_slot_color_right** **(** :ref:`int` idx, :ref:`Color` color_right **)** + +Sets the :ref:`Color` of the right (output) side of the slot ``idx`` to ``color_right``. + +---- + +.. _class_GraphNode_method_set_slot_enabled_left: + +- void **set_slot_enabled_left** **(** :ref:`int` idx, :ref:`bool` enable_left **)** + +Toggles the left (input) side of the slot ``idx``. If ``enable_left`` is ``true``, a port will appear on the left side and the slot will be able to be connected from this side. + +---- + +.. _class_GraphNode_method_set_slot_enabled_right: + +- void **set_slot_enabled_right** **(** :ref:`int` idx, :ref:`bool` enable_right **)** + +Toggles the right (output) side of the slot ``idx``. If ``enable_right`` is ``true``, a port will appear on the right side and the slot will be able to be connected from this side. + +---- + +.. _class_GraphNode_method_set_slot_type_left: + +- void **set_slot_type_left** **(** :ref:`int` idx, :ref:`int` type_left **)** + +Sets the left (input) type of the slot ``idx`` to ``type_left``. + +---- + +.. _class_GraphNode_method_set_slot_type_right: + +- void **set_slot_type_right** **(** :ref:`int` idx, :ref:`int` type_right **)** + +Sets the right (output) type of the slot ``idx`` to ``type_right``. + +Theme Property Descriptions +--------------------------- + +.. _class_GraphNode_theme_color_close_color: + +- :ref:`Color` **close_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +The color modulation applied to the close button icon. + +---- + +.. _class_GraphNode_theme_color_resizer_color: + +- :ref:`Color` **resizer_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +The color modulation applied to the resizer icon. + +---- + +.. _class_GraphNode_theme_color_title_color: + +- :ref:`Color` **title_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +Color of the title text. + +---- + +.. _class_GraphNode_theme_constant_close_offset: + +- :ref:`int` **close_offset** + ++-----------+--------+ +| *Default* | ``18`` | ++-----------+--------+ + +The vertical offset of the close button. + +---- + +.. _class_GraphNode_theme_constant_port_offset: + +- :ref:`int` **port_offset** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +Horizontal offset for the ports. + +---- + +.. _class_GraphNode_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The vertical distance between ports. + +---- + +.. _class_GraphNode_theme_constant_title_offset: + +- :ref:`int` **title_offset** + ++-----------+--------+ +| *Default* | ``20`` | ++-----------+--------+ + +Vertical offset of the title text. + +---- + +.. _class_GraphNode_theme_font_title_font: + +- :ref:`Font` **title_font** + +Font used for the title text. + +---- + +.. _class_GraphNode_theme_icon_close: + +- :ref:`Texture` **close** + +The icon for the close button, visible when :ref:`show_close` is enabled. + +---- + +.. _class_GraphNode_theme_icon_port: + +- :ref:`Texture` **port** + +The icon used for representing ports. + +---- + +.. _class_GraphNode_theme_icon_resizer: + +- :ref:`Texture` **resizer** + +The icon used for resizer, visible when :ref:`resizable` is enabled. + +---- + +.. _class_GraphNode_theme_style_breakpoint: + +- :ref:`StyleBox` **breakpoint** + +The background used when :ref:`overlay` is set to :ref:`OVERLAY_BREAKPOINT`. + +---- + +.. _class_GraphNode_theme_style_comment: + +- :ref:`StyleBox` **comment** + +The :ref:`StyleBox` used when :ref:`comment` is enabled. + +---- + +.. _class_GraphNode_theme_style_commentfocus: + +- :ref:`StyleBox` **commentfocus** + +The :ref:`StyleBox` used when :ref:`comment` is enabled and the ``GraphNode`` is focused. + +---- + +.. _class_GraphNode_theme_style_defaultfocus: + +- :ref:`StyleBox` **defaultfocus** + +---- + +.. _class_GraphNode_theme_style_defaultframe: + +- :ref:`StyleBox` **defaultframe** + +---- + +.. _class_GraphNode_theme_style_frame: + +- :ref:`StyleBox` **frame** + +The default background for ``GraphNode``. + +---- + +.. _class_GraphNode_theme_style_position: + +- :ref:`StyleBox` **position** + +The background used when :ref:`overlay` is set to :ref:`OVERLAY_POSITION`. + +---- + +.. _class_GraphNode_theme_style_selectedframe: + +- :ref:`StyleBox` **selectedframe** + +The background used when the ``GraphNode`` is selected. + +.. |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.)` diff --git a/classes/class_gridcontainer.rst b/classes/class_gridcontainer.rst new file mode 100644 index 0000000..e6fc3fc --- /dev/null +++ b/classes/class_gridcontainer.rst @@ -0,0 +1,92 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GridContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GridContainer: + +GridContainer +============= + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Grid container used to arrange Control-derived children in a grid like layout. + +Description +----------- + +GridContainer will arrange its Control-derived children in a grid like structure, the grid columns are specified using the :ref:`columns` property and the number of rows will be equal to the number of children in the container divided by the number of columns. For example, if the container has 5 children, and 2 columns, there will be 3 rows in the container. + +Notice that grid layout will preserve the columns and rows for every size of the container, and that empty columns will be expanded automatically. + +**Note:** GridContainer only works with child nodes inheriting from Control. It won't rearrange child nodes inheriting from Node2D. + +Tutorials +--------- + +- `OS Test Demo `__ + +Properties +---------- + ++----------------------------------------------+------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`columns` | ``1`` | ++----------------------------------------------+------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``1`` *(parent override)* | ++----------------------------------------------+------------------------------------------------------+---------------------------+ + +Theme Properties +---------------- + ++-----------------------+--------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++-----------------------+--------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`vseparation` | ``4`` | ++-----------------------+--------------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_GridContainer_property_columns: + +- :ref:`int` **columns** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_columns(value) | ++-----------+--------------------+ +| *Getter* | get_columns() | ++-----------+--------------------+ + +The number of columns in the ``GridContainer``. If modified, ``GridContainer`` reorders its Control-derived children to accommodate the new layout. + +Theme Property Descriptions +--------------------------- + +.. _class_GridContainer_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal separation of children nodes. + +---- + +.. _class_GridContainer_theme_constant_vseparation: + +- :ref:`int` **vseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The vertical separation of children nodes. + +.. |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.)` diff --git a/classes/class_gridmap.rst b/classes/class_gridmap.rst new file mode 100644 index 0000000..2ab549e --- /dev/null +++ b/classes/class_gridmap.rst @@ -0,0 +1,428 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GridMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GridMap: + +GridMap +======= + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Node for 3D tile-based maps. + +Description +----------- + +GridMap lets you place meshes on a grid interactively. It works both from the editor and from scripts, which can help you create in-game level editors. + +GridMaps use a :ref:`MeshLibrary` which contains a list of tiles. Each tile is a mesh with materials plus optional collision and navigation shapes. + +A GridMap contains a collection of cells. Each grid cell refers to a tile in the :ref:`MeshLibrary`. All cells in the map have the same dimensions. + +Internally, a GridMap is split into a sparse collection of octants for efficient rendering and physics processing. Every octant has the same dimensions and can contain several cells. + +**Note:** GridMap doesn't extend :ref:`VisualInstance` and therefore can't be hidden or cull masked based on :ref:`VisualInstance.layers`. If you make a light not affect the first layer, the whole GridMap won't be lit by the light in question. + +Tutorials +--------- + +- :doc:`../tutorials/3d/using_gridmaps` + +- `3D Platformer Demo `__ + +- `3D Kinematic Character Demo `__ + +Properties +---------- + ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`cell_center_x` | ``true`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`cell_center_y` | ``true`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`cell_center_z` | ``true`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`cell_octant_size` | ``8`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`cell_scale` | ``1.0`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`cell_size` | ``Vector3( 2, 2, 2 )`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`MeshLibrary` | :ref:`mesh_library` | | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`use_in_baked_light` | ``false`` | ++---------------------------------------+----------------------------------------------------------------------+------------------------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_baked_meshes` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_bake_mesh_instance` **(** :ref:`int` idx **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_bake_meshes` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_cell_item` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_cell_item_orientation` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_meshes` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_used_cells` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_baked_meshes` **(** :ref:`bool` gen_lightmap_uv=false, :ref:`float` lightmap_uv_texel_size=0.1 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`map_to_world` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resource_changed` **(** :ref:`Resource` resource **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cell_item` **(** :ref:`int` x, :ref:`int` y, :ref:`int` z, :ref:`int` item, :ref:`int` orientation=0 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_clip` **(** :ref:`bool` enabled, :ref:`bool` clipabove=true, :ref:`int` floor=0, Vector3.Axis axis=0 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`world_to_map` **(** :ref:`Vector3` pos **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_GridMap_signal_cell_size_changed: + +- **cell_size_changed** **(** :ref:`Vector3` cell_size **)** + +Emitted when :ref:`cell_size` changes. + +Constants +--------- + +.. _class_GridMap_constant_INVALID_CELL_ITEM: + +- **INVALID_CELL_ITEM** = **-1** --- Invalid cell item that can be used in :ref:`set_cell_item` to clear cells (or represent an empty cell in :ref:`get_cell_item`). + +Property Descriptions +--------------------- + +.. _class_GridMap_property_cell_center_x: + +- :ref:`bool` **cell_center_x** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_center_x(value) | ++-----------+---------------------+ +| *Getter* | get_center_x() | ++-----------+---------------------+ + +If ``true``, grid items are centered on the X axis. + +---- + +.. _class_GridMap_property_cell_center_y: + +- :ref:`bool` **cell_center_y** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_center_y(value) | ++-----------+---------------------+ +| *Getter* | get_center_y() | ++-----------+---------------------+ + +If ``true``, grid items are centered on the Y axis. + +---- + +.. _class_GridMap_property_cell_center_z: + +- :ref:`bool` **cell_center_z** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_center_z(value) | ++-----------+---------------------+ +| *Getter* | get_center_z() | ++-----------+---------------------+ + +If ``true``, grid items are centered on the Z axis. + +---- + +.. _class_GridMap_property_cell_octant_size: + +- :ref:`int` **cell_octant_size** + ++-----------+------------------------+ +| *Default* | ``8`` | ++-----------+------------------------+ +| *Setter* | set_octant_size(value) | ++-----------+------------------------+ +| *Getter* | get_octant_size() | ++-----------+------------------------+ + +The size of each octant measured in number of cells. This applies to all three axis. + +---- + +.. _class_GridMap_property_cell_scale: + +- :ref:`float` **cell_scale** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_cell_scale(value) | ++-----------+-----------------------+ +| *Getter* | get_cell_scale() | ++-----------+-----------------------+ + +The scale of the cell items. + +This does not affect the size of the grid cells themselves, only the items in them. This can be used to make cell items overlap their neighbors. + +---- + +.. _class_GridMap_property_cell_size: + +- :ref:`Vector3` **cell_size** + ++-----------+------------------------+ +| *Default* | ``Vector3( 2, 2, 2 )`` | ++-----------+------------------------+ +| *Setter* | set_cell_size(value) | ++-----------+------------------------+ +| *Getter* | get_cell_size() | ++-----------+------------------------+ + +The dimensions of the grid's cells. + +This does not affect the size of the meshes. See :ref:`cell_scale`. + +---- + +.. _class_GridMap_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layers this GridMap is in. + +GridMaps act as static bodies, meaning they aren't affected by gravity or other forces. They only affect other physics bodies that collide with them. + +---- + +.. _class_GridMap_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layers this GridMap detects collisions in. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_GridMap_property_mesh_library: + +- :ref:`MeshLibrary` **mesh_library** + ++----------+-------------------------+ +| *Setter* | set_mesh_library(value) | ++----------+-------------------------+ +| *Getter* | get_mesh_library() | ++----------+-------------------------+ + +The assigned :ref:`MeshLibrary`. + +---- + +.. _class_GridMap_property_use_in_baked_light: + +- :ref:`bool` **use_in_baked_light** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_use_in_baked_light(value) | ++-----------+-------------------------------+ +| *Getter* | get_use_in_baked_light() | ++-----------+-------------------------------+ + +Controls whether this GridMap will be baked in a :ref:`BakedLightmap` or not. + +Method Descriptions +------------------- + +.. _class_GridMap_method_clear: + +- void **clear** **(** **)** + +Clear all cells. + +---- + +.. _class_GridMap_method_clear_baked_meshes: + +- void **clear_baked_meshes** **(** **)** + +---- + +.. _class_GridMap_method_get_bake_mesh_instance: + +- :ref:`RID` **get_bake_mesh_instance** **(** :ref:`int` idx **)** + +---- + +.. _class_GridMap_method_get_bake_meshes: + +- :ref:`Array` **get_bake_meshes** **(** **)** + +Returns an array of :ref:`ArrayMesh`\ es and :ref:`Transform` references of all bake meshes that exist within the current GridMap. + +---- + +.. _class_GridMap_method_get_cell_item: + +- :ref:`int` **get_cell_item** **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| + +The :ref:`MeshLibrary` item index located at the grid-based X, Y and Z coordinates. If the cell is empty, :ref:`INVALID_CELL_ITEM` will be returned. + +---- + +.. _class_GridMap_method_get_cell_item_orientation: + +- :ref:`int` **get_cell_item_orientation** **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| + +The orientation of the cell at the grid-based X, Y and Z coordinates. -1 is returned if the cell is empty. + +---- + +.. _class_GridMap_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the :ref:`collision_layer`. + +---- + +.. _class_GridMap_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the :ref:`collision_mask`. + +---- + +.. _class_GridMap_method_get_meshes: + +- :ref:`Array` **get_meshes** **(** **)** + +Returns an array of :ref:`Transform` and :ref:`Mesh` references corresponding to the non-empty cells in the grid. The transforms are specified in world space. + +---- + +.. _class_GridMap_method_get_used_cells: + +- :ref:`Array` **get_used_cells** **(** **)** |const| + +Returns an array of :ref:`Vector3` with the non-empty cell coordinates in the grid map. + +---- + +.. _class_GridMap_method_make_baked_meshes: + +- void **make_baked_meshes** **(** :ref:`bool` gen_lightmap_uv=false, :ref:`float` lightmap_uv_texel_size=0.1 **)** + +---- + +.. _class_GridMap_method_map_to_world: + +- :ref:`Vector3` **map_to_world** **(** :ref:`int` x, :ref:`int` y, :ref:`int` z **)** |const| + +Returns the position of a grid cell in the GridMap's local coordinate space. + +---- + +.. _class_GridMap_method_resource_changed: + +- void **resource_changed** **(** :ref:`Resource` resource **)** + +---- + +.. _class_GridMap_method_set_cell_item: + +- void **set_cell_item** **(** :ref:`int` x, :ref:`int` y, :ref:`int` z, :ref:`int` item, :ref:`int` orientation=0 **)** + +Sets the mesh index for the cell referenced by its grid-based X, Y and Z coordinates. + +A negative item index such as :ref:`INVALID_CELL_ITEM` will clear the cell. + +Optionally, the item's orientation can be passed. For valid orientation values, see :ref:`Basis.get_orthogonal_index`. + +---- + +.. _class_GridMap_method_set_clip: + +- void **set_clip** **(** :ref:`bool` enabled, :ref:`bool` clipabove=true, :ref:`int` floor=0, Vector3.Axis axis=0 **)** + +---- + +.. _class_GridMap_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets an individual bit on the :ref:`collision_layer`. + +---- + +.. _class_GridMap_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets an individual bit on the :ref:`collision_mask`. + +---- + +.. _class_GridMap_method_world_to_map: + +- :ref:`Vector3` **world_to_map** **(** :ref:`Vector3` pos **)** |const| + +Returns the coordinates of the grid cell containing the given point. + +``pos`` should be in the GridMap's local coordinate space. + +.. |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.)` diff --git a/classes/class_groovejoint2d.rst b/classes/class_groovejoint2d.rst new file mode 100644 index 0000000..10c1371 --- /dev/null +++ b/classes/class_groovejoint2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the GrooveJoint2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_GrooveJoint2D: + +GrooveJoint2D +============= + +**Inherits:** :ref:`Joint2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Groove constraint for 2D physics. + +Description +----------- + +Groove constraint for 2D physics. This is useful for making a body "slide" through a segment placed in another. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`initial_offset` | ``25.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`length` | ``50.0`` | ++---------------------------+--------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_GrooveJoint2D_property_initial_offset: + +- :ref:`float` **initial_offset** + ++-----------+---------------------------+ +| *Default* | ``25.0`` | ++-----------+---------------------------+ +| *Setter* | set_initial_offset(value) | ++-----------+---------------------------+ +| *Getter* | get_initial_offset() | ++-----------+---------------------------+ + +The body B's initial anchor position defined by the joint's origin and a local offset :ref:`initial_offset` along the joint's Y axis (along the groove). + +---- + +.. _class_GrooveJoint2D_property_length: + +- :ref:`float` **length** + ++-----------+-------------------+ +| *Default* | ``50.0`` | ++-----------+-------------------+ +| *Setter* | set_length(value) | ++-----------+-------------------+ +| *Getter* | get_length() | ++-----------+-------------------+ + +The groove's length. The groove is from the joint's origin towards :ref:`length` along the joint's local Y 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.)` diff --git a/classes/class_hashingcontext.rst b/classes/class_hashingcontext.rst new file mode 100644 index 0000000..6be5af7 --- /dev/null +++ b/classes/class_hashingcontext.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HashingContext.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HashingContext: + +HashingContext +============== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Context to compute cryptographic hashes over multiple iterations. + +Description +----------- + +The HashingContext class provides an interface for computing cryptographic hashes over multiple iterations. This is useful for example when computing hashes of big files (so you don't have to load them all in memory), network streams, and data streams in general (so you don't have to hold buffers). + +The :ref:`HashType` enum shows the supported hashing algorithms. + +:: + + const CHUNK_SIZE = 1024 + + func hash_file(path): + var ctx = HashingContext.new() + var file = File.new() + # Start a SHA-256 context. + ctx.start(HashingContext.HASH_SHA256) + # Check that file exists. + if not file.file_exists(path): + return + # Open the file to hash. + file.open(path, File.READ) + # Update the context after reading each chunk. + while not file.eof_reached(): + ctx.update(file.get_buffer(CHUNK_SIZE)) + # Get the computed hash. + var res = ctx.finish() + # Print the result as hex string and array. + printt(res.hex_encode(), Array(res)) + +**Note:** Not available in HTML5 exports. + +Methods +------- + ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`finish` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start` **(** :ref:`HashType` type **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`update` **(** :ref:`PoolByteArray` chunk **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_HashingContext_HashType: + +.. _class_HashingContext_constant_HASH_MD5: + +.. _class_HashingContext_constant_HASH_SHA1: + +.. _class_HashingContext_constant_HASH_SHA256: + +enum **HashType**: + +- **HASH_MD5** = **0** --- Hashing algorithm: MD5. + +- **HASH_SHA1** = **1** --- Hashing algorithm: SHA-1. + +- **HASH_SHA256** = **2** --- Hashing algorithm: SHA-256. + +Method Descriptions +------------------- + +.. _class_HashingContext_method_finish: + +- :ref:`PoolByteArray` **finish** **(** **)** + +Closes the current context, and return the computed hash. + +---- + +.. _class_HashingContext_method_start: + +- :ref:`Error` **start** **(** :ref:`HashType` type **)** + +Starts a new hash computation of the given ``type`` (e.g. :ref:`HASH_SHA256` to start computation of a SHA-256). + +---- + +.. _class_HashingContext_method_update: + +- :ref:`Error` **update** **(** :ref:`PoolByteArray` chunk **)** + +Updates the computation with the given ``chunk`` of data. + +.. |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.)` diff --git a/classes/class_hboxcontainer.rst b/classes/class_hboxcontainer.rst new file mode 100644 index 0000000..bcb0fe9 --- /dev/null +++ b/classes/class_hboxcontainer.rst @@ -0,0 +1,45 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HBoxContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HBoxContainer: + +HBoxContainer +============= + +**Inherits:** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorResourcePicker` + +Horizontal box container. + +Description +----------- + +Horizontal box container. See :ref:`BoxContainer`. + +Theme Properties +---------------- + ++-----------------------+------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`separation` | ``4`` | ++-----------------------+------------------------------------------------------------------+-------+ + +Theme Property Descriptions +--------------------------- + +.. _class_HBoxContainer_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal space between the ``HBoxContainer``'s elements. + +.. |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.)` diff --git a/classes/class_heightmapshape.rst b/classes/class_heightmapshape.rst new file mode 100644 index 0000000..16e32f5 --- /dev/null +++ b/classes/class_heightmapshape.rst @@ -0,0 +1,83 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HeightMapShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HeightMapShape: + +HeightMapShape +============== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Height map shape for 3D physics. + +Description +----------- + +Height map shape resource, which can be added to a :ref:`PhysicsBody` or :ref:`Area`. + +Properties +---------- + ++-------------------------------------------+-----------------------------------------------------------+---------------------------------+ +| :ref:`PoolRealArray` | :ref:`map_data` | ``PoolRealArray( 0, 0, 0, 0 )`` | ++-------------------------------------------+-----------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`map_depth` | ``2`` | ++-------------------------------------------+-----------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`map_width` | ``2`` | ++-------------------------------------------+-----------------------------------------------------------+---------------------------------+ + +Property Descriptions +--------------------- + +.. _class_HeightMapShape_property_map_data: + +- :ref:`PoolRealArray` **map_data** + ++-----------+---------------------------------+ +| *Default* | ``PoolRealArray( 0, 0, 0, 0 )`` | ++-----------+---------------------------------+ +| *Setter* | set_map_data(value) | ++-----------+---------------------------------+ +| *Getter* | get_map_data() | ++-----------+---------------------------------+ + +Height map data, pool array must be of :ref:`map_width` \* :ref:`map_depth` size. + +---- + +.. _class_HeightMapShape_property_map_depth: + +- :ref:`int` **map_depth** + ++-----------+----------------------+ +| *Default* | ``2`` | ++-----------+----------------------+ +| *Setter* | set_map_depth(value) | ++-----------+----------------------+ +| *Getter* | get_map_depth() | ++-----------+----------------------+ + +Depth of the height map data. Changing this will resize the :ref:`map_data`. + +---- + +.. _class_HeightMapShape_property_map_width: + +- :ref:`int` **map_width** + ++-----------+----------------------+ +| *Default* | ``2`` | ++-----------+----------------------+ +| *Setter* | set_map_width(value) | ++-----------+----------------------+ +| *Getter* | get_map_width() | ++-----------+----------------------+ + +Width of the height map data. Changing this will resize the :ref:`map_data`. + +.. |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.)` diff --git a/classes/class_hingejoint.rst b/classes/class_hingejoint.rst new file mode 100644 index 0000000..30a4976 --- /dev/null +++ b/classes/class_hingejoint.rst @@ -0,0 +1,306 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HingeJoint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HingeJoint: + +HingeJoint +========== + +**Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A hinge between two 3D PhysicsBodies. + +Description +----------- + +A HingeJoint normally uses the Z axis of body A as the hinge axis, another axis can be specified when adding it manually though. See also :ref:`Generic6DOFJoint`. + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit/bias` | ``0.3`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`angular_limit/enable` | ``false`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit/lower` | ``-90.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit/relaxation` | ``1.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit/softness` | ``0.9`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`angular_limit/upper` | ``90.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`motor/enable` | ``false`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`motor/max_impulse` | ``1.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`motor/target_velocity` | ``1.0`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`params/bias` | ``0.3`` | ++---------------------------+-------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag` **(** :ref:`Flag` flag **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag` **(** :ref:`Flag` flag, :ref:`bool` enabled **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_HingeJoint_Param: + +.. _class_HingeJoint_constant_PARAM_BIAS: + +.. _class_HingeJoint_constant_PARAM_LIMIT_UPPER: + +.. _class_HingeJoint_constant_PARAM_LIMIT_LOWER: + +.. _class_HingeJoint_constant_PARAM_LIMIT_BIAS: + +.. _class_HingeJoint_constant_PARAM_LIMIT_SOFTNESS: + +.. _class_HingeJoint_constant_PARAM_LIMIT_RELAXATION: + +.. _class_HingeJoint_constant_PARAM_MOTOR_TARGET_VELOCITY: + +.. _class_HingeJoint_constant_PARAM_MOTOR_MAX_IMPULSE: + +.. _class_HingeJoint_constant_PARAM_MAX: + +enum **Param**: + +- **PARAM_BIAS** = **0** --- The speed with which the two bodies get pulled together when they move in different directions. + +- **PARAM_LIMIT_UPPER** = **1** --- The maximum rotation. Only active if :ref:`angular_limit/enable` is ``true``. + +- **PARAM_LIMIT_LOWER** = **2** --- The minimum rotation. Only active if :ref:`angular_limit/enable` is ``true``. + +- **PARAM_LIMIT_BIAS** = **3** --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected. + +- **PARAM_LIMIT_SOFTNESS** = **4** + +- **PARAM_LIMIT_RELAXATION** = **5** --- The lower this value, the more the rotation gets slowed down. + +- **PARAM_MOTOR_TARGET_VELOCITY** = **6** --- Target speed for the motor. + +- **PARAM_MOTOR_MAX_IMPULSE** = **7** --- Maximum acceleration for the motor. + +- **PARAM_MAX** = **8** --- Represents the size of the :ref:`Param` enum. + +---- + +.. _enum_HingeJoint_Flag: + +.. _class_HingeJoint_constant_FLAG_USE_LIMIT: + +.. _class_HingeJoint_constant_FLAG_ENABLE_MOTOR: + +.. _class_HingeJoint_constant_FLAG_MAX: + +enum **Flag**: + +- **FLAG_USE_LIMIT** = **0** --- If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower` and :ref:`angular_limit/upper` has effects. + +- **FLAG_ENABLE_MOTOR** = **1** --- When activated, a motor turns the hinge. + +- **FLAG_MAX** = **2** --- Represents the size of the :ref:`Flag` enum. + +Property Descriptions +--------------------- + +.. _class_HingeJoint_property_angular_limit/bias: + +- :ref:`float` **angular_limit/bias** + ++-----------+------------------+ +| *Default* | ``0.3`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The speed with which the rotation across the axis perpendicular to the hinge gets corrected. + +---- + +.. _class_HingeJoint_property_angular_limit/enable: + +- :ref:`bool` **angular_limit/enable** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the hinges maximum and minimum rotation, defined by :ref:`angular_limit/lower` and :ref:`angular_limit/upper` has effects. + +---- + +.. _class_HingeJoint_property_angular_limit/lower: + +- :ref:`float` **angular_limit/lower** + ++-----------+-----------+ +| *Default* | ``-90.0`` | ++-----------+-----------+ + +The minimum rotation. Only active if :ref:`angular_limit/enable` is ``true``. + +---- + +.. _class_HingeJoint_property_angular_limit/relaxation: + +- :ref:`float` **angular_limit/relaxation** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The lower this value, the more the rotation gets slowed down. + +---- + +.. _class_HingeJoint_property_angular_limit/softness: + +- :ref:`float` **angular_limit/softness** + ++-----------+------------------+ +| *Default* | ``0.9`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +---- + +.. _class_HingeJoint_property_angular_limit/upper: + +- :ref:`float` **angular_limit/upper** + ++-----------+----------+ +| *Default* | ``90.0`` | ++-----------+----------+ + +The maximum rotation. Only active if :ref:`angular_limit/enable` is ``true``. + +---- + +.. _class_HingeJoint_property_motor/enable: + +- :ref:`bool` **motor/enable** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +When activated, a motor turns the hinge. + +---- + +.. _class_HingeJoint_property_motor/max_impulse: + +- :ref:`float` **motor/max_impulse** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Maximum acceleration for the motor. + +---- + +.. _class_HingeJoint_property_motor/target_velocity: + +- :ref:`float` **motor/target_velocity** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Target speed for the motor. + +---- + +.. _class_HingeJoint_property_params/bias: + +- :ref:`float` **params/bias** + ++-----------+------------------+ +| *Default* | ``0.3`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The speed with which the two bodies get pulled together when they move in different directions. + +Method Descriptions +------------------- + +.. _class_HingeJoint_method_get_flag: + +- :ref:`bool` **get_flag** **(** :ref:`Flag` flag **)** |const| + +Returns the value of the specified flag. + +---- + +.. _class_HingeJoint_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| + +Returns the value of the specified parameter. + +---- + +.. _class_HingeJoint_method_set_flag: + +- void **set_flag** **(** :ref:`Flag` flag, :ref:`bool` enabled **)** + +If ``true``, enables the specified flag. + +---- + +.. _class_HingeJoint_method_set_param: + +- void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** + +Sets the value of the specified parameter. + +.. |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.)` diff --git a/classes/class_hmaccontext.rst b/classes/class_hmaccontext.rst new file mode 100644 index 0000000..0b236d9 --- /dev/null +++ b/classes/class_hmaccontext.rst @@ -0,0 +1,106 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HMACContext.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HMACContext: + +HMACContext +=========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Used to create an HMAC for a message using a key. + +Description +----------- + +The HMACContext class is useful for advanced HMAC use cases, such as streaming the message as it supports creating the message over time rather than providing it all at once. + +:: + + extends Node + var ctx = HMACContext.new() + + func _ready(): + var key = "supersecret".to_utf8() + var err = ctx.start(HashingContext.HASH_SHA256, key) + assert(err == OK) + var msg1 = "this is ".to_utf8() + var msg2 = "super duper secret".to_utf8() + err = ctx.update(msg1) + assert(err == OK) + err = ctx.update(msg2) + assert(err == OK) + var hmac = ctx.finish() + print(hmac.hex_encode()) + +And in C# we can use the following. + +:: + + using Godot; + using System; + using System.Diagnostics; + + public class CryptoNode : Node + { + private HMACContext ctx = new HMACContext(); + public override void _Ready() + { + PoolByteArray key = String("supersecret").to_utf8(); + Error err = ctx.Start(HashingContext.HASH_SHA256, key); + GD.Assert(err == OK); + PoolByteArray msg1 = String("this is ").to_utf8(); + PoolByteArray msg2 = String("super duper secret").to_utf8(); + err = ctx.Update(msg1); + GD.Assert(err == OK); + err = ctx.Update(msg2); + GD.Assert(err == OK); + PoolByteArray hmac = ctx.Finish(); + GD.Print(hmac.HexEncode()); + } + } + +**Note:** Not available in HTML5 exports. + +Methods +------- + ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`finish` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start` **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` key **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`update` **(** :ref:`PoolByteArray` data **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_HMACContext_method_finish: + +- :ref:`PoolByteArray` **finish** **(** **)** + +Returns the resulting HMAC. If the HMAC failed, an empty :ref:`PoolByteArray` is returned. + +---- + +.. _class_HMACContext_method_start: + +- :ref:`Error` **start** **(** :ref:`HashType` hash_type, :ref:`PoolByteArray` key **)** + +Initializes the HMACContext. This method cannot be called again on the same HMACContext until :ref:`finish` has been called. + +---- + +.. _class_HMACContext_method_update: + +- :ref:`Error` **update** **(** :ref:`PoolByteArray` data **)** + +Updates the message to be HMACed. This can be called multiple times before :ref:`finish` is called to append ``data`` to the message, but cannot be called until :ref:`start` has been called. + +.. |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.)` diff --git a/classes/class_hscrollbar.rst b/classes/class_hscrollbar.rst new file mode 100644 index 0000000..7470466 --- /dev/null +++ b/classes/class_hscrollbar.rst @@ -0,0 +1,139 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HScrollBar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HScrollBar: + +HScrollBar +========== + +**Inherits:** :ref:`ScrollBar` **<** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Horizontal scroll bar. + +Description +----------- + +Horizontal version of :ref:`ScrollBar`, which goes from left (min) to right (max). + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`scroll` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`scroll_focus` | ++---------------------------------+-----------------------------------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_HScrollBar_theme_icon_decrement: + +- :ref:`Texture` **decrement** + +Icon used as a button to scroll the :ref:`ScrollBar` left. Supports custom step using the :ref:`ScrollBar.custom_step` property. + +---- + +.. _class_HScrollBar_theme_icon_decrement_highlight: + +- :ref:`Texture` **decrement_highlight** + +Displayed when the mouse cursor hovers over the decrement button. + +---- + +.. _class_HScrollBar_theme_icon_decrement_pressed: + +- :ref:`Texture` **decrement_pressed** + +Displayed when the decrement button is being pressed. + +---- + +.. _class_HScrollBar_theme_icon_increment: + +- :ref:`Texture` **increment** + +Icon used as a button to scroll the :ref:`ScrollBar` right. Supports custom step using the :ref:`ScrollBar.custom_step` property. + +---- + +.. _class_HScrollBar_theme_icon_increment_highlight: + +- :ref:`Texture` **increment_highlight** + +Displayed when the mouse cursor hovers over the increment button. + +---- + +.. _class_HScrollBar_theme_icon_increment_pressed: + +- :ref:`Texture` **increment_pressed** + +Displayed when the increment button is being pressed. + +---- + +.. _class_HScrollBar_theme_style_grabber: + +- :ref:`StyleBox` **grabber** + +Used as texture for the grabber, the draggable element representing current scroll. + +---- + +.. _class_HScrollBar_theme_style_grabber_highlight: + +- :ref:`StyleBox` **grabber_highlight** + +Used when the mouse hovers over the grabber. + +---- + +.. _class_HScrollBar_theme_style_grabber_pressed: + +- :ref:`StyleBox` **grabber_pressed** + +Used when the grabber is being dragged. + +---- + +.. _class_HScrollBar_theme_style_scroll: + +- :ref:`StyleBox` **scroll** + +Used as background of this :ref:`ScrollBar`. + +---- + +.. _class_HScrollBar_theme_style_scroll_focus: + +- :ref:`StyleBox` **scroll_focus** + +Used as background when the :ref:`ScrollBar` has the GUI focus. + +.. |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.)` diff --git a/classes/class_hseparator.rst b/classes/class_hseparator.rst new file mode 100644 index 0000000..af584d8 --- /dev/null +++ b/classes/class_hseparator.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HSeparator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HSeparator: + +HSeparator +========== + +**Inherits:** :ref:`Separator` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Horizontal separator. + +Description +----------- + +Horizontal separator. See :ref:`Separator`. Even though it looks horizontal, it is used to separate objects vertically. + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`separation` | ``4`` | ++---------------------------------+---------------------------------------------------------------+-------+ +| :ref:`StyleBox` | :ref:`separator` | | ++---------------------------------+---------------------------------------------------------------+-------+ + +Theme Property Descriptions +--------------------------- + +.. _class_HSeparator_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The height of the area covered by the separator. Effectively works like a minimum height. + +---- + +.. _class_HSeparator_theme_style_separator: + +- :ref:`StyleBox` **separator** + +The style for the separator line. Works best with :ref:`StyleBoxLine`. + +.. |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.)` diff --git a/classes/class_hslider.rst b/classes/class_hslider.rst new file mode 100644 index 0000000..f49ff47 --- /dev/null +++ b/classes/class_hslider.rst @@ -0,0 +1,99 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HSlider.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HSlider: + +HSlider +======= + +**Inherits:** :ref:`Slider` **<** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Horizontal slider. + +Description +----------- + +Horizontal slider. See :ref:`Slider`. This one goes from left (min) to right (max). + +**Note:** The :ref:`Range.changed` and :ref:`Range.value_changed` signals are part of the :ref:`Range` class which this class inherits from. + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber_disabled` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber_highlight` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`tick` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_area` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_area_highlight` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`slider` | ++---------------------------------+---------------------------------------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_HSlider_theme_icon_grabber: + +- :ref:`Texture` **grabber** + +The texture for the grabber (the draggable element). + +---- + +.. _class_HSlider_theme_icon_grabber_disabled: + +- :ref:`Texture` **grabber_disabled** + +The texture for the grabber when it's disabled. + +---- + +.. _class_HSlider_theme_icon_grabber_highlight: + +- :ref:`Texture` **grabber_highlight** + +The texture for the grabber when it's focused. + +---- + +.. _class_HSlider_theme_icon_tick: + +- :ref:`Texture` **tick** + +The texture for the ticks, visible when :ref:`Slider.tick_count` is greater than 0. + +---- + +.. _class_HSlider_theme_style_grabber_area: + +- :ref:`StyleBox` **grabber_area** + +The background of the area to the left of the grabber. + +---- + +.. _class_HSlider_theme_style_grabber_area_highlight: + +- :ref:`StyleBox` **grabber_area_highlight** + +---- + +.. _class_HSlider_theme_style_slider: + +- :ref:`StyleBox` **slider** + +The background for the whole slider. Determines the height of the ``grabber_area``. + +.. |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.)` diff --git a/classes/class_hsplitcontainer.rst b/classes/class_hsplitcontainer.rst new file mode 100644 index 0000000..17c4687 --- /dev/null +++ b/classes/class_hsplitcontainer.rst @@ -0,0 +1,75 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HSplitContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HSplitContainer: + +HSplitContainer +=============== + +**Inherits:** :ref:`SplitContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Horizontal split container. + +Description +----------- + +Horizontal split container. See :ref:`SplitContainer`. This goes from left to right. + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`autohide` | ``1`` | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`separation` | ``12`` | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`Texture` | :ref:`grabber` | | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+--------------------------------------------------------------------+--------+ + +Theme Property Descriptions +--------------------------- + +.. _class_HSplitContainer_theme_constant_autohide: + +- :ref:`int` **autohide** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Boolean value. If 1 (``true``), the grabber will hide automatically when it isn't under the cursor. If 0 (``false``), it's always visible. + +---- + +.. _class_HSplitContainer_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+--------+ +| *Default* | ``12`` | ++-----------+--------+ + +The space between sides of the container. + +---- + +.. _class_HSplitContainer_theme_icon_grabber: + +- :ref:`Texture` **grabber** + +The icon used for the grabber drawn in the middle area. + +---- + +.. _class_HSplitContainer_theme_style_bg: + +- :ref:`StyleBox` **bg** + +.. |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.)` diff --git a/classes/class_httpclient.rst b/classes/class_httpclient.rst new file mode 100644 index 0000000..0c6f83a --- /dev/null +++ b/classes/class_httpclient.rst @@ -0,0 +1,641 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HTTPClient.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HTTPClient: + +HTTPClient +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Low-level hyper-text transfer protocol client. + +Description +----------- + +Hyper-text transfer protocol client (sometimes called "User Agent"). Used to make HTTP requests to download web content, upload files and other data or to communicate with various services, among other use cases. **See the :ref:`HTTPRequest` node for a higher-level alternative.** + +**Note:** This client only needs to connect to a host once (see :ref:`connect_to_host`) to send multiple requests. Because of this, methods that take URLs usually take just the part after the host instead of the full URL, as the client is already connected to a host. See :ref:`request` for a full example and to get started. + +A ``HTTPClient`` should be reused between multiple requests or to connect to different hosts instead of creating one client per request. Supports SSL and SSL server certificate verification. HTTP status codes in the 2xx range indicate success, 3xx redirection (i.e. "try again, but over here"), 4xx something was wrong with the request, and 5xx something went wrong on the server's side. + +For more information on HTTP, see https://developer.mozilla.org/en-US/docs/Web/HTTP (or read RFC 2616 to get it straight from the source: https://tools.ietf.org/html/rfc2616). + +**Note:** When performing HTTP requests from a project exported to HTML5, keep in mind the remote server may not allow requests from foreign origins due to `CORS `__. If you host the server in question, you should modify its backend to allow requests from foreign origins by adding the ``Access-Control-Allow-Origin: *`` HTTP header. + +**Note:** SSL/TLS support is currently limited to TLS 1.0, TLS 1.1, and TLS 1.2. Attempting to connect to a TLS 1.3-only server will return an error. + +**Warning:** SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period. + +Tutorials +--------- + +- :doc:`../tutorials/networking/http_client_class` + +- :doc:`../tutorials/networking/ssl_certificates` + +Properties +---------- + ++-------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`blocking_mode_enabled` | ``false`` | ++-------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`StreamPeer` | :ref:`connection` | | ++-------------------------------------+-------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`read_chunk_size` | ``65536`` | ++-------------------------------------+-------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_host` **(** :ref:`String` host, :ref:`int` port=-1, :ref:`bool` use_ssl=false, :ref:`bool` verify_host=true **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_response_body_length` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_response_code` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_response_headers` **(** **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_response_headers_as_dictionary` **(** **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_status` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_response` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_response_chunked` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`poll` **(** **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`query_string_from_dict` **(** :ref:`Dictionary` fields **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`read_response_body_chunk` **(** **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`request` **(** :ref:`Method` method, :ref:`String` url, :ref:`PoolStringArray` headers, :ref:`String` body="" **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`request_raw` **(** :ref:`Method` method, :ref:`String` url, :ref:`PoolStringArray` headers, :ref:`PoolByteArray` body **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_HTTPClient_Method: + +.. _class_HTTPClient_constant_METHOD_GET: + +.. _class_HTTPClient_constant_METHOD_HEAD: + +.. _class_HTTPClient_constant_METHOD_POST: + +.. _class_HTTPClient_constant_METHOD_PUT: + +.. _class_HTTPClient_constant_METHOD_DELETE: + +.. _class_HTTPClient_constant_METHOD_OPTIONS: + +.. _class_HTTPClient_constant_METHOD_TRACE: + +.. _class_HTTPClient_constant_METHOD_CONNECT: + +.. _class_HTTPClient_constant_METHOD_PATCH: + +.. _class_HTTPClient_constant_METHOD_MAX: + +enum **Method**: + +- **METHOD_GET** = **0** --- HTTP GET method. The GET method requests a representation of the specified resource. Requests using GET should only retrieve data. + +- **METHOD_HEAD** = **1** --- HTTP HEAD method. The HEAD method asks for a response identical to that of a GET request, but without the response body. This is useful to request metadata like HTTP headers or to check if a resource exists. + +- **METHOD_POST** = **2** --- HTTP POST method. The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server. This is often used for forms and submitting data or uploading files. + +- **METHOD_PUT** = **3** --- HTTP PUT method. The PUT method asks to replace all current representations of the target resource with the request payload. (You can think of POST as "create or update" and PUT as "update", although many services tend to not make a clear distinction or change their meaning). + +- **METHOD_DELETE** = **4** --- HTTP DELETE method. The DELETE method requests to delete the specified resource. + +- **METHOD_OPTIONS** = **5** --- HTTP OPTIONS method. The OPTIONS method asks for a description of the communication options for the target resource. Rarely used. + +- **METHOD_TRACE** = **6** --- HTTP TRACE method. The TRACE method performs a message loop-back test along the path to the target resource. Returns the entire HTTP request received in the response body. Rarely used. + +- **METHOD_CONNECT** = **7** --- HTTP CONNECT method. The CONNECT method establishes a tunnel to the server identified by the target resource. Rarely used. + +- **METHOD_PATCH** = **8** --- HTTP PATCH method. The PATCH method is used to apply partial modifications to a resource. + +- **METHOD_MAX** = **9** --- Represents the size of the :ref:`Method` enum. + +---- + +.. _enum_HTTPClient_Status: + +.. _class_HTTPClient_constant_STATUS_DISCONNECTED: + +.. _class_HTTPClient_constant_STATUS_RESOLVING: + +.. _class_HTTPClient_constant_STATUS_CANT_RESOLVE: + +.. _class_HTTPClient_constant_STATUS_CONNECTING: + +.. _class_HTTPClient_constant_STATUS_CANT_CONNECT: + +.. _class_HTTPClient_constant_STATUS_CONNECTED: + +.. _class_HTTPClient_constant_STATUS_REQUESTING: + +.. _class_HTTPClient_constant_STATUS_BODY: + +.. _class_HTTPClient_constant_STATUS_CONNECTION_ERROR: + +.. _class_HTTPClient_constant_STATUS_SSL_HANDSHAKE_ERROR: + +enum **Status**: + +- **STATUS_DISCONNECTED** = **0** --- Status: Disconnected from the server. + +- **STATUS_RESOLVING** = **1** --- Status: Currently resolving the hostname for the given URL into an IP. + +- **STATUS_CANT_RESOLVE** = **2** --- Status: DNS failure: Can't resolve the hostname for the given URL. + +- **STATUS_CONNECTING** = **3** --- Status: Currently connecting to server. + +- **STATUS_CANT_CONNECT** = **4** --- Status: Can't connect to the server. + +- **STATUS_CONNECTED** = **5** --- Status: Connection established. + +- **STATUS_REQUESTING** = **6** --- Status: Currently sending request. + +- **STATUS_BODY** = **7** --- Status: HTTP body received. + +- **STATUS_CONNECTION_ERROR** = **8** --- Status: Error in HTTP connection. + +- **STATUS_SSL_HANDSHAKE_ERROR** = **9** --- Status: Error in SSL handshake. + +---- + +.. _enum_HTTPClient_ResponseCode: + +.. _class_HTTPClient_constant_RESPONSE_CONTINUE: + +.. _class_HTTPClient_constant_RESPONSE_SWITCHING_PROTOCOLS: + +.. _class_HTTPClient_constant_RESPONSE_PROCESSING: + +.. _class_HTTPClient_constant_RESPONSE_OK: + +.. _class_HTTPClient_constant_RESPONSE_CREATED: + +.. _class_HTTPClient_constant_RESPONSE_ACCEPTED: + +.. _class_HTTPClient_constant_RESPONSE_NON_AUTHORITATIVE_INFORMATION: + +.. _class_HTTPClient_constant_RESPONSE_NO_CONTENT: + +.. _class_HTTPClient_constant_RESPONSE_RESET_CONTENT: + +.. _class_HTTPClient_constant_RESPONSE_PARTIAL_CONTENT: + +.. _class_HTTPClient_constant_RESPONSE_MULTI_STATUS: + +.. _class_HTTPClient_constant_RESPONSE_ALREADY_REPORTED: + +.. _class_HTTPClient_constant_RESPONSE_IM_USED: + +.. _class_HTTPClient_constant_RESPONSE_MULTIPLE_CHOICES: + +.. _class_HTTPClient_constant_RESPONSE_MOVED_PERMANENTLY: + +.. _class_HTTPClient_constant_RESPONSE_FOUND: + +.. _class_HTTPClient_constant_RESPONSE_SEE_OTHER: + +.. _class_HTTPClient_constant_RESPONSE_NOT_MODIFIED: + +.. _class_HTTPClient_constant_RESPONSE_USE_PROXY: + +.. _class_HTTPClient_constant_RESPONSE_SWITCH_PROXY: + +.. _class_HTTPClient_constant_RESPONSE_TEMPORARY_REDIRECT: + +.. _class_HTTPClient_constant_RESPONSE_PERMANENT_REDIRECT: + +.. _class_HTTPClient_constant_RESPONSE_BAD_REQUEST: + +.. _class_HTTPClient_constant_RESPONSE_UNAUTHORIZED: + +.. _class_HTTPClient_constant_RESPONSE_PAYMENT_REQUIRED: + +.. _class_HTTPClient_constant_RESPONSE_FORBIDDEN: + +.. _class_HTTPClient_constant_RESPONSE_NOT_FOUND: + +.. _class_HTTPClient_constant_RESPONSE_METHOD_NOT_ALLOWED: + +.. _class_HTTPClient_constant_RESPONSE_NOT_ACCEPTABLE: + +.. _class_HTTPClient_constant_RESPONSE_PROXY_AUTHENTICATION_REQUIRED: + +.. _class_HTTPClient_constant_RESPONSE_REQUEST_TIMEOUT: + +.. _class_HTTPClient_constant_RESPONSE_CONFLICT: + +.. _class_HTTPClient_constant_RESPONSE_GONE: + +.. _class_HTTPClient_constant_RESPONSE_LENGTH_REQUIRED: + +.. _class_HTTPClient_constant_RESPONSE_PRECONDITION_FAILED: + +.. _class_HTTPClient_constant_RESPONSE_REQUEST_ENTITY_TOO_LARGE: + +.. _class_HTTPClient_constant_RESPONSE_REQUEST_URI_TOO_LONG: + +.. _class_HTTPClient_constant_RESPONSE_UNSUPPORTED_MEDIA_TYPE: + +.. _class_HTTPClient_constant_RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE: + +.. _class_HTTPClient_constant_RESPONSE_EXPECTATION_FAILED: + +.. _class_HTTPClient_constant_RESPONSE_IM_A_TEAPOT: + +.. _class_HTTPClient_constant_RESPONSE_MISDIRECTED_REQUEST: + +.. _class_HTTPClient_constant_RESPONSE_UNPROCESSABLE_ENTITY: + +.. _class_HTTPClient_constant_RESPONSE_LOCKED: + +.. _class_HTTPClient_constant_RESPONSE_FAILED_DEPENDENCY: + +.. _class_HTTPClient_constant_RESPONSE_UPGRADE_REQUIRED: + +.. _class_HTTPClient_constant_RESPONSE_PRECONDITION_REQUIRED: + +.. _class_HTTPClient_constant_RESPONSE_TOO_MANY_REQUESTS: + +.. _class_HTTPClient_constant_RESPONSE_REQUEST_HEADER_FIELDS_TOO_LARGE: + +.. _class_HTTPClient_constant_RESPONSE_UNAVAILABLE_FOR_LEGAL_REASONS: + +.. _class_HTTPClient_constant_RESPONSE_INTERNAL_SERVER_ERROR: + +.. _class_HTTPClient_constant_RESPONSE_NOT_IMPLEMENTED: + +.. _class_HTTPClient_constant_RESPONSE_BAD_GATEWAY: + +.. _class_HTTPClient_constant_RESPONSE_SERVICE_UNAVAILABLE: + +.. _class_HTTPClient_constant_RESPONSE_GATEWAY_TIMEOUT: + +.. _class_HTTPClient_constant_RESPONSE_HTTP_VERSION_NOT_SUPPORTED: + +.. _class_HTTPClient_constant_RESPONSE_VARIANT_ALSO_NEGOTIATES: + +.. _class_HTTPClient_constant_RESPONSE_INSUFFICIENT_STORAGE: + +.. _class_HTTPClient_constant_RESPONSE_LOOP_DETECTED: + +.. _class_HTTPClient_constant_RESPONSE_NOT_EXTENDED: + +.. _class_HTTPClient_constant_RESPONSE_NETWORK_AUTH_REQUIRED: + +enum **ResponseCode**: + +- **RESPONSE_CONTINUE** = **100** --- HTTP status code ``100 Continue``. Interim response that indicates everything so far is OK and that the client should continue with the request (or ignore this status if already finished). + +- **RESPONSE_SWITCHING_PROTOCOLS** = **101** --- HTTP status code ``101 Switching Protocol``. Sent in response to an ``Upgrade`` request header by the client. Indicates the protocol the server is switching to. + +- **RESPONSE_PROCESSING** = **102** --- HTTP status code ``102 Processing`` (WebDAV). Indicates that the server has received and is processing the request, but no response is available yet. + +- **RESPONSE_OK** = **200** --- HTTP status code ``200 OK``. The request has succeeded. Default response for successful requests. Meaning varies depending on the request. GET: The resource has been fetched and is transmitted in the message body. HEAD: The entity headers are in the message body. POST: The resource describing the result of the action is transmitted in the message body. TRACE: The message body contains the request message as received by the server. + +- **RESPONSE_CREATED** = **201** --- HTTP status code ``201 Created``. The request has succeeded and a new resource has been created as a result of it. This is typically the response sent after a PUT request. + +- **RESPONSE_ACCEPTED** = **202** --- HTTP status code ``202 Accepted``. The request has been received but not yet acted upon. It is non-committal, meaning that there is no way in HTTP to later send an asynchronous response indicating the outcome of processing the request. It is intended for cases where another process or server handles the request, or for batch processing. + +- **RESPONSE_NON_AUTHORITATIVE_INFORMATION** = **203** --- HTTP status code ``203 Non-Authoritative Information``. This response code means returned meta-information set is not exact set as available from the origin server, but collected from a local or a third party copy. Except this condition, 200 OK response should be preferred instead of this response. + +- **RESPONSE_NO_CONTENT** = **204** --- HTTP status code ``204 No Content``. There is no content to send for this request, but the headers may be useful. The user-agent may update its cached headers for this resource with the new ones. + +- **RESPONSE_RESET_CONTENT** = **205** --- HTTP status code ``205 Reset Content``. The server has fulfilled the request and desires that the client resets the "document view" that caused the request to be sent to its original state as received from the origin server. + +- **RESPONSE_PARTIAL_CONTENT** = **206** --- HTTP status code ``206 Partial Content``. This response code is used because of a range header sent by the client to separate download into multiple streams. + +- **RESPONSE_MULTI_STATUS** = **207** --- HTTP status code ``207 Multi-Status`` (WebDAV). A Multi-Status response conveys information about multiple resources in situations where multiple status codes might be appropriate. + +- **RESPONSE_ALREADY_REPORTED** = **208** --- HTTP status code ``208 Already Reported`` (WebDAV). Used inside a DAV: propstat response element to avoid enumerating the internal members of multiple bindings to the same collection repeatedly. + +- **RESPONSE_IM_USED** = **226** --- HTTP status code ``226 IM Used`` (WebDAV). The server has fulfilled a GET request for the resource, and the response is a representation of the result of one or more instance-manipulations applied to the current instance. + +- **RESPONSE_MULTIPLE_CHOICES** = **300** --- HTTP status code ``300 Multiple Choice``. The request has more than one possible responses and there is no standardized way to choose one of the responses. User-agent or user should choose one of them. + +- **RESPONSE_MOVED_PERMANENTLY** = **301** --- HTTP status code ``301 Moved Permanently``. Redirection. This response code means the URI of requested resource has been changed. The new URI is usually included in the response. + +- **RESPONSE_FOUND** = **302** --- HTTP status code ``302 Found``. Temporary redirection. This response code means the URI of requested resource has been changed temporarily. New changes in the URI might be made in the future. Therefore, this same URI should be used by the client in future requests. + +- **RESPONSE_SEE_OTHER** = **303** --- HTTP status code ``303 See Other``. The server is redirecting the user agent to a different resource, as indicated by a URI in the Location header field, which is intended to provide an indirect response to the original request. + +- **RESPONSE_NOT_MODIFIED** = **304** --- HTTP status code ``304 Not Modified``. A conditional GET or HEAD request has been received and would have resulted in a 200 OK response if it were not for the fact that the condition evaluated to ``false``. + +- **RESPONSE_USE_PROXY** = **305** --- HTTP status code ``305 Use Proxy``. *Deprecated. Do not use.* + +- **RESPONSE_SWITCH_PROXY** = **306** --- HTTP status code ``306 Switch Proxy``. *Deprecated. Do not use.* + +- **RESPONSE_TEMPORARY_REDIRECT** = **307** --- HTTP status code ``307 Temporary Redirect``. The target resource resides temporarily under a different URI and the user agent MUST NOT change the request method if it performs an automatic redirection to that URI. + +- **RESPONSE_PERMANENT_REDIRECT** = **308** --- HTTP status code ``308 Permanent Redirect``. The target resource has been assigned a new permanent URI and any future references to this resource ought to use one of the enclosed URIs. + +- **RESPONSE_BAD_REQUEST** = **400** --- HTTP status code ``400 Bad Request``. The request was invalid. The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, invalid request contents, or deceptive request routing). + +- **RESPONSE_UNAUTHORIZED** = **401** --- HTTP status code ``401 Unauthorized``. Credentials required. The request has not been applied because it lacks valid authentication credentials for the target resource. + +- **RESPONSE_PAYMENT_REQUIRED** = **402** --- HTTP status code ``402 Payment Required``. This response code is reserved for future use. Initial aim for creating this code was using it for digital payment systems, however this is not currently used. + +- **RESPONSE_FORBIDDEN** = **403** --- HTTP status code ``403 Forbidden``. The client does not have access rights to the content, i.e. they are unauthorized, so server is rejecting to give proper response. Unlike ``401``, the client's identity is known to the server. + +- **RESPONSE_NOT_FOUND** = **404** --- HTTP status code ``404 Not Found``. The server can not find requested resource. Either the URL is not recognized or the endpoint is valid but the resource itself does not exist. May also be sent instead of 403 to hide existence of a resource if the client is not authorized. + +- **RESPONSE_METHOD_NOT_ALLOWED** = **405** --- HTTP status code ``405 Method Not Allowed``. The request's HTTP method is known by the server but has been disabled and cannot be used. For example, an API may forbid DELETE-ing a resource. The two mandatory methods, GET and HEAD, must never be disabled and should not return this error code. + +- **RESPONSE_NOT_ACCEPTABLE** = **406** --- HTTP status code ``406 Not Acceptable``. The target resource does not have a current representation that would be acceptable to the user agent, according to the proactive negotiation header fields received in the request. Used when negotiation content. + +- **RESPONSE_PROXY_AUTHENTICATION_REQUIRED** = **407** --- HTTP status code ``407 Proxy Authentication Required``. Similar to 401 Unauthorized, but it indicates that the client needs to authenticate itself in order to use a proxy. + +- **RESPONSE_REQUEST_TIMEOUT** = **408** --- HTTP status code ``408 Request Timeout``. The server did not receive a complete request message within the time that it was prepared to wait. + +- **RESPONSE_CONFLICT** = **409** --- HTTP status code ``409 Conflict``. The request could not be completed due to a conflict with the current state of the target resource. This code is used in situations where the user might be able to resolve the conflict and resubmit the request. + +- **RESPONSE_GONE** = **410** --- HTTP status code ``410 Gone``. The target resource is no longer available at the origin server and this condition is likely permanent. + +- **RESPONSE_LENGTH_REQUIRED** = **411** --- HTTP status code ``411 Length Required``. The server refuses to accept the request without a defined Content-Length header. + +- **RESPONSE_PRECONDITION_FAILED** = **412** --- HTTP status code ``412 Precondition Failed``. One or more conditions given in the request header fields evaluated to ``false`` when tested on the server. + +- **RESPONSE_REQUEST_ENTITY_TOO_LARGE** = **413** --- HTTP status code ``413 Entity Too Large``. The server is refusing to process a request because the request payload is larger than the server is willing or able to process. + +- **RESPONSE_REQUEST_URI_TOO_LONG** = **414** --- HTTP status code ``414 Request-URI Too Long``. The server is refusing to service the request because the request-target is longer than the server is willing to interpret. + +- **RESPONSE_UNSUPPORTED_MEDIA_TYPE** = **415** --- HTTP status code ``415 Unsupported Media Type``. The origin server is refusing to service the request because the payload is in a format not supported by this method on the target resource. + +- **RESPONSE_REQUESTED_RANGE_NOT_SATISFIABLE** = **416** --- HTTP status code ``416 Requested Range Not Satisfiable``. None of the ranges in the request's Range header field overlap the current extent of the selected resource or the set of ranges requested has been rejected due to invalid ranges or an excessive request of small or overlapping ranges. + +- **RESPONSE_EXPECTATION_FAILED** = **417** --- HTTP status code ``417 Expectation Failed``. The expectation given in the request's Expect header field could not be met by at least one of the inbound servers. + +- **RESPONSE_IM_A_TEAPOT** = **418** --- HTTP status code ``418 I'm A Teapot``. Any attempt to brew coffee with a teapot should result in the error code "418 I'm a teapot". The resulting entity body MAY be short and stout. + +- **RESPONSE_MISDIRECTED_REQUEST** = **421** --- HTTP status code ``421 Misdirected Request``. The request was directed at a server that is not able to produce a response. This can be sent by a server that is not configured to produce responses for the combination of scheme and authority that are included in the request URI. + +- **RESPONSE_UNPROCESSABLE_ENTITY** = **422** --- HTTP status code ``422 Unprocessable Entity`` (WebDAV). The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions. + +- **RESPONSE_LOCKED** = **423** --- HTTP status code ``423 Locked`` (WebDAV). The source or destination resource of a method is locked. + +- **RESPONSE_FAILED_DEPENDENCY** = **424** --- HTTP status code ``424 Failed Dependency`` (WebDAV). The method could not be performed on the resource because the requested action depended on another action and that action failed. + +- **RESPONSE_UPGRADE_REQUIRED** = **426** --- HTTP status code ``426 Upgrade Required``. The server refuses to perform the request using the current protocol but might be willing to do so after the client upgrades to a different protocol. + +- **RESPONSE_PRECONDITION_REQUIRED** = **428** --- HTTP status code ``428 Precondition Required``. The origin server requires the request to be conditional. + +- **RESPONSE_TOO_MANY_REQUESTS** = **429** --- HTTP status code ``429 Too Many Requests``. The user has sent too many requests in a given amount of time (see "rate limiting"). Back off and increase time between requests or try again later. + +- **RESPONSE_REQUEST_HEADER_FIELDS_TOO_LARGE** = **431** --- HTTP status code ``431 Request Header Fields Too Large``. The server is unwilling to process the request because its header fields are too large. The request MAY be resubmitted after reducing the size of the request header fields. + +- **RESPONSE_UNAVAILABLE_FOR_LEGAL_REASONS** = **451** --- HTTP status code ``451 Response Unavailable For Legal Reasons``. The server is denying access to the resource as a consequence of a legal demand. + +- **RESPONSE_INTERNAL_SERVER_ERROR** = **500** --- HTTP status code ``500 Internal Server Error``. The server encountered an unexpected condition that prevented it from fulfilling the request. + +- **RESPONSE_NOT_IMPLEMENTED** = **501** --- HTTP status code ``501 Not Implemented``. The server does not support the functionality required to fulfill the request. + +- **RESPONSE_BAD_GATEWAY** = **502** --- HTTP status code ``502 Bad Gateway``. The server, while acting as a gateway or proxy, received an invalid response from an inbound server it accessed while attempting to fulfill the request. Usually returned by load balancers or proxies. + +- **RESPONSE_SERVICE_UNAVAILABLE** = **503** --- HTTP status code ``503 Service Unavailable``. The server is currently unable to handle the request due to a temporary overload or scheduled maintenance, which will likely be alleviated after some delay. Try again later. + +- **RESPONSE_GATEWAY_TIMEOUT** = **504** --- HTTP status code ``504 Gateway Timeout``. The server, while acting as a gateway or proxy, did not receive a timely response from an upstream server it needed to access in order to complete the request. Usually returned by load balancers or proxies. + +- **RESPONSE_HTTP_VERSION_NOT_SUPPORTED** = **505** --- HTTP status code ``505 HTTP Version Not Supported``. The server does not support, or refuses to support, the major version of HTTP that was used in the request message. + +- **RESPONSE_VARIANT_ALSO_NEGOTIATES** = **506** --- HTTP status code ``506 Variant Also Negotiates``. The server has an internal configuration error: the chosen variant resource is configured to engage in transparent content negotiation itself, and is therefore not a proper end point in the negotiation process. + +- **RESPONSE_INSUFFICIENT_STORAGE** = **507** --- HTTP status code ``507 Insufficient Storage``. The method could not be performed on the resource because the server is unable to store the representation needed to successfully complete the request. + +- **RESPONSE_LOOP_DETECTED** = **508** --- HTTP status code ``508 Loop Detected``. The server terminated an operation because it encountered an infinite loop while processing a request with "Depth: infinity". This status indicates that the entire operation failed. + +- **RESPONSE_NOT_EXTENDED** = **510** --- HTTP status code ``510 Not Extended``. The policy for accessing the resource has not been met in the request. The server should send back all the information necessary for the client to issue an extended request. + +- **RESPONSE_NETWORK_AUTH_REQUIRED** = **511** --- HTTP status code ``511 Network Authentication Required``. The client needs to authenticate to gain network access. + +Property Descriptions +--------------------- + +.. _class_HTTPClient_property_blocking_mode_enabled: + +- :ref:`bool` **blocking_mode_enabled** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_blocking_mode(value) | ++-----------+----------------------------+ +| *Getter* | is_blocking_mode_enabled() | ++-----------+----------------------------+ + +If ``true``, execution will block until all data is read from the response. + +---- + +.. _class_HTTPClient_property_connection: + +- :ref:`StreamPeer` **connection** + ++----------+-----------------------+ +| *Setter* | set_connection(value) | ++----------+-----------------------+ +| *Getter* | get_connection() | ++----------+-----------------------+ + +The connection to use for this client. + +---- + +.. _class_HTTPClient_property_read_chunk_size: + +- :ref:`int` **read_chunk_size** + ++-----------+----------------------------+ +| *Default* | ``65536`` | ++-----------+----------------------------+ +| *Setter* | set_read_chunk_size(value) | ++-----------+----------------------------+ +| *Getter* | get_read_chunk_size() | ++-----------+----------------------------+ + +The size of the buffer used and maximum bytes to read per iteration. See :ref:`read_response_body_chunk`. + +Method Descriptions +------------------- + +.. _class_HTTPClient_method_close: + +- void **close** **(** **)** + +Closes the current connection, allowing reuse of this ``HTTPClient``. + +---- + +.. _class_HTTPClient_method_connect_to_host: + +- :ref:`Error` **connect_to_host** **(** :ref:`String` host, :ref:`int` port=-1, :ref:`bool` use_ssl=false, :ref:`bool` verify_host=true **)** + +Connects to a host. This needs to be done before any requests are sent. + +The host should not have http:// prepended but will strip the protocol identifier if provided. + +If no ``port`` is specified (or ``-1`` is used), it is automatically set to 80 for HTTP and 443 for HTTPS (if ``use_ssl`` is enabled). + +``verify_host`` will check the SSL identity of the host if set to ``true``. + +---- + +.. _class_HTTPClient_method_get_response_body_length: + +- :ref:`int` **get_response_body_length** **(** **)** |const| + +Returns the response's body length. + +**Note:** Some Web servers may not send a body length. In this case, the value returned will be ``-1``. If using chunked transfer encoding, the body length will also be ``-1``. + +---- + +.. _class_HTTPClient_method_get_response_code: + +- :ref:`int` **get_response_code** **(** **)** |const| + +Returns the response's HTTP status code. + +---- + +.. _class_HTTPClient_method_get_response_headers: + +- :ref:`PoolStringArray` **get_response_headers** **(** **)** + +Returns the response headers. + +---- + +.. _class_HTTPClient_method_get_response_headers_as_dictionary: + +- :ref:`Dictionary` **get_response_headers_as_dictionary** **(** **)** + +Returns all response headers as a Dictionary of structure ``{ "key": "value1; value2" }`` where the case-sensitivity of the keys and values is kept like the server delivers it. A value is a simple String, this string can have more than one value where "; " is used as separator. + +**Example:** + +:: + + { + "content-length": 12, + "Content-Type": "application/json; charset=UTF-8", + } + +---- + +.. _class_HTTPClient_method_get_status: + +- :ref:`Status` **get_status** **(** **)** |const| + +Returns a :ref:`Status` constant. Need to call :ref:`poll` in order to get status updates. + +---- + +.. _class_HTTPClient_method_has_response: + +- :ref:`bool` **has_response** **(** **)** |const| + +If ``true``, this ``HTTPClient`` has a response available. + +---- + +.. _class_HTTPClient_method_is_response_chunked: + +- :ref:`bool` **is_response_chunked** **(** **)** |const| + +If ``true``, this ``HTTPClient`` has a response that is chunked. + +---- + +.. _class_HTTPClient_method_poll: + +- :ref:`Error` **poll** **(** **)** + +This needs to be called in order to have any request processed. Check results with :ref:`get_status`. + +---- + +.. _class_HTTPClient_method_query_string_from_dict: + +- :ref:`String` **query_string_from_dict** **(** :ref:`Dictionary` fields **)** + +Generates a GET/POST application/x-www-form-urlencoded style query string from a provided dictionary, e.g.: + +:: + + var fields = {"username": "user", "password": "pass"} + var query_string = http_client.query_string_from_dict(fields) + # Returns "username=user&password=pass" + +Furthermore, if a key has a ``null`` value, only the key itself is added, without equal sign and value. If the value is an array, for each value in it a pair with the same key is added. + +:: + + var fields = {"single": 123, "not_valued": null, "multiple": [22, 33, 44]} + var query_string = http_client.query_string_from_dict(fields) + # Returns "single=123¬_valued&multiple=22&multiple=33&multiple=44" + +---- + +.. _class_HTTPClient_method_read_response_body_chunk: + +- :ref:`PoolByteArray` **read_response_body_chunk** **(** **)** + +Reads one chunk from the response. + +---- + +.. _class_HTTPClient_method_request: + +- :ref:`Error` **request** **(** :ref:`Method` method, :ref:`String` url, :ref:`PoolStringArray` headers, :ref:`String` body="" **)** + +Sends a request to the connected host. + +The URL parameter is usually just the part after the host, so for ``http://somehost.com/index.php``, it is ``/index.php``. When sending requests to an HTTP proxy server, it should be an absolute URL. For :ref:`METHOD_OPTIONS` requests, ``*`` is also allowed. For :ref:`METHOD_CONNECT` requests, it should be the authority component (``host:port``). + +Headers are HTTP request headers. For available HTTP methods, see :ref:`Method`. + +To create a POST request with query strings to push to the server, do: + +:: + + var fields = {"username" : "user", "password" : "pass"} + var query_string = http_client.query_string_from_dict(fields) + var headers = ["Content-Type: application/x-www-form-urlencoded", "Content-Length: " + str(query_string.length())] + var result = http_client.request(http_client.METHOD_POST, "/index.php", headers, query_string) + +**Note:** The ``request_data`` parameter is ignored if ``method`` is :ref:`METHOD_GET`. This is because GET methods can't contain request data. As a workaround, you can pass request data as a query string in the URL. See :ref:`String.http_escape` for an example. + +---- + +.. _class_HTTPClient_method_request_raw: + +- :ref:`Error` **request_raw** **(** :ref:`Method` method, :ref:`String` url, :ref:`PoolStringArray` headers, :ref:`PoolByteArray` body **)** + +Sends a raw request to the connected host. + +The URL parameter is usually just the part after the host, so for ``http://somehost.com/index.php``, it is ``/index.php``. When sending requests to an HTTP proxy server, it should be an absolute URL. For :ref:`METHOD_OPTIONS` requests, ``*`` is also allowed. For :ref:`METHOD_CONNECT` requests, it should be the authority component (``host:port``). + +Headers are HTTP request headers. For available HTTP methods, see :ref:`Method`. + +Sends the body data raw, as a byte array and does not encode it in any way. + +.. |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.)` diff --git a/classes/class_httprequest.rst b/classes/class_httprequest.rst new file mode 100644 index 0000000..b1eec9d --- /dev/null +++ b/classes/class_httprequest.rst @@ -0,0 +1,352 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the HTTPRequest.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_HTTPRequest: + +HTTPRequest +=========== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +A node with the ability to send HTTP(S) requests. + +Description +----------- + +A node with the ability to send HTTP requests. Uses :ref:`HTTPClient` internally. + +Can be used to make HTTP requests, i.e. download or upload files or web content via HTTP. + +**Warning:** See the notes and warnings on :ref:`HTTPClient` for limitations, especially regarding SSL security. + +**Example of contacting a REST API and printing one of its returned fields:** + +:: + + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform a GET request. The URL below returns JSON as of writing. + var error = http_request.request("https://httpbin.org/get") + if error != OK: + push_error("An error occurred in the HTTP request.") + + # Perform a POST request. The URL below returns JSON as of writing. + # Note: Don't make simultaneous requests using a single HTTPRequest node. + # The snippet below is provided for reference only. + var body = {"name": "Godette"} + error = http_request.request("https://httpbin.org/post", [], true, HTTPClient.METHOD_POST, body) + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var response = parse_json(body.get_string_from_utf8()) + + # Will print the user agent string used by the HTTPRequest node (as recognized by httpbin.org). + print(response.headers["User-Agent"]) + +**Example of loading and displaying an image using HTTPRequest:** + +:: + + func _ready(): + # Create an HTTP request node and connect its completion signal. + var http_request = HTTPRequest.new() + add_child(http_request) + http_request.connect("request_completed", self, "_http_request_completed") + + # Perform the HTTP request. The URL below returns a PNG image as of writing. + var error = http_request.request("https://via.placeholder.com/512") + if error != OK: + push_error("An error occurred in the HTTP request.") + + + # Called when the HTTP request is completed. + func _http_request_completed(result, response_code, headers, body): + var image = Image.new() + var error = image.load_png_from_buffer(body) + if error != OK: + push_error("Couldn't load the image.") + + var texture = ImageTexture.new() + texture.create_from_image(image) + + # Display the image in a TextureRect node. + var texture_rect = TextureRect.new() + add_child(texture_rect) + texture_rect.texture = texture + +Tutorials +--------- + +- :doc:`../tutorials/networking/http_request_class` + +- :doc:`../tutorials/networking/ssl_certificates` + +Properties +---------- + ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`body_size_limit` | ``-1`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`download_chunk_size` | ``65536`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`download_file` | ``""`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`max_redirects` | ``8`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`timeout` | ``0`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_threads` | ``false`` | ++-----------------------------+----------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`cancel_request` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_body_size` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_downloaded_bytes` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_http_client_status` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`request` **(** :ref:`String` url, :ref:`PoolStringArray` custom_headers=PoolStringArray( ), :ref:`bool` ssl_validate_domain=true, :ref:`Method` method=0, :ref:`String` request_data="" **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`request_raw` **(** :ref:`String` url, :ref:`PoolStringArray` custom_headers=PoolStringArray( ), :ref:`bool` ssl_validate_domain=true, :ref:`Method` method=0, :ref:`PoolByteArray` request_data_raw=PoolByteArray( ) **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_HTTPRequest_signal_request_completed: + +- **request_completed** **(** :ref:`int` result, :ref:`int` response_code, :ref:`PoolStringArray` headers, :ref:`PoolByteArray` body **)** + +Emitted when a request is completed. + +Enumerations +------------ + +.. _enum_HTTPRequest_Result: + +.. _class_HTTPRequest_constant_RESULT_SUCCESS: + +.. _class_HTTPRequest_constant_RESULT_CHUNKED_BODY_SIZE_MISMATCH: + +.. _class_HTTPRequest_constant_RESULT_CANT_CONNECT: + +.. _class_HTTPRequest_constant_RESULT_CANT_RESOLVE: + +.. _class_HTTPRequest_constant_RESULT_CONNECTION_ERROR: + +.. _class_HTTPRequest_constant_RESULT_SSL_HANDSHAKE_ERROR: + +.. _class_HTTPRequest_constant_RESULT_NO_RESPONSE: + +.. _class_HTTPRequest_constant_RESULT_BODY_SIZE_LIMIT_EXCEEDED: + +.. _class_HTTPRequest_constant_RESULT_REQUEST_FAILED: + +.. _class_HTTPRequest_constant_RESULT_DOWNLOAD_FILE_CANT_OPEN: + +.. _class_HTTPRequest_constant_RESULT_DOWNLOAD_FILE_WRITE_ERROR: + +.. _class_HTTPRequest_constant_RESULT_REDIRECT_LIMIT_REACHED: + +.. _class_HTTPRequest_constant_RESULT_TIMEOUT: + +enum **Result**: + +- **RESULT_SUCCESS** = **0** --- Request successful. + +- **RESULT_CHUNKED_BODY_SIZE_MISMATCH** = **1** + +- **RESULT_CANT_CONNECT** = **2** --- Request failed while connecting. + +- **RESULT_CANT_RESOLVE** = **3** --- Request failed while resolving. + +- **RESULT_CONNECTION_ERROR** = **4** --- Request failed due to connection (read/write) error. + +- **RESULT_SSL_HANDSHAKE_ERROR** = **5** --- Request failed on SSL handshake. + +- **RESULT_NO_RESPONSE** = **6** --- Request does not have a response (yet). + +- **RESULT_BODY_SIZE_LIMIT_EXCEEDED** = **7** --- Request exceeded its maximum size limit, see :ref:`body_size_limit`. + +- **RESULT_REQUEST_FAILED** = **8** --- Request failed (currently unused). + +- **RESULT_DOWNLOAD_FILE_CANT_OPEN** = **9** --- HTTPRequest couldn't open the download file. + +- **RESULT_DOWNLOAD_FILE_WRITE_ERROR** = **10** --- HTTPRequest couldn't write to the download file. + +- **RESULT_REDIRECT_LIMIT_REACHED** = **11** --- Request reached its maximum redirect limit, see :ref:`max_redirects`. + +- **RESULT_TIMEOUT** = **12** + +Property Descriptions +--------------------- + +.. _class_HTTPRequest_property_body_size_limit: + +- :ref:`int` **body_size_limit** + ++-----------+----------------------------+ +| *Default* | ``-1`` | ++-----------+----------------------------+ +| *Setter* | set_body_size_limit(value) | ++-----------+----------------------------+ +| *Getter* | get_body_size_limit() | ++-----------+----------------------------+ + +Maximum allowed size for response bodies. + +---- + +.. _class_HTTPRequest_property_download_chunk_size: + +- :ref:`int` **download_chunk_size** + ++-----------+--------------------------------+ +| *Default* | ``65536`` | ++-----------+--------------------------------+ +| *Setter* | set_download_chunk_size(value) | ++-----------+--------------------------------+ +| *Getter* | get_download_chunk_size() | ++-----------+--------------------------------+ + +The size of the buffer used and maximum bytes to read per iteration. See :ref:`HTTPClient.read_chunk_size`. + +Set this to a lower value (e.g. 4096 for 4 KiB) when downloading small files to decrease memory usage at the cost of download speeds. + +---- + +.. _class_HTTPRequest_property_download_file: + +- :ref:`String` **download_file** + ++-----------+--------------------------+ +| *Default* | ``""`` | ++-----------+--------------------------+ +| *Setter* | set_download_file(value) | ++-----------+--------------------------+ +| *Getter* | get_download_file() | ++-----------+--------------------------+ + +The file to download into. Will output any received file into it. + +---- + +.. _class_HTTPRequest_property_max_redirects: + +- :ref:`int` **max_redirects** + ++-----------+--------------------------+ +| *Default* | ``8`` | ++-----------+--------------------------+ +| *Setter* | set_max_redirects(value) | ++-----------+--------------------------+ +| *Getter* | get_max_redirects() | ++-----------+--------------------------+ + +Maximum number of allowed redirects. + +---- + +.. _class_HTTPRequest_property_timeout: + +- :ref:`int` **timeout** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_timeout(value) | ++-----------+--------------------+ +| *Getter* | get_timeout() | ++-----------+--------------------+ + +---- + +.. _class_HTTPRequest_property_use_threads: + +- :ref:`bool` **use_threads** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_use_threads(value) | ++-----------+------------------------+ +| *Getter* | is_using_threads() | ++-----------+------------------------+ + +If ``true``, multithreading is used to improve performance. + +Method Descriptions +------------------- + +.. _class_HTTPRequest_method_cancel_request: + +- void **cancel_request** **(** **)** + +Cancels the current request. + +---- + +.. _class_HTTPRequest_method_get_body_size: + +- :ref:`int` **get_body_size** **(** **)** |const| + +Returns the response body length. + +**Note:** Some Web servers may not send a body length. In this case, the value returned will be ``-1``. If using chunked transfer encoding, the body length will also be ``-1``. + +---- + +.. _class_HTTPRequest_method_get_downloaded_bytes: + +- :ref:`int` **get_downloaded_bytes** **(** **)** |const| + +Returns the amount of bytes this HTTPRequest downloaded. + +---- + +.. _class_HTTPRequest_method_get_http_client_status: + +- :ref:`Status` **get_http_client_status** **(** **)** |const| + +Returns the current status of the underlying :ref:`HTTPClient`. See :ref:`Status`. + +---- + +.. _class_HTTPRequest_method_request: + +- :ref:`Error` **request** **(** :ref:`String` url, :ref:`PoolStringArray` custom_headers=PoolStringArray( ), :ref:`bool` ssl_validate_domain=true, :ref:`Method` method=0, :ref:`String` request_data="" **)** + +Creates request on the underlying :ref:`HTTPClient`. If there is no configuration errors, it tries to connect using :ref:`HTTPClient.connect_to_host` and passes parameters onto :ref:`HTTPClient.request`. + +Returns :ref:`@GlobalScope.OK` if request is successfully created. (Does not imply that the server has responded), :ref:`@GlobalScope.ERR_UNCONFIGURED` if not in the tree, :ref:`@GlobalScope.ERR_BUSY` if still processing previous request, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if given string is not a valid URL format, or :ref:`@GlobalScope.ERR_CANT_CONNECT` if not using thread and the :ref:`HTTPClient` cannot connect to host. + +**Note:** When ``method`` is :ref:`HTTPClient.METHOD_GET`, the payload sent via ``request_data`` might be ignored by the server or even cause the server to reject the request (check `RFC 7231 section 4.3.1 `__ for more details). As a workaround, you can send data as a query string in the URL. See :ref:`String.http_escape` for an example. + +---- + +.. _class_HTTPRequest_method_request_raw: + +- :ref:`Error` **request_raw** **(** :ref:`String` url, :ref:`PoolStringArray` custom_headers=PoolStringArray( ), :ref:`bool` ssl_validate_domain=true, :ref:`Method` method=0, :ref:`PoolByteArray` request_data_raw=PoolByteArray( ) **)** + +Creates request on the underlying :ref:`HTTPClient` using a raw array of bytes for the request body. If there is no configuration errors, it tries to connect using :ref:`HTTPClient.connect_to_host` and passes parameters onto :ref:`HTTPClient.request`. + +Returns :ref:`@GlobalScope.OK` if request is successfully created. (Does not imply that the server has responded), :ref:`@GlobalScope.ERR_UNCONFIGURED` if not in the tree, :ref:`@GlobalScope.ERR_BUSY` if still processing previous request, :ref:`@GlobalScope.ERR_INVALID_PARAMETER` if given string is not a valid URL format, or :ref:`@GlobalScope.ERR_CANT_CONNECT` if not using thread and the :ref:`HTTPClient` cannot connect to host. + +.. |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.)` diff --git a/classes/class_image.rst b/classes/class_image.rst new file mode 100644 index 0000000..193812d --- /dev/null +++ b/classes/class_image.rst @@ -0,0 +1,916 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Image.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Image: + +Image +===== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Image datatype. + +Description +----------- + +Native image datatype. Contains image data which can be converted to an :ref:`ImageTexture` and provides commonly used *image processing* methods. The maximum width and height for an ``Image`` are :ref:`MAX_WIDTH` and :ref:`MAX_HEIGHT`. + +An ``Image`` cannot be assigned to a ``texture`` property of an object directly (such as :ref:`Sprite`), and has to be converted manually to an :ref:`ImageTexture` first. + +**Note:** The maximum image size is 16384×16384 pixels due to graphics hardware limitations. Larger images may fail to import. + +Tutorials +--------- + +- :doc:`../tutorials/assets_pipeline/importing_images` + +Properties +---------- + ++-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`data` | ``{"data": PoolByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}`` | ++-------------------------------------+----------------------------------------+------------------------------------------------------------------------------------------+ + +Methods +------- + ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_rect` **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blend_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blit_rect` **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`blit_rect_mask` **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bumpmap_to_normalmap` **(** :ref:`float` bump_scale=1.0 **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_mipmaps` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`compress` **(** :ref:`CompressMode` mode, :ref:`CompressSource` source, :ref:`float` lossy_quality **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`convert` **(** :ref:`Format` format **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_from` **(** :ref:`Image` src **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from_data` **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PoolByteArray` data **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`crop` **(** :ref:`int` width, :ref:`int` height **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`decompress` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AlphaMode` | :ref:`detect_alpha` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`expand_x2_hq2x` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fill` **(** :ref:`Color` color **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fix_alpha_edges` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flip_x` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flip_y` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`generate_mipmaps` **(** :ref:`bool` renormalize=false **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`get_data` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Format` | :ref:`get_format` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_height` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_mipmap_offset` **(** :ref:`int` mipmap **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_pixel` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_pixelv` **(** :ref:`Vector2` src **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_rect` **(** :ref:`Rect2` rect **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_size` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_used_rect` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_width` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_mipmaps` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_compressed` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_invisible` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_bmp_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_jpg_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_png_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_tga_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load_webp_from_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lock` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`normalmap_to_xy` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`premultiply_alpha` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize_to_po2` **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`rgbe_to_srgb` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_exr` **(** :ref:`String` path, :ref:`bool` grayscale=false **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_png` **(** :ref:`String` path **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`save_png_to_buffer` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_pixel` **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_pixelv` **(** :ref:`Vector2` dst, :ref:`Color` color **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shrink_x2` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`srgb_to_linear` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unlock` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Image_Format: + +.. _class_Image_constant_FORMAT_L8: + +.. _class_Image_constant_FORMAT_LA8: + +.. _class_Image_constant_FORMAT_R8: + +.. _class_Image_constant_FORMAT_RG8: + +.. _class_Image_constant_FORMAT_RGB8: + +.. _class_Image_constant_FORMAT_RGBA8: + +.. _class_Image_constant_FORMAT_RGBA4444: + +.. _class_Image_constant_FORMAT_RGBA5551: + +.. _class_Image_constant_FORMAT_RF: + +.. _class_Image_constant_FORMAT_RGF: + +.. _class_Image_constant_FORMAT_RGBF: + +.. _class_Image_constant_FORMAT_RGBAF: + +.. _class_Image_constant_FORMAT_RH: + +.. _class_Image_constant_FORMAT_RGH: + +.. _class_Image_constant_FORMAT_RGBH: + +.. _class_Image_constant_FORMAT_RGBAH: + +.. _class_Image_constant_FORMAT_RGBE9995: + +.. _class_Image_constant_FORMAT_DXT1: + +.. _class_Image_constant_FORMAT_DXT3: + +.. _class_Image_constant_FORMAT_DXT5: + +.. _class_Image_constant_FORMAT_RGTC_R: + +.. _class_Image_constant_FORMAT_RGTC_RG: + +.. _class_Image_constant_FORMAT_BPTC_RGBA: + +.. _class_Image_constant_FORMAT_BPTC_RGBF: + +.. _class_Image_constant_FORMAT_BPTC_RGBFU: + +.. _class_Image_constant_FORMAT_PVRTC2: + +.. _class_Image_constant_FORMAT_PVRTC2A: + +.. _class_Image_constant_FORMAT_PVRTC4: + +.. _class_Image_constant_FORMAT_PVRTC4A: + +.. _class_Image_constant_FORMAT_ETC: + +.. _class_Image_constant_FORMAT_ETC2_R11: + +.. _class_Image_constant_FORMAT_ETC2_R11S: + +.. _class_Image_constant_FORMAT_ETC2_RG11: + +.. _class_Image_constant_FORMAT_ETC2_RG11S: + +.. _class_Image_constant_FORMAT_ETC2_RGB8: + +.. _class_Image_constant_FORMAT_ETC2_RGBA8: + +.. _class_Image_constant_FORMAT_ETC2_RGB8A1: + +.. _class_Image_constant_FORMAT_MAX: + +enum **Format**: + +- **FORMAT_L8** = **0** --- Texture format with a single 8-bit depth representing luminance. + +- **FORMAT_LA8** = **1** --- OpenGL texture format with two values, luminance and alpha each stored with 8 bits. + +- **FORMAT_R8** = **2** --- OpenGL texture format ``RED`` with a single component and a bitdepth of 8. + +**Note:** When using the GLES2 backend, this uses the alpha channel instead of the red channel for storage. + +- **FORMAT_RG8** = **3** --- OpenGL texture format ``RG`` with two components and a bitdepth of 8 for each. + +- **FORMAT_RGB8** = **4** --- OpenGL texture format ``RGB`` with three components, each with a bitdepth of 8. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_RGBA8** = **5** --- OpenGL texture format ``RGBA`` with four components, each with a bitdepth of 8. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_RGBA4444** = **6** --- OpenGL texture format ``RGBA`` with four components, each with a bitdepth of 4. + +- **FORMAT_RGBA5551** = **7** --- OpenGL texture format ``GL_RGB5_A1`` where 5 bits of depth for each component of RGB and one bit for alpha. + +- **FORMAT_RF** = **8** --- OpenGL texture format ``GL_R32F`` where there's one component, a 32-bit floating-point value. + +- **FORMAT_RGF** = **9** --- OpenGL texture format ``GL_RG32F`` where there are two components, each a 32-bit floating-point values. + +- **FORMAT_RGBF** = **10** --- OpenGL texture format ``GL_RGB32F`` where there are three components, each a 32-bit floating-point values. + +- **FORMAT_RGBAF** = **11** --- OpenGL texture format ``GL_RGBA32F`` where there are four components, each a 32-bit floating-point values. + +- **FORMAT_RH** = **12** --- OpenGL texture format ``GL_R32F`` where there's one component, a 16-bit "half-precision" floating-point value. + +- **FORMAT_RGH** = **13** --- OpenGL texture format ``GL_RG32F`` where there are two components, each a 16-bit "half-precision" floating-point value. + +- **FORMAT_RGBH** = **14** --- OpenGL texture format ``GL_RGB32F`` where there are three components, each a 16-bit "half-precision" floating-point value. + +- **FORMAT_RGBAH** = **15** --- OpenGL texture format ``GL_RGBA32F`` where there are four components, each a 16-bit "half-precision" floating-point value. + +- **FORMAT_RGBE9995** = **16** --- A special OpenGL texture format where the three color components have 9 bits of precision and all three share a single 5-bit exponent. + +- **FORMAT_DXT1** = **17** --- The `S3TC `__ texture format that uses Block Compression 1, and is the smallest variation of S3TC, only providing 1 bit of alpha and color data being premultiplied with alpha. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_DXT3** = **18** --- The `S3TC `__ texture format that uses Block Compression 2, and color data is interpreted as not having been premultiplied by alpha. Well suited for images with sharp alpha transitions between translucent and opaque areas. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_DXT5** = **19** --- The `S3TC `__ texture format also known as Block Compression 3 or BC3 that contains 64 bits of alpha channel data followed by 64 bits of DXT1-encoded color data. Color data is not premultiplied by alpha, same as DXT3. DXT5 generally produces superior results for transparent gradients compared to DXT3. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_RGTC_R** = **20** --- Texture format that uses `Red Green Texture Compression `__, normalizing the red channel data using the same compression algorithm that DXT5 uses for the alpha channel. + +- **FORMAT_RGTC_RG** = **21** --- Texture format that uses `Red Green Texture Compression `__, normalizing the red and green channel data using the same compression algorithm that DXT5 uses for the alpha channel. + +- **FORMAT_BPTC_RGBA** = **22** --- Texture format that uses `BPTC `__ compression with unsigned normalized RGBA components. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_BPTC_RGBF** = **23** --- Texture format that uses `BPTC `__ compression with signed floating-point RGB components. + +- **FORMAT_BPTC_RGBFU** = **24** --- Texture format that uses `BPTC `__ compression with unsigned floating-point RGB components. + +- **FORMAT_PVRTC2** = **25** --- Texture format used on PowerVR-supported mobile platforms, uses 2-bit color depth with no alpha. More information can be found `here `__. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_PVRTC2A** = **26** --- Same as `PVRTC2 `__, but with an alpha component. + +- **FORMAT_PVRTC4** = **27** --- Similar to `PVRTC2 `__, but with 4-bit color depth and no alpha. + +- **FORMAT_PVRTC4A** = **28** --- Same as `PVRTC4 `__, but with an alpha component. + +- **FORMAT_ETC** = **29** --- `Ericsson Texture Compression format 1 `__, also referred to as "ETC1", and is part of the OpenGL ES graphics standard. This format cannot store an alpha channel. + +- **FORMAT_ETC2_R11** = **30** --- `Ericsson Texture Compression format 2 `__ (``R11_EAC`` variant), which provides one channel of unsigned data. + +- **FORMAT_ETC2_R11S** = **31** --- `Ericsson Texture Compression format 2 `__ (``SIGNED_R11_EAC`` variant), which provides one channel of signed data. + +- **FORMAT_ETC2_RG11** = **32** --- `Ericsson Texture Compression format 2 `__ (``RG11_EAC`` variant), which provides two channels of unsigned data. + +- **FORMAT_ETC2_RG11S** = **33** --- `Ericsson Texture Compression format 2 `__ (``SIGNED_RG11_EAC`` variant), which provides two channels of signed data. + +- **FORMAT_ETC2_RGB8** = **34** --- `Ericsson Texture Compression format 2 `__ (``RGB8`` variant), which is a follow-up of ETC1 and compresses RGB888 data. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_ETC2_RGBA8** = **35** --- `Ericsson Texture Compression format 2 `__ (``RGBA8``\ variant), which compresses RGBA8888 data with full alpha support. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_ETC2_RGB8A1** = **36** --- `Ericsson Texture Compression format 2 `__ (``RGB8_PUNCHTHROUGH_ALPHA1`` variant), which compresses RGBA data to make alpha either fully transparent or fully opaque. + +**Note:** When creating an :ref:`ImageTexture`, an sRGB to linear color space conversion is performed. + +- **FORMAT_MAX** = **37** --- Represents the size of the :ref:`Format` enum. + +---- + +.. _enum_Image_Interpolation: + +.. _class_Image_constant_INTERPOLATE_NEAREST: + +.. _class_Image_constant_INTERPOLATE_BILINEAR: + +.. _class_Image_constant_INTERPOLATE_CUBIC: + +.. _class_Image_constant_INTERPOLATE_TRILINEAR: + +.. _class_Image_constant_INTERPOLATE_LANCZOS: + +enum **Interpolation**: + +- **INTERPOLATE_NEAREST** = **0** --- Performs nearest-neighbor interpolation. If the image is resized, it will be pixelated. + +- **INTERPOLATE_BILINEAR** = **1** --- Performs bilinear interpolation. If the image is resized, it will be blurry. This mode is faster than :ref:`INTERPOLATE_CUBIC`, but it results in lower quality. + +- **INTERPOLATE_CUBIC** = **2** --- Performs cubic interpolation. If the image is resized, it will be blurry. This mode often gives better results compared to :ref:`INTERPOLATE_BILINEAR`, at the cost of being slower. + +- **INTERPOLATE_TRILINEAR** = **3** --- Performs bilinear separately on the two most-suited mipmap levels, then linearly interpolates between them. + +It's slower than :ref:`INTERPOLATE_BILINEAR`, but produces higher-quality results with far fewer aliasing artifacts. + +If the image does not have mipmaps, they will be generated and used internally, but no mipmaps will be generated on the resulting image. + +**Note:** If you intend to scale multiple copies of the original image, it's better to call :ref:`generate_mipmaps`] on it in advance, to avoid wasting processing power in generating them again and again. + +On the other hand, if the image already has mipmaps, they will be used, and a new set will be generated for the resulting image. + +- **INTERPOLATE_LANCZOS** = **4** --- Performs Lanczos interpolation. This is the slowest image resizing mode, but it typically gives the best results, especially when downscalng images. + +---- + +.. _enum_Image_AlphaMode: + +.. _class_Image_constant_ALPHA_NONE: + +.. _class_Image_constant_ALPHA_BIT: + +.. _class_Image_constant_ALPHA_BLEND: + +enum **AlphaMode**: + +- **ALPHA_NONE** = **0** --- Image does not have alpha. + +- **ALPHA_BIT** = **1** --- Image stores alpha in a single bit. + +- **ALPHA_BLEND** = **2** --- Image uses alpha. + +---- + +.. _enum_Image_CompressMode: + +.. _class_Image_constant_COMPRESS_S3TC: + +.. _class_Image_constant_COMPRESS_PVRTC2: + +.. _class_Image_constant_COMPRESS_PVRTC4: + +.. _class_Image_constant_COMPRESS_ETC: + +.. _class_Image_constant_COMPRESS_ETC2: + +enum **CompressMode**: + +- **COMPRESS_S3TC** = **0** --- Use S3TC compression. + +- **COMPRESS_PVRTC2** = **1** --- Use PVRTC2 compression. + +- **COMPRESS_PVRTC4** = **2** --- Use PVRTC4 compression. + +- **COMPRESS_ETC** = **3** --- Use ETC compression. + +- **COMPRESS_ETC2** = **4** --- Use ETC2 compression. + +---- + +.. _enum_Image_CompressSource: + +.. _class_Image_constant_COMPRESS_SOURCE_GENERIC: + +.. _class_Image_constant_COMPRESS_SOURCE_SRGB: + +.. _class_Image_constant_COMPRESS_SOURCE_NORMAL: + +.. _class_Image_constant_COMPRESS_SOURCE_LAYERED: + +enum **CompressSource**: + +- **COMPRESS_SOURCE_GENERIC** = **0** --- Source texture (before compression) is a regular texture. Default for all textures. + +- **COMPRESS_SOURCE_SRGB** = **1** --- Source texture (before compression) is in sRGB space. + +- **COMPRESS_SOURCE_NORMAL** = **2** --- Source texture (before compression) is a normal texture (e.g. it can be compressed into two channels). + +- **COMPRESS_SOURCE_LAYERED** = **3** --- Source texture (before compression) is a :ref:`TextureLayered`. + +Constants +--------- + +.. _class_Image_constant_MAX_WIDTH: + +.. _class_Image_constant_MAX_HEIGHT: + +- **MAX_WIDTH** = **16384** --- The maximal width allowed for ``Image`` resources. + +- **MAX_HEIGHT** = **16384** --- The maximal height allowed for ``Image`` resources. + +Property Descriptions +--------------------- + +.. _class_Image_property_data: + +- :ref:`Dictionary` **data** + ++-----------+------------------------------------------------------------------------------------------+ +| *Default* | ``{"data": PoolByteArray( ),"format": "Lum8","height": 0,"mipmaps": false,"width": 0}`` | ++-----------+------------------------------------------------------------------------------------------+ + +Holds all the image's color data in a given format. See :ref:`Format` constants. + +Method Descriptions +------------------- + +.. _class_Image_method_blend_rect: + +- void **blend_rect** **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** + +Alpha-blends ``src_rect`` from ``src`` image to this image at coordinates ``dest``. + +---- + +.. _class_Image_method_blend_rect_mask: + +- void **blend_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** + +Alpha-blends ``src_rect`` from ``src`` image to this image using ``mask`` image at coordinates ``dst``. Alpha channels are required for both ``src`` and ``mask``. ``dst`` pixels and ``src`` pixels will blend if the corresponding mask pixel's alpha value is not 0. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. + +---- + +.. _class_Image_method_blit_rect: + +- void **blit_rect** **(** :ref:`Image` src, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** + +Copies ``src_rect`` from ``src`` image to this image at coordinates ``dst``. + +---- + +.. _class_Image_method_blit_rect_mask: + +- void **blit_rect_mask** **(** :ref:`Image` src, :ref:`Image` mask, :ref:`Rect2` src_rect, :ref:`Vector2` dst **)** + +Blits ``src_rect`` area from ``src`` image to this image at the coordinates given by ``dst``. ``src`` pixel is copied onto ``dst`` if the corresponding ``mask`` pixel's alpha value is not 0. ``src`` image and ``mask`` image **must** have the same size (width and height) but they can have different formats. + +---- + +.. _class_Image_method_bumpmap_to_normalmap: + +- void **bumpmap_to_normalmap** **(** :ref:`float` bump_scale=1.0 **)** + +Converts a bumpmap to a normalmap. A bumpmap provides a height offset per-pixel, while a normalmap provides a normal direction per pixel. + +---- + +.. _class_Image_method_clear_mipmaps: + +- void **clear_mipmaps** **(** **)** + +Removes the image's mipmaps. + +---- + +.. _class_Image_method_compress: + +- :ref:`Error` **compress** **(** :ref:`CompressMode` mode, :ref:`CompressSource` source, :ref:`float` lossy_quality **)** + +Compresses the image to use less memory. Can not directly access pixel data while the image is compressed. Returns error if the chosen compression mode is not available. See :ref:`CompressMode` and :ref:`CompressSource` constants. + +---- + +.. _class_Image_method_convert: + +- void **convert** **(** :ref:`Format` format **)** + +Converts the image's format. See :ref:`Format` constants. + +---- + +.. _class_Image_method_copy_from: + +- void **copy_from** **(** :ref:`Image` src **)** + +Copies ``src`` image to this image. + +---- + +.. _class_Image_method_create: + +- void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format **)** + +Creates an empty image of given size and format. See :ref:`Format` constants. If ``use_mipmaps`` is ``true`` then generate mipmaps for this image. See the :ref:`generate_mipmaps`. + +---- + +.. _class_Image_method_create_from_data: + +- void **create_from_data** **(** :ref:`int` width, :ref:`int` height, :ref:`bool` use_mipmaps, :ref:`Format` format, :ref:`PoolByteArray` data **)** + +Creates a new image of given size and format. See :ref:`Format` constants. Fills the image with the given raw data. If ``use_mipmaps`` is ``true`` then loads mipmaps for this image from ``data``. See :ref:`generate_mipmaps`. + +---- + +.. _class_Image_method_crop: + +- void **crop** **(** :ref:`int` width, :ref:`int` height **)** + +Crops the image to the given ``width`` and ``height``. If the specified size is larger than the current size, the extra area is filled with black pixels. + +---- + +.. _class_Image_method_decompress: + +- :ref:`Error` **decompress** **(** **)** + +Decompresses the image if it is compressed. Returns an error if decompress function is not available. + +---- + +.. _class_Image_method_detect_alpha: + +- :ref:`AlphaMode` **detect_alpha** **(** **)** |const| + +Returns :ref:`ALPHA_BLEND` if the image has data for alpha values. Returns :ref:`ALPHA_BIT` if all the alpha values are stored in a single bit. Returns :ref:`ALPHA_NONE` if no data for alpha values is found. + +---- + +.. _class_Image_method_expand_x2_hq2x: + +- void **expand_x2_hq2x** **(** **)** + +Stretches the image and enlarges it by a factor of 2. No interpolation is done. + +---- + +.. _class_Image_method_fill: + +- void **fill** **(** :ref:`Color` color **)** + +Fills the image with a given :ref:`Color`. + +---- + +.. _class_Image_method_fix_alpha_edges: + +- void **fix_alpha_edges** **(** **)** + +Blends low-alpha pixels with nearby pixels. + +---- + +.. _class_Image_method_flip_x: + +- void **flip_x** **(** **)** + +Flips the image horizontally. + +---- + +.. _class_Image_method_flip_y: + +- void **flip_y** **(** **)** + +Flips the image vertically. + +---- + +.. _class_Image_method_generate_mipmaps: + +- :ref:`Error` **generate_mipmaps** **(** :ref:`bool` renormalize=false **)** + +Generates mipmaps for the image. Mipmaps are precalculated lower-resolution copies of the image that are automatically used if the image needs to be scaled down when rendered. They help improve image quality and performance when rendering. This method returns an error if the image is compressed, in a custom format, or if the image's width/height is ``0``. + +**Note:** Mipmap generation is done on the CPU, is single-threaded and is *always* done on the main thread. This means generating mipmaps will result in noticeable stuttering during gameplay, even if :ref:`generate_mipmaps` is called from a :ref:`Thread`. + +---- + +.. _class_Image_method_get_data: + +- :ref:`PoolByteArray` **get_data** **(** **)** |const| + +Returns a copy of the image's raw data. + +---- + +.. _class_Image_method_get_format: + +- :ref:`Format` **get_format** **(** **)** |const| + +Returns the image's format. See :ref:`Format` constants. + +---- + +.. _class_Image_method_get_height: + +- :ref:`int` **get_height** **(** **)** |const| + +Returns the image's height. + +---- + +.. _class_Image_method_get_mipmap_offset: + +- :ref:`int` **get_mipmap_offset** **(** :ref:`int` mipmap **)** |const| + +Returns the offset where the image's mipmap with index ``mipmap`` is stored in the ``data`` dictionary. + +---- + +.. _class_Image_method_get_pixel: + +- :ref:`Color` **get_pixel** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns the color of the pixel at ``(x, y)`` if the image is locked. If the image is unlocked, it always returns a :ref:`Color` with the value ``(0, 0, 0, 1.0)``. This is the same as :ref:`get_pixelv`, but two integer arguments instead of a Vector2 argument. + +---- + +.. _class_Image_method_get_pixelv: + +- :ref:`Color` **get_pixelv** **(** :ref:`Vector2` src **)** |const| + +Returns the color of the pixel at ``src`` if the image is locked. If the image is unlocked, it always returns a :ref:`Color` with the value ``(0, 0, 0, 1.0)``. This is the same as :ref:`get_pixel`, but with a Vector2 argument instead of two integer arguments. + +---- + +.. _class_Image_method_get_rect: + +- :ref:`Image` **get_rect** **(** :ref:`Rect2` rect **)** |const| + +Returns a new image that is a copy of the image's area specified with ``rect``. + +---- + +.. _class_Image_method_get_size: + +- :ref:`Vector2` **get_size** **(** **)** |const| + +Returns the image's size (width and height). + +---- + +.. _class_Image_method_get_used_rect: + +- :ref:`Rect2` **get_used_rect** **(** **)** |const| + +Returns a :ref:`Rect2` enclosing the visible portion of the image, considering each pixel with a non-zero alpha channel as visible. + +---- + +.. _class_Image_method_get_width: + +- :ref:`int` **get_width** **(** **)** |const| + +Returns the image's width. + +---- + +.. _class_Image_method_has_mipmaps: + +- :ref:`bool` **has_mipmaps** **(** **)** |const| + +Returns ``true`` if the image has generated mipmaps. + +---- + +.. _class_Image_method_is_compressed: + +- :ref:`bool` **is_compressed** **(** **)** |const| + +Returns ``true`` if the image is compressed. + +---- + +.. _class_Image_method_is_empty: + +- :ref:`bool` **is_empty** **(** **)** |const| + +Returns ``true`` if the image has no data. + +---- + +.. _class_Image_method_is_invisible: + +- :ref:`bool` **is_invisible** **(** **)** |const| + +Returns ``true`` if all the image's pixels have an alpha value of 0. Returns ``false`` if any pixel has an alpha value higher than 0. + +---- + +.. _class_Image_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path **)** + +Loads an image from file ``path``. See `Supported image formats `__ for a list of supported image formats and limitations. + +**Warning:** This method should only be used in the editor or in cases when you need to load external images at run-time, such as images located at the ``user://`` directory, and may not work in exported projects. + +See also :ref:`ImageTexture` description for usage examples. + +---- + +.. _class_Image_method_load_bmp_from_buffer: + +- :ref:`Error` **load_bmp_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a BMP file. + +**Note:** Godot's BMP module doesn't support 16-bit per pixel images. Only 1-bit, 4-bit, 8-bit, 24-bit, and 32-bit per pixel images are supported. + +---- + +.. _class_Image_method_load_jpg_from_buffer: + +- :ref:`Error` **load_jpg_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a JPEG file. + +---- + +.. _class_Image_method_load_png_from_buffer: + +- :ref:`Error` **load_png_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a PNG file. + +---- + +.. _class_Image_method_load_tga_from_buffer: + +- :ref:`Error` **load_tga_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a TGA file. + +---- + +.. _class_Image_method_load_webp_from_buffer: + +- :ref:`Error` **load_webp_from_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Loads an image from the binary contents of a WebP file. + +---- + +.. _class_Image_method_lock: + +- void **lock** **(** **)** + +Locks the data for reading and writing access. Sends an error to the console if the image is not locked when reading or writing a pixel. + +---- + +.. _class_Image_method_normalmap_to_xy: + +- void **normalmap_to_xy** **(** **)** + +Converts the image's data to represent coordinates on a 3D plane. This is used when the image represents a normalmap. A normalmap can add lots of detail to a 3D surface without increasing the polygon count. + +---- + +.. _class_Image_method_premultiply_alpha: + +- void **premultiply_alpha** **(** **)** + +Multiplies color values with alpha values. Resulting color values for a pixel are ``(color * alpha)/256``. + +---- + +.. _class_Image_method_resize: + +- void **resize** **(** :ref:`int` width, :ref:`int` height, :ref:`Interpolation` interpolation=1 **)** + +Resizes the image to the given ``width`` and ``height``. New pixels are calculated using the ``interpolation`` mode defined via :ref:`Interpolation` constants. + +---- + +.. _class_Image_method_resize_to_po2: + +- void **resize_to_po2** **(** :ref:`bool` square=false, :ref:`Interpolation` interpolation=1 **)** + +Resizes the image to the nearest power of 2 for the width and height. If ``square`` is ``true`` then set width and height to be the same. New pixels are calculated using the ``interpolation`` mode defined via :ref:`Interpolation` constants. + +---- + +.. _class_Image_method_rgbe_to_srgb: + +- :ref:`Image` **rgbe_to_srgb** **(** **)** + +Converts a standard RGBE (Red Green Blue Exponent) image to an sRGB image. + +---- + +.. _class_Image_method_save_exr: + +- :ref:`Error` **save_exr** **(** :ref:`String` path, :ref:`bool` grayscale=false **)** |const| + +Saves the image as an EXR file to ``path``. If ``grayscale`` is ``true`` and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return :ref:`@GlobalScope.ERR_UNAVAILABLE` if Godot was compiled without the TinyEXR module. + +**Note:** The TinyEXR module is disabled in non-editor builds, which means :ref:`save_exr` will return :ref:`@GlobalScope.ERR_UNAVAILABLE` when it is called from an exported project. + +---- + +.. _class_Image_method_save_png: + +- :ref:`Error` **save_png** **(** :ref:`String` path **)** |const| + +Saves the image as a PNG file to ``path``. + +---- + +.. _class_Image_method_save_png_to_buffer: + +- :ref:`PoolByteArray` **save_png_to_buffer** **(** **)** |const| + +---- + +.. _class_Image_method_set_pixel: + +- void **set_pixel** **(** :ref:`int` x, :ref:`int` y, :ref:`Color` color **)** + +Sets the :ref:`Color` of the pixel at ``(x, y)`` if the image is locked. Example: + +:: + + var img = Image.new() + img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + img.lock() + img.set_pixel(x, y, color) # Works + img.unlock() + img.set_pixel(x, y, color) # Does not have an effect + +---- + +.. _class_Image_method_set_pixelv: + +- void **set_pixelv** **(** :ref:`Vector2` dst, :ref:`Color` color **)** + +Sets the :ref:`Color` of the pixel at ``(dst.x, dst.y)`` if the image is locked. Note that the ``dst`` values must be integers. Example: + +:: + + var img = Image.new() + img.create(img_width, img_height, false, Image.FORMAT_RGBA8) + img.lock() + img.set_pixelv(Vector2(x, y), color) # Works + img.unlock() + img.set_pixelv(Vector2(x, y), color) # Does not have an effect + +---- + +.. _class_Image_method_shrink_x2: + +- void **shrink_x2** **(** **)** + +Shrinks the image by a factor of 2. + +---- + +.. _class_Image_method_srgb_to_linear: + +- void **srgb_to_linear** **(** **)** + +Converts the raw data from the sRGB colorspace to a linear scale. + +---- + +.. _class_Image_method_unlock: + +- void **unlock** **(** **)** + +Unlocks the data and prevents changes. + +.. |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.)` diff --git a/classes/class_imagetexture.rst b/classes/class_imagetexture.rst new file mode 100644 index 0000000..1a7f782 --- /dev/null +++ b/classes/class_imagetexture.rst @@ -0,0 +1,195 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ImageTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ImageTexture: + +ImageTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Texture` based on an :ref:`Image`. + +Description +----------- + +A :ref:`Texture` based on an :ref:`Image`. For an image to be displayed, an ``ImageTexture`` has to be created from it using the :ref:`create_from_image` method: + +:: + + var texture = ImageTexture.new() + var image = Image.new() + image.load("res://icon.png") + texture.create_from_image(image) + $Sprite.texture = texture + +This way, textures can be created at run-time by loading images both from within the editor and externally. + +**Warning:** Prefer to load imported textures with :ref:`@GDScript.load` over loading them from within the filesystem dynamically with :ref:`Image.load`, as it may not work in exported projects: + +:: + + var texture = load("res://icon.png") + $Sprite.texture = texture + +This is because images have to be imported as :ref:`StreamTexture` first to be loaded with :ref:`@GDScript.load`. If you'd still like to load an image file just like any other :ref:`Resource`, import it as an :ref:`Image` resource instead, and then load it normally using the :ref:`@GDScript.load` method. + +But do note that the image data can still be retrieved from an imported texture as well using the :ref:`Texture.get_data` method, which returns a copy of the data: + +:: + + var texture = load("res://icon.png") + var image : Image = texture.get_data() + +An ``ImageTexture`` is not meant to be operated from within the editor interface directly, and is mostly useful for rendering images on screen dynamically via code. If you need to generate images procedurally from within the editor, consider saving and importing images as custom texture resources implementing a new :ref:`EditorImportPlugin`. + +**Note:** The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. + +Tutorials +--------- + +- :doc:`../tutorials/assets_pipeline/importing_images` + +Properties +---------- + ++-------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``7`` *(parent override)* | ++-------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`lossy_quality` | ``0.7`` | ++-------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`Storage` | :ref:`storage` | ``0`` | ++-------------------------------------------+-----------------------------------------------------------------+---------------------------+ + +Methods +------- + ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`Format` format, :ref:`int` flags=7 **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from_image` **(** :ref:`Image` image, :ref:`int` flags=7 **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Format` | :ref:`get_format` **(** **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_data` **(** :ref:`Image` image **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_size_override` **(** :ref:`Vector2` size **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ImageTexture_Storage: + +.. _class_ImageTexture_constant_STORAGE_RAW: + +.. _class_ImageTexture_constant_STORAGE_COMPRESS_LOSSY: + +.. _class_ImageTexture_constant_STORAGE_COMPRESS_LOSSLESS: + +enum **Storage**: + +- **STORAGE_RAW** = **0** --- :ref:`Image` data is stored raw and unaltered. + +- **STORAGE_COMPRESS_LOSSY** = **1** --- :ref:`Image` data is compressed with a lossy algorithm. You can set the storage quality with :ref:`lossy_quality`. + +- **STORAGE_COMPRESS_LOSSLESS** = **2** --- :ref:`Image` data is compressed with a lossless algorithm. + +Property Descriptions +--------------------- + +.. _class_ImageTexture_property_lossy_quality: + +- :ref:`float` **lossy_quality** + ++-----------+----------------------------------+ +| *Default* | ``0.7`` | ++-----------+----------------------------------+ +| *Setter* | set_lossy_storage_quality(value) | ++-----------+----------------------------------+ +| *Getter* | get_lossy_storage_quality() | ++-----------+----------------------------------+ + +The storage quality for :ref:`STORAGE_COMPRESS_LOSSY`. + +---- + +.. _class_ImageTexture_property_storage: + +- :ref:`Storage` **storage** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_storage(value) | ++-----------+--------------------+ +| *Getter* | get_storage() | ++-----------+--------------------+ + +The storage type (raw, lossy, or compressed). + +Method Descriptions +------------------- + +.. _class_ImageTexture_method_create: + +- void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`Format` format, :ref:`int` flags=7 **)** + +Create a new ``ImageTexture`` with ``width`` and ``height``. + +``format`` is a value from :ref:`Format`, ``flags`` is any combination of :ref:`Flags`. + +---- + +.. _class_ImageTexture_method_create_from_image: + +- void **create_from_image** **(** :ref:`Image` image, :ref:`int` flags=7 **)** + +Initializes the texture by allocating and setting the data from an :ref:`Image` with ``flags`` from :ref:`Flags`. An sRGB to linear color space conversion can take place, according to :ref:`Format`. + +---- + +.. _class_ImageTexture_method_get_format: + +- :ref:`Format` **get_format** **(** **)** |const| + +Returns the format of the texture, one of :ref:`Format`. + +---- + +.. _class_ImageTexture_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path **)** + +Loads an image from a file path and creates a texture from it. + +**Note:** This method is deprecated and will be removed in Godot 4.0, use :ref:`Image.load` and :ref:`create_from_image` instead. + +---- + +.. _class_ImageTexture_method_set_data: + +- void **set_data** **(** :ref:`Image` image **)** + +Replaces the texture's data with a new :ref:`Image`. + +**Note:** The texture has to be initialized first with the :ref:`create_from_image` method before it can be updated. The new image dimensions, format, and mipmaps configuration should match the existing texture's image configuration, otherwise it has to be re-created with the :ref:`create_from_image` method. + +Use this method over :ref:`create_from_image` if you need to update the texture frequently, which is faster than allocating additional memory for a new texture each time. + +---- + +.. _class_ImageTexture_method_set_size_override: + +- void **set_size_override** **(** :ref:`Vector2` size **)** + +Resizes the texture to the specified dimensions. + +.. |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.)` diff --git a/classes/class_immediategeometry.rst b/classes/class_immediategeometry.rst new file mode 100644 index 0000000..b332178 --- /dev/null +++ b/classes/class_immediategeometry.rst @@ -0,0 +1,139 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ImmediateGeometry.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ImmediateGeometry: + +ImmediateGeometry +================= + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Draws simple geometry from code. + +Description +----------- + +Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x. + +See also :ref:`ArrayMesh`, :ref:`MeshDataTool` and :ref:`SurfaceTool` for procedural geometry generation. + +**Note:** ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use :ref:`ArrayMesh`, :ref:`MeshDataTool` or :ref:`SurfaceTool` instead. + +**Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. + +**Note:** In case of missing points when handling large amounts of mesh data, try increasing its buffer size limit under :ref:`ProjectSettings.rendering/limits/buffers/immediate_buffer_size_kb`. + +Methods +------- + ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_sphere` **(** :ref:`int` lats, :ref:`int` lons, :ref:`float` radius, :ref:`bool` add_uv=true **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_vertex` **(** :ref:`Vector3` position **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`begin` **(** :ref:`PrimitiveType` primitive, :ref:`Texture` texture=null **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`end` **(** **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_color` **(** :ref:`Color` color **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_normal` **(** :ref:`Vector3` normal **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tangent` **(** :ref:`Plane` tangent **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_uv` **(** :ref:`Vector2` uv **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_uv2` **(** :ref:`Vector2` uv **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ImmediateGeometry_method_add_sphere: + +- void **add_sphere** **(** :ref:`int` lats, :ref:`int` lons, :ref:`float` radius, :ref:`bool` add_uv=true **)** + +Simple helper to draw an UV sphere with given latitude, longitude and radius. + +---- + +.. _class_ImmediateGeometry_method_add_vertex: + +- void **add_vertex** **(** :ref:`Vector3` position **)** + +Adds a vertex in local coordinate space with the currently set color/uv/etc. + +---- + +.. _class_ImmediateGeometry_method_begin: + +- void **begin** **(** :ref:`PrimitiveType` primitive, :ref:`Texture` texture=null **)** + +Begin drawing (and optionally pass a texture override). When done call :ref:`end`. For more information on how this works, search for ``glBegin()`` and ``glEnd()`` references. + +For the type of primitive, see the :ref:`PrimitiveType` enum. + +---- + +.. _class_ImmediateGeometry_method_clear: + +- void **clear** **(** **)** + +Clears everything that was drawn using begin/end. + +---- + +.. _class_ImmediateGeometry_method_end: + +- void **end** **(** **)** + +Ends a drawing context and displays the results. + +---- + +.. _class_ImmediateGeometry_method_set_color: + +- void **set_color** **(** :ref:`Color` color **)** + +The current drawing color. + +---- + +.. _class_ImmediateGeometry_method_set_normal: + +- void **set_normal** **(** :ref:`Vector3` normal **)** + +The next vertex's normal. + +---- + +.. _class_ImmediateGeometry_method_set_tangent: + +- void **set_tangent** **(** :ref:`Plane` tangent **)** + +The next vertex's tangent (and binormal facing). + +---- + +.. _class_ImmediateGeometry_method_set_uv: + +- void **set_uv** **(** :ref:`Vector2` uv **)** + +The next vertex's UV. + +---- + +.. _class_ImmediateGeometry_method_set_uv2: + +- void **set_uv2** **(** :ref:`Vector2` uv **)** + +The next vertex's second layer UV. + +.. |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.)` diff --git a/classes/class_input.rst b/classes/class_input.rst new file mode 100644 index 0000000..e550086 --- /dev/null +++ b/classes/class_input.rst @@ -0,0 +1,721 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Input.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Input: + +Input +===== + +**Inherits:** :ref:`Object` + +A singleton that deals with inputs. + +Description +----------- + +A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the **Input Map** tab in the **Project > Project Settings**, or with the :ref:`InputMap` class. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/index` + +- `2D Dodge The Creeps Demo `__ + +- `3D Voxel Demo `__ + +Methods +------- + ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_press` **(** :ref:`String` action, :ref:`float` strength=1.0 **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_release` **(** :ref:`String` action **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_joy_mapping` **(** :ref:`String` mapping, :ref:`bool` update_existing=false **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`flush_buffered_events` **(** **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_accelerometer` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_action_raw_strength` **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_action_strength` **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_axis` **(** :ref:`String` negative_action, :ref:`String` positive_action **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_connected_joypads` **(** **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`CursorShape` | :ref:`get_current_cursor_shape` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_gravity` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_gyroscope` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_joy_axis` **(** :ref:`int` device, :ref:`int` axis **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_joy_axis_index_from_string` **(** :ref:`String` axis **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_joy_axis_string` **(** :ref:`int` axis_index **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_joy_button_index_from_string` **(** :ref:`String` button **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_joy_button_string` **(** :ref:`int` button_index **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_joy_guid` **(** :ref:`int` device **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_joy_name` **(** :ref:`int` device **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_joy_vibration_duration` **(** :ref:`int` device **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_joy_vibration_strength` **(** :ref:`int` device **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_last_mouse_speed` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_magnetometer` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_mouse_button_mask` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`MouseMode` | :ref:`get_mouse_mode` **(** **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_vector` **(** :ref:`String` negative_x, :ref:`String` positive_x, :ref:`String` negative_y, :ref:`String` positive_y, :ref:`float` deadzone=-1.0 **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_just_pressed` **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_just_released` **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_pressed` **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_joy_button_pressed` **(** :ref:`int` device, :ref:`int` button **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_joy_known` **(** :ref:`int` device **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_key_pressed` **(** :ref:`int` scancode **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_mouse_button_pressed` **(** :ref:`int` button **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_physical_key_pressed` **(** :ref:`int` scancode **)** |const| | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`joy_connection_changed` **(** :ref:`int` device, :ref:`bool` connected, :ref:`String` name, :ref:`String` guid **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`parse_input_event` **(** :ref:`InputEvent` event **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_joy_mapping` **(** :ref:`String` guid **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_accelerometer` **(** :ref:`Vector3` value **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_mouse_cursor` **(** :ref:`Resource` image, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2( 0, 0 ) **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_cursor_shape` **(** :ref:`CursorShape` shape=0 **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_gravity` **(** :ref:`Vector3` value **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_gyroscope` **(** :ref:`Vector3` value **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_magnetometer` **(** :ref:`Vector3` value **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_mouse_mode` **(** :ref:`MouseMode` mode **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_use_accumulated_input` **(** :ref:`bool` enable **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`start_joy_vibration` **(** :ref:`int` device, :ref:`float` weak_magnitude, :ref:`float` strong_magnitude, :ref:`float` duration=0 **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop_joy_vibration` **(** :ref:`int` device **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`vibrate_handheld` **(** :ref:`int` duration_ms=500 **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`warp_mouse_position` **(** :ref:`Vector2` to **)** | ++--------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Input_signal_joy_connection_changed: + +- **joy_connection_changed** **(** :ref:`int` device, :ref:`bool` connected **)** + +Emitted when a joypad device has been connected or disconnected. + +Enumerations +------------ + +.. _enum_Input_MouseMode: + +.. _class_Input_constant_MOUSE_MODE_VISIBLE: + +.. _class_Input_constant_MOUSE_MODE_HIDDEN: + +.. _class_Input_constant_MOUSE_MODE_CAPTURED: + +.. _class_Input_constant_MOUSE_MODE_CONFINED: + +enum **MouseMode**: + +- **MOUSE_MODE_VISIBLE** = **0** --- Makes the mouse cursor visible if it is hidden. + +- **MOUSE_MODE_HIDDEN** = **1** --- Makes the mouse cursor hidden if it is visible. + +- **MOUSE_MODE_CAPTURED** = **2** --- Captures the mouse. The mouse will be hidden and its position locked at the center of the screen. + +**Note:** If you want to process the mouse's movement in this mode, you need to use :ref:`InputEventMouseMotion.relative`. + +- **MOUSE_MODE_CONFINED** = **3** --- Makes the mouse cursor visible but confines it to the game window. + +---- + +.. _enum_Input_CursorShape: + +.. _class_Input_constant_CURSOR_ARROW: + +.. _class_Input_constant_CURSOR_IBEAM: + +.. _class_Input_constant_CURSOR_POINTING_HAND: + +.. _class_Input_constant_CURSOR_CROSS: + +.. _class_Input_constant_CURSOR_WAIT: + +.. _class_Input_constant_CURSOR_BUSY: + +.. _class_Input_constant_CURSOR_DRAG: + +.. _class_Input_constant_CURSOR_CAN_DROP: + +.. _class_Input_constant_CURSOR_FORBIDDEN: + +.. _class_Input_constant_CURSOR_VSIZE: + +.. _class_Input_constant_CURSOR_HSIZE: + +.. _class_Input_constant_CURSOR_BDIAGSIZE: + +.. _class_Input_constant_CURSOR_FDIAGSIZE: + +.. _class_Input_constant_CURSOR_MOVE: + +.. _class_Input_constant_CURSOR_VSPLIT: + +.. _class_Input_constant_CURSOR_HSPLIT: + +.. _class_Input_constant_CURSOR_HELP: + +enum **CursorShape**: + +- **CURSOR_ARROW** = **0** --- Arrow cursor. Standard, default pointing cursor. + +- **CURSOR_IBEAM** = **1** --- I-beam cursor. Usually used to show where the text cursor will appear when the mouse is clicked. + +- **CURSOR_POINTING_HAND** = **2** --- Pointing hand cursor. Usually used to indicate the pointer is over a link or other interactable item. + +- **CURSOR_CROSS** = **3** --- Cross cursor. Typically appears over regions in which a drawing operation can be performed or for selections. + +- **CURSOR_WAIT** = **4** --- Wait cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application is still usable during the operation. + +- **CURSOR_BUSY** = **5** --- Busy cursor. Indicates that the application is busy performing an operation. This cursor shape denotes that the application isn't usable during the operation (e.g. something is blocking its main thread). + +- **CURSOR_DRAG** = **6** --- Drag cursor. Usually displayed when dragging something. + +- **CURSOR_CAN_DROP** = **7** --- Can drop cursor. Usually displayed when dragging something to indicate that it can be dropped at the current position. + +- **CURSOR_FORBIDDEN** = **8** --- Forbidden cursor. Indicates that the current action is forbidden (for example, when dragging something) or that the control at a position is disabled. + +- **CURSOR_VSIZE** = **9** --- Vertical resize mouse cursor. A double-headed vertical arrow. It tells the user they can resize the window or the panel vertically. + +- **CURSOR_HSIZE** = **10** --- Horizontal resize mouse cursor. A double-headed horizontal arrow. It tells the user they can resize the window or the panel horizontally. + +- **CURSOR_BDIAGSIZE** = **11** --- Window resize mouse cursor. The cursor is a double-headed arrow that goes from the bottom left to the top right. It tells the user they can resize the window or the panel both horizontally and vertically. + +- **CURSOR_FDIAGSIZE** = **12** --- Window resize mouse cursor. The cursor is a double-headed arrow that goes from the top left to the bottom right, the opposite of :ref:`CURSOR_BDIAGSIZE`. It tells the user they can resize the window or the panel both horizontally and vertically. + +- **CURSOR_MOVE** = **13** --- Move cursor. Indicates that something can be moved. + +- **CURSOR_VSPLIT** = **14** --- Vertical split mouse cursor. On Windows, it's the same as :ref:`CURSOR_VSIZE`. + +- **CURSOR_HSPLIT** = **15** --- Horizontal split mouse cursor. On Windows, it's the same as :ref:`CURSOR_HSIZE`. + +- **CURSOR_HELP** = **16** --- Help cursor. Usually a question mark. + +Method Descriptions +------------------- + +.. _class_Input_method_action_press: + +- void **action_press** **(** :ref:`String` action, :ref:`float` strength=1.0 **)** + +This will simulate pressing the specified action. + +The strength can be used for non-boolean actions, it's ranged between 0 and 1 representing the intensity of the given action. + +**Note:** This method will not cause any :ref:`Node._input` calls. It is intended to be used with :ref:`is_action_pressed` and :ref:`is_action_just_pressed`. If you want to simulate ``_input``, use :ref:`parse_input_event` instead. + +---- + +.. _class_Input_method_action_release: + +- void **action_release** **(** :ref:`String` action **)** + +If the specified action is already pressed, this will release it. + +---- + +.. _class_Input_method_add_joy_mapping: + +- void **add_joy_mapping** **(** :ref:`String` mapping, :ref:`bool` update_existing=false **)** + +Adds a new mapping entry (in SDL2 format) to the mapping database. Optionally update already connected devices. + +---- + +.. _class_Input_method_flush_buffered_events: + +- void **flush_buffered_events** **(** **)** + +Sends all input events which are in the current buffer to the game loop. These events may have been buffered as a result of accumulated input (:ref:`set_use_accumulated_input`) or agile input flushing (:ref:`ProjectSettings.input_devices/buffering/agile_event_flushing`). + +The engine will already do this itself at key execution points (at least once per frame). However, this can be useful in advanced cases where you want precise control over the timing of event handling. + +---- + +.. _class_Input_method_get_accelerometer: + +- :ref:`Vector3` **get_accelerometer** **(** **)** |const| + +Returns the acceleration of the device's accelerometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. + +Note this method returns an empty :ref:`Vector3` when running from the editor even when your device has an accelerometer. You must export your project to a supported device to read values from the accelerometer. + +**Note:** This method only works on iOS, Android, and UWP. On other platforms, it always returns :ref:`Vector3.ZERO`. On Android the unit of measurement for each axis is m/s² while on iOS and UWP it's a multiple of the Earth's gravitational acceleration ``g`` (~9.81 m/s²). + +---- + +.. _class_Input_method_get_action_raw_strength: + +- :ref:`float` **get_action_raw_strength** **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| + +Returns a value between 0 and 1 representing the raw intensity of the given action, ignoring the action's deadzone. In most cases, you should use :ref:`get_action_strength` instead. + +If ``exact`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_Input_method_get_action_strength: + +- :ref:`float` **get_action_strength** **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| + +Returns a value between 0 and 1 representing the intensity of the given action. In a joypad, for example, the further away the axis (analog sticks or L2, R2 triggers) is from the dead zone, the closer the value will be to 1. If the action is mapped to a control that has no axis as the keyboard, the value returned will be 0 or 1. + +If ``exact`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_Input_method_get_axis: + +- :ref:`float` **get_axis** **(** :ref:`String` negative_action, :ref:`String` positive_action **)** |const| + +Get axis input by specifying two actions, one negative and one positive. + +This is a shorthand for writing ``Input.get_action_strength("positive_action") - Input.get_action_strength("negative_action")``. + +---- + +.. _class_Input_method_get_connected_joypads: + +- :ref:`Array` **get_connected_joypads** **(** **)** + +Returns an :ref:`Array` containing the device IDs of all currently connected joypads. + +---- + +.. _class_Input_method_get_current_cursor_shape: + +- :ref:`CursorShape` **get_current_cursor_shape** **(** **)** |const| + +Returns the currently assigned cursor shape (see :ref:`CursorShape`). + +---- + +.. _class_Input_method_get_gravity: + +- :ref:`Vector3` **get_gravity** **(** **)** |const| + +Returns the gravity of the device's accelerometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. + +**Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO`. On Android the unit of measurement for each axis is m/s² while on iOS it's a multiple of the Earth's gravitational acceleration ``g`` (~9.81 m/s²). + +---- + +.. _class_Input_method_get_gyroscope: + +- :ref:`Vector3` **get_gyroscope** **(** **)** |const| + +Returns the rotation rate in rad/s around a device's X, Y, and Z axes of the gyroscope sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. + +**Note:** This method only works on Android and iOS. On other platforms, it always returns :ref:`Vector3.ZERO`. + +---- + +.. _class_Input_method_get_joy_axis: + +- :ref:`float` **get_joy_axis** **(** :ref:`int` device, :ref:`int` axis **)** |const| + +Returns the current value of the joypad axis at given index (see :ref:`JoystickList`). + +---- + +.. _class_Input_method_get_joy_axis_index_from_string: + +- :ref:`int` **get_joy_axis_index_from_string** **(** :ref:`String` axis **)** + +Returns the index of the provided axis name. + +---- + +.. _class_Input_method_get_joy_axis_string: + +- :ref:`String` **get_joy_axis_string** **(** :ref:`int` axis_index **)** + +Receives a :ref:`JoystickList` axis and returns its equivalent name as a string. + +---- + +.. _class_Input_method_get_joy_button_index_from_string: + +- :ref:`int` **get_joy_button_index_from_string** **(** :ref:`String` button **)** + +Returns the index of the provided button name. + +---- + +.. _class_Input_method_get_joy_button_string: + +- :ref:`String` **get_joy_button_string** **(** :ref:`int` button_index **)** + +Receives a gamepad button from :ref:`JoystickList` and returns its equivalent name as a string. + +---- + +.. _class_Input_method_get_joy_guid: + +- :ref:`String` **get_joy_guid** **(** :ref:`int` device **)** |const| + +Returns a SDL2-compatible device GUID on platforms that use gamepad remapping. Returns ``"Default Gamepad"`` otherwise. + +---- + +.. _class_Input_method_get_joy_name: + +- :ref:`String` **get_joy_name** **(** :ref:`int` device **)** + +Returns the name of the joypad at the specified device index. + +---- + +.. _class_Input_method_get_joy_vibration_duration: + +- :ref:`float` **get_joy_vibration_duration** **(** :ref:`int` device **)** + +Returns the duration of the current vibration effect in seconds. + +---- + +.. _class_Input_method_get_joy_vibration_strength: + +- :ref:`Vector2` **get_joy_vibration_strength** **(** :ref:`int` device **)** + +Returns the strength of the joypad vibration: x is the strength of the weak motor, and y is the strength of the strong motor. + +---- + +.. _class_Input_method_get_last_mouse_speed: + +- :ref:`Vector2` **get_last_mouse_speed** **(** **)** |const| + +Returns the mouse speed for the last time the cursor was moved, and this until the next frame where the mouse moves. This means that even if the mouse is not moving, this function will still return the value of the last motion. + +---- + +.. _class_Input_method_get_magnetometer: + +- :ref:`Vector3` **get_magnetometer** **(** **)** |const| + +Returns the magnetic field strength in micro-Tesla for all axes of the device's magnetometer sensor, if the device has one. Otherwise, the method returns :ref:`Vector3.ZERO`. + +**Note:** This method only works on Android, iOS and UWP. On other platforms, it always returns :ref:`Vector3.ZERO`. + +---- + +.. _class_Input_method_get_mouse_button_mask: + +- :ref:`int` **get_mouse_button_mask** **(** **)** |const| + +Returns mouse buttons as a bitmask. If multiple mouse buttons are pressed at the same time, the bits are added together. + +---- + +.. _class_Input_method_get_mouse_mode: + +- :ref:`MouseMode` **get_mouse_mode** **(** **)** |const| + +Returns the mouse mode. See the constants for more information. + +---- + +.. _class_Input_method_get_vector: + +- :ref:`Vector2` **get_vector** **(** :ref:`String` negative_x, :ref:`String` positive_x, :ref:`String` negative_y, :ref:`String` positive_y, :ref:`float` deadzone=-1.0 **)** |const| + +Gets an input vector by specifying four actions for the positive and negative X and Y axes. + +This method is useful when getting vector input, such as from a joystick, directional pad, arrows, or WASD. The vector has its length limited to 1 and has a circular deadzone, which is useful for using vector input as movement. + +By default, the deadzone is automatically calculated from the average of the action deadzones. However, you can override the deadzone to be whatever you want (on the range of 0 to 1). + +---- + +.. _class_Input_method_is_action_just_pressed: + +- :ref:`bool` **is_action_just_pressed** **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| + +Returns ``true`` when the user starts pressing the action event, meaning it's ``true`` only on the frame that the user pressed down the button. + +This is useful for code that needs to run only once when an action is pressed, instead of every frame while it's pressed. + +If ``exact`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +**Note:** Due to keyboard ghosting, :ref:`is_action_just_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_Input_method_is_action_just_released: + +- :ref:`bool` **is_action_just_released** **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| + +Returns ``true`` when the user stops pressing the action event, meaning it's ``true`` only on the frame that the user released the button. + +If ``exact`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_Input_method_is_action_pressed: + +- :ref:`bool` **is_action_pressed** **(** :ref:`String` action, :ref:`bool` exact=false **)** |const| + +Returns ``true`` if you are pressing the action event. Note that if an action has multiple buttons assigned and more than one of them is pressed, releasing one button will release the action, even if some other button assigned to this action is still pressed. + +If ``exact`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +**Note:** Due to keyboard ghosting, :ref:`is_action_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_Input_method_is_joy_button_pressed: + +- :ref:`bool` **is_joy_button_pressed** **(** :ref:`int` device, :ref:`int` button **)** |const| + +Returns ``true`` if you are pressing the joypad button (see :ref:`JoystickList`). + +---- + +.. _class_Input_method_is_joy_known: + +- :ref:`bool` **is_joy_known** **(** :ref:`int` device **)** + +Returns ``true`` if the system knows the specified device. This means that it sets all button and axis indices exactly as defined in :ref:`JoystickList`. Unknown joypads are not expected to match these constants, but you can still retrieve events from them. + +---- + +.. _class_Input_method_is_key_pressed: + +- :ref:`bool` **is_key_pressed** **(** :ref:`int` scancode **)** |const| + +Returns ``true`` if you are pressing the key in the current keyboard layout. You can pass a :ref:`KeyList` constant. + +:ref:`is_key_pressed` is only recommended over :ref:`is_physical_key_pressed` in non-game applications. This ensures that shortcut keys behave as expected depending on the user's keyboard layout, as keyboard shortcuts are generally dependent on the keyboard layout in non-game applications. If in doubt, use :ref:`is_physical_key_pressed`. + +**Note:** Due to keyboard ghosting, :ref:`is_key_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_Input_method_is_mouse_button_pressed: + +- :ref:`bool` **is_mouse_button_pressed** **(** :ref:`int` button **)** |const| + +Returns ``true`` if you are pressing the mouse button specified with :ref:`ButtonList`. + +---- + +.. _class_Input_method_is_physical_key_pressed: + +- :ref:`bool` **is_physical_key_pressed** **(** :ref:`int` scancode **)** |const| + +Returns ``true`` if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a :ref:`KeyList` constant. + +:ref:`is_physical_key_pressed` is recommended over :ref:`is_key_pressed` for in-game actions, as it will make W/A/S/D layouts work regardless of the user's keyboard layout. :ref:`is_physical_key_pressed` will also ensure that the top row number keys work on any keyboard layout. If in doubt, use :ref:`is_physical_key_pressed`. + +**Note:** Due to keyboard ghosting, :ref:`is_physical_key_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_Input_method_joy_connection_changed: + +- void **joy_connection_changed** **(** :ref:`int` device, :ref:`bool` connected, :ref:`String` name, :ref:`String` guid **)** + +Notifies the ``Input`` singleton that a connection has changed, to update the state for the ``device`` index. + +This is used internally and should not have to be called from user scripts. See :ref:`joy_connection_changed` for the signal emitted when this is triggered internally. + +---- + +.. _class_Input_method_parse_input_event: + +- void **parse_input_event** **(** :ref:`InputEvent` event **)** + +Feeds an :ref:`InputEvent` to the game. Can be used to artificially trigger input events from code. Also generates :ref:`Node._input` calls. + +Example: + +:: + + var a = InputEventAction.new() + a.action = "ui_cancel" + a.pressed = true + Input.parse_input_event(a) + +---- + +.. _class_Input_method_remove_joy_mapping: + +- void **remove_joy_mapping** **(** :ref:`String` guid **)** + +Removes all mappings from the internal database that match the given GUID. + +---- + +.. _class_Input_method_set_accelerometer: + +- void **set_accelerometer** **(** :ref:`Vector3` value **)** + +Sets the acceleration value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + +**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + +---- + +.. _class_Input_method_set_custom_mouse_cursor: + +- void **set_custom_mouse_cursor** **(** :ref:`Resource` image, :ref:`CursorShape` shape=0, :ref:`Vector2` hotspot=Vector2( 0, 0 ) **)** + +Sets a custom mouse cursor image, which is only visible inside the game window. The hotspot can also be specified. Passing ``null`` to the image parameter resets to the system cursor. See :ref:`CursorShape` for the list of shapes. + +``image``'s size must be lower than 256×256. + +``hotspot`` must be within ``image``'s size. + +**Note:** :ref:`AnimatedTexture`\ s aren't supported as custom mouse cursors. If using an :ref:`AnimatedTexture`, only the first frame will be displayed. + +**Note:** Only images imported with the **Lossless**, **Lossy** or **Uncompressed** compression modes are supported. The **Video RAM** compression mode can't be used for custom cursors. + +---- + +.. _class_Input_method_set_default_cursor_shape: + +- void **set_default_cursor_shape** **(** :ref:`CursorShape` shape=0 **)** + +Sets the default cursor shape to be used in the viewport instead of :ref:`CURSOR_ARROW`. + +**Note:** If you want to change the default cursor shape for :ref:`Control`'s nodes, use :ref:`Control.mouse_default_cursor_shape` instead. + +**Note:** This method generates an :ref:`InputEventMouseMotion` to update cursor immediately. + +---- + +.. _class_Input_method_set_gravity: + +- void **set_gravity** **(** :ref:`Vector3` value **)** + +Sets the gravity value of the accelerometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + +**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + +---- + +.. _class_Input_method_set_gyroscope: + +- void **set_gyroscope** **(** :ref:`Vector3` value **)** + +Sets the value of the rotation rate of the gyroscope sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + +**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + +---- + +.. _class_Input_method_set_magnetometer: + +- void **set_magnetometer** **(** :ref:`Vector3` value **)** + +Sets the value of the magnetic field of the magnetometer sensor. Can be used for debugging on devices without a hardware sensor, for example in an editor on a PC. + +**Note:** This value can be immediately overwritten by the hardware sensor value on Android and iOS. + +---- + +.. _class_Input_method_set_mouse_mode: + +- void **set_mouse_mode** **(** :ref:`MouseMode` mode **)** + +Sets the mouse mode. See the constants for more information. + +---- + +.. _class_Input_method_set_use_accumulated_input: + +- void **set_use_accumulated_input** **(** :ref:`bool` enable **)** + +Enables or disables the accumulation of similar input events sent by the operating system. When input accumulation is enabled, all input events generated during a frame will be merged and emitted when the frame is done rendering. Therefore, this limits the number of input method calls per second to the rendering FPS. + +Input accumulation is enabled by default. It can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage. In applications where drawing freehand lines is required, input accumulation should generally be disabled while the user is drawing the line to get results that closely follow the actual input. + +---- + +.. _class_Input_method_start_joy_vibration: + +- void **start_joy_vibration** **(** :ref:`int` device, :ref:`float` weak_magnitude, :ref:`float` strong_magnitude, :ref:`float` duration=0 **)** + +Starts to vibrate the joypad. Joypads usually come with two rumble motors, a strong and a weak one. ``weak_magnitude`` is the strength of the weak motor (between 0 and 1) and ``strong_magnitude`` is the strength of the strong motor (between 0 and 1). ``duration`` is the duration of the effect in seconds (a duration of 0 will try to play the vibration indefinitely). + +**Note:** Not every hardware is compatible with long effect durations; it is recommended to restart an effect if it has to be played for more than a few seconds. + +---- + +.. _class_Input_method_stop_joy_vibration: + +- void **stop_joy_vibration** **(** :ref:`int` device **)** + +Stops the vibration of the joypad. + +---- + +.. _class_Input_method_vibrate_handheld: + +- void **vibrate_handheld** **(** :ref:`int` duration_ms=500 **)** + +Vibrate Android and iOS devices. + +**Note:** It needs ``VIBRATE`` permission for Android at export settings. iOS does not support duration. + +---- + +.. _class_Input_method_warp_mouse_position: + +- void **warp_mouse_position** **(** :ref:`Vector2` to **)** + +Sets the mouse position to the specified vector, provided in pixels and relative to an origin at the upper left corner of the game window. + +Mouse position is clipped to the limits of the screen resolution, or to the limits of the game window if :ref:`MouseMode` is set to :ref:`MOUSE_MODE_CONFINED`. + +.. |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.)` diff --git a/classes/class_inputevent.rst b/classes/class_inputevent.rst new file mode 100644 index 0000000..4ab3da4 --- /dev/null +++ b/classes/class_inputevent.rst @@ -0,0 +1,194 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEvent.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEvent: + +InputEvent +========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`InputEventAction`, :ref:`InputEventJoypadButton`, :ref:`InputEventJoypadMotion`, :ref:`InputEventMIDI`, :ref:`InputEventScreenDrag`, :ref:`InputEventScreenTouch`, :ref:`InputEventWithModifiers` + +Generic input event. + +Description +----------- + +Base class of all sort of input event. See :ref:`Node._input`. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +- :doc:`../tutorials/2d/2d_transforms` + +- `2D Dodge The Creeps Demo `__ + +- `3D Voxel Demo `__ + +Properties +---------- + ++-----------------------+-------------------------------------------------+-------+ +| :ref:`int` | :ref:`device` | ``0`` | ++-----------------------+-------------------------------------------------+-------+ + +Methods +------- + ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`accumulate` **(** :ref:`InputEvent` with_event **)** | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`as_text` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_action_strength` **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action` **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_pressed` **(** :ref:`String` action, :ref:`bool` allow_echo=false, :ref:`bool` exact_match=false **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_released` **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_action_type` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_echo` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_pressed` **(** **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`shortcut_match` **(** :ref:`InputEvent` event, :ref:`bool` exact_match=true **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`InputEvent` | :ref:`xformed_by` **(** :ref:`Transform2D` xform, :ref:`Vector2` local_ofs=Vector2( 0, 0 ) **)** |const| | ++-------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEvent_property_device: + +- :ref:`int` **device** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_device(value) | ++-----------+-------------------+ +| *Getter* | get_device() | ++-----------+-------------------+ + +The event's device ID. + +**Note:** This device ID will always be ``-1`` for emulated mouse input from a touchscreen. This can be used to distinguish emulated mouse input from physical mouse input. + +Method Descriptions +------------------- + +.. _class_InputEvent_method_accumulate: + +- :ref:`bool` **accumulate** **(** :ref:`InputEvent` with_event **)** + +Returns ``true`` if the given input event and this input event can be added together (only for events of type :ref:`InputEventMouseMotion`). + +The given input event's position, global position and speed will be copied. The resulting ``relative`` is a sum of both events. Both events' modifiers have to be identical. + +---- + +.. _class_InputEvent_method_as_text: + +- :ref:`String` **as_text** **(** **)** |const| + +Returns a :ref:`String` representation of the event. + +---- + +.. _class_InputEvent_method_get_action_strength: + +- :ref:`float` **get_action_strength** **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| + +Returns a value between 0.0 and 1.0 depending on the given actions' state. Useful for getting the value of events of type :ref:`InputEventJoypadMotion`. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_InputEvent_method_is_action: + +- :ref:`bool` **is_action** **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| + +Returns ``true`` if this input event matches a pre-defined action of any type. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_InputEvent_method_is_action_pressed: + +- :ref:`bool` **is_action_pressed** **(** :ref:`String` action, :ref:`bool` allow_echo=false, :ref:`bool` exact_match=false **)** |const| + +Returns ``true`` if the given action is being pressed (and is not an echo event for :ref:`InputEventKey` events, unless ``allow_echo`` is ``true``). Not relevant for events of type :ref:`InputEventMouseMotion` or :ref:`InputEventScreenDrag`. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +**Note:** Due to keyboard ghosting, :ref:`is_action_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_InputEvent_method_is_action_released: + +- :ref:`bool` **is_action_released** **(** :ref:`String` action, :ref:`bool` exact_match=false **)** |const| + +Returns ``true`` if the given action is released (i.e. not pressed). Not relevant for events of type :ref:`InputEventMouseMotion` or :ref:`InputEventScreenDrag`. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_InputEvent_method_is_action_type: + +- :ref:`bool` **is_action_type** **(** **)** |const| + +Returns ``true`` if this input event's type is one that can be assigned to an input action. + +---- + +.. _class_InputEvent_method_is_echo: + +- :ref:`bool` **is_echo** **(** **)** |const| + +Returns ``true`` if this input event is an echo event (only for events of type :ref:`InputEventKey`). + +---- + +.. _class_InputEvent_method_is_pressed: + +- :ref:`bool` **is_pressed** **(** **)** |const| + +Returns ``true`` if this input event is pressed. Not relevant for events of type :ref:`InputEventMouseMotion` or :ref:`InputEventScreenDrag`. + +**Note:** Due to keyboard ghosting, :ref:`is_action_pressed` may return ``false`` even if one of the action's keys is pressed. See `Input examples `__ in the documentation for more information. + +---- + +.. _class_InputEvent_method_shortcut_match: + +- :ref:`bool` **shortcut_match** **(** :ref:`InputEvent` event, :ref:`bool` exact_match=true **)** |const| + +Returns ``true`` if the specified ``event`` matches this event. Only valid for action events i.e key (:ref:`InputEventKey`), button (:ref:`InputEventMouseButton` or :ref:`InputEventJoypadButton`), axis :ref:`InputEventJoypadMotion` or action (:ref:`InputEventAction`) events. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_InputEvent_method_xformed_by: + +- :ref:`InputEvent` **xformed_by** **(** :ref:`Transform2D` xform, :ref:`Vector2` local_ofs=Vector2( 0, 0 ) **)** |const| + +Returns a copy of the given input event which has been offset by ``local_ofs`` and transformed by ``xform``. Relevant for events of type :ref:`InputEventMouseButton`, :ref:`InputEventMouseMotion`, :ref:`InputEventScreenTouch`, :ref:`InputEventScreenDrag`, :ref:`InputEventMagnifyGesture` and :ref:`InputEventPanGesture`. + +.. |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.)` diff --git a/classes/class_inputeventaction.rst b/classes/class_inputeventaction.rst new file mode 100644 index 0000000..875734a --- /dev/null +++ b/classes/class_inputeventaction.rst @@ -0,0 +1,92 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventAction.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventAction: + +InputEventAction +================ + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for actions. + +Description +----------- + +Contains a generic action which can be targeted from several types of inputs. Actions can be created from the **Input Map** tab in the **Project > Project Settings** menu. See :ref:`Node._input`. + +Tutorials +--------- + +- `#actions <../tutorials/inputs/inputevent.html#actions>`_ in :doc:`../tutorials/inputs/inputevent` + +- `2D Dodge The Creeps Demo `__ + +- `3D Voxel Demo `__ + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`action` | ``""`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++-----------------------------+-----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`strength` | ``1.0`` | ++-----------------------------+-----------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_InputEventAction_property_action: + +- :ref:`String` **action** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_action(value) | ++-----------+-------------------+ +| *Getter* | get_action() | ++-----------+-------------------+ + +The action's name. Actions are accessed via this :ref:`String`. + +---- + +.. _class_InputEventAction_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the action's state is pressed. If ``false``, the action's state is released. + +---- + +.. _class_InputEventAction_property_strength: + +- :ref:`float` **strength** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_strength(value) | ++-----------+---------------------+ +| *Getter* | get_strength() | ++-----------+---------------------+ + +The action's strength between 0 and 1. This value is considered as equal to 0 if pressed is ``false``. The event strength allows faking analog joypad motion events, by specifying how strongly the joypad axis is bent or pressed. + +.. |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.)` diff --git a/classes/class_inputeventgesture.rst b/classes/class_inputeventgesture.rst new file mode 100644 index 0000000..52cb3fd --- /dev/null +++ b/classes/class_inputeventgesture.rst @@ -0,0 +1,44 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventGesture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventGesture: + +InputEventGesture +================= + +**Inherits:** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`InputEventMagnifyGesture`, :ref:`InputEventPanGesture` + +Base class for touch control gestures. + +Properties +---------- + ++-------------------------------+------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventGesture_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_position(value) | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The local gesture position relative to the :ref:`Viewport`. If used in :ref:`Control._gui_input`, the position is relative to the current :ref:`Control` that received this gesture. + +.. |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.)` diff --git a/classes/class_inputeventjoypadbutton.rst b/classes/class_inputeventjoypadbutton.rst new file mode 100644 index 0000000..315a0de --- /dev/null +++ b/classes/class_inputeventjoypadbutton.rst @@ -0,0 +1,88 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventJoypadButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventJoypadButton: + +InputEventJoypadButton +====================== + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event for gamepad buttons. + +Description +----------- + +Input event type for gamepad buttons. For gamepad analog sticks and joysticks, see :ref:`InputEventJoypadMotion`. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`button_index` | ``0`` | ++---------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++---------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`pressure` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_InputEventJoypadButton_property_button_index: + +- :ref:`int` **button_index** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_button_index(value) | ++-----------+-------------------------+ +| *Getter* | get_button_index() | ++-----------+-------------------------+ + +Button identifier. One of the :ref:`JoystickList` button constants. + +---- + +.. _class_InputEventJoypadButton_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the button's state is pressed. If ``false``, the button's state is released. + +---- + +.. _class_InputEventJoypadButton_property_pressure: + +- :ref:`float` **pressure** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_pressure(value) | ++-----------+---------------------+ +| *Getter* | get_pressure() | ++-----------+---------------------+ + +Represents the pressure the user puts on the button with his finger, if the controller supports it. Ranges from ``0`` to ``1``. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_inputeventjoypadmotion.rst b/classes/class_inputeventjoypadmotion.rst new file mode 100644 index 0000000..17a51b1 --- /dev/null +++ b/classes/class_inputeventjoypadmotion.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventJoypadMotion.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventJoypadMotion: + +InputEventJoypadMotion +====================== + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for gamepad joysticks and other motions. For buttons, see ``InputEventJoypadButton``. + +Description +----------- + +Stores information about joystick motions. One ``InputEventJoypadMotion`` represents one axis at a time. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`int` | :ref:`axis` | ``0`` | ++---------------------------+---------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`axis_value` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_InputEventJoypadMotion_property_axis: + +- :ref:`int` **axis** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_axis(value) | ++-----------+-----------------+ +| *Getter* | get_axis() | ++-----------+-----------------+ + +Axis identifier. Use one of the :ref:`JoystickList` axis constants. + +---- + +.. _class_InputEventJoypadMotion_property_axis_value: + +- :ref:`float` **axis_value** + ++-----------+-----------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------+ +| *Setter* | set_axis_value(value) | ++-----------+-----------------------+ +| *Getter* | get_axis_value() | ++-----------+-----------------------+ + +Current position of the joystick on the given axis. The value ranges from ``-1.0`` to ``1.0``. A value of ``0`` means the axis is in its resting position. + +.. |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.)` diff --git a/classes/class_inputeventkey.rst b/classes/class_inputeventkey.rst new file mode 100644 index 0000000..48f27fd --- /dev/null +++ b/classes/class_inputeventkey.rst @@ -0,0 +1,158 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventKey.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventKey: + +InputEventKey +============= + +**Inherits:** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for keyboard events. + +Description +----------- + +Stores key presses on the keyboard. Supports key presses, key releases and :ref:`echo` events. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`echo` | ``false`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`physical_scancode` | ``0`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`scancode` | ``0`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`unicode` | ``0`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_physical_scancode_with_modifiers` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_scancode_with_modifiers` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventKey_property_echo: + +- :ref:`bool` **echo** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_echo(value) | ++-----------+-----------------+ +| *Getter* | is_echo() | ++-----------+-----------------+ + +If ``true``, the key was already pressed before this event. It means the user is holding the key down. + +---- + +.. _class_InputEventKey_property_physical_scancode: + +- :ref:`int` **physical_scancode** + ++-----------+------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------+ +| *Setter* | set_physical_scancode(value) | ++-----------+------------------------------+ +| *Getter* | get_physical_scancode() | ++-----------+------------------------------+ + +Key physical scancode, which corresponds to one of the :ref:`KeyList` constants. Represent the physical location of a key on the 101/102-key US QWERTY keyboard. + +To get a human-readable representation of the ``InputEventKey``, use ``OS.get_scancode_string(event.physical_scancode)`` where ``event`` is the ``InputEventKey``. + +---- + +.. _class_InputEventKey_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the key's state is pressed. If ``false``, the key's state is released. + +---- + +.. _class_InputEventKey_property_scancode: + +- :ref:`int` **scancode** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_scancode(value) | ++-----------+---------------------+ +| *Getter* | get_scancode() | ++-----------+---------------------+ + +The key scancode, which corresponds to one of the :ref:`KeyList` constants. Represent key in the current keyboard layout. + +To get a human-readable representation of the ``InputEventKey``, use ``OS.get_scancode_string(event.scancode)`` where ``event`` is the ``InputEventKey``. + +---- + +.. _class_InputEventKey_property_unicode: + +- :ref:`int` **unicode** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_unicode(value) | ++-----------+--------------------+ +| *Getter* | get_unicode() | ++-----------+--------------------+ + +The key Unicode identifier (when relevant). Unicode identifiers for the composite characters and complex scripts may not be available unless IME input mode is active. See :ref:`OS.set_ime_active` for more information. + +Method Descriptions +------------------- + +.. _class_InputEventKey_method_get_physical_scancode_with_modifiers: + +- :ref:`int` **get_physical_scancode_with_modifiers** **(** **)** |const| + +Returns the physical scancode combined with modifier keys such as ``Shift`` or ``Alt``. See also :ref:`InputEventWithModifiers`. + +To get a human-readable representation of the ``InputEventKey`` with modifiers, use ``OS.get_scancode_string(event.get_physical_scancode_with_modifiers())`` where ``event`` is the ``InputEventKey``. + +---- + +.. _class_InputEventKey_method_get_scancode_with_modifiers: + +- :ref:`int` **get_scancode_with_modifiers** **(** **)** |const| + +Returns the scancode combined with modifier keys such as ``Shift`` or ``Alt``. See also :ref:`InputEventWithModifiers`. + +To get a human-readable representation of the ``InputEventKey`` with modifiers, use ``OS.get_scancode_string(event.get_scancode_with_modifiers())`` where ``event`` is the ``InputEventKey``. + +.. |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.)` diff --git a/classes/class_inputeventmagnifygesture.rst b/classes/class_inputeventmagnifygesture.rst new file mode 100644 index 0000000..c56370b --- /dev/null +++ b/classes/class_inputeventmagnifygesture.rst @@ -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 InputEventMagnifyGesture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventMagnifyGesture: + +InputEventMagnifyGesture +======================== + +**Inherits:** :ref:`InputEventGesture` **<** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------+---------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`factor` | ``1.0`` | ++---------------------------+---------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_InputEventMagnifyGesture_property_factor: + +- :ref:`float` **factor** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_factor(value) | ++-----------+-------------------+ +| *Getter* | get_factor() | ++-----------+-------------------+ + +.. |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.)` diff --git a/classes/class_inputeventmidi.rst b/classes/class_inputeventmidi.rst new file mode 100644 index 0000000..cc09810 --- /dev/null +++ b/classes/class_inputeventmidi.rst @@ -0,0 +1,152 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventMIDI.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventMIDI: + +InputEventMIDI +============== + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`channel` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`controller_number` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`controller_value` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`instrument` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`message` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`pitch` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`pressure` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`velocity` | ``0`` | ++-----------------------+---------------------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_InputEventMIDI_property_channel: + +- :ref:`int` **channel** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_channel(value) | ++-----------+--------------------+ +| *Getter* | get_channel() | ++-----------+--------------------+ + +---- + +.. _class_InputEventMIDI_property_controller_number: + +- :ref:`int` **controller_number** + ++-----------+------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------+ +| *Setter* | set_controller_number(value) | ++-----------+------------------------------+ +| *Getter* | get_controller_number() | ++-----------+------------------------------+ + +---- + +.. _class_InputEventMIDI_property_controller_value: + +- :ref:`int` **controller_value** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_controller_value(value) | ++-----------+-----------------------------+ +| *Getter* | get_controller_value() | ++-----------+-----------------------------+ + +---- + +.. _class_InputEventMIDI_property_instrument: + +- :ref:`int` **instrument** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_instrument(value) | ++-----------+-----------------------+ +| *Getter* | get_instrument() | ++-----------+-----------------------+ + +---- + +.. _class_InputEventMIDI_property_message: + +- :ref:`int` **message** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_message(value) | ++-----------+--------------------+ +| *Getter* | get_message() | ++-----------+--------------------+ + +---- + +.. _class_InputEventMIDI_property_pitch: + +- :ref:`int` **pitch** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_pitch(value) | ++-----------+------------------+ +| *Getter* | get_pitch() | ++-----------+------------------+ + +---- + +.. _class_InputEventMIDI_property_pressure: + +- :ref:`int` **pressure** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_pressure(value) | ++-----------+---------------------+ +| *Getter* | get_pressure() | ++-----------+---------------------+ + +---- + +.. _class_InputEventMIDI_property_velocity: + +- :ref:`int` **velocity** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_velocity(value) | ++-----------+---------------------+ +| *Getter* | get_velocity() | ++-----------+---------------------+ + +.. |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.)` diff --git a/classes/class_inputeventmouse.rst b/classes/class_inputeventmouse.rst new file mode 100644 index 0000000..df96a25 --- /dev/null +++ b/classes/class_inputeventmouse.rst @@ -0,0 +1,90 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventMouse.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventMouse: + +InputEventMouse +=============== + +**Inherits:** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`InputEventMouseButton`, :ref:`InputEventMouseMotion` + +Base input event type for mouse events. + +Description +----------- + +Stores general mouse events information. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`button_mask` | ``0`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`global_position` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventMouse_property_button_mask: + +- :ref:`int` **button_mask** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_button_mask(value) | ++-----------+------------------------+ +| *Getter* | get_button_mask() | ++-----------+------------------------+ + +The mouse button mask identifier, one of or a bitwise combination of the :ref:`ButtonList` button masks. + +---- + +.. _class_InputEventMouse_property_global_position: + +- :ref:`Vector2` **global_position** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_global_position(value) | ++-----------+----------------------------+ +| *Getter* | get_global_position() | ++-----------+----------------------------+ + +The global mouse position relative to the current :ref:`Viewport`. If used in :ref:`Control._gui_input` and if the current :ref:`Control` is not under the mouse, moving it will not update this value. + +---- + +.. _class_InputEventMouse_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_position(value) | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The local mouse position relative to the :ref:`Viewport`. If used in :ref:`Control._gui_input`, the position is relative to the current :ref:`Control` which is under the mouse. If the current :ref:`Control` is not under the mouse, moving it will not update this value. + +.. |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.)` diff --git a/classes/class_inputeventmousebutton.rst b/classes/class_inputeventmousebutton.rst new file mode 100644 index 0000000..f8483ac --- /dev/null +++ b/classes/class_inputeventmousebutton.rst @@ -0,0 +1,106 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventMouseButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventMouseButton: + +InputEventMouseButton +===================== + +**Inherits:** :ref:`InputEventMouse` **<** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for mouse button events. + +Description +----------- + +Contains mouse click information. See :ref:`Node._input`. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/mouse_and_input_coordinates` + +Properties +---------- + ++---------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`button_index` | ``0`` | ++---------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`doubleclick` | ``false`` | ++---------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`factor` | ``1.0`` | ++---------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++---------------------------+------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_InputEventMouseButton_property_button_index: + +- :ref:`int` **button_index** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_button_index(value) | ++-----------+-------------------------+ +| *Getter* | get_button_index() | ++-----------+-------------------------+ + +The mouse button identifier, one of the :ref:`ButtonList` button or button wheel constants. + +---- + +.. _class_InputEventMouseButton_property_doubleclick: + +- :ref:`bool` **doubleclick** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_doubleclick(value) | ++-----------+------------------------+ +| *Getter* | is_doubleclick() | ++-----------+------------------------+ + +If ``true``, the mouse button's state is a double-click. + +---- + +.. _class_InputEventMouseButton_property_factor: + +- :ref:`float` **factor** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_factor(value) | ++-----------+-------------------+ +| *Getter* | get_factor() | ++-----------+-------------------+ + +The amount (or delta) of the event. When used for high-precision scroll events, this indicates the scroll amount (vertical or horizontal). This is only supported on some platforms; the reported sensitivity varies depending on the platform. May be ``0`` if not supported. + +---- + +.. _class_InputEventMouseButton_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the mouse button's state is pressed. If ``false``, the mouse button's state is released. + +.. |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.)` diff --git a/classes/class_inputeventmousemotion.rst b/classes/class_inputeventmousemotion.rst new file mode 100644 index 0000000..c8c0ca4 --- /dev/null +++ b/classes/class_inputeventmousemotion.rst @@ -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 InputEventMouseMotion.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventMouseMotion: + +InputEventMouseMotion +===================== + +**Inherits:** :ref:`InputEventMouse` **<** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for mouse motion events. + +Description +----------- + +Contains mouse and pen motion information. Supports relative, absolute positions and speed. See :ref:`Node._input`. + +**Note:** By default, this event is only emitted once per frame rendered at most. If you need more precise input reporting, call :ref:`Input.set_use_accumulated_input` with ``false`` to make events emitted as often as possible. If you use InputEventMouseMotion to draw lines, consider implementing `Bresenham's line algorithm `__ as well to avoid visible gaps in lines if the user is moving the mouse quickly. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/mouse_and_input_coordinates` + +- `3D Voxel Demo `__ + +Properties +---------- + ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`pressure` | ``0.0`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`relative` | ``Vector2( 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`speed` | ``Vector2( 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`tilt` | ``Vector2( 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventMouseMotion_property_pressure: + +- :ref:`float` **pressure** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_pressure(value) | ++-----------+---------------------+ +| *Getter* | get_pressure() | ++-----------+---------------------+ + +Represents the pressure the user puts on the pen. Ranges from ``0.0`` to ``1.0``. + +---- + +.. _class_InputEventMouseMotion_property_relative: + +- :ref:`Vector2` **relative** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_relative(value) | ++-----------+---------------------+ +| *Getter* | get_relative() | ++-----------+---------------------+ + +The mouse position relative to the previous position (position at the last frame). + +**Note:** Since ``InputEventMouseMotion`` is only emitted when the mouse moves, the last event won't have a relative position of ``Vector2(0, 0)`` when the user stops moving the mouse. + +---- + +.. _class_InputEventMouseMotion_property_speed: + +- :ref:`Vector2` **speed** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_speed(value) | ++-----------+---------------------+ +| *Getter* | get_speed() | ++-----------+---------------------+ + +The mouse speed in pixels per second. + +---- + +.. _class_InputEventMouseMotion_property_tilt: + +- :ref:`Vector2` **tilt** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_tilt(value) | ++-----------+---------------------+ +| *Getter* | get_tilt() | ++-----------+---------------------+ + +Represents the angles of tilt of the pen. Positive X-coordinate value indicates a tilt to the right. Positive Y-coordinate value indicates a tilt toward the user. Ranges from ``-1.0`` to ``1.0`` for both axes. + +.. |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.)` diff --git a/classes/class_inputeventpangesture.rst b/classes/class_inputeventpangesture.rst new file mode 100644 index 0000000..1c977a6 --- /dev/null +++ b/classes/class_inputeventpangesture.rst @@ -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 InputEventPanGesture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventPanGesture: + +InputEventPanGesture +==================== + +**Inherits:** :ref:`InputEventGesture` **<** :ref:`InputEventWithModifiers` **<** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------+---------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`delta` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventPanGesture_property_delta: + +- :ref:`Vector2` **delta** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_delta(value) | ++-----------+---------------------+ +| *Getter* | get_delta() | ++-----------+---------------------+ + +.. |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.)` diff --git a/classes/class_inputeventscreendrag.rst b/classes/class_inputeventscreendrag.rst new file mode 100644 index 0000000..efc05ba --- /dev/null +++ b/classes/class_inputeventscreendrag.rst @@ -0,0 +1,106 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventScreenDrag.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventScreenDrag: + +InputEventScreenDrag +==================== + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for screen drag events. Only available on mobile devices. + +Description +----------- + +Contains screen drag information. See :ref:`Node._input`. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++-------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`index` | ``0`` | ++-------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`relative` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`speed` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventScreenDrag_property_index: + +- :ref:`int` **index** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_index(value) | ++-----------+------------------+ +| *Getter* | get_index() | ++-----------+------------------+ + +The drag event index in the case of a multi-drag event. + +---- + +.. _class_InputEventScreenDrag_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_position(value) | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The drag position. + +---- + +.. _class_InputEventScreenDrag_property_relative: + +- :ref:`Vector2` **relative** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_relative(value) | ++-----------+---------------------+ +| *Getter* | get_relative() | ++-----------+---------------------+ + +The drag position relative to the previous position (position at the last frame). + +---- + +.. _class_InputEventScreenDrag_property_speed: + +- :ref:`Vector2` **speed** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_speed(value) | ++-----------+---------------------+ +| *Getter* | get_speed() | ++-----------+---------------------+ + +The drag speed. + +.. |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.)` diff --git a/classes/class_inputeventscreentouch.rst b/classes/class_inputeventscreentouch.rst new file mode 100644 index 0000000..2148bae --- /dev/null +++ b/classes/class_inputeventscreentouch.rst @@ -0,0 +1,90 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputEventScreenTouch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventScreenTouch: + +InputEventScreenTouch +===================== + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Input event type for screen touch events. + +(only available on mobile devices) + +Description +----------- + +Stores multi-touch press/release information. Supports touch press, touch release and :ref:`index` for multi-touch count and order. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`index` | ``0`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`pressed` | ``false`` | ++-------------------------------+----------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_InputEventScreenTouch_property_index: + +- :ref:`int` **index** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_index(value) | ++-----------+------------------+ +| *Getter* | get_index() | ++-----------+------------------+ + +The touch index in the case of a multi-touch event. One index = one finger. + +---- + +.. _class_InputEventScreenTouch_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_position(value) | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The touch position. + +---- + +.. _class_InputEventScreenTouch_property_pressed: + +- :ref:`bool` **pressed** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_pressed(value) | ++-----------+--------------------+ +| *Getter* | is_pressed() | ++-----------+--------------------+ + +If ``true``, the touch's state is pressed. If ``false``, the touch's state is released. + +.. |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.)` diff --git a/classes/class_inputeventwithmodifiers.rst b/classes/class_inputeventwithmodifiers.rst new file mode 100644 index 0000000..3818ff1 --- /dev/null +++ b/classes/class_inputeventwithmodifiers.rst @@ -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 InputEventWithModifiers.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputEventWithModifiers: + +InputEventWithModifiers +======================= + +**Inherits:** :ref:`InputEvent` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`InputEventGesture`, :ref:`InputEventKey`, :ref:`InputEventMouse` + +Base class for keys events with modifiers. + +Description +----------- + +Contains keys events information with modifiers support like ``Shift`` or ``Alt``. See :ref:`Node._input`. + +Tutorials +--------- + +- :doc:`../tutorials/inputs/inputevent` + +Properties +---------- + ++-------------------------+----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`alt` | ``false`` | ++-------------------------+----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`command` | ``false`` | ++-------------------------+----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`control` | ``false`` | ++-------------------------+----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`meta` | ``false`` | ++-------------------------+----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`shift` | ``false`` | ++-------------------------+----------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_InputEventWithModifiers_property_alt: + +- :ref:`bool` **alt** + ++-----------+----------------+ +| *Default* | ``false`` | ++-----------+----------------+ +| *Setter* | set_alt(value) | ++-----------+----------------+ +| *Getter* | get_alt() | ++-----------+----------------+ + +State of the ``Alt`` modifier. + +---- + +.. _class_InputEventWithModifiers_property_command: + +- :ref:`bool` **command** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_command(value) | ++-----------+--------------------+ +| *Getter* | get_command() | ++-----------+--------------------+ + +State of the ``Command`` modifier. + +---- + +.. _class_InputEventWithModifiers_property_control: + +- :ref:`bool` **control** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_control(value) | ++-----------+--------------------+ +| *Getter* | get_control() | ++-----------+--------------------+ + +State of the ``Ctrl`` modifier. + +---- + +.. _class_InputEventWithModifiers_property_meta: + +- :ref:`bool` **meta** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_metakey(value) | ++-----------+--------------------+ +| *Getter* | get_metakey() | ++-----------+--------------------+ + +State of the ``Meta`` modifier. + +---- + +.. _class_InputEventWithModifiers_property_shift: + +- :ref:`bool` **shift** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_shift(value) | ++-----------+------------------+ +| *Getter* | get_shift() | ++-----------+------------------+ + +State of the ``Shift`` modifier. + +.. |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.)` diff --git a/classes/class_inputmap.rst b/classes/class_inputmap.rst new file mode 100644 index 0000000..3042884 --- /dev/null +++ b/classes/class_inputmap.rst @@ -0,0 +1,168 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InputMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InputMap: + +InputMap +======== + +**Inherits:** :ref:`Object` + +Singleton that manages :ref:`InputEventAction`. + +Description +----------- + +Manages all :ref:`InputEventAction` which can be created/modified from the project settings menu **Project > Project Settings > Input Map** or in code with :ref:`add_action` and :ref:`action_add_event`. See :ref:`Node._input`. + +Tutorials +--------- + +- `#inputmap <../tutorials/inputs/inputevent.html#inputmap>`_ in :doc:`../tutorials/inputs/inputevent` + +Methods +------- + ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_add_event` **(** :ref:`String` action, :ref:`InputEvent` event **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_erase_event` **(** :ref:`String` action, :ref:`InputEvent` event **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_erase_events` **(** :ref:`String` action **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`action_get_deadzone` **(** :ref:`String` action **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`action_has_event` **(** :ref:`String` action, :ref:`InputEvent` event **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`action_set_deadzone` **(** :ref:`String` action, :ref:`float` deadzone **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_action` **(** :ref:`String` action, :ref:`float` deadzone=0.5 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_action` **(** :ref:`String` action **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`event_is_action` **(** :ref:`InputEvent` event, :ref:`String` action, :ref:`bool` exact_match=false **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_action_list` **(** :ref:`String` action **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_actions` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_action` **(** :ref:`String` action **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`load_from_globals` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_InputMap_method_action_add_event: + +- void **action_add_event** **(** :ref:`String` action, :ref:`InputEvent` event **)** + +Adds an :ref:`InputEvent` to an action. This :ref:`InputEvent` will trigger the action. + +---- + +.. _class_InputMap_method_action_erase_event: + +- void **action_erase_event** **(** :ref:`String` action, :ref:`InputEvent` event **)** + +Removes an :ref:`InputEvent` from an action. + +---- + +.. _class_InputMap_method_action_erase_events: + +- void **action_erase_events** **(** :ref:`String` action **)** + +Removes all events from an action. + +---- + +.. _class_InputMap_method_action_get_deadzone: + +- :ref:`float` **action_get_deadzone** **(** :ref:`String` action **)** + +Returns a deadzone value for the action. + +---- + +.. _class_InputMap_method_action_has_event: + +- :ref:`bool` **action_has_event** **(** :ref:`String` action, :ref:`InputEvent` event **)** + +Returns ``true`` if the action has the given :ref:`InputEvent` associated with it. + +---- + +.. _class_InputMap_method_action_set_deadzone: + +- void **action_set_deadzone** **(** :ref:`String` action, :ref:`float` deadzone **)** + +Sets a deadzone value for the action. + +---- + +.. _class_InputMap_method_add_action: + +- void **add_action** **(** :ref:`String` action, :ref:`float` deadzone=0.5 **)** + +Adds an empty action to the ``InputMap`` with a configurable ``deadzone``. + +An :ref:`InputEvent` can then be added to this action with :ref:`action_add_event`. + +---- + +.. _class_InputMap_method_erase_action: + +- void **erase_action** **(** :ref:`String` action **)** + +Removes an action from the ``InputMap``. + +---- + +.. _class_InputMap_method_event_is_action: + +- :ref:`bool` **event_is_action** **(** :ref:`InputEvent` event, :ref:`String` action, :ref:`bool` exact_match=false **)** |const| + +Returns ``true`` if the given event is part of an existing action. This method ignores keyboard modifiers if the given :ref:`InputEvent` is not pressed (for proper release detection). See :ref:`action_has_event` if you don't want this behavior. + +If ``exact_match`` is ``false``, it ignores the input modifiers for :ref:`InputEventKey` and :ref:`InputEventMouseButton` events, and the direction for :ref:`InputEventJoypadMotion` events. + +---- + +.. _class_InputMap_method_get_action_list: + +- :ref:`Array` **get_action_list** **(** :ref:`String` action **)** + +Returns an array of :ref:`InputEvent`\ s associated with a given action. + +---- + +.. _class_InputMap_method_get_actions: + +- :ref:`Array` **get_actions** **(** **)** + +Returns an array of all actions in the ``InputMap``. + +---- + +.. _class_InputMap_method_has_action: + +- :ref:`bool` **has_action** **(** :ref:`String` action **)** |const| + +Returns ``true`` if the ``InputMap`` has a registered action with the given name. + +---- + +.. _class_InputMap_method_load_from_globals: + +- void **load_from_globals** **(** **)** + +Clears all :ref:`InputEventAction` in the ``InputMap`` and load it anew from :ref:`ProjectSettings`. + +.. |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.)` diff --git a/classes/class_instanceplaceholder.rst b/classes/class_instanceplaceholder.rst new file mode 100644 index 0000000..7a2dfe1 --- /dev/null +++ b/classes/class_instanceplaceholder.rst @@ -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 InstancePlaceholder.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InstancePlaceholder: + +InstancePlaceholder +=================== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Placeholder for the root :ref:`Node` of a :ref:`PackedScene`. + +Description +----------- + +Turning on the option **Load As Placeholder** for an instanced scene in the editor causes it to be replaced by an InstancePlaceholder when running the game. This makes it possible to delay actually loading the scene until calling :ref:`replace_by_instance`. This is useful to avoid loading large scenes all at once by loading parts of it selectively. + +The InstancePlaceholder does not have a transform. This causes any child nodes to be positioned relatively to the Viewport from point (0,0), rather than their parent as displayed in the editor. Replacing the placeholder with a scene with a transform will transform children relatively to their parent again. + +Methods +------- + ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`create_instance` **(** :ref:`bool` replace=false, :ref:`PackedScene` custom_scene=null **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_instance_path` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_stored_values` **(** :ref:`bool` with_order=false **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`replace_by_instance` **(** :ref:`PackedScene` custom_scene=null **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_InstancePlaceholder_method_create_instance: + +- :ref:`Node` **create_instance** **(** :ref:`bool` replace=false, :ref:`PackedScene` custom_scene=null **)** + +Not thread-safe. Use :ref:`Object.call_deferred` if calling from a thread. + +---- + +.. _class_InstancePlaceholder_method_get_instance_path: + +- :ref:`String` **get_instance_path** **(** **)** |const| + +Gets the path to the :ref:`PackedScene` resource file that is loaded by default when calling :ref:`replace_by_instance`. Not thread-safe. Use :ref:`Object.call_deferred` if calling from a thread. + +---- + +.. _class_InstancePlaceholder_method_get_stored_values: + +- :ref:`Dictionary` **get_stored_values** **(** :ref:`bool` with_order=false **)** + +---- + +.. _class_InstancePlaceholder_method_replace_by_instance: + +- void **replace_by_instance** **(** :ref:`PackedScene` custom_scene=null **)** + +Replaces this placeholder by the scene handed as an argument, or the original scene if no argument is given. As for all resources, the scene is loaded only if it's not loaded already. By manually loading the scene beforehand, delays caused by this function can be avoided. + +.. |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.)` diff --git a/classes/class_int.rst b/classes/class_int.rst new file mode 100644 index 0000000..a769c13 --- /dev/null +++ b/classes/class_int.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the int.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_int: + +int +=== + +Integer built-in type. + +Description +----------- + +Signed 64-bit integer type. + +It can take values in the interval ``[-2^63, 2^63 - 1]``, i.e. ``[-9223372036854775808, 9223372036854775807]``. Exceeding those bounds will wrap around. + +``int`` is a :ref:`Variant` type, and will thus be used when assigning an integer value to a :ref:`Variant`. It can also be enforced with the ``: int`` type hint. + +:: + + var my_variant = 0 # int, value 0. + my_variant += 4.2 # float, value 4.2. + var my_int: int = 1 # int, value 1. + my_int = 4.2 # int, value 4, the right value is implicitly cast to int. + my_int = int("6.7") # int, value 6, the String is explicitly cast with int. + + var max_int = 9223372036854775807 + print(max_int) # 9223372036854775807, OK. + max_int += 1 + print(max_int) # -9223372036854775808, we overflowed and wrapped around. + +Methods +------- + ++-----------------------+-------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`int` **(** :ref:`bool` from **)** | ++-----------------------+-------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`int` **(** :ref:`float` from **)** | ++-----------------------+-------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`int` **(** :ref:`String` from **)** | ++-----------------------+-------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_int_method_int: + +- :ref:`int` **int** **(** :ref:`bool` from **)** + +Cast a :ref:`bool` value to an integer value, ``int(true)`` will be equals to 1 and ``int(false)`` will be equals to 0. + +---- + +- :ref:`int` **int** **(** :ref:`float` from **)** + +Cast a float value to an integer value, this method simply removes the number fractions (i.e. rounds ``from`` towards zero), so for example ``int(2.7)`` will be equals to 2, ``int(0.1)`` will be equals to 0 and ``int(-2.7)`` will be equals to -2. This operation is also called truncation. + +---- + +- :ref:`int` **int** **(** :ref:`String` from **)** + +Cast a :ref:`String` value to an integer value, this method is an integer parser from a string, so calling this method with an invalid integer string will return 0, a valid string will be something like ``'1.7'``. This method will ignore all non-number characters, so calling ``int('1e3')`` will return 13. + +.. |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.)` diff --git a/classes/class_interpolatedcamera.rst b/classes/class_interpolatedcamera.rst new file mode 100644 index 0000000..659e4bb --- /dev/null +++ b/classes/class_interpolatedcamera.rst @@ -0,0 +1,101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the InterpolatedCamera.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_InterpolatedCamera: + +InterpolatedCamera +================== + +**Inherits:** :ref:`Camera` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +*Deprecated.* Camera which moves toward another node. + +Description +----------- + +*Deprecated (will be removed in Godot 4.0).* InterpolatedCamera is a :ref:`Camera` which smoothly moves to match a target node's position and rotation. + +If it is not :ref:`enabled` or does not have a valid target set, InterpolatedCamera acts like a normal Camera. + +Properties +---------- + ++---------------------------------+-----------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`enabled` | ``false`` | ++---------------------------------+-----------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`speed` | ``1.0`` | ++---------------------------------+-----------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`target` | ``NodePath("")`` | ++---------------------------------+-----------------------------------------------------------+------------------+ + +Methods +------- + ++------+--------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_target` **(** :ref:`Object` target **)** | ++------+--------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_InterpolatedCamera_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_interpolation_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_interpolation_enabled() | ++-----------+----------------------------------+ + +If ``true``, and a target is set, the camera will move automatically. + +---- + +.. _class_InterpolatedCamera_property_speed: + +- :ref:`float` **speed** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_speed(value) | ++-----------+------------------+ +| *Getter* | get_speed() | ++-----------+------------------+ + +How quickly the camera moves toward its target. Higher values will result in tighter camera motion. + +---- + +.. _class_InterpolatedCamera_property_target: + +- :ref:`NodePath` **target** + ++-----------+------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------+ +| *Setter* | set_target_path(value) | ++-----------+------------------------+ +| *Getter* | get_target_path() | ++-----------+------------------------+ + +The target's :ref:`NodePath`. + +Method Descriptions +------------------- + +.. _class_InterpolatedCamera_method_set_target: + +- void **set_target** **(** :ref:`Object` target **)** + +Sets the node to move toward and orient 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.)` diff --git a/classes/class_ip.rst b/classes/class_ip.rst new file mode 100644 index 0000000..61ba5fc --- /dev/null +++ b/classes/class_ip.rst @@ -0,0 +1,196 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the IP.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_IP: + +IP +== + +**Inherits:** :ref:`Object` + +Internet protocol (IP) support functions such as DNS resolution. + +Description +----------- + +IP contains support functions for the Internet Protocol (IP). TCP/IP support is in different classes (see :ref:`StreamPeerTCP` and :ref:`TCP_Server`). IP provides DNS hostname resolution support, both blocking and threaded. + +Methods +------- + ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_cache` **(** :ref:`String` hostname="" **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_resolve_item` **(** :ref:`int` id **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_local_addresses` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_local_interfaces` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_resolve_item_address` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_resolve_item_addresses` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ResolverStatus` | :ref:`get_resolve_item_status` **(** :ref:`int` id **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`resolve_hostname` **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`resolve_hostname_addresses` **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`resolve_hostname_queue_item` **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_IP_ResolverStatus: + +.. _class_IP_constant_RESOLVER_STATUS_NONE: + +.. _class_IP_constant_RESOLVER_STATUS_WAITING: + +.. _class_IP_constant_RESOLVER_STATUS_DONE: + +.. _class_IP_constant_RESOLVER_STATUS_ERROR: + +enum **ResolverStatus**: + +- **RESOLVER_STATUS_NONE** = **0** --- DNS hostname resolver status: No status. + +- **RESOLVER_STATUS_WAITING** = **1** --- DNS hostname resolver status: Waiting. + +- **RESOLVER_STATUS_DONE** = **2** --- DNS hostname resolver status: Done. + +- **RESOLVER_STATUS_ERROR** = **3** --- DNS hostname resolver status: Error. + +---- + +.. _enum_IP_Type: + +.. _class_IP_constant_TYPE_NONE: + +.. _class_IP_constant_TYPE_IPV4: + +.. _class_IP_constant_TYPE_IPV6: + +.. _class_IP_constant_TYPE_ANY: + +enum **Type**: + +- **TYPE_NONE** = **0** --- Address type: None. + +- **TYPE_IPV4** = **1** --- Address type: Internet protocol version 4 (IPv4). + +- **TYPE_IPV6** = **2** --- Address type: Internet protocol version 6 (IPv6). + +- **TYPE_ANY** = **3** --- Address type: Any. + +Constants +--------- + +.. _class_IP_constant_RESOLVER_MAX_QUERIES: + +.. _class_IP_constant_RESOLVER_INVALID_ID: + +- **RESOLVER_MAX_QUERIES** = **32** --- Maximum number of concurrent DNS resolver queries allowed, :ref:`RESOLVER_INVALID_ID` is returned if exceeded. + +- **RESOLVER_INVALID_ID** = **-1** --- Invalid ID constant. Returned if :ref:`RESOLVER_MAX_QUERIES` is exceeded. + +Method Descriptions +------------------- + +.. _class_IP_method_clear_cache: + +- void **clear_cache** **(** :ref:`String` hostname="" **)** + +Removes all of a ``hostname``'s cached references. If no ``hostname`` is given, all cached IP addresses are removed. + +---- + +.. _class_IP_method_erase_resolve_item: + +- void **erase_resolve_item** **(** :ref:`int` id **)** + +Removes a given item ``id`` from the queue. This should be used to free a queue after it has completed to enable more queries to happen. + +---- + +.. _class_IP_method_get_local_addresses: + +- :ref:`Array` **get_local_addresses** **(** **)** |const| + +Returns all the user's current IPv4 and IPv6 addresses as an array. + +---- + +.. _class_IP_method_get_local_interfaces: + +- :ref:`Array` **get_local_interfaces** **(** **)** |const| + +Returns all network adapters as an array. + +Each adapter is a dictionary of the form: + +:: + + { + "index": "1", # Interface index. + "name": "eth0", # Interface name. + "friendly": "Ethernet One", # A friendly name (might be empty). + "addresses": ["192.168.1.101"], # An array of IP addresses associated to this interface. + } + +---- + +.. _class_IP_method_get_resolve_item_address: + +- :ref:`String` **get_resolve_item_address** **(** :ref:`int` id **)** |const| + +Returns a queued hostname's IP address, given its queue ``id``. Returns an empty string on error or if resolution hasn't happened yet (see :ref:`get_resolve_item_status`). + +---- + +.. _class_IP_method_get_resolve_item_addresses: + +- :ref:`Array` **get_resolve_item_addresses** **(** :ref:`int` id **)** |const| + +Return resolved addresses, or an empty array if an error happened or resolution didn't happen yet (see :ref:`get_resolve_item_status`). + +---- + +.. _class_IP_method_get_resolve_item_status: + +- :ref:`ResolverStatus` **get_resolve_item_status** **(** :ref:`int` id **)** |const| + +Returns a queued hostname's status as a :ref:`ResolverStatus` constant, given its queue ``id``. + +---- + +.. _class_IP_method_resolve_hostname: + +- :ref:`String` **resolve_hostname** **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** + +Returns a given hostname's IPv4 or IPv6 address when resolved (blocking-type method). The address type returned depends on the :ref:`Type` constant given as ``ip_type``. + +---- + +.. _class_IP_method_resolve_hostname_addresses: + +- :ref:`Array` **resolve_hostname_addresses** **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** + +Resolves a given hostname in a blocking way. Addresses are returned as an :ref:`Array` of IPv4 or IPv6 depending on ``ip_type``. + +---- + +.. _class_IP_method_resolve_hostname_queue_item: + +- :ref:`int` **resolve_hostname_queue_item** **(** :ref:`String` host, :ref:`Type` ip_type=3 **)** + +Creates a queue item to resolve a hostname to an IPv4 or IPv6 address depending on the :ref:`Type` constant given as ``ip_type``. Returns the queue ID if successful, or :ref:`RESOLVER_INVALID_ID` on error. + +.. |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.)` diff --git a/classes/class_itemlist.rst b/classes/class_itemlist.rst new file mode 100644 index 0000000..dbf122d --- /dev/null +++ b/classes/class_itemlist.rst @@ -0,0 +1,923 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ItemList.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ItemList: + +ItemList +======== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control that provides a list of selectable items (and/or icons) in a single column, or optionally in multiple columns. + +Description +----------- + +This control provides a selectable list of items that may be in a single (or multiple columns) with option of text, icons, or both text and icon. Tooltips are supported and may be different for every item in the list. + +Selectable items in the list may be selected or deselected and multiple selection may be enabled. Selection with right mouse button may also be enabled to allow use of popup context menus. Items may also be "activated" by double-clicking them or by pressing Enter. + +Item text only supports single-line strings, newline characters (e.g. ``\n``) in the string won't produce a newline. Text wrapping is enabled in :ref:`ICON_MODE_TOP` mode, but column's width is adjusted to fully fit its content by default. You need to set :ref:`fixed_column_width` greater than zero to wrap the text. + +Properties +---------- + ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`allow_reselect` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`allow_rmb_select` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`auto_height` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`fixed_column_width` | ``0`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`fixed_icon_size` | ``Vector2( 0, 0 )`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`IconMode` | :ref:`icon_mode` | ``1`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`icon_scale` | ``1.0`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`max_columns` | ``1`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`max_text_lines` | ``1`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`same_column_width` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ +| :ref:`SelectMode` | :ref:`select_mode` | ``0`` | ++---------------------------------------------+-----------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_item` **(** :ref:`Texture` icon, :ref:`bool` selectable=true **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_item` **(** :ref:`String` text, :ref:`Texture` icon=null, :ref:`bool` selectable=true **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`ensure_current_is_visible` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_at_position` **(** :ref:`Vector2` position, :ref:`bool` exact=false **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_count` **(** **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_item_custom_bg_color` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_item_custom_fg_color` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_item_icon` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_item_icon_modulate` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_item_icon_region` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_tooltip` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_selected_items` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VScrollBar` | :ref:`get_v_scroll` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_anything_selected` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_icon_transposed` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_selectable` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_tooltip_enabled` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_selected` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_item` **(** :ref:`int` from_idx, :ref:`int` to_idx **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_item` **(** :ref:`int` idx **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` idx, :ref:`bool` single=true **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_custom_bg_color` **(** :ref:`int` idx, :ref:`Color` custom_bg_color **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_custom_fg_color` **(** :ref:`int` idx, :ref:`Color` custom_fg_color **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture` icon **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon_modulate` **(** :ref:`int` idx, :ref:`Color` modulate **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon_region` **(** :ref:`int` idx, :ref:`Rect2` rect **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon_transposed` **(** :ref:`int` idx, :ref:`bool` transposed **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_selectable` **(** :ref:`int` idx, :ref:`bool` selectable **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_tooltip` **(** :ref:`int` idx, :ref:`String` tooltip **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_tooltip_enabled` **(** :ref:`int` idx, :ref:`bool` enable **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sort_items_by_text` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unselect` **(** :ref:`int` idx **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unselect_all` **(** **)** | ++-----------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.63, 0.63, 0.63, 1 )`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_selected` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`guide_color` | ``Color( 0, 0, 0, 0.1 )`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`icon_margin` | ``4`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`line_separation` | ``2`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`vseparation` | ``2`` | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`bg_focus` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`cursor` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`cursor_unfocused` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`selected` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`selected_focus` | | ++---------------------------------+----------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_ItemList_signal_item_activated: + +- **item_activated** **(** :ref:`int` index **)** + +Triggered when specified list item is activated via double-clicking or by pressing Enter. + +---- + +.. _class_ItemList_signal_item_rmb_selected: + +- **item_rmb_selected** **(** :ref:`int` index, :ref:`Vector2` at_position **)** + +Triggered when specified list item has been selected via right mouse clicking. + +The click position is also provided to allow appropriate popup of context menus at the correct location. + +:ref:`allow_rmb_select` must be enabled. + +---- + +.. _class_ItemList_signal_item_selected: + +- **item_selected** **(** :ref:`int` index **)** + +Triggered when specified item has been selected. + +:ref:`allow_reselect` must be enabled to reselect an item. + +---- + +.. _class_ItemList_signal_multi_selected: + +- **multi_selected** **(** :ref:`int` index, :ref:`bool` selected **)** + +Triggered when a multiple selection is altered on a list allowing multiple selection. + +---- + +.. _class_ItemList_signal_nothing_selected: + +- **nothing_selected** **(** **)** + +Triggered when a left mouse click is issued within the rect of the list but on empty space. + +---- + +.. _class_ItemList_signal_rmb_clicked: + +- **rmb_clicked** **(** :ref:`Vector2` at_position **)** + +Triggered when a right mouse click is issued within the rect of the list but on empty space. + +:ref:`allow_rmb_select` must be enabled. + +Enumerations +------------ + +.. _enum_ItemList_IconMode: + +.. _class_ItemList_constant_ICON_MODE_TOP: + +.. _class_ItemList_constant_ICON_MODE_LEFT: + +enum **IconMode**: + +- **ICON_MODE_TOP** = **0** --- Icon is drawn above the text. + +- **ICON_MODE_LEFT** = **1** --- Icon is drawn to the left of the text. + +---- + +.. _enum_ItemList_SelectMode: + +.. _class_ItemList_constant_SELECT_SINGLE: + +.. _class_ItemList_constant_SELECT_MULTI: + +enum **SelectMode**: + +- **SELECT_SINGLE** = **0** --- Only allow selecting a single item. + +- **SELECT_MULTI** = **1** --- Allows selecting multiple items by holding Ctrl or Shift. + +Property Descriptions +--------------------- + +.. _class_ItemList_property_allow_reselect: + +- :ref:`bool` **allow_reselect** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_allow_reselect(value) | ++-----------+---------------------------+ +| *Getter* | get_allow_reselect() | ++-----------+---------------------------+ + +If ``true``, the currently selected item can be selected again. + +---- + +.. _class_ItemList_property_allow_rmb_select: + +- :ref:`bool` **allow_rmb_select** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_allow_rmb_select(value) | ++-----------+-----------------------------+ +| *Getter* | get_allow_rmb_select() | ++-----------+-----------------------------+ + +If ``true``, right mouse button click can select items. + +---- + +.. _class_ItemList_property_auto_height: + +- :ref:`bool` **auto_height** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_auto_height(value) | ++-----------+------------------------+ +| *Getter* | has_auto_height() | ++-----------+------------------------+ + +If ``true``, the control will automatically resize the height to fit its content. + +---- + +.. _class_ItemList_property_fixed_column_width: + +- :ref:`int` **fixed_column_width** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_fixed_column_width(value) | ++-----------+-------------------------------+ +| *Getter* | get_fixed_column_width() | ++-----------+-------------------------------+ + +The width all columns will be adjusted to. + +A value of zero disables the adjustment, each item will have a width equal to the width of its content and the columns will have an uneven width. + +---- + +.. _class_ItemList_property_fixed_icon_size: + +- :ref:`Vector2` **fixed_icon_size** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_fixed_icon_size(value) | ++-----------+----------------------------+ +| *Getter* | get_fixed_icon_size() | ++-----------+----------------------------+ + +The size all icons will be adjusted to. + +If either X or Y component is not greater than zero, icon size won't be affected. + +---- + +.. _class_ItemList_property_icon_mode: + +- :ref:`IconMode` **icon_mode** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_icon_mode(value) | ++-----------+----------------------+ +| *Getter* | get_icon_mode() | ++-----------+----------------------+ + +The icon position, whether above or to the left of the text. See the :ref:`IconMode` constants. + +---- + +.. _class_ItemList_property_icon_scale: + +- :ref:`float` **icon_scale** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_icon_scale(value) | ++-----------+-----------------------+ +| *Getter* | get_icon_scale() | ++-----------+-----------------------+ + +The scale of icon applied after :ref:`fixed_icon_size` and transposing takes effect. + +---- + +.. _class_ItemList_property_max_columns: + +- :ref:`int` **max_columns** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_max_columns(value) | ++-----------+------------------------+ +| *Getter* | get_max_columns() | ++-----------+------------------------+ + +Maximum columns the list will have. + +If greater than zero, the content will be split among the specified columns. + +A value of zero means unlimited columns, i.e. all items will be put in the same row. + +---- + +.. _class_ItemList_property_max_text_lines: + +- :ref:`int` **max_text_lines** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_max_text_lines(value) | ++-----------+---------------------------+ +| *Getter* | get_max_text_lines() | ++-----------+---------------------------+ + +Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. + +**Note:** This property takes effect only when :ref:`icon_mode` is :ref:`ICON_MODE_TOP`. To make the text wrap, :ref:`fixed_column_width` should be greater than zero. + +---- + +.. _class_ItemList_property_same_column_width: + +- :ref:`bool` **same_column_width** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_same_column_width(value) | ++-----------+------------------------------+ +| *Getter* | is_same_column_width() | ++-----------+------------------------------+ + +Whether all columns will have the same width. + +If ``true``, the width is equal to the largest column width of all columns. + +---- + +.. _class_ItemList_property_select_mode: + +- :ref:`SelectMode` **select_mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_select_mode(value) | ++-----------+------------------------+ +| *Getter* | get_select_mode() | ++-----------+------------------------+ + +Allows single or multiple item selection. See the :ref:`SelectMode` constants. + +Method Descriptions +------------------- + +.. _class_ItemList_method_add_icon_item: + +- void **add_icon_item** **(** :ref:`Texture` icon, :ref:`bool` selectable=true **)** + +Adds an item to the item list with no text, only an icon. + +---- + +.. _class_ItemList_method_add_item: + +- void **add_item** **(** :ref:`String` text, :ref:`Texture` icon=null, :ref:`bool` selectable=true **)** + +Adds an item to the item list with specified text. Specify an ``icon``, or use ``null`` as the ``icon`` for a list item with no icon. + +If selectable is ``true``, the list item will be selectable. + +---- + +.. _class_ItemList_method_clear: + +- void **clear** **(** **)** + +Removes all items from the list. + +---- + +.. _class_ItemList_method_ensure_current_is_visible: + +- void **ensure_current_is_visible** **(** **)** + +Ensure current selection is visible, adjusting the scroll position as necessary. + +---- + +.. _class_ItemList_method_get_item_at_position: + +- :ref:`int` **get_item_at_position** **(** :ref:`Vector2` position, :ref:`bool` exact=false **)** |const| + +Returns the item index at the given ``position``. + +When there is no item at that point, -1 will be returned if ``exact`` is ``true``, and the closest item index will be returned otherwise. + +---- + +.. _class_ItemList_method_get_item_count: + +- :ref:`int` **get_item_count** **(** **)** |const| + +Returns the number of items currently in the list. + +---- + +.. _class_ItemList_method_get_item_custom_bg_color: + +- :ref:`Color` **get_item_custom_bg_color** **(** :ref:`int` idx **)** |const| + +Returns the custom background color of the item specified by ``idx`` index. + +---- + +.. _class_ItemList_method_get_item_custom_fg_color: + +- :ref:`Color` **get_item_custom_fg_color** **(** :ref:`int` idx **)** |const| + +Returns the custom foreground color of the item specified by ``idx`` index. + +---- + +.. _class_ItemList_method_get_item_icon: + +- :ref:`Texture` **get_item_icon** **(** :ref:`int` idx **)** |const| + +Returns the icon associated with the specified index. + +---- + +.. _class_ItemList_method_get_item_icon_modulate: + +- :ref:`Color` **get_item_icon_modulate** **(** :ref:`int` idx **)** |const| + +Returns a :ref:`Color` modulating item's icon at the specified index. + +---- + +.. _class_ItemList_method_get_item_icon_region: + +- :ref:`Rect2` **get_item_icon_region** **(** :ref:`int` idx **)** |const| + +Returns the region of item's icon used. The whole icon will be used if the region has no area. + +---- + +.. _class_ItemList_method_get_item_metadata: + +- :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** |const| + +Returns the metadata value of the specified index. + +---- + +.. _class_ItemList_method_get_item_text: + +- :ref:`String` **get_item_text** **(** :ref:`int` idx **)** |const| + +Returns the text associated with the specified index. + +---- + +.. _class_ItemList_method_get_item_tooltip: + +- :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** |const| + +Returns the tooltip hint associated with the specified index. + +---- + +.. _class_ItemList_method_get_selected_items: + +- :ref:`PoolIntArray` **get_selected_items** **(** **)** + +Returns an array with the indexes of the selected items. + +---- + +.. _class_ItemList_method_get_v_scroll: + +- :ref:`VScrollBar` **get_v_scroll** **(** **)** + +Returns the vertical scrollbar. + +**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` property. + +---- + +.. _class_ItemList_method_is_anything_selected: + +- :ref:`bool` **is_anything_selected** **(** **)** + +Returns ``true`` if one or more items are selected. + +---- + +.. _class_ItemList_method_is_item_disabled: + +- :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at the specified index is disabled. + +---- + +.. _class_ItemList_method_is_item_icon_transposed: + +- :ref:`bool` **is_item_icon_transposed** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item icon will be drawn transposed, i.e. the X and Y axes are swapped. + +---- + +.. _class_ItemList_method_is_item_selectable: + +- :ref:`bool` **is_item_selectable** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at the specified index is selectable. + +---- + +.. _class_ItemList_method_is_item_tooltip_enabled: + +- :ref:`bool` **is_item_tooltip_enabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the tooltip is enabled for specified item index. + +---- + +.. _class_ItemList_method_is_selected: + +- :ref:`bool` **is_selected** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at the specified index is currently selected. + +---- + +.. _class_ItemList_method_move_item: + +- void **move_item** **(** :ref:`int` from_idx, :ref:`int` to_idx **)** + +Moves item from index ``from_idx`` to ``to_idx``. + +---- + +.. _class_ItemList_method_remove_item: + +- void **remove_item** **(** :ref:`int` idx **)** + +Removes the item specified by ``idx`` index from the list. + +---- + +.. _class_ItemList_method_select: + +- void **select** **(** :ref:`int` idx, :ref:`bool` single=true **)** + +Select the item at the specified index. + +**Note:** This method does not trigger the item selection signal. + +---- + +.. _class_ItemList_method_set_item_custom_bg_color: + +- void **set_item_custom_bg_color** **(** :ref:`int` idx, :ref:`Color` custom_bg_color **)** + +Sets the background color of the item specified by ``idx`` index to the specified :ref:`Color`. + +---- + +.. _class_ItemList_method_set_item_custom_fg_color: + +- void **set_item_custom_fg_color** **(** :ref:`int` idx, :ref:`Color` custom_fg_color **)** + +Sets the foreground color of the item specified by ``idx`` index to the specified :ref:`Color`. + +---- + +.. _class_ItemList_method_set_item_disabled: + +- void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** + +Disables (or enables) the item at the specified index. + +Disabled items cannot be selected and do not trigger activation signals (when double-clicking or pressing Enter). + +---- + +.. _class_ItemList_method_set_item_icon: + +- void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture` icon **)** + +Sets (or replaces) the icon's :ref:`Texture` associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_icon_modulate: + +- void **set_item_icon_modulate** **(** :ref:`int` idx, :ref:`Color` modulate **)** + +Sets a modulating :ref:`Color` of the item associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_icon_region: + +- void **set_item_icon_region** **(** :ref:`int` idx, :ref:`Rect2` rect **)** + +Sets the region of item's icon used. The whole icon will be used if the region has no area. + +---- + +.. _class_ItemList_method_set_item_icon_transposed: + +- void **set_item_icon_transposed** **(** :ref:`int` idx, :ref:`bool` transposed **)** + +Sets whether the item icon will be drawn transposed. + +---- + +.. _class_ItemList_method_set_item_metadata: + +- void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** + +Sets a value (of any type) to be stored with the item associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_selectable: + +- void **set_item_selectable** **(** :ref:`int` idx, :ref:`bool` selectable **)** + +Allows or disallows selection of the item associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_text: + +- void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** + +Sets text of the item associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_tooltip: + +- void **set_item_tooltip** **(** :ref:`int` idx, :ref:`String` tooltip **)** + +Sets the tooltip hint for the item associated with the specified index. + +---- + +.. _class_ItemList_method_set_item_tooltip_enabled: + +- void **set_item_tooltip_enabled** **(** :ref:`int` idx, :ref:`bool` enable **)** + +Sets whether the tooltip hint is enabled for specified item index. + +---- + +.. _class_ItemList_method_sort_items_by_text: + +- void **sort_items_by_text** **(** **)** + +Sorts items in the list by their text. + +---- + +.. _class_ItemList_method_unselect: + +- void **unselect** **(** :ref:`int` idx **)** + +Ensures the item associated with the specified index is not selected. + +---- + +.. _class_ItemList_method_unselect_all: + +- void **unselect_all** **(** **)** + +Ensures there are no items selected. + +Theme Property Descriptions +--------------------------- + +.. _class_ItemList_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.63, 0.63, 0.63, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the item. + +---- + +.. _class_ItemList_theme_color_font_color_selected: + +- :ref:`Color` **font_color_selected** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the item is selected. + +---- + +.. _class_ItemList_theme_color_guide_color: + +- :ref:`Color` **guide_color** + ++-----------+---------------------------+ +| *Default* | ``Color( 0, 0, 0, 0.1 )`` | ++-----------+---------------------------+ + +:ref:`Color` of the guideline. The guideline is a line drawn between each row of items. + +---- + +.. _class_ItemList_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal spacing between items. + +---- + +.. _class_ItemList_theme_constant_icon_margin: + +- :ref:`int` **icon_margin** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The spacing between item's icon and text. + +---- + +.. _class_ItemList_theme_constant_line_separation: + +- :ref:`int` **line_separation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The vertical spacing between each line of text. + +---- + +.. _class_ItemList_theme_constant_vseparation: + +- :ref:`int` **vseparation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The vertical spacing between items. + +---- + +.. _class_ItemList_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the item's text. + +---- + +.. _class_ItemList_theme_style_bg: + +- :ref:`StyleBox` **bg** + +Default :ref:`StyleBox` for the ``ItemList``, i.e. used when the control is not being focused. + +---- + +.. _class_ItemList_theme_style_bg_focus: + +- :ref:`StyleBox` **bg_focus** + +:ref:`StyleBox` used when the ``ItemList`` is being focused. + +---- + +.. _class_ItemList_theme_style_cursor: + +- :ref:`StyleBox` **cursor** + +:ref:`StyleBox` used for the cursor, when the ``ItemList`` is being focused. + +---- + +.. _class_ItemList_theme_style_cursor_unfocused: + +- :ref:`StyleBox` **cursor_unfocused** + +:ref:`StyleBox` used for the cursor, when the ``ItemList`` is not being focused. + +---- + +.. _class_ItemList_theme_style_selected: + +- :ref:`StyleBox` **selected** + +:ref:`StyleBox` for the selected items, used when the ``ItemList`` is not being focused. + +---- + +.. _class_ItemList_theme_style_selected_focus: + +- :ref:`StyleBox` **selected_focus** + +:ref:`StyleBox` for the selected items, used when the ``ItemList`` is being focused. + +.. |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.)` diff --git a/classes/class_javaclass.rst b/classes/class_javaclass.rst new file mode 100644 index 0000000..da75dbf --- /dev/null +++ b/classes/class_javaclass.rst @@ -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 JavaClass.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JavaClass: + +JavaClass +========= + +**Inherits:** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_javaclasswrapper.rst b/classes/class_javaclasswrapper.rst new file mode 100644 index 0000000..23e154d --- /dev/null +++ b/classes/class_javaclasswrapper.rst @@ -0,0 +1,32 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JavaClassWrapper.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JavaClassWrapper: + +JavaClassWrapper +================ + +**Inherits:** :ref:`Object` + + + +Methods +------- + ++-----------------------------------+----------------------------------------------------------------------------------------------+ +| :ref:`JavaClass` | :ref:`wrap` **(** :ref:`String` name **)** | ++-----------------------------------+----------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_JavaClassWrapper_method_wrap: + +- :ref:`JavaClass` **wrap** **(** :ref:`String` 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.)` diff --git a/classes/class_javascript.rst b/classes/class_javascript.rst new file mode 100644 index 0000000..8fb2ded --- /dev/null +++ b/classes/class_javascript.rst @@ -0,0 +1,94 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JavaScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JavaScript: + +JavaScript +========== + +**Inherits:** :ref:`Object` + +Singleton that connects the engine with the browser's JavaScript context in HTML5 export. + +Description +----------- + +The JavaScript singleton is implemented only in the HTML5 export. It's used to access the browser's JavaScript context. This allows interaction with embedding pages or calling third-party JavaScript APIs. + +**Note:** This singleton can be disabled at build-time to improve security. By default, the JavaScript singleton is enabled. Official export templates also have the JavaScript singleton enabled. See `Compiling for the Web `__ in the documentation for more information. + +Tutorials +--------- + +- `#calling-javascript-from-script <../tutorials/export/exporting_for_web.html#calling-javascript-from-script>`_ in :doc:`../tutorials/export/exporting_for_web` + +Methods +------- + ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`JavaScriptObject` | :ref:`create_callback` **(** :ref:`Object` object, :ref:`String` method **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`create_object` **(** :ref:`String` object, ... **)** |vararg| | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`download_buffer` **(** :ref:`PoolByteArray` buffer, :ref:`String` name, :ref:`String` mime="application/octet-stream" **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`eval` **(** :ref:`String` code, :ref:`bool` use_global_execution_context=false **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`JavaScriptObject` | :ref:`get_interface` **(** :ref:`String` interface **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_JavaScript_method_create_callback: + +- :ref:`JavaScriptObject` **create_callback** **(** :ref:`Object` object, :ref:`String` method **)** + +Creates a reference to a script function that can be used as a callback by JavaScript. The reference must be kept until the callback happens, or it won't be called at all. See :ref:`JavaScriptObject` for usage. + +---- + +.. _class_JavaScript_method_create_object: + +- :ref:`Variant` **create_object** **(** :ref:`String` object, ... **)** |vararg| + +Creates a new JavaScript object using the ``new`` constructor. The ``object`` must a valid property of the JavaScript ``window``. See :ref:`JavaScriptObject` for usage. + +---- + +.. _class_JavaScript_method_download_buffer: + +- void **download_buffer** **(** :ref:`PoolByteArray` buffer, :ref:`String` name, :ref:`String` mime="application/octet-stream" **)** + +Prompts the user to download a file containing the specified ``buffer``. The file will have the given ``name`` and ``mime`` type. + +**Note:** The browser may override the `MIME type `__ provided based on the file ``name``'s extension. + +**Note:** Browsers might block the download if :ref:`download_buffer` is not being called from a user interaction (e.g. button click). + +**Note:** Browsers might ask the user for permission or block the download if multiple download requests are made in a quick succession. + +---- + +.. _class_JavaScript_method_eval: + +- :ref:`Variant` **eval** **(** :ref:`String` code, :ref:`bool` use_global_execution_context=false **)** + +Execute the string ``code`` as JavaScript code within the browser window. This is a call to the actual global JavaScript function ``eval()``. + +If ``use_global_execution_context`` is ``true``, the code will be evaluated in the global execution context. Otherwise, it is evaluated in the execution context of a function within the engine's runtime environment. + +---- + +.. _class_JavaScript_method_get_interface: + +- :ref:`JavaScriptObject` **get_interface** **(** :ref:`String` interface **)** + +Returns an interface to a JavaScript object that can be used by scripts. The ``interface`` must be a valid property of the JavaScript ``window``. The callback must accept a single :ref:`Array` argument, which will contain the JavaScript ``arguments``. See :ref:`JavaScriptObject` 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.)` diff --git a/classes/class_javascriptobject.rst b/classes/class_javascriptobject.rst new file mode 100644 index 0000000..44f8841 --- /dev/null +++ b/classes/class_javascriptobject.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JavaScriptObject.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JavaScriptObject: + +JavaScriptObject +================ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A wrapper class for native JavaScript objects. + +Description +----------- + +JavaScriptObject is used to interact with JavaScript objects retrieved or created via :ref:`JavaScript.get_interface`, :ref:`JavaScript.create_object`, or :ref:`JavaScript.create_callback`. + +Example: + +:: + + extends Node + + var _my_js_callback = JavaScript.create_callback(self, "myCallback") # This reference must be kept + var console = JavaScript.get_interface("console") + + func _init(): + var buf = JavaScript.create_object("ArrayBuffer", 10) # new ArrayBuffer(10) + print(buf) # prints [JavaScriptObject:OBJECT_ID] + var uint8arr = JavaScript.create_object("Uint8Array", buf) # new Uint8Array(buf) + uint8arr[1] = 255 + prints(uint8arr[1], uint8arr.byteLength) # prints 255 10 + console.log(uint8arr) # prints in browser console "Uint8Array(10) [ 0, 255, 0, 0, 0, 0, 0, 0, 0, 0 ]" + + # Equivalent of JavaScript: Array.from(uint8arr).forEach(myCallback) + JavaScript.get_interface("Array").from(uint8arr).forEach(_my_js_callback) + + func myCallback(args): + # Will be called with the parameters passed to the "forEach" callback + # [0, 0, [JavaScriptObject:1173]] + # [255, 1, [JavaScriptObject:1173]] + # ... + # [0, 9, [JavaScriptObject:1180]] + print(args) + +**Note:** Only available in the HTML5 platform. + +.. |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.)` diff --git a/classes/class_jnisingleton.rst b/classes/class_jnisingleton.rst new file mode 100644 index 0000000..94f4bd7 --- /dev/null +++ b/classes/class_jnisingleton.rst @@ -0,0 +1,28 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JNISingleton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JNISingleton: + +JNISingleton +============ + +**Inherits:** :ref:`Object` + +Singleton that connects the engine with Android plugins to interface with native Android code. + +Description +----------- + +The JNISingleton is implemented only in the Android export. It's used to call methods and connect signals from an Android plugin written in Java or Kotlin. Methods and signals can be called and connected to the JNISingleton as if it is a Node. See `Java Native Interface - Wikipedia `__ for more information. + +Tutorials +--------- + +- :doc:`../tutorials/platform/android/android_plugin` + +.. |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.)` diff --git a/classes/class_joint.rst b/classes/class_joint.rst new file mode 100644 index 0000000..cceb5bc --- /dev/null +++ b/classes/class_joint.rst @@ -0,0 +1,108 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Joint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Joint: + +Joint +===== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ConeTwistJoint`, :ref:`Generic6DOFJoint`, :ref:`HingeJoint`, :ref:`PinJoint`, :ref:`SliderJoint` + +Base class for all 3D joints. + +Description +----------- + +Joints are used to bind together two physics bodies. They have a solver priority and can define if the bodies of the two attached nodes should be able to collide with each other. + +Tutorials +--------- + +- `3D Truck Town Demo `__ + +Properties +---------- + ++---------------------------------+------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`collision/exclude_nodes` | ``true`` | ++---------------------------------+------------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`nodes/node_a` | ``NodePath("")`` | ++---------------------------------+------------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`nodes/node_b` | ``NodePath("")`` | ++---------------------------------+------------------------------------------------------------------------------+------------------+ +| :ref:`int` | :ref:`solver/priority` | ``1`` | ++---------------------------------+------------------------------------------------------------------------------+------------------+ + +Property Descriptions +--------------------- + +.. _class_Joint_property_collision/exclude_nodes: + +- :ref:`bool` **collision/exclude_nodes** + ++-----------+-----------------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------------+ +| *Setter* | set_exclude_nodes_from_collision(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_exclude_nodes_from_collision() | ++-----------+-----------------------------------------+ + +If ``true``, the two bodies of the nodes are not able to collide with each other. + +---- + +.. _class_Joint_property_nodes/node_a: + +- :ref:`NodePath` **nodes/node_a** + ++-----------+-------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-------------------+ +| *Setter* | set_node_a(value) | ++-----------+-------------------+ +| *Getter* | get_node_a() | ++-----------+-------------------+ + +The node attached to the first side (A) of the joint. + +---- + +.. _class_Joint_property_nodes/node_b: + +- :ref:`NodePath` **nodes/node_b** + ++-----------+-------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-------------------+ +| *Setter* | set_node_b(value) | ++-----------+-------------------+ +| *Getter* | get_node_b() | ++-----------+-------------------+ + +The node attached to the second side (B) of the joint. + +---- + +.. _class_Joint_property_solver/priority: + +- :ref:`int` **solver/priority** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_solver_priority(value) | ++-----------+----------------------------+ +| *Getter* | get_solver_priority() | ++-----------+----------------------------+ + +The priority used to define which solver is executed first for multiple joints. The lower the value, the higher the priority. + +.. |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.)` diff --git a/classes/class_joint2d.rst b/classes/class_joint2d.rst new file mode 100644 index 0000000..cb1b70b --- /dev/null +++ b/classes/class_joint2d.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Joint2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Joint2D: + +Joint2D +======= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`DampedSpringJoint2D`, :ref:`GrooveJoint2D`, :ref:`PinJoint2D` + +Base node for all joint constraints in 2D physics. + +Description +----------- + +Base node for all joint constraints in 2D physics. Joints take 2 bodies and apply a custom constraint. + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`bias` | ``0.0`` | ++---------------------------------+--------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`disable_collision` | ``true`` | ++---------------------------------+--------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`node_a` | ``NodePath("")`` | ++---------------------------------+--------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`node_b` | ``NodePath("")`` | ++---------------------------------+--------------------------------------------------------------------+------------------+ + +Property Descriptions +--------------------- + +.. _class_Joint2D_property_bias: + +- :ref:`float` **bias** + ++-----------+-----------------+ +| *Default* | ``0.0`` | ++-----------+-----------------+ +| *Setter* | set_bias(value) | ++-----------+-----------------+ +| *Getter* | get_bias() | ++-----------+-----------------+ + +When :ref:`node_a` and :ref:`node_b` move in different directions the ``bias`` controls how fast the joint pulls them back to their original position. The lower the ``bias`` the more the two bodies can pull on the joint. + +---- + +.. _class_Joint2D_property_disable_collision: + +- :ref:`bool` **disable_collision** + ++-----------+-----------------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------------+ +| *Setter* | set_exclude_nodes_from_collision(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_exclude_nodes_from_collision() | ++-----------+-----------------------------------------+ + +If ``true``, :ref:`node_a` and :ref:`node_b` can not collide. + +---- + +.. _class_Joint2D_property_node_a: + +- :ref:`NodePath` **node_a** + ++-----------+-------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-------------------+ +| *Setter* | set_node_a(value) | ++-----------+-------------------+ +| *Getter* | get_node_a() | ++-----------+-------------------+ + +The first body attached to the joint. Must derive from :ref:`PhysicsBody2D`. + +---- + +.. _class_Joint2D_property_node_b: + +- :ref:`NodePath` **node_b** + ++-----------+-------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-------------------+ +| *Setter* | set_node_b(value) | ++-----------+-------------------+ +| *Getter* | get_node_b() | ++-----------+-------------------+ + +The second body attached to the joint. Must derive from :ref:`PhysicsBody2D`. + +.. |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.)` diff --git a/classes/class_json.rst b/classes/class_json.rst new file mode 100644 index 0000000..3d853c1 --- /dev/null +++ b/classes/class_json.rst @@ -0,0 +1,92 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JSON.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JSON: + +JSON +==== + +**Inherits:** :ref:`Object` + +Helper class for parsing JSON data. + +Description +----------- + +Helper class for parsing JSON data. For usage example and other important hints, see :ref:`JSONParseResult`. + +Methods +------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`JSONParseResult` | :ref:`parse` **(** :ref:`String` json **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`print` **(** :ref:`Variant` value, :ref:`String` indent="", :ref:`bool` sort_keys=false **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_JSON_method_parse: + +- :ref:`JSONParseResult` **parse** **(** :ref:`String` json **)** + +Parses a JSON-encoded string and returns a :ref:`JSONParseResult` containing the result. + +---- + +.. _class_JSON_method_print: + +- :ref:`String` **print** **(** :ref:`Variant` value, :ref:`String` indent="", :ref:`bool` sort_keys=false **)** + +Converts a :ref:`Variant` var to JSON text and returns the result. Useful for serializing data to store or send over the network. + +**Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, converting a Variant to JSON text will convert all numerical values to :ref:`float` types. + +The ``indent`` parameter controls if and how something is indented, the string used for this parameter will be used where there should be an indent in the output, even spaces like ``" "`` will work. ``\t`` and ``\n`` can also be used for a tab indent, or to make a newline for each indent respectively. + +**Example output:** + +:: + + ## JSON.print(my_dictionary) + {"name":"my_dictionary","version":"1.0.0","entities":[{"name":"entity_0","value":"value_0"},{"name":"entity_1","value":"value_1"}]} + + ## JSON.print(my_dictionary, "\t") + { + "name": "my_dictionary", + "version": "1.0.0", + "entities": [ + { + "name": "entity_0", + "value": "value_0" + }, + { + "name": "entity_1", + "value": "value_1" + } + ] + } + + ## JSON.print(my_dictionary, "...") + { + ..."name": "my_dictionary", + ..."version": "1.0.0", + ..."entities": [ + ......{ + ........."name": "entity_0", + ........."value": "value_0" + ......}, + ......{ + ........."name": "entity_1", + ........."value": "value_1" + ......} + ...] + } + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_jsonparseresult.rst b/classes/class_jsonparseresult.rst new file mode 100644 index 0000000..4fae306 --- /dev/null +++ b/classes/class_jsonparseresult.rst @@ -0,0 +1,109 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JSONParseResult.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JSONParseResult: + +JSONParseResult +=============== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Data class wrapper for decoded JSON. + +Description +----------- + +Returned by :ref:`JSON.parse`, ``JSONParseResult`` contains the decoded JSON or error information if the JSON source wasn't successfully parsed. You can check if the JSON source was successfully parsed with ``if json_result.error == OK``. + +Properties +---------- + ++---------------------------------------+------------------------------------------------------------------+--------+ +| :ref:`Error` | :ref:`error` | | ++---------------------------------------+------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`error_line` | ``-1`` | ++---------------------------------------+------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`error_string` | ``""`` | ++---------------------------------------+------------------------------------------------------------------+--------+ +| :ref:`Variant` | :ref:`result` | | ++---------------------------------------+------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_JSONParseResult_property_error: + +- :ref:`Error` **error** + ++----------+------------------+ +| *Setter* | set_error(value) | ++----------+------------------+ +| *Getter* | get_error() | ++----------+------------------+ + +The error type if the JSON source was not successfully parsed. See the :ref:`Error` constants. + +---- + +.. _class_JSONParseResult_property_error_line: + +- :ref:`int` **error_line** + ++-----------+-----------------------+ +| *Default* | ``-1`` | ++-----------+-----------------------+ +| *Setter* | set_error_line(value) | ++-----------+-----------------------+ +| *Getter* | get_error_line() | ++-----------+-----------------------+ + +The line number where the error occurred if the JSON source was not successfully parsed. + +---- + +.. _class_JSONParseResult_property_error_string: + +- :ref:`String` **error_string** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_error_string(value) | ++-----------+-------------------------+ +| *Getter* | get_error_string() | ++-----------+-------------------------+ + +The error message if the JSON source was not successfully parsed. See the :ref:`Error` constants. + +---- + +.. _class_JSONParseResult_property_result: + +- :ref:`Variant` **result** + ++----------+-------------------+ +| *Setter* | set_result(value) | ++----------+-------------------+ +| *Getter* | get_result() | ++----------+-------------------+ + +A :ref:`Variant` containing the parsed JSON. Use :ref:`@GDScript.typeof` or the ``is`` keyword to check if it is what you expect. For example, if the JSON source starts with curly braces (``{}``), a :ref:`Dictionary` will be returned. If the JSON source starts with brackets (``[]``), an :ref:`Array` will be returned. + +**Note:** The JSON specification does not define integer or float types, but only a *number* type. Therefore, parsing a JSON text will convert all numerical values to :ref:`float` types. + +**Note:** JSON objects do not preserve key order like Godot dictionaries, thus, you should not rely on keys being in a certain order if a dictionary is constructed from JSON. In contrast, JSON arrays retain the order of their elements: + +:: + + var p = JSON.parse('["hello", "world", "!"]') + if typeof(p.result) == TYPE_ARRAY: + print(p.result[0]) # Prints "hello" + else: + push_error("Unexpected results.") + +.. |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.)` diff --git a/classes/class_jsonrpc.rst b/classes/class_jsonrpc.rst new file mode 100644 index 0000000..a824ab8 --- /dev/null +++ b/classes/class_jsonrpc.rst @@ -0,0 +1,146 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the JSONRPC.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_JSONRPC: + +JSONRPC +======= + +**Inherits:** :ref:`Object` + +A helper to handle dictionaries which look like JSONRPC documents. + +Description +----------- + +`JSON-RPC `__ is a standard which wraps a method call in a :ref:`JSON` object. The object has a particular structure and identifies which method is called, the parameters to that function, and carries an ID to keep track of responses. This class implements that standard on top of :ref:`Dictionary`; you will have to convert between a :ref:`Dictionary` and :ref:`JSON` with other functions. + +Methods +------- + ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`make_notification` **(** :ref:`String` method, :ref:`Variant` params **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`make_request` **(** :ref:`String` method, :ref:`Variant` params, :ref:`Variant` id **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`make_response` **(** :ref:`Variant` result, :ref:`Variant` id **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`make_response_error` **(** :ref:`int` code, :ref:`String` message, :ref:`Variant` id=null **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`process_action` **(** :ref:`Variant` action, :ref:`bool` recurse=false **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`process_string` **(** :ref:`String` action **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_scope` **(** :ref:`String` scope, :ref:`Object` target **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_JSONRPC_ErrorCode: + +.. _class_JSONRPC_constant_PARSE_ERROR: + +.. _class_JSONRPC_constant_INVALID_REQUEST: + +.. _class_JSONRPC_constant_METHOD_NOT_FOUND: + +.. _class_JSONRPC_constant_INVALID_PARAMS: + +.. _class_JSONRPC_constant_INTERNAL_ERROR: + +enum **ErrorCode**: + +- **PARSE_ERROR** = **-32700** + +- **INVALID_REQUEST** = **-32600** + +- **METHOD_NOT_FOUND** = **-32601** --- A method call was requested but no function of that name existed in the JSONRPC subclass. + +- **INVALID_PARAMS** = **-32602** + +- **INTERNAL_ERROR** = **-32603** + +Method Descriptions +------------------- + +.. _class_JSONRPC_method_make_notification: + +- :ref:`Dictionary` **make_notification** **(** :ref:`String` method, :ref:`Variant` params **)** + +Returns a dictionary in the form of a JSON-RPC notification. Notifications are one-shot messages which do not expect a response. + +- ``method``: Name of the method being called. + +- ``params``: An array or dictionary of parameters being passed to the method. + +---- + +.. _class_JSONRPC_method_make_request: + +- :ref:`Dictionary` **make_request** **(** :ref:`String` method, :ref:`Variant` params, :ref:`Variant` id **)** + +Returns a dictionary in the form of a JSON-RPC request. Requests are sent to a server with the expectation of a response. The ID field is used for the server to specify which exact request it is responding to. + +- ``method``: Name of the method being called. + +- ``params``: An array or dictionary of parameters being passed to the method. + +- ``id``: Uniquely identifies this request. The server is expected to send a response with the same ID. + +---- + +.. _class_JSONRPC_method_make_response: + +- :ref:`Dictionary` **make_response** **(** :ref:`Variant` result, :ref:`Variant` id **)** + +When a server has received and processed a request, it is expected to send a response. If you did not want a response then you need to have sent a Notification instead. + +- ``result``: The return value of the function which was called. + +- ``id``: The ID of the request this response is targeted to. + +---- + +.. _class_JSONRPC_method_make_response_error: + +- :ref:`Dictionary` **make_response_error** **(** :ref:`int` code, :ref:`String` message, :ref:`Variant` id=null **)** |const| + +Creates a response which indicates a previous reply has failed in some way. + +- ``code``: The error code corresponding to what kind of error this is. See the :ref:`ErrorCode` constants. + +- ``message``: A custom message about this error. + +- ``id``: The request this error is a response to. + +---- + +.. _class_JSONRPC_method_process_action: + +- :ref:`Variant` **process_action** **(** :ref:`Variant` action, :ref:`bool` recurse=false **)** + +Given a Dictionary which takes the form of a JSON-RPC request: unpack the request and run it. Methods are resolved by looking at the field called "method" and looking for an equivalently named function in the JSONRPC object. If one is found that method is called. + +To add new supported methods extend the JSONRPC class and call :ref:`process_action` on your subclass. + +``action``: The action to be run, as a Dictionary in the form of a JSON-RPC request or notification. + +---- + +.. _class_JSONRPC_method_process_string: + +- :ref:`String` **process_string** **(** :ref:`String` action **)** + +---- + +.. _class_JSONRPC_method_set_scope: + +- void **set_scope** **(** :ref:`String` scope, :ref:`Object` target **)** + +.. |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.)` diff --git a/classes/class_kinematicbody.rst b/classes/class_kinematicbody.rst new file mode 100644 index 0000000..a93d5fd --- /dev/null +++ b/classes/class_kinematicbody.rst @@ -0,0 +1,376 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the KinematicBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_KinematicBody: + +KinematicBody +============= + +**Inherits:** :ref:`PhysicsBody` **<** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Kinematic body 3D node. + +Description +----------- + +Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: + +**Simulated motion:** When these bodies are moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`AnimationPlayer.playback_process_mode` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + +**Kinematic characters:** KinematicBody also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. + +Tutorials +--------- + +- :doc:`../tutorials/physics/kinematic_character_2d` + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +- `3D Voxel Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`axis_lock_motion_x` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`axis_lock_motion_y` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`axis_lock_motion_z` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`collision/safe_margin` | ``0.001`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`motion/sync_to_physics` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`move_lock_x` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`move_lock_y` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`move_lock_z` | ``false`` | ++---------------------------+------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_axis_lock` **(** :ref:`BodyAxis` axis **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_floor_angle` **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_floor_normal` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_floor_velocity` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision` | :ref:`get_last_slide_collision` **(** **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision` | :ref:`get_slide_collision` **(** :ref:`int` slide_idx **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_slide_count` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_ceiling` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_floor` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_wall` **(** **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision` | :ref:`move_and_collide` **(** :ref:`Vector3` rel_vec, :ref:`bool` infinite_inertia=true, :ref:`bool` exclude_raycast_shapes=true, :ref:`bool` test_only=false **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`move_and_slide` **(** :ref:`Vector3` linear_velocity, :ref:`Vector3` up_direction=Vector3( 0, 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`move_and_slide_with_snap` **(** :ref:`Vector3` linear_velocity, :ref:`Vector3` snap, :ref:`Vector3` up_direction=Vector3( 0, 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_lock` **(** :ref:`BodyAxis` axis, :ref:`bool` lock **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`test_move` **(** :ref:`Transform` from, :ref:`Vector3` rel_vec, :ref:`bool` infinite_inertia=true **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_KinematicBody_property_axis_lock_motion_x: + +- :ref:`bool` **axis_lock_motion_x** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's X axis movement. + +---- + +.. _class_KinematicBody_property_axis_lock_motion_y: + +- :ref:`bool` **axis_lock_motion_y** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's Y axis movement. + +---- + +.. _class_KinematicBody_property_axis_lock_motion_z: + +- :ref:`bool` **axis_lock_motion_z** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's Z axis movement. + +---- + +.. _class_KinematicBody_property_collision/safe_margin: + +- :ref:`float` **collision/safe_margin** + ++-----------+------------------------+ +| *Default* | ``0.001`` | ++-----------+------------------------+ +| *Setter* | set_safe_margin(value) | ++-----------+------------------------+ +| *Getter* | get_safe_margin() | ++-----------+------------------------+ + +Extra margin used for collision recovery in motion functions (see :ref:`move_and_collide`, :ref:`move_and_slide`, :ref:`move_and_slide_with_snap`). + +If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. + +A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. + +A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of kinematic bodies. + +---- + +.. _class_KinematicBody_property_motion/sync_to_physics: + +- :ref:`bool` **motion/sync_to_physics** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_sync_to_physics(value) | ++-----------+------------------------------+ +| *Getter* | is_sync_to_physics_enabled() | ++-----------+------------------------------+ + +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`move_and_slide` or :ref:`move_and_collide` functions. + +---- + +.. _class_KinematicBody_property_move_lock_x: + +- :ref:`bool` **move_lock_x** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's X axis movement. Deprecated alias for :ref:`axis_lock_motion_x`. + +---- + +.. _class_KinematicBody_property_move_lock_y: + +- :ref:`bool` **move_lock_y** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's Y axis movement. Deprecated alias for :ref:`axis_lock_motion_y`. + +---- + +.. _class_KinematicBody_property_move_lock_z: + +- :ref:`bool` **move_lock_z** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's Z axis movement. Deprecated alias for :ref:`axis_lock_motion_z`. + +Method Descriptions +------------------- + +.. _class_KinematicBody_method_get_axis_lock: + +- :ref:`bool` **get_axis_lock** **(** :ref:`BodyAxis` axis **)** |const| + +Returns ``true`` if the specified ``axis`` is locked. See also :ref:`move_lock_x`, :ref:`move_lock_y` and :ref:`move_lock_z`. + +---- + +.. _class_KinematicBody_method_get_floor_angle: + +- :ref:`float` **get_floor_angle** **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| + +Returns the floor's collision angle at the last collision point according to ``up_direction``, which is ``Vector3.UP`` by default. This value is always positive and only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody_method_get_floor_normal: + +- :ref:`Vector3` **get_floor_normal** **(** **)** |const| + +Returns the surface normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody_method_get_floor_velocity: + +- :ref:`Vector3` **get_floor_velocity** **(** **)** |const| + +Returns the linear velocity of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody_method_get_last_slide_collision: + +- :ref:`KinematicCollision` **get_last_slide_collision** **(** **)** + +Returns a :ref:`KinematicCollision`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide`. + +---- + +.. _class_KinematicBody_method_get_slide_collision: + +- :ref:`KinematicCollision` **get_slide_collision** **(** :ref:`int` slide_idx **)** + +Returns a :ref:`KinematicCollision`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). + +---- + +.. _class_KinematicBody_method_get_slide_count: + +- :ref:`int` **get_slide_count** **(** **)** |const| + +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. + +---- + +.. _class_KinematicBody_method_is_on_ceiling: + +- :ref:`bool` **is_on_ceiling** **(** **)** |const| + +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody_method_is_on_floor: + +- :ref:`bool` **is_on_floor** **(** **)** |const| + +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody_method_is_on_wall: + +- :ref:`bool` **is_on_wall** **(** **)** |const| + +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody_method_move_and_collide: + +- :ref:`KinematicCollision` **move_and_collide** **(** :ref:`Vector3` rel_vec, :ref:`bool` infinite_inertia=true, :ref:`bool` exclude_raycast_shapes=true, :ref:`bool` test_only=false **)** + +Moves the body along the vector ``rel_vec``. The body will stop if it collides. Returns a :ref:`KinematicCollision`, which contains information about the collision when stopped, or when touching another body along the motion. + +If ``test_only`` is ``true``, the body does not move but the would-be collision information is given. + +---- + +.. _class_KinematicBody_method_move_and_slide: + +- :ref:`Vector3` **move_and_slide** **(** :ref:`Vector3` linear_velocity, :ref:`Vector3` up_direction=Vector3( 0, 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** + +Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody`` or :ref:`RigidBody`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + +This method should be used in :ref:`Node._physics_process` (or in a method called by :ref:`Node._physics_process`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. + +``linear_velocity`` is the velocity vector (typically meters per second). Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. + +``up_direction`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector3(0, 0, 0)``, everything is considered a wall. + +If ``stop_on_slope`` is ``true``, body will not slide on slopes when you include gravity in ``linear_velocity`` and the body is standing still. + +If the body collides, it will change direction a maximum of ``max_slides`` times before it stops. + +``floor_max_angle`` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. + +If ``infinite_inertia`` is ``true``, body will be able to push :ref:`RigidBody` nodes, but it won't also detect any collisions with them. If ``false``, it will interact with :ref:`RigidBody` nodes like with :ref:`StaticBody`. + +Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use :ref:`get_slide_collision`. + +When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + +---- + +.. _class_KinematicBody_method_move_and_slide_with_snap: + +- :ref:`Vector3` **move_and_slide_with_snap** **(** :ref:`Vector3` linear_velocity, :ref:`Vector3` snap, :ref:`Vector3` up_direction=Vector3( 0, 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** + +Moves the body while keeping it attached to slopes. Similar to :ref:`move_and_slide`. + +As long as the ``snap`` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting ``snap`` to ``(0, 0, 0)`` or by using :ref:`move_and_slide` instead. + +---- + +.. _class_KinematicBody_method_set_axis_lock: + +- void **set_axis_lock** **(** :ref:`BodyAxis` axis, :ref:`bool` lock **)** + +Locks or unlocks the specified ``axis`` depending on the value of ``lock``. See also :ref:`move_lock_x`, :ref:`move_lock_y` and :ref:`move_lock_z`. + +---- + +.. _class_KinematicBody_method_test_move: + +- :ref:`bool` **test_move** **(** :ref:`Transform` from, :ref:`Vector3` rel_vec, :ref:`bool` infinite_inertia=true **)** + +Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given :ref:`Transform`, then tries to move the body along the vector ``rel_vec``. Returns ``true`` if a collision would stop the body from moving along the whole path. + +Use :ref:`move_and_collide` instead for detecting collision with touching bodies. + +.. |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.)` diff --git a/classes/class_kinematicbody2d.rst b/classes/class_kinematicbody2d.rst new file mode 100644 index 0000000..a11040a --- /dev/null +++ b/classes/class_kinematicbody2d.rst @@ -0,0 +1,254 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the KinematicBody2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_KinematicBody2D: + +KinematicBody2D +=============== + +**Inherits:** :ref:`PhysicsBody2D` **<** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Kinematic body 2D node. + +Description +----------- + +Kinematic bodies are special types of bodies that are meant to be user-controlled. They are not affected by physics at all; to other types of bodies, such as a character or a rigid body, these are the same as a static body. However, they have two main uses: + +**Simulated motion:** When these bodies are moved manually, either from code or from an :ref:`AnimationPlayer` (with :ref:`AnimationPlayer.playback_process_mode` set to "physics"), the physics will automatically compute an estimate of their linear and angular velocity. This makes them very useful for moving platforms or other AnimationPlayer-controlled objects (like a door, a bridge that opens, etc). + +**Kinematic characters:** KinematicBody2D also has an API for moving objects (the :ref:`move_and_collide` and :ref:`move_and_slide` methods) while performing collision tests. This makes them really useful to implement characters that collide against a world, but don't require advanced physics. + +Tutorials +--------- + +- :doc:`../tutorials/physics/kinematic_character_2d` + +- :doc:`../tutorials/physics/using_kinematic_body_2d` + +- `2D Kinematic Character Demo `__ + +- `2D Platformer Demo `__ + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`collision/safe_margin` | ``0.08`` | ++---------------------------+--------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`motion/sync_to_physics` | ``false`` | ++---------------------------+--------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_floor_angle` **(** :ref:`Vector2` up_direction=Vector2( 0, -1 ) **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_floor_normal` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_floor_velocity` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision2D` | :ref:`get_last_slide_collision` **(** **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision2D` | :ref:`get_slide_collision` **(** :ref:`int` slide_idx **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_slide_count` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_ceiling` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_floor` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_wall` **(** **)** |const| | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`KinematicCollision2D` | :ref:`move_and_collide` **(** :ref:`Vector2` rel_vec, :ref:`bool` infinite_inertia=true, :ref:`bool` exclude_raycast_shapes=true, :ref:`bool` test_only=false **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`move_and_slide` **(** :ref:`Vector2` linear_velocity, :ref:`Vector2` up_direction=Vector2( 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`move_and_slide_with_snap` **(** :ref:`Vector2` linear_velocity, :ref:`Vector2` snap, :ref:`Vector2` up_direction=Vector2( 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`test_move` **(** :ref:`Transform2D` from, :ref:`Vector2` rel_vec, :ref:`bool` infinite_inertia=true **)** | ++---------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_KinematicBody2D_property_collision/safe_margin: + +- :ref:`float` **collision/safe_margin** + ++-----------+------------------------+ +| *Default* | ``0.08`` | ++-----------+------------------------+ +| *Setter* | set_safe_margin(value) | ++-----------+------------------------+ +| *Getter* | get_safe_margin() | ++-----------+------------------------+ + +Extra margin used for collision recovery in motion functions (see :ref:`move_and_collide`, :ref:`move_and_slide`, :ref:`move_and_slide_with_snap`). + +If the body is at least this close to another body, it will consider them to be colliding and will be pushed away before performing the actual motion. + +A higher value means it's more flexible for detecting collision, which helps with consistently detecting walls and floors. + +A lower value forces the collision algorithm to use more exact detection, so it can be used in cases that specifically require precision, e.g at very low scale to avoid visible jittering, or for stability with a stack of kinematic bodies. + +---- + +.. _class_KinematicBody2D_property_motion/sync_to_physics: + +- :ref:`bool` **motion/sync_to_physics** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_sync_to_physics(value) | ++-----------+------------------------------+ +| *Getter* | is_sync_to_physics_enabled() | ++-----------+------------------------------+ + +If ``true``, the body's movement will be synchronized to the physics frame. This is useful when animating movement via :ref:`AnimationPlayer`, for example on moving platforms. Do **not** use together with :ref:`move_and_slide` or :ref:`move_and_collide` functions. + +Method Descriptions +------------------- + +.. _class_KinematicBody2D_method_get_floor_angle: + +- :ref:`float` **get_floor_angle** **(** :ref:`Vector2` up_direction=Vector2( 0, -1 ) **)** |const| + +Returns the floor's collision angle at the last collision point according to ``up_direction``, which is ``Vector2.UP`` by default. This value is always positive and only valid after calling :ref:`move_and_slide` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody2D_method_get_floor_normal: + +- :ref:`Vector2` **get_floor_normal** **(** **)** |const| + +Returns the surface normal of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody2D_method_get_floor_velocity: + +- :ref:`Vector2` **get_floor_velocity** **(** **)** |const| + +Returns the linear velocity of the floor at the last collision point. Only valid after calling :ref:`move_and_slide` or :ref:`move_and_slide_with_snap` and when :ref:`is_on_floor` returns ``true``. + +---- + +.. _class_KinematicBody2D_method_get_last_slide_collision: + +- :ref:`KinematicCollision2D` **get_last_slide_collision** **(** **)** + +Returns a :ref:`KinematicCollision2D`, which contains information about the latest collision that occurred during the last call to :ref:`move_and_slide`. + +---- + +.. _class_KinematicBody2D_method_get_slide_collision: + +- :ref:`KinematicCollision2D` **get_slide_collision** **(** :ref:`int` slide_idx **)** + +Returns a :ref:`KinematicCollision2D`, which contains information about a collision that occurred during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Since the body can collide several times in a single call to :ref:`move_and_slide`, you must specify the index of the collision in the range 0 to (:ref:`get_slide_count` - 1). + +**Example usage:** + +:: + + for i in get_slide_count(): + var collision = get_slide_collision(i) + print("Collided with: ", collision.collider.name) + +---- + +.. _class_KinematicBody2D_method_get_slide_count: + +- :ref:`int` **get_slide_count** **(** **)** |const| + +Returns the number of times the body collided and changed direction during the last call to :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. + +---- + +.. _class_KinematicBody2D_method_is_on_ceiling: + +- :ref:`bool` **is_on_ceiling** **(** **)** |const| + +Returns ``true`` if the body collided with the ceiling on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody2D_method_is_on_floor: + +- :ref:`bool` **is_on_floor** **(** **)** |const| + +Returns ``true`` if the body collided with the floor on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody2D_method_is_on_wall: + +- :ref:`bool` **is_on_wall** **(** **)** |const| + +Returns ``true`` if the body collided with a wall on the last call of :ref:`move_and_slide` or :ref:`move_and_slide_with_snap`. Otherwise, returns ``false``. + +---- + +.. _class_KinematicBody2D_method_move_and_collide: + +- :ref:`KinematicCollision2D` **move_and_collide** **(** :ref:`Vector2` rel_vec, :ref:`bool` infinite_inertia=true, :ref:`bool` exclude_raycast_shapes=true, :ref:`bool` test_only=false **)** + +Moves the body along the vector ``rel_vec``. The body will stop if it collides. Returns a :ref:`KinematicCollision2D`, which contains information about the collision when stopped, or when touching another body along the motion. + +If ``test_only`` is ``true``, the body does not move but the would-be collision information is given. + +---- + +.. _class_KinematicBody2D_method_move_and_slide: + +- :ref:`Vector2` **move_and_slide** **(** :ref:`Vector2` linear_velocity, :ref:`Vector2` up_direction=Vector2( 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** + +Moves the body along a vector. If the body collides with another, it will slide along the other body rather than stop immediately. If the other body is a ``KinematicBody2D`` or :ref:`RigidBody2D`, it will also be affected by the motion of the other body. You can use this to make moving and rotating platforms, or to make nodes push other nodes. + +This method should be used in :ref:`Node._physics_process` (or in a method called by :ref:`Node._physics_process`), as it uses the physics step's ``delta`` value automatically in calculations. Otherwise, the simulation will run at an incorrect speed. + +``linear_velocity`` is the velocity vector in pixels per second. Unlike in :ref:`move_and_collide`, you should *not* multiply it by ``delta`` — the physics engine handles applying the velocity. + +``up_direction`` is the up direction, used to determine what is a wall and what is a floor or a ceiling. If set to the default value of ``Vector2(0, 0)``, everything is considered a wall. This is useful for topdown games. + +If ``stop_on_slope`` is ``true``, body will not slide on slopes when you include gravity in ``linear_velocity`` and the body is standing still. + +If the body collides, it will change direction a maximum of ``max_slides`` times before it stops. + +``floor_max_angle`` is the maximum angle (in radians) where a slope is still considered a floor (or a ceiling), rather than a wall. The default value equals 45 degrees. + +If ``infinite_inertia`` is ``true``, body will be able to push :ref:`RigidBody2D` nodes, but it won't also detect any collisions with them. If ``false``, it will interact with :ref:`RigidBody2D` nodes like with :ref:`StaticBody2D`. + +Returns the ``linear_velocity`` vector, rotated and/or scaled if a slide collision occurred. To get detailed information about collisions that occurred, use :ref:`get_slide_collision`. + +When the body touches a moving platform, the platform's velocity is automatically added to the body motion. If a collision occurs due to the platform's motion, it will always be first in the slide collisions. + +---- + +.. _class_KinematicBody2D_method_move_and_slide_with_snap: + +- :ref:`Vector2` **move_and_slide_with_snap** **(** :ref:`Vector2` linear_velocity, :ref:`Vector2` snap, :ref:`Vector2` up_direction=Vector2( 0, 0 ), :ref:`bool` stop_on_slope=false, :ref:`int` max_slides=4, :ref:`float` floor_max_angle=0.785398, :ref:`bool` infinite_inertia=true **)** + +Moves the body while keeping it attached to slopes. Similar to :ref:`move_and_slide`. + +As long as the ``snap`` vector is in contact with the ground, the body will remain attached to the surface. This means you must disable snap in order to jump, for example. You can do this by setting ``snap`` to ``(0, 0)`` or by using :ref:`move_and_slide` instead. + +---- + +.. _class_KinematicBody2D_method_test_move: + +- :ref:`bool` **test_move** **(** :ref:`Transform2D` from, :ref:`Vector2` rel_vec, :ref:`bool` infinite_inertia=true **)** + +Checks for collisions without moving the body. Virtually sets the node's position, scale and rotation to that of the given :ref:`Transform2D`, then tries to move the body along the vector ``rel_vec``. Returns ``true`` if a collision would stop the body from moving along the whole path. + +Use :ref:`move_and_collide` instead for detecting collision with touching bodies. + +.. |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.)` diff --git a/classes/class_kinematiccollision.rst b/classes/class_kinematiccollision.rst new file mode 100644 index 0000000..66383c0 --- /dev/null +++ b/classes/class_kinematiccollision.rst @@ -0,0 +1,229 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the KinematicCollision.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_KinematicCollision: + +KinematicCollision +================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Collision data for :ref:`KinematicBody` collisions. + +Description +----------- + +Contains collision data for :ref:`KinematicBody` collisions. When a :ref:`KinematicBody` is moved using :ref:`KinematicBody.move_and_collide`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision object is returned. + +This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Object` | :ref:`collider` | | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collider_id` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Variant` | :ref:`collider_metadata` | | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`RID` | :ref:`collider_rid` | | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Object` | :ref:`collider_shape` | | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collider_shape_index` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`collider_velocity` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Object` | :ref:`local_shape` | | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`normal` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`position` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`remainder` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`travel` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------+------------------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_angle` **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_KinematicCollision_property_collider: + +- :ref:`Object` **collider** + ++----------+----------------+ +| *Getter* | get_collider() | ++----------+----------------+ + +The colliding body. + +---- + +.. _class_KinematicCollision_property_collider_id: + +- :ref:`int` **collider_id** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Getter* | get_collider_id() | ++-----------+-------------------+ + +The colliding body's unique instance ID. See :ref:`Object.get_instance_id`. + +---- + +.. _class_KinematicCollision_property_collider_metadata: + +- :ref:`Variant` **collider_metadata** + ++----------+-------------------------+ +| *Getter* | get_collider_metadata() | ++----------+-------------------------+ + +The colliding body's metadata. See :ref:`Object`. + +---- + +.. _class_KinematicCollision_property_collider_rid: + +- :ref:`RID` **collider_rid** + ++----------+--------------------+ +| *Getter* | get_collider_rid() | ++----------+--------------------+ + +The colliding body's :ref:`RID` used by the :ref:`PhysicsServer`. + +---- + +.. _class_KinematicCollision_property_collider_shape: + +- :ref:`Object` **collider_shape** + ++----------+----------------------+ +| *Getter* | get_collider_shape() | ++----------+----------------------+ + +The colliding body's shape. + +---- + +.. _class_KinematicCollision_property_collider_shape_index: + +- :ref:`int` **collider_shape_index** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Getter* | get_collider_shape_index() | ++-----------+----------------------------+ + +The colliding shape's index. See :ref:`CollisionObject`. + +---- + +.. _class_KinematicCollision_property_collider_velocity: + +- :ref:`Vector3` **collider_velocity** + ++-----------+-------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Getter* | get_collider_velocity() | ++-----------+-------------------------+ + +The colliding object's velocity. + +---- + +.. _class_KinematicCollision_property_local_shape: + +- :ref:`Object` **local_shape** + ++----------+-------------------+ +| *Getter* | get_local_shape() | ++----------+-------------------+ + +The moving object's colliding shape. + +---- + +.. _class_KinematicCollision_property_normal: + +- :ref:`Vector3` **normal** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_normal() | ++-----------+------------------------+ + +The colliding body's shape's normal at the point of collision. + +---- + +.. _class_KinematicCollision_property_position: + +- :ref:`Vector3` **position** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_position() | ++-----------+------------------------+ + +The point of collision, in global coordinates. + +---- + +.. _class_KinematicCollision_property_remainder: + +- :ref:`Vector3` **remainder** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_remainder() | ++-----------+------------------------+ + +The moving object's remaining movement vector. + +---- + +.. _class_KinematicCollision_property_travel: + +- :ref:`Vector3` **travel** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_travel() | ++-----------+------------------------+ + +The distance the moving object traveled before collision. + +Method Descriptions +------------------- + +.. _class_KinematicCollision_method_get_angle: + +- :ref:`float` **get_angle** **(** :ref:`Vector3` up_direction=Vector3( 0, 1, 0 ) **)** |const| + +The collision angle according to ``up_direction``, which is ``Vector3.UP`` by default. This value is always positive. + +.. |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.)` diff --git a/classes/class_kinematiccollision2d.rst b/classes/class_kinematiccollision2d.rst new file mode 100644 index 0000000..d81bc40 --- /dev/null +++ b/classes/class_kinematiccollision2d.rst @@ -0,0 +1,229 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the KinematicCollision2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_KinematicCollision2D: + +KinematicCollision2D +==================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Collision data for :ref:`KinematicBody2D` collisions. + +Description +----------- + +Contains collision data for :ref:`KinematicBody2D` collisions. When a :ref:`KinematicBody2D` is moved using :ref:`KinematicBody2D.move_and_collide`, it stops if it detects a collision with another body. If a collision is detected, a KinematicCollision2D object is returned. + +This object contains information about the collision, including the colliding object, the remaining motion, and the collision position. This information can be used to calculate a collision response. + +Properties +---------- + ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Object` | :ref:`collider` | | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`collider_id` | ``0`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Variant` | :ref:`collider_metadata` | | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`RID` | :ref:`collider_rid` | | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Object` | :ref:`collider_shape` | | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`collider_shape_index` | ``0`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`collider_velocity` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Object` | :ref:`local_shape` | | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`normal` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`remainder` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`travel` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_angle` **(** :ref:`Vector2` up_direction=Vector2( 0, -1 ) **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_KinematicCollision2D_property_collider: + +- :ref:`Object` **collider** + ++----------+----------------+ +| *Getter* | get_collider() | ++----------+----------------+ + +The colliding body. + +---- + +.. _class_KinematicCollision2D_property_collider_id: + +- :ref:`int` **collider_id** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Getter* | get_collider_id() | ++-----------+-------------------+ + +The colliding body's unique instance ID. See :ref:`Object.get_instance_id`. + +---- + +.. _class_KinematicCollision2D_property_collider_metadata: + +- :ref:`Variant` **collider_metadata** + ++----------+-------------------------+ +| *Getter* | get_collider_metadata() | ++----------+-------------------------+ + +The colliding body's metadata. See :ref:`Object`. + +---- + +.. _class_KinematicCollision2D_property_collider_rid: + +- :ref:`RID` **collider_rid** + ++----------+--------------------+ +| *Getter* | get_collider_rid() | ++----------+--------------------+ + +The colliding body's :ref:`RID` used by the :ref:`Physics2DServer`. + +---- + +.. _class_KinematicCollision2D_property_collider_shape: + +- :ref:`Object` **collider_shape** + ++----------+----------------------+ +| *Getter* | get_collider_shape() | ++----------+----------------------+ + +The colliding body's shape. + +---- + +.. _class_KinematicCollision2D_property_collider_shape_index: + +- :ref:`int` **collider_shape_index** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Getter* | get_collider_shape_index() | ++-----------+----------------------------+ + +The colliding shape's index. See :ref:`CollisionObject2D`. + +---- + +.. _class_KinematicCollision2D_property_collider_velocity: + +- :ref:`Vector2` **collider_velocity** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Getter* | get_collider_velocity() | ++-----------+-------------------------+ + +The colliding object's velocity. + +---- + +.. _class_KinematicCollision2D_property_local_shape: + +- :ref:`Object` **local_shape** + ++----------+-------------------+ +| *Getter* | get_local_shape() | ++----------+-------------------+ + +The moving object's colliding shape. + +---- + +.. _class_KinematicCollision2D_property_normal: + +- :ref:`Vector2` **normal** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_normal() | ++-----------+---------------------+ + +The colliding body's shape's normal at the point of collision. + +---- + +.. _class_KinematicCollision2D_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +The point of collision, in global coordinates. + +---- + +.. _class_KinematicCollision2D_property_remainder: + +- :ref:`Vector2` **remainder** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_remainder() | ++-----------+---------------------+ + +The moving object's remaining movement vector. + +---- + +.. _class_KinematicCollision2D_property_travel: + +- :ref:`Vector2` **travel** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_travel() | ++-----------+---------------------+ + +The distance the moving object traveled before collision. + +Method Descriptions +------------------- + +.. _class_KinematicCollision2D_method_get_angle: + +- :ref:`float` **get_angle** **(** :ref:`Vector2` up_direction=Vector2( 0, -1 ) **)** |const| + +The collision angle according to ``up_direction``, which is ``Vector2.UP`` by default. This value is always positive. + +.. |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.)` diff --git a/classes/class_label.rst b/classes/class_label.rst new file mode 100644 index 0000000..5299843 --- /dev/null +++ b/classes/class_label.rst @@ -0,0 +1,437 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Label.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Label: + +Label +===== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Displays plain text in a line or wrapped inside a rectangle. For formatted text, use :ref:`RichTextLabel`. + +Description +----------- + +Label displays plain text on the screen. It gives you control over the horizontal and vertical alignment and can wrap the text inside the node's bounding rectangle. It doesn't support bold, italics, or other formatting. For that, use :ref:`RichTextLabel` instead. + +**Note:** Contrarily to most other :ref:`Control`\ s, Label's :ref:`Control.mouse_filter` defaults to :ref:`Control.MOUSE_FILTER_IGNORE` (i.e. it doesn't react to mouse input events). This implies that a label won't display any configured :ref:`Control.hint_tooltip`, unless you change its mouse filter. + +**Note:** Unicode characters after ``0xffff`` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0. + +Tutorials +--------- + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`Align` | :ref:`align` | ``0`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`autowrap` | ``false`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`clip_text` | ``false`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`lines_skipped` | ``0`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`max_lines_visible` | ``-1`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``2`` *(parent override)* | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`percent_visible` | ``1.0`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | size_flags_vertical | ``4`` *(parent override)* | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`uppercase` | ``false`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`VAlign` | :ref:`valign` | ``0`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`visible_characters` | ``-1`` | ++----------------------------------------------+--------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-----------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_count` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_height` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_total_character_count` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_visible_line_count` **(** **)** |const| | ++-----------------------+----------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`font_color_shadow` | ``Color( 0, 0, 0, 0 )`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`font_outline_modulate` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`line_spacing` | ``3`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`shadow_as_outline` | ``0`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`shadow_offset_x` | ``1`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`shadow_offset_y` | ``1`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ + +Enumerations +------------ + +.. _enum_Label_Align: + +.. _class_Label_constant_ALIGN_LEFT: + +.. _class_Label_constant_ALIGN_CENTER: + +.. _class_Label_constant_ALIGN_RIGHT: + +.. _class_Label_constant_ALIGN_FILL: + +enum **Align**: + +- **ALIGN_LEFT** = **0** --- Align rows to the left (default). + +- **ALIGN_CENTER** = **1** --- Align rows centered. + +- **ALIGN_RIGHT** = **2** --- Align rows to the right. + +- **ALIGN_FILL** = **3** --- Expand row whitespaces to fit the width. + +---- + +.. _enum_Label_VAlign: + +.. _class_Label_constant_VALIGN_TOP: + +.. _class_Label_constant_VALIGN_CENTER: + +.. _class_Label_constant_VALIGN_BOTTOM: + +.. _class_Label_constant_VALIGN_FILL: + +enum **VAlign**: + +- **VALIGN_TOP** = **0** --- Align the whole text to the top. + +- **VALIGN_CENTER** = **1** --- Align the whole text to the center. + +- **VALIGN_BOTTOM** = **2** --- Align the whole text to the bottom. + +- **VALIGN_FILL** = **3** --- Align the whole text by spreading the rows. + +Property Descriptions +--------------------- + +.. _class_Label_property_align: + +- :ref:`Align` **align** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_align(value) | ++-----------+------------------+ +| *Getter* | get_align() | ++-----------+------------------+ + +Controls the text's horizontal align. Supports left, center, right, and fill, or justify. Set it to one of the :ref:`Align` constants. + +---- + +.. _class_Label_property_autowrap: + +- :ref:`bool` **autowrap** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_autowrap(value) | ++-----------+---------------------+ +| *Getter* | has_autowrap() | ++-----------+---------------------+ + +If ``true``, wraps the text inside the node's bounding rectangle. If you resize the node, it will change its height automatically to show all the text. + +---- + +.. _class_Label_property_clip_text: + +- :ref:`bool` **clip_text** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_clip_text(value) | ++-----------+----------------------+ +| *Getter* | is_clipping_text() | ++-----------+----------------------+ + +If ``true``, the Label only shows the text that fits inside its bounding rectangle and will clip text horizontally. + +---- + +.. _class_Label_property_lines_skipped: + +- :ref:`int` **lines_skipped** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_lines_skipped(value) | ++-----------+--------------------------+ +| *Getter* | get_lines_skipped() | ++-----------+--------------------------+ + +The node ignores the first ``lines_skipped`` lines before it starts to display text. + +---- + +.. _class_Label_property_max_lines_visible: + +- :ref:`int` **max_lines_visible** + ++-----------+------------------------------+ +| *Default* | ``-1`` | ++-----------+------------------------------+ +| *Setter* | set_max_lines_visible(value) | ++-----------+------------------------------+ +| *Getter* | get_max_lines_visible() | ++-----------+------------------------------+ + +Limits the lines of text the node shows on screen. + +---- + +.. _class_Label_property_percent_visible: + +- :ref:`float` **percent_visible** + ++-----------+----------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------+ +| *Setter* | set_percent_visible(value) | ++-----------+----------------------------+ +| *Getter* | get_percent_visible() | ++-----------+----------------------------+ + +Limits the amount of visible characters. If you set ``percent_visible`` to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. + +---- + +.. _class_Label_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The text to display on screen. + +---- + +.. _class_Label_property_uppercase: + +- :ref:`bool` **uppercase** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_uppercase(value) | ++-----------+----------------------+ +| *Getter* | is_uppercase() | ++-----------+----------------------+ + +If ``true``, all the text displays as UPPERCASE. + +---- + +.. _class_Label_property_valign: + +- :ref:`VAlign` **valign** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_valign(value) | ++-----------+-------------------+ +| *Getter* | get_valign() | ++-----------+-------------------+ + +Controls the text's vertical align. Supports top, center, bottom, and fill. Set it to one of the :ref:`VAlign` constants. + +---- + +.. _class_Label_property_visible_characters: + +- :ref:`int` **visible_characters** + ++-----------+-------------------------------+ +| *Default* | ``-1`` | ++-----------+-------------------------------+ +| *Setter* | set_visible_characters(value) | ++-----------+-------------------------------+ +| *Getter* | get_visible_characters() | ++-----------+-------------------------------+ + +Restricts the number of characters to display. Set to -1 to disable. + +Method Descriptions +------------------- + +.. _class_Label_method_get_line_count: + +- :ref:`int` **get_line_count** **(** **)** |const| + +Returns the amount of lines of text the Label has. + +---- + +.. _class_Label_method_get_line_height: + +- :ref:`int` **get_line_height** **(** **)** |const| + +Returns the font size in pixels. + +---- + +.. _class_Label_method_get_total_character_count: + +- :ref:`int` **get_total_character_count** **(** **)** |const| + +Returns the total number of printable characters in the text (excluding spaces and newlines). + +---- + +.. _class_Label_method_get_visible_line_count: + +- :ref:`int` **get_visible_line_count** **(** **)** |const| + +Returns the number of lines shown. Useful if the ``Label``'s height cannot currently display all lines. + +Theme Property Descriptions +--------------------------- + +.. _class_Label_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Default text :ref:`Color` of the ``Label``. + +---- + +.. _class_Label_theme_color_font_color_shadow: + +- :ref:`Color` **font_color_shadow** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ + +:ref:`Color` of the text's shadow effect. + +---- + +.. _class_Label_theme_color_font_outline_modulate: + +- :ref:`Color` **font_outline_modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The tint of :ref:`Font`'s outline. See :ref:`DynamicFont.outline_color`. + +---- + +.. _class_Label_theme_constant_line_spacing: + +- :ref:`int` **line_spacing** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +Vertical space between lines in multiline ``Label``. + +---- + +.. _class_Label_theme_constant_shadow_as_outline: + +- :ref:`int` **shadow_as_outline** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Boolean value. If set to 1 (``true``), the shadow will be displayed around the whole text as an outline. + +---- + +.. _class_Label_theme_constant_shadow_offset_x: + +- :ref:`int` **shadow_offset_x** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The horizontal offset of the text's shadow. + +---- + +.. _class_Label_theme_constant_shadow_offset_y: + +- :ref:`int` **shadow_offset_y** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The vertical offset of the text's shadow. + +---- + +.. _class_Label_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` used for the ``Label``'s text. + +---- + +.. _class_Label_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Background :ref:`StyleBox` for the ``Label``. + +.. |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.)` diff --git a/classes/class_largetexture.rst b/classes/class_largetexture.rst new file mode 100644 index 0000000..a05e9be --- /dev/null +++ b/classes/class_largetexture.rst @@ -0,0 +1,118 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the LargeTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_LargeTexture: + +LargeTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +*Deprecated.* A :ref:`Texture` capable of storing many smaller textures with offsets. + +Description +----------- + +*Deprecated (will be removed in Godot 4.0).* A :ref:`Texture` capable of storing many smaller textures with offsets. + +You can dynamically add pieces (:ref:`Texture`\ s) to this ``LargeTexture`` using different offsets. + +Properties +---------- + ++-----------------------+-------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-----------------------+-------+---------------------------+ + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_piece` **(** :ref:`Vector2` ofs, :ref:`Texture` texture **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_piece_count` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_piece_offset` **(** :ref:`int` idx **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_piece_texture` **(** :ref:`int` idx **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_piece_offset` **(** :ref:`int` idx, :ref:`Vector2` ofs **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_piece_texture` **(** :ref:`int` idx, :ref:`Texture` texture **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_size` **(** :ref:`Vector2` size **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_LargeTexture_method_add_piece: + +- :ref:`int` **add_piece** **(** :ref:`Vector2` ofs, :ref:`Texture` texture **)** + +Adds ``texture`` to this ``LargeTexture``, starting on offset ``ofs``. + +---- + +.. _class_LargeTexture_method_clear: + +- void **clear** **(** **)** + +Clears the ``LargeTexture``. + +---- + +.. _class_LargeTexture_method_get_piece_count: + +- :ref:`int` **get_piece_count** **(** **)** |const| + +Returns the number of pieces currently in this ``LargeTexture``. + +---- + +.. _class_LargeTexture_method_get_piece_offset: + +- :ref:`Vector2` **get_piece_offset** **(** :ref:`int` idx **)** |const| + +Returns the offset of the piece with the index ``idx``. + +---- + +.. _class_LargeTexture_method_get_piece_texture: + +- :ref:`Texture` **get_piece_texture** **(** :ref:`int` idx **)** |const| + +Returns the :ref:`Texture` of the piece with the index ``idx``. + +---- + +.. _class_LargeTexture_method_set_piece_offset: + +- void **set_piece_offset** **(** :ref:`int` idx, :ref:`Vector2` ofs **)** + +Sets the offset of the piece with the index ``idx`` to ``ofs``. + +---- + +.. _class_LargeTexture_method_set_piece_texture: + +- void **set_piece_texture** **(** :ref:`int` idx, :ref:`Texture` texture **)** + +Sets the :ref:`Texture` of the piece with index ``idx`` to ``texture``. + +---- + +.. _class_LargeTexture_method_set_size: + +- void **set_size** **(** :ref:`Vector2` size **)** + +Sets the size of this ``LargeTexture``. + +.. |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.)` diff --git a/classes/class_light.rst b/classes/class_light.rst new file mode 100644 index 0000000..86eb5cb --- /dev/null +++ b/classes/class_light.rst @@ -0,0 +1,415 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Light.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Light: + +Light +===== + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`DirectionalLight`, :ref:`OmniLight`, :ref:`SpotLight` + +Provides a base class for different kinds of light nodes. + +Description +----------- + +Light is the *abstract* base class for light nodes. As it can't be instanced, it shouldn't be used directly. Other types of light nodes inherit from it. Light contains the common variables and parameters used for lighting. + +Tutorials +--------- + +- :doc:`../tutorials/3d/lights_and_shadows` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`editor_only` | ``false`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`BakeMode` | :ref:`light_bake_mode` | ``1`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`light_color` | ``Color( 1, 1, 1, 1 )`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`light_cull_mask` | ``4294967295`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`light_energy` | ``1.0`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`light_indirect_energy` | ``1.0`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`light_negative` | ``false`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`light_size` | ``0.0`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`light_specular` | ``0.5`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`shadow_bias` | ``0.15`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`shadow_color` | ``Color( 0, 0, 0, 1 )`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`shadow_contact` | ``0.0`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shadow_enabled` | ``false`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shadow_reverse_cull_face` | ``false`` | ++--------------------------------------+--------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Light_Param: + +.. _class_Light_constant_PARAM_ENERGY: + +.. _class_Light_constant_PARAM_INDIRECT_ENERGY: + +.. _class_Light_constant_PARAM_SIZE: + +.. _class_Light_constant_PARAM_SPECULAR: + +.. _class_Light_constant_PARAM_RANGE: + +.. _class_Light_constant_PARAM_ATTENUATION: + +.. _class_Light_constant_PARAM_SPOT_ANGLE: + +.. _class_Light_constant_PARAM_SPOT_ATTENUATION: + +.. _class_Light_constant_PARAM_CONTACT_SHADOW_SIZE: + +.. _class_Light_constant_PARAM_SHADOW_MAX_DISTANCE: + +.. _class_Light_constant_PARAM_SHADOW_SPLIT_1_OFFSET: + +.. _class_Light_constant_PARAM_SHADOW_SPLIT_2_OFFSET: + +.. _class_Light_constant_PARAM_SHADOW_SPLIT_3_OFFSET: + +.. _class_Light_constant_PARAM_SHADOW_NORMAL_BIAS: + +.. _class_Light_constant_PARAM_SHADOW_BIAS: + +.. _class_Light_constant_PARAM_SHADOW_BIAS_SPLIT_SCALE: + +.. _class_Light_constant_PARAM_MAX: + +enum **Param**: + +- **PARAM_ENERGY** = **0** --- Constant for accessing :ref:`light_energy`. + +- **PARAM_INDIRECT_ENERGY** = **1** --- Constant for accessing :ref:`light_indirect_energy`. + +- **PARAM_SIZE** = **2** --- Constant for accessing :ref:`light_size`. + +- **PARAM_SPECULAR** = **3** --- Constant for accessing :ref:`light_specular`. + +- **PARAM_RANGE** = **4** --- Constant for accessing :ref:`OmniLight.omni_range` or :ref:`SpotLight.spot_range`. + +- **PARAM_ATTENUATION** = **5** --- Constant for accessing :ref:`OmniLight.omni_attenuation` or :ref:`SpotLight.spot_attenuation`. + +- **PARAM_SPOT_ANGLE** = **6** --- Constant for accessing :ref:`SpotLight.spot_angle`. + +- **PARAM_SPOT_ATTENUATION** = **7** --- Constant for accessing :ref:`SpotLight.spot_angle_attenuation`. + +- **PARAM_CONTACT_SHADOW_SIZE** = **8** --- Constant for accessing :ref:`shadow_contact`. + +- **PARAM_SHADOW_MAX_DISTANCE** = **9** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_max_distance`. + +- **PARAM_SHADOW_SPLIT_1_OFFSET** = **10** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_split_1`. + +- **PARAM_SHADOW_SPLIT_2_OFFSET** = **11** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_split_2`. + +- **PARAM_SHADOW_SPLIT_3_OFFSET** = **12** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_split_3`. + +- **PARAM_SHADOW_NORMAL_BIAS** = **13** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_normal_bias`. + +- **PARAM_SHADOW_BIAS** = **14** --- Constant for accessing :ref:`shadow_bias`. + +- **PARAM_SHADOW_BIAS_SPLIT_SCALE** = **15** --- Constant for accessing :ref:`DirectionalLight.directional_shadow_bias_split_scale`. + +- **PARAM_MAX** = **16** --- Represents the size of the :ref:`Param` enum. + +---- + +.. _enum_Light_BakeMode: + +.. _class_Light_constant_BAKE_DISABLED: + +.. _class_Light_constant_BAKE_INDIRECT: + +.. _class_Light_constant_BAKE_ALL: + +enum **BakeMode**: + +- **BAKE_DISABLED** = **0** --- Light is ignored when baking. + +**Note:** Hiding a light does *not* affect baking. + +- **BAKE_INDIRECT** = **1** --- Only indirect lighting will be baked (default). + +- **BAKE_ALL** = **2** --- Both direct and indirect light will be baked. + +**Note:** You should hide the light if you don't want it to appear twice (dynamic and baked). + +Property Descriptions +--------------------- + +.. _class_Light_property_editor_only: + +- :ref:`bool` **editor_only** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_editor_only(value) | ++-----------+------------------------+ +| *Getter* | is_editor_only() | ++-----------+------------------------+ + +If ``true``, the light only appears in the editor and will not be visible at runtime. + +---- + +.. _class_Light_property_light_bake_mode: + +- :ref:`BakeMode` **light_bake_mode** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_bake_mode(value) | ++-----------+----------------------+ +| *Getter* | get_bake_mode() | ++-----------+----------------------+ + +The light's bake mode. See :ref:`BakeMode`. + +---- + +.. _class_Light_property_light_color: + +- :ref:`Color` **light_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The light's color. An *overbright* color can be used to achieve a result equivalent to increasing the light's :ref:`light_energy`. + +---- + +.. _class_Light_property_light_cull_mask: + +- :ref:`int` **light_cull_mask** + ++-----------+----------------------+ +| *Default* | ``4294967295`` | ++-----------+----------------------+ +| *Setter* | set_cull_mask(value) | ++-----------+----------------------+ +| *Getter* | get_cull_mask() | ++-----------+----------------------+ + +The light will affect objects in the selected layers. + +---- + +.. _class_Light_property_light_energy: + +- :ref:`float` **light_energy** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The light's strength multiplier (this is not a physical unit). For :ref:`OmniLight` and :ref:`SpotLight`, changing this value will only change the light color's intensity, not the light's radius. + +---- + +.. _class_Light_property_light_indirect_energy: + +- :ref:`float` **light_indirect_energy** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Secondary multiplier used with indirect light (light bounces). This works on both :ref:`BakedLightmap` and :ref:`GIProbe`. + +---- + +.. _class_Light_property_light_negative: + +- :ref:`bool` **light_negative** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_negative(value) | ++-----------+---------------------+ +| *Getter* | is_negative() | ++-----------+---------------------+ + +If ``true``, the light's effect is reversed, darkening areas and casting bright shadows. + +---- + +.. _class_Light_property_light_size: + +- :ref:`float` **light_size** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The size of the light in Godot units. Only considered in baked lightmaps and only if :ref:`light_bake_mode` is set to :ref:`BAKE_ALL`. Increasing this value will make the shadows appear blurrier. This can be used to simulate area lights to an extent. + +---- + +.. _class_Light_property_light_specular: + +- :ref:`float` **light_specular** + ++-----------+------------------+ +| *Default* | ``0.5`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The intensity of the specular blob in objects affected by the light. At ``0``, the light becomes a pure diffuse light. When not baking emission, this can be used to avoid unrealistic reflections when placing lights above an emissive surface. + +---- + +.. _class_Light_property_shadow_bias: + +- :ref:`float` **shadow_bias** + ++-----------+------------------+ +| *Default* | ``0.15`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Used to adjust shadow appearance. Too small a value results in self-shadowing ("shadow acne"), while too large a value causes shadows to separate from casters ("peter-panning"). Adjust as needed. + +---- + +.. _class_Light_property_shadow_color: + +- :ref:`Color` **shadow_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_shadow_color(value) | ++-----------+-------------------------+ +| *Getter* | get_shadow_color() | ++-----------+-------------------------+ + +The color of shadows cast by this light. + +---- + +.. _class_Light_property_shadow_contact: + +- :ref:`float` **shadow_contact** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Attempts to reduce :ref:`shadow_bias` gap by rendering screen-space contact shadows. This has a performance impact, especially at higher values. + +**Note:** Contact shadows can look broken, so leaving this property to ``0.0`` is recommended. + +---- + +.. _class_Light_property_shadow_enabled: + +- :ref:`bool` **shadow_enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_shadow(value) | ++-----------+-------------------+ +| *Getter* | has_shadow() | ++-----------+-------------------+ + +If ``true``, the light will cast shadows. + +---- + +.. _class_Light_property_shadow_reverse_cull_face: + +- :ref:`bool` **shadow_reverse_cull_face** + ++-----------+-------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------+ +| *Setter* | set_shadow_reverse_cull_face(value) | ++-----------+-------------------------------------+ +| *Getter* | get_shadow_reverse_cull_face() | ++-----------+-------------------------------------+ + +If ``true``, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double-sided shadows with :ref:`GeometryInstance.SHADOW_CASTING_SETTING_DOUBLE_SIDED`. + +Method Descriptions +------------------- + +.. _class_Light_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| + +Returns the value of the specified :ref:`Param` parameter. + +---- + +.. _class_Light_method_set_param: + +- void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** + +Sets the value of the specified :ref:`Param` parameter. + +.. |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.)` diff --git a/classes/class_light2d.rst b/classes/class_light2d.rst new file mode 100644 index 0000000..3de9f31 --- /dev/null +++ b/classes/class_light2d.rst @@ -0,0 +1,465 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Light2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Light2D: + +Light2D +======= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Casts light in a 2D environment. + +Description +----------- + +Casts light in a 2D environment. Light is defined by a (usually grayscale) texture, a color, an energy value, a mode (see constants), and various other parameters (range and shadows-related). + +**Note:** Light2D can also be used as a mask. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_lights_and_shadows` + +Properties +---------- + ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`editor_only` | ``false`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`enabled` | ``true`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`energy` | ``1.0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`range_height` | ``0.0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`range_item_cull_mask` | ``1`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`range_layer_max` | ``0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`range_layer_min` | ``0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`range_z_max` | ``1024`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`range_z_min` | ``-1024`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`shadow_buffer_size` | ``2048`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`shadow_color` | ``Color( 0, 0, 0, 0 )`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shadow_enabled` | ``false`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`ShadowFilter` | :ref:`shadow_filter` | ``0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`shadow_filter_smooth` | ``0.0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`shadow_gradient_length` | ``0.0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`shadow_item_cull_mask` | ``1`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`texture_scale` | ``1.0`` | ++------------------------------------------------+------------------------------------------------------------------------------+-------------------------+ + +Enumerations +------------ + +.. _enum_Light2D_Mode: + +.. _class_Light2D_constant_MODE_ADD: + +.. _class_Light2D_constant_MODE_SUB: + +.. _class_Light2D_constant_MODE_MIX: + +.. _class_Light2D_constant_MODE_MASK: + +enum **Mode**: + +- **MODE_ADD** = **0** --- Adds the value of pixels corresponding to the Light2D to the values of pixels under it. This is the common behavior of a light. + +- **MODE_SUB** = **1** --- Subtracts the value of pixels corresponding to the Light2D to the values of pixels under it, resulting in inversed light effect. + +- **MODE_MIX** = **2** --- Mix the value of pixels corresponding to the Light2D to the values of pixels under it by linear interpolation. + +- **MODE_MASK** = **3** --- The light texture of the Light2D is used as a mask, hiding or revealing parts of the screen underneath depending on the value of each pixel of the light (mask) texture. + +---- + +.. _enum_Light2D_ShadowFilter: + +.. _class_Light2D_constant_SHADOW_FILTER_NONE: + +.. _class_Light2D_constant_SHADOW_FILTER_PCF3: + +.. _class_Light2D_constant_SHADOW_FILTER_PCF5: + +.. _class_Light2D_constant_SHADOW_FILTER_PCF7: + +.. _class_Light2D_constant_SHADOW_FILTER_PCF9: + +.. _class_Light2D_constant_SHADOW_FILTER_PCF13: + +enum **ShadowFilter**: + +- **SHADOW_FILTER_NONE** = **0** --- No filter applies to the shadow map. See :ref:`shadow_filter`. + +- **SHADOW_FILTER_PCF3** = **1** --- Percentage closer filtering (3 samples) applies to the shadow map. See :ref:`shadow_filter`. + +- **SHADOW_FILTER_PCF5** = **2** --- Percentage closer filtering (5 samples) applies to the shadow map. See :ref:`shadow_filter`. + +- **SHADOW_FILTER_PCF7** = **3** --- Percentage closer filtering (7 samples) applies to the shadow map. See :ref:`shadow_filter`. + +- **SHADOW_FILTER_PCF9** = **4** --- Percentage closer filtering (9 samples) applies to the shadow map. See :ref:`shadow_filter`. + +- **SHADOW_FILTER_PCF13** = **5** --- Percentage closer filtering (13 samples) applies to the shadow map. See :ref:`shadow_filter`. + +Property Descriptions +--------------------- + +.. _class_Light2D_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The Light2D's :ref:`Color`. + +---- + +.. _class_Light2D_property_editor_only: + +- :ref:`bool` **editor_only** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_editor_only(value) | ++-----------+------------------------+ +| *Getter* | is_editor_only() | ++-----------+------------------------+ + +If ``true``, Light2D will only appear when editing the scene. + +---- + +.. _class_Light2D_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_enabled(value) | ++-----------+--------------------+ +| *Getter* | is_enabled() | ++-----------+--------------------+ + +If ``true``, Light2D will emit light. + +---- + +.. _class_Light2D_property_energy: + +- :ref:`float` **energy** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_energy(value) | ++-----------+-------------------+ +| *Getter* | get_energy() | ++-----------+-------------------+ + +The Light2D's energy value. The larger the value, the stronger the light. + +---- + +.. _class_Light2D_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The Light2D's mode. See :ref:`Mode` constants for values. + +---- + +.. _class_Light2D_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------------+ +| *Setter* | set_texture_offset(value) | ++-----------+---------------------------+ +| *Getter* | get_texture_offset() | ++-----------+---------------------------+ + +The offset of the Light2D's ``texture``. + +---- + +.. _class_Light2D_property_range_height: + +- :ref:`float` **range_height** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +The height of the Light2D. Used with 2D normal mapping. + +---- + +.. _class_Light2D_property_range_item_cull_mask: + +- :ref:`int` **range_item_cull_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_item_cull_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_item_cull_mask() | ++-----------+---------------------------+ + +The layer mask. Only objects with a matching mask will be affected by the Light2D. + +---- + +.. _class_Light2D_property_range_layer_max: + +- :ref:`int` **range_layer_max** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_layer_range_max(value) | ++-----------+----------------------------+ +| *Getter* | get_layer_range_max() | ++-----------+----------------------------+ + +Maximum layer value of objects that are affected by the Light2D. + +---- + +.. _class_Light2D_property_range_layer_min: + +- :ref:`int` **range_layer_min** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_layer_range_min(value) | ++-----------+----------------------------+ +| *Getter* | get_layer_range_min() | ++-----------+----------------------------+ + +Minimum layer value of objects that are affected by the Light2D. + +---- + +.. _class_Light2D_property_range_z_max: + +- :ref:`int` **range_z_max** + ++-----------+------------------------+ +| *Default* | ``1024`` | ++-----------+------------------------+ +| *Setter* | set_z_range_max(value) | ++-----------+------------------------+ +| *Getter* | get_z_range_max() | ++-----------+------------------------+ + +Maximum ``z`` value of objects that are affected by the Light2D. + +---- + +.. _class_Light2D_property_range_z_min: + +- :ref:`int` **range_z_min** + ++-----------+------------------------+ +| *Default* | ``-1024`` | ++-----------+------------------------+ +| *Setter* | set_z_range_min(value) | ++-----------+------------------------+ +| *Getter* | get_z_range_min() | ++-----------+------------------------+ + +Minimum ``z`` value of objects that are affected by the Light2D. + +---- + +.. _class_Light2D_property_shadow_buffer_size: + +- :ref:`int` **shadow_buffer_size** + ++-----------+-------------------------------+ +| *Default* | ``2048`` | ++-----------+-------------------------------+ +| *Setter* | set_shadow_buffer_size(value) | ++-----------+-------------------------------+ +| *Getter* | get_shadow_buffer_size() | ++-----------+-------------------------------+ + +Shadow buffer size. + +---- + +.. _class_Light2D_property_shadow_color: + +- :ref:`Color` **shadow_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_shadow_color(value) | ++-----------+-------------------------+ +| *Getter* | get_shadow_color() | ++-----------+-------------------------+ + +:ref:`Color` of shadows cast by the Light2D. + +---- + +.. _class_Light2D_property_shadow_enabled: + +- :ref:`bool` **shadow_enabled** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_shadow_enabled(value) | ++-----------+---------------------------+ +| *Getter* | is_shadow_enabled() | ++-----------+---------------------------+ + +If ``true``, the Light2D will cast shadows. + +---- + +.. _class_Light2D_property_shadow_filter: + +- :ref:`ShadowFilter` **shadow_filter** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_shadow_filter(value) | ++-----------+--------------------------+ +| *Getter* | get_shadow_filter() | ++-----------+--------------------------+ + +Shadow filter type. See :ref:`ShadowFilter` for possible values. + +---- + +.. _class_Light2D_property_shadow_filter_smooth: + +- :ref:`float` **shadow_filter_smooth** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_shadow_smooth(value) | ++-----------+--------------------------+ +| *Getter* | get_shadow_smooth() | ++-----------+--------------------------+ + +Smoothing value for shadows. + +---- + +.. _class_Light2D_property_shadow_gradient_length: + +- :ref:`float` **shadow_gradient_length** + ++-----------+-----------------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_shadow_gradient_length(value) | ++-----------+-----------------------------------+ +| *Getter* | get_shadow_gradient_length() | ++-----------+-----------------------------------+ + +Smooth shadow gradient length. + +---- + +.. _class_Light2D_property_shadow_item_cull_mask: + +- :ref:`int` **shadow_item_cull_mask** + ++-----------+----------------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------------+ +| *Setter* | set_item_shadow_cull_mask(value) | ++-----------+----------------------------------+ +| *Getter* | get_item_shadow_cull_mask() | ++-----------+----------------------------------+ + +The shadow mask. Used with :ref:`LightOccluder2D` to cast shadows. Only occluders with a matching light mask will cast shadows. + +---- + +.. _class_Light2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +:ref:`Texture` used for the Light2D's appearance. + +---- + +.. _class_Light2D_property_texture_scale: + +- :ref:`float` **texture_scale** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_texture_scale(value) | ++-----------+--------------------------+ +| *Getter* | get_texture_scale() | ++-----------+--------------------------+ + +The ``texture``'s scale factor. + +.. |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.)` diff --git a/classes/class_lightoccluder2d.rst b/classes/class_lightoccluder2d.rst new file mode 100644 index 0000000..9944153 --- /dev/null +++ b/classes/class_lightoccluder2d.rst @@ -0,0 +1,68 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the LightOccluder2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_LightOccluder2D: + +LightOccluder2D +=============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Occludes light cast by a Light2D, casting shadows. + +Description +----------- + +Occludes light cast by a Light2D, casting shadows. The LightOccluder2D must be provided with an :ref:`OccluderPolygon2D` in order for the shadow to be computed. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_lights_and_shadows` + +Properties +---------- + ++---------------------------------------------------+--------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`light_mask` | ``1`` | ++---------------------------------------------------+--------------------------------------------------------------+-------+ +| :ref:`OccluderPolygon2D` | :ref:`occluder` | | ++---------------------------------------------------+--------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_LightOccluder2D_property_light_mask: + +- :ref:`int` **light_mask** + ++-----------+--------------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------------+ +| *Setter* | set_occluder_light_mask(value) | ++-----------+--------------------------------+ +| *Getter* | get_occluder_light_mask() | ++-----------+--------------------------------+ + +The LightOccluder2D's light mask. The LightOccluder2D will cast shadows only from Light2D(s) that have the same light mask(s). + +---- + +.. _class_LightOccluder2D_property_occluder: + +- :ref:`OccluderPolygon2D` **occluder** + ++----------+-----------------------------+ +| *Setter* | set_occluder_polygon(value) | ++----------+-----------------------------+ +| *Getter* | get_occluder_polygon() | ++----------+-----------------------------+ + +The :ref:`OccluderPolygon2D` used to compute the shadow. + +.. |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.)` diff --git a/classes/class_line2d.rst b/classes/class_line2d.rst new file mode 100644 index 0000000..0b60d10 --- /dev/null +++ b/classes/class_line2d.rst @@ -0,0 +1,391 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Line2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Line2D: + +Line2D +====== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A 2D line. + +Description +----------- + +A line through several points in 2D space. + +**Note:** By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_buffer_size_kb` and :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_index_buffer_size_kb`. + +Tutorials +--------- + +- `Matrix Transform Demo `__ + +- `2.5D Demo `__ + +Properties +---------- + ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`bool` | :ref:`antialiased` | ``false`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`LineCapMode` | :ref:`begin_cap_mode` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`Color` | :ref:`default_color` | ``Color( 0.4, 0.5, 1, 1 )`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`LineCapMode` | :ref:`end_cap_mode` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`Gradient` | :ref:`gradient` | | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`LineJointMode` | :ref:`joint_mode` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`PoolVector2Array` | :ref:`points` | ``PoolVector2Array( )`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`int` | :ref:`round_precision` | ``8`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`sharp_limit` | ``2.0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`LineTextureMode` | :ref:`texture_mode` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`width` | ``10.0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ +| :ref:`Curve` | :ref:`width_curve` | | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------------------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_point` **(** :ref:`Vector2` position, :ref:`int` at_position=-1 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_points` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_point_count` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_point_position` **(** :ref:`int` i **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_point` **(** :ref:`int` i **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_position` **(** :ref:`int` i, :ref:`Vector2` position **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Line2D_LineJointMode: + +.. _class_Line2D_constant_LINE_JOINT_SHARP: + +.. _class_Line2D_constant_LINE_JOINT_BEVEL: + +.. _class_Line2D_constant_LINE_JOINT_ROUND: + +enum **LineJointMode**: + +- **LINE_JOINT_SHARP** = **0** --- The line's joints will be pointy. If ``sharp_limit`` is greater than the rotation of a joint, it becomes a bevel joint instead. + +- **LINE_JOINT_BEVEL** = **1** --- The line's joints will be bevelled/chamfered. + +- **LINE_JOINT_ROUND** = **2** --- The line's joints will be rounded. + +---- + +.. _enum_Line2D_LineCapMode: + +.. _class_Line2D_constant_LINE_CAP_NONE: + +.. _class_Line2D_constant_LINE_CAP_BOX: + +.. _class_Line2D_constant_LINE_CAP_ROUND: + +enum **LineCapMode**: + +- **LINE_CAP_NONE** = **0** --- Don't draw a line cap. + +- **LINE_CAP_BOX** = **1** --- Draws the line cap as a box. + +- **LINE_CAP_ROUND** = **2** --- Draws the line cap as a circle. + +---- + +.. _enum_Line2D_LineTextureMode: + +.. _class_Line2D_constant_LINE_TEXTURE_NONE: + +.. _class_Line2D_constant_LINE_TEXTURE_TILE: + +.. _class_Line2D_constant_LINE_TEXTURE_STRETCH: + +enum **LineTextureMode**: + +- **LINE_TEXTURE_NONE** = **0** --- Takes the left pixels of the texture and renders it over the whole line. + +- **LINE_TEXTURE_TILE** = **1** --- Tiles the texture over the line. The texture must be imported with **Repeat** enabled for it to work properly. + +- **LINE_TEXTURE_STRETCH** = **2** --- Stretches the texture across the line. Import the texture with **Repeat** disabled for best results. + +Property Descriptions +--------------------- + +.. _class_Line2D_property_antialiased: + +- :ref:`bool` **antialiased** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_antialiased(value) | ++-----------+------------------------+ +| *Getter* | get_antialiased() | ++-----------+------------------------+ + +If ``true``, the line's border will be anti-aliased. + +**Note:** Line2D is not accelerated by batching when being anti-aliased. + +---- + +.. _class_Line2D_property_begin_cap_mode: + +- :ref:`LineCapMode` **begin_cap_mode** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_begin_cap_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_begin_cap_mode() | ++-----------+---------------------------+ + +Controls the style of the line's first point. Use :ref:`LineCapMode` constants. + +---- + +.. _class_Line2D_property_default_color: + +- :ref:`Color` **default_color** + ++-----------+-----------------------------+ +| *Default* | ``Color( 0.4, 0.5, 1, 1 )`` | ++-----------+-----------------------------+ +| *Setter* | set_default_color(value) | ++-----------+-----------------------------+ +| *Getter* | get_default_color() | ++-----------+-----------------------------+ + +The line's color. Will not be used if a gradient is set. + +---- + +.. _class_Line2D_property_end_cap_mode: + +- :ref:`LineCapMode` **end_cap_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_end_cap_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_end_cap_mode() | ++-----------+-------------------------+ + +Controls the style of the line's last point. Use :ref:`LineCapMode` constants. + +---- + +.. _class_Line2D_property_gradient: + +- :ref:`Gradient` **gradient** + ++----------+---------------------+ +| *Setter* | set_gradient(value) | ++----------+---------------------+ +| *Getter* | get_gradient() | ++----------+---------------------+ + +The gradient is drawn through the whole line from start to finish. The default color will not be used if a gradient is set. + +---- + +.. _class_Line2D_property_joint_mode: + +- :ref:`LineJointMode` **joint_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_joint_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_joint_mode() | ++-----------+-----------------------+ + +The style for the points between the start and the end. + +---- + +.. _class_Line2D_property_points: + +- :ref:`PoolVector2Array` **points** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_points(value) | ++-----------+--------------------------+ +| *Getter* | get_points() | ++-----------+--------------------------+ + +The points that form the lines. The line is drawn between every point set in this array. Points are interpreted as local vectors. + +---- + +.. _class_Line2D_property_round_precision: + +- :ref:`int` **round_precision** + ++-----------+----------------------------+ +| *Default* | ``8`` | ++-----------+----------------------------+ +| *Setter* | set_round_precision(value) | ++-----------+----------------------------+ +| *Getter* | get_round_precision() | ++-----------+----------------------------+ + +The smoothness of the rounded joints and caps. This is only used if a cap or joint is set as round. + +---- + +.. _class_Line2D_property_sharp_limit: + +- :ref:`float` **sharp_limit** + ++-----------+------------------------+ +| *Default* | ``2.0`` | ++-----------+------------------------+ +| *Setter* | set_sharp_limit(value) | ++-----------+------------------------+ +| *Getter* | get_sharp_limit() | ++-----------+------------------------+ + +The direction difference in radians between vector points. This value is only used if ``joint mode`` is set to :ref:`LINE_JOINT_SHARP`. + +---- + +.. _class_Line2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The texture used for the line's texture. Uses ``texture_mode`` for drawing style. + +---- + +.. _class_Line2D_property_texture_mode: + +- :ref:`LineTextureMode` **texture_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_texture_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_texture_mode() | ++-----------+-------------------------+ + +The style to render the ``texture`` on the line. Use :ref:`LineTextureMode` constants. + +---- + +.. _class_Line2D_property_width: + +- :ref:`float` **width** + ++-----------+------------------+ +| *Default* | ``10.0`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +The line's width. + +---- + +.. _class_Line2D_property_width_curve: + +- :ref:`Curve` **width_curve** + ++----------+------------------+ +| *Setter* | set_curve(value) | ++----------+------------------+ +| *Getter* | get_curve() | ++----------+------------------+ + +The line's width varies with the curve. The original width is simply multiply by the value of the Curve. + +Method Descriptions +------------------- + +.. _class_Line2D_method_add_point: + +- void **add_point** **(** :ref:`Vector2` position, :ref:`int` at_position=-1 **)** + +Adds a point at the ``position``. Appends the point at the end of the line. + +If ``at_position`` is given, the point is inserted before the point number ``at_position``, moving that point (and every point after) after the inserted point. If ``at_position`` is not given, or is an illegal value (``at_position < 0`` or ``at_position >= [method get_point_count]``), the point will be appended at the end of the point list. + +---- + +.. _class_Line2D_method_clear_points: + +- void **clear_points** **(** **)** + +Removes all points from the line. + +---- + +.. _class_Line2D_method_get_point_count: + +- :ref:`int` **get_point_count** **(** **)** |const| + +Returns the Line2D's amount of points. + +---- + +.. _class_Line2D_method_get_point_position: + +- :ref:`Vector2` **get_point_position** **(** :ref:`int` i **)** |const| + +Returns point ``i``'s position. + +---- + +.. _class_Line2D_method_remove_point: + +- void **remove_point** **(** :ref:`int` i **)** + +Removes the point at index ``i`` from the line. + +---- + +.. _class_Line2D_method_set_point_position: + +- void **set_point_position** **(** :ref:`int` i, :ref:`Vector2` position **)** + +Overwrites the position in point ``i`` with the supplied ``position``. + +.. |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.)` diff --git a/classes/class_lineedit.rst b/classes/class_lineedit.rst new file mode 100644 index 0000000..598eea7 --- /dev/null +++ b/classes/class_lineedit.rst @@ -0,0 +1,780 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the LineEdit.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_LineEdit: + +LineEdit +======== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control that provides single-line string editing. + +Description +----------- + +LineEdit provides a single-line string editor, used for text fields. + +It features many built-in shortcuts which will always be available (``Ctrl`` here maps to ``Command`` on macOS): + +- Ctrl + C: Copy + +- Ctrl + X: Cut + +- Ctrl + V or Ctrl + Y: Paste/"yank" + +- Ctrl + Z: Undo + +- Ctrl + Shift + Z: Redo + +- Ctrl + U: Delete text from the cursor position to the beginning of the line + +- Ctrl + K: Delete text from the cursor position to the end of the line + +- Ctrl + A: Select all text + +- Up/Down arrow: Move the cursor to the beginning/end of the line + +On macOS, some extra keyboard shortcuts are available: + +- Ctrl + F: Like the right arrow key, move the cursor one character right + +- Ctrl + B: Like the left arrow key, move the cursor one character left + +- Ctrl + P: Like the up arrow key, move the cursor to the previous line + +- Ctrl + N: Like the down arrow key, move the cursor to the next line + +- Ctrl + D: Like the Delete key, delete the character on the right side of cursor + +- Ctrl + H: Like the Backspace key, delete the character on the left side of the cursor + +- Command + Left arrow: Like the Home key, move the cursor to the beginning of the line + +- Command + Right arrow: Like the End key, move the cursor to the end of the line + +Properties +---------- + ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`Align` | :ref:`align` | ``0`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`caret_blink` | ``false`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`caret_blink_speed` | ``0.65`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`caret_position` | ``0`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`clear_button_enabled` | ``false`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`context_menu_enabled` | ``true`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`editable` | ``true`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`expand_to_text_length` | ``false`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`max_length` | ``0`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`CursorShape` | mouse_default_cursor_shape | ``1`` *(parent override)* | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`placeholder_alpha` | ``0.6`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`placeholder_text` | ``""`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`right_icon` | | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`secret` | ``false`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`secret_character` | ``"*"`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`selecting_enabled` | ``true`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`shortcut_keys_enabled` | ``true`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`virtual_keyboard_enabled` | ``true`` | ++----------------------------------------------+-----------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_at_cursor` **(** :ref:`String` text **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delete_char_at_cursor` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delete_text` **(** :ref:`int` from_column, :ref:`int` to_column **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`deselect` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PopupMenu` | :ref:`get_menu` **(** **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_scroll_offset` **(** **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`menu_option` **(** :ref:`int` option **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` from=0, :ref:`int` to=-1 **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select_all` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`clear_button_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`clear_button_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`cursor_color` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`font_color_selected` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`font_color_uneditable` | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Color` | :ref:`selection_color` | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`int` | :ref:`minimum_spaces` | ``12`` | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`Texture` | :ref:`clear` | | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ +| :ref:`StyleBox` | :ref:`read_only` | | ++---------------------------------+------------------------------------------------------------------------------------------+------------------------------------+ + +Signals +------- + +.. _class_LineEdit_signal_text_change_rejected: + +- **text_change_rejected** **(** :ref:`String` rejected_substring **)** + +Emitted when appending text that overflows the :ref:`max_length`. The appended text is truncated to fit :ref:`max_length`, and the part that couldn't fit is passed as the ``rejected_substring`` argument. + +---- + +.. _class_LineEdit_signal_text_changed: + +- **text_changed** **(** :ref:`String` new_text **)** + +Emitted when the text changes. + +---- + +.. _class_LineEdit_signal_text_entered: + +- **text_entered** **(** :ref:`String` new_text **)** + +Emitted when the user presses :ref:`@GlobalScope.KEY_ENTER` on the ``LineEdit``. + +Enumerations +------------ + +.. _enum_LineEdit_Align: + +.. _class_LineEdit_constant_ALIGN_LEFT: + +.. _class_LineEdit_constant_ALIGN_CENTER: + +.. _class_LineEdit_constant_ALIGN_RIGHT: + +.. _class_LineEdit_constant_ALIGN_FILL: + +enum **Align**: + +- **ALIGN_LEFT** = **0** --- Aligns the text on the left-hand side of the ``LineEdit``. + +- **ALIGN_CENTER** = **1** --- Centers the text in the middle of the ``LineEdit``. + +- **ALIGN_RIGHT** = **2** --- Aligns the text on the right-hand side of the ``LineEdit``. + +- **ALIGN_FILL** = **3** --- Stretches whitespaces to fit the ``LineEdit``'s width. + +---- + +.. _enum_LineEdit_MenuItems: + +.. _class_LineEdit_constant_MENU_CUT: + +.. _class_LineEdit_constant_MENU_COPY: + +.. _class_LineEdit_constant_MENU_PASTE: + +.. _class_LineEdit_constant_MENU_CLEAR: + +.. _class_LineEdit_constant_MENU_SELECT_ALL: + +.. _class_LineEdit_constant_MENU_UNDO: + +.. _class_LineEdit_constant_MENU_REDO: + +.. _class_LineEdit_constant_MENU_MAX: + +enum **MenuItems**: + +- **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text. + +- **MENU_COPY** = **1** --- Copies the selected text. + +- **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position). + +Non-printable escape characters are automatically stripped from the OS clipboard via :ref:`String.strip_escapes`. + +- **MENU_CLEAR** = **3** --- Erases the whole ``LineEdit`` text. + +- **MENU_SELECT_ALL** = **4** --- Selects the whole ``LineEdit`` text. + +- **MENU_UNDO** = **5** --- Undoes the previous action. + +- **MENU_REDO** = **6** --- Reverse the last undo action. + +- **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems` enum. + +Property Descriptions +--------------------- + +.. _class_LineEdit_property_align: + +- :ref:`Align` **align** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_align(value) | ++-----------+------------------+ +| *Getter* | get_align() | ++-----------+------------------+ + +Text alignment as defined in the :ref:`Align` enum. + +---- + +.. _class_LineEdit_property_caret_blink: + +- :ref:`bool` **caret_blink** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | cursor_set_blink_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | cursor_get_blink_enabled() | ++-----------+---------------------------------+ + +If ``true``, the caret (visual cursor) blinks. + +---- + +.. _class_LineEdit_property_caret_blink_speed: + +- :ref:`float` **caret_blink_speed** + ++-----------+-------------------------------+ +| *Default* | ``0.65`` | ++-----------+-------------------------------+ +| *Setter* | cursor_set_blink_speed(value) | ++-----------+-------------------------------+ +| *Getter* | cursor_get_blink_speed() | ++-----------+-------------------------------+ + +Duration (in seconds) of a caret's blinking cycle. + +---- + +.. _class_LineEdit_property_caret_position: + +- :ref:`int` **caret_position** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_cursor_position(value) | ++-----------+----------------------------+ +| *Getter* | get_cursor_position() | ++-----------+----------------------------+ + +The cursor's position inside the ``LineEdit``. When set, the text may scroll to accommodate it. + +---- + +.. _class_LineEdit_property_clear_button_enabled: + +- :ref:`bool` **clear_button_enabled** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_clear_button_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_clear_button_enabled() | ++-----------+---------------------------------+ + +If ``true``, the ``LineEdit`` will show a clear button if ``text`` is not empty, which can be used to clear the text quickly. + +---- + +.. _class_LineEdit_property_context_menu_enabled: + +- :ref:`bool` **context_menu_enabled** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_context_menu_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_context_menu_enabled() | ++-----------+---------------------------------+ + +If ``true``, the context menu will appear when right-clicked. + +---- + +.. _class_LineEdit_property_editable: + +- :ref:`bool` **editable** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_editable(value) | ++-----------+---------------------+ +| *Getter* | is_editable() | ++-----------+---------------------+ + +If ``false``, existing text cannot be modified and new text cannot be added. + +---- + +.. _class_LineEdit_property_expand_to_text_length: + +- :ref:`bool` **expand_to_text_length** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_expand_to_text_length(value) | ++-----------+----------------------------------+ +| *Getter* | get_expand_to_text_length() | ++-----------+----------------------------------+ + +If ``true``, the ``LineEdit`` width will increase to stay longer than the :ref:`text`. It will **not** compress if the :ref:`text` is shortened. + +---- + +.. _class_LineEdit_property_max_length: + +- :ref:`int` **max_length** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_max_length(value) | ++-----------+-----------------------+ +| *Getter* | get_max_length() | ++-----------+-----------------------+ + +Maximum amount of characters that can be entered inside the ``LineEdit``. If ``0``, there is no limit. + +When a limit is defined, characters that would exceed :ref:`max_length` are truncated. This happens both for existing :ref:`text` contents when setting the max length, or for new text inserted in the ``LineEdit``, including pasting. If any input text is truncated, the :ref:`text_change_rejected` signal is emitted with the truncated substring as parameter. + +**Example:** + +:: + + text = "Hello world" + max_length = 5 + # `text` becomes "Hello". + max_length = 10 + text += " goodbye" + # `text` becomes "Hello good". + # `text_change_rejected` is emitted with "bye" as parameter. + +---- + +.. _class_LineEdit_property_placeholder_alpha: + +- :ref:`float` **placeholder_alpha** + ++-----------+------------------------------+ +| *Default* | ``0.6`` | ++-----------+------------------------------+ +| *Setter* | set_placeholder_alpha(value) | ++-----------+------------------------------+ +| *Getter* | get_placeholder_alpha() | ++-----------+------------------------------+ + +Opacity of the :ref:`placeholder_text`. From ``0`` to ``1``. + +---- + +.. _class_LineEdit_property_placeholder_text: + +- :ref:`String` **placeholder_text** + ++-----------+------------------------+ +| *Default* | ``""`` | ++-----------+------------------------+ +| *Setter* | set_placeholder(value) | ++-----------+------------------------+ +| *Getter* | get_placeholder() | ++-----------+------------------------+ + +Text shown when the ``LineEdit`` is empty. It is **not** the ``LineEdit``'s default value (see :ref:`text`). + +---- + +.. _class_LineEdit_property_right_icon: + +- :ref:`Texture` **right_icon** + ++----------+-----------------------+ +| *Setter* | set_right_icon(value) | ++----------+-----------------------+ +| *Getter* | get_right_icon() | ++----------+-----------------------+ + +Sets the icon that will appear in the right end of the ``LineEdit`` if there's no :ref:`text`, or always, if :ref:`clear_button_enabled` is set to ``false``. + +---- + +.. _class_LineEdit_property_secret: + +- :ref:`bool` **secret** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_secret(value) | ++-----------+-------------------+ +| *Getter* | is_secret() | ++-----------+-------------------+ + +If ``true``, every character is replaced with the secret character (see :ref:`secret_character`). + +---- + +.. _class_LineEdit_property_secret_character: + +- :ref:`String` **secret_character** + ++-----------+-----------------------------+ +| *Default* | ``"*"`` | ++-----------+-----------------------------+ +| *Setter* | set_secret_character(value) | ++-----------+-----------------------------+ +| *Getter* | get_secret_character() | ++-----------+-----------------------------+ + +The character to use to mask secret input (defaults to "\*"). Only a single character can be used as the secret character. + +---- + +.. _class_LineEdit_property_selecting_enabled: + +- :ref:`bool` **selecting_enabled** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_selecting_enabled(value) | ++-----------+------------------------------+ +| *Getter* | is_selecting_enabled() | ++-----------+------------------------------+ + +If ``false``, it's impossible to select the text using mouse nor keyboard. + +---- + +.. _class_LineEdit_property_shortcut_keys_enabled: + +- :ref:`bool` **shortcut_keys_enabled** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_shortcut_keys_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_shortcut_keys_enabled() | ++-----------+----------------------------------+ + +If ``false``, using shortcuts will be disabled. + +---- + +.. _class_LineEdit_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +String value of the ``LineEdit``. + +**Note:** Changing text using this property won't emit the :ref:`text_changed` signal. + +---- + +.. _class_LineEdit_property_virtual_keyboard_enabled: + +- :ref:`bool` **virtual_keyboard_enabled** + ++-----------+-------------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------------+ +| *Setter* | set_virtual_keyboard_enabled(value) | ++-----------+-------------------------------------+ +| *Getter* | is_virtual_keyboard_enabled() | ++-----------+-------------------------------------+ + +If ``true``, the native virtual keyboard is shown when focused on platforms that support it. + +Method Descriptions +------------------- + +.. _class_LineEdit_method_append_at_cursor: + +- void **append_at_cursor** **(** :ref:`String` text **)** + +Adds ``text`` after the cursor. If the resulting value is longer than :ref:`max_length`, nothing happens. + +---- + +.. _class_LineEdit_method_clear: + +- void **clear** **(** **)** + +Erases the ``LineEdit``'s :ref:`text`. + +---- + +.. _class_LineEdit_method_delete_char_at_cursor: + +- void **delete_char_at_cursor** **(** **)** + +Deletes one character at the cursor's current position (equivalent to pressing the ``Delete`` key). + +---- + +.. _class_LineEdit_method_delete_text: + +- void **delete_text** **(** :ref:`int` from_column, :ref:`int` to_column **)** + +Deletes a section of the :ref:`text` going from position ``from_column`` to ``to_column``. Both parameters should be within the text's length. + +---- + +.. _class_LineEdit_method_deselect: + +- void **deselect** **(** **)** + +Clears the current selection. + +---- + +.. _class_LineEdit_method_get_menu: + +- :ref:`PopupMenu` **get_menu** **(** **)** |const| + +Returns the :ref:`PopupMenu` of this ``LineEdit``. By default, this menu is displayed when right-clicking on the ``LineEdit``. + +**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` property. + +---- + +.. _class_LineEdit_method_get_scroll_offset: + +- :ref:`int` **get_scroll_offset** **(** **)** |const| + +Returns the scroll offset due to :ref:`caret_position`, as a number of characters. + +---- + +.. _class_LineEdit_method_menu_option: + +- void **menu_option** **(** :ref:`int` option **)** + +Executes a given action as defined in the :ref:`MenuItems` enum. + +---- + +.. _class_LineEdit_method_select: + +- void **select** **(** :ref:`int` from=0, :ref:`int` to=-1 **)** + +Selects characters inside ``LineEdit`` between ``from`` and ``to``. By default, ``from`` is at the beginning and ``to`` at the end. + +:: + + text = "Welcome" + select() # Will select "Welcome". + select(4) # Will select "ome". + select(2, 5) # Will select "lco". + +---- + +.. _class_LineEdit_method_select_all: + +- void **select_all** **(** **)** + +Selects the whole :ref:`String`. + +Theme Property Descriptions +--------------------------- + +.. _class_LineEdit_theme_color_clear_button_color: + +- :ref:`Color` **clear_button_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Color used as default tint for the clear button. + +---- + +.. _class_LineEdit_theme_color_clear_button_color_pressed: + +- :ref:`Color` **clear_button_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Color used for the clear button when it's pressed. + +---- + +.. _class_LineEdit_theme_color_cursor_color: + +- :ref:`Color` **cursor_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Color of the ``LineEdit``'s visual cursor (caret). + +---- + +.. _class_LineEdit_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default font color. + +---- + +.. _class_LineEdit_theme_color_font_color_selected: + +- :ref:`Color` **font_color_selected** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +Font color for selected text (inside the selection rectangle). + +---- + +.. _class_LineEdit_theme_color_font_color_uneditable: + +- :ref:`Color` **font_color_uneditable** + ++-----------+------------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | ++-----------+------------------------------------+ + +Font color when editing is disabled. + +---- + +.. _class_LineEdit_theme_color_selection_color: + +- :ref:`Color` **selection_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++-----------+----------------------------------+ + +Color of the selection rectangle. + +---- + +.. _class_LineEdit_theme_constant_minimum_spaces: + +- :ref:`int` **minimum_spaces** + ++-----------+--------+ +| *Default* | ``12`` | ++-----------+--------+ + +Minimum horizontal space for the text (not counting the clear button and content margins). This value is measured in count of space characters (i.e. this amount of space characters can be displayed without scrolling). + +---- + +.. _class_LineEdit_theme_font_font: + +- :ref:`Font` **font** + +Font used for the text. + +---- + +.. _class_LineEdit_theme_icon_clear: + +- :ref:`Texture` **clear** + +Texture for the clear button. See :ref:`clear_button_enabled`. + +---- + +.. _class_LineEdit_theme_style_focus: + +- :ref:`StyleBox` **focus** + +Background used when ``LineEdit`` has GUI focus. + +---- + +.. _class_LineEdit_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default background for the ``LineEdit``. + +---- + +.. _class_LineEdit_theme_style_read_only: + +- :ref:`StyleBox` **read_only** + +Background used when ``LineEdit`` is in read-only mode (:ref:`editable` is set to ``false``). + +.. |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.)` diff --git a/classes/class_lineshape2d.rst b/classes/class_lineshape2d.rst new file mode 100644 index 0000000..3adbf77 --- /dev/null +++ b/classes/class_lineshape2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the LineShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_LineShape2D: + +LineShape2D +=========== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Line shape for 2D collisions. + +Description +----------- + +Line shape for 2D collisions. It works like a 2D plane and will not allow any physics body to go to the negative side. Not recommended for rigid bodies, and usually not recommended for static bodies either because it forces checks against it on every frame. + +Properties +---------- + ++-------------------------------+--------------------------------------------------+----------------------+ +| :ref:`float` | :ref:`d` | ``0.0`` | ++-------------------------------+--------------------------------------------------+----------------------+ +| :ref:`Vector2` | :ref:`normal` | ``Vector2( 0, -1 )`` | ++-------------------------------+--------------------------------------------------+----------------------+ + +Property Descriptions +--------------------- + +.. _class_LineShape2D_property_d: + +- :ref:`float` **d** + ++-----------+--------------+ +| *Default* | ``0.0`` | ++-----------+--------------+ +| *Setter* | set_d(value) | ++-----------+--------------+ +| *Getter* | get_d() | ++-----------+--------------+ + +The line's distance from the origin. + +---- + +.. _class_LineShape2D_property_normal: + +- :ref:`Vector2` **normal** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, -1 )`` | ++-----------+----------------------+ +| *Setter* | set_normal(value) | ++-----------+----------------------+ +| *Getter* | get_normal() | ++-----------+----------------------+ + +The line's normal. + +.. |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.)` diff --git a/classes/class_linkbutton.rst b/classes/class_linkbutton.rst new file mode 100644 index 0000000..a2ea141 --- /dev/null +++ b/classes/class_linkbutton.rst @@ -0,0 +1,186 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the LinkButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_LinkButton: + +LinkButton +========== + +**Inherits:** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Simple button used to represent a link to some resource. + +Description +----------- + +This kind of button is primarily used when the interaction with the button causes a context change (like linking to a web page). + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Properties +---------- + ++-----------------------------------------------------+-------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``0`` *(parent override)* | ++-----------------------------------------------------+-------------------------------------------------------+---------------------------+ +| :ref:`CursorShape` | mouse_default_cursor_shape | ``2`` *(parent override)* | ++-----------------------------------------------------+-------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++-----------------------------------------------------+-------------------------------------------------------+---------------------------+ +| :ref:`UnderlineMode` | :ref:`underline` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------+---------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`underline_spacing` | ``2`` | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+-----------------------------------------------------------------------------+----------------------------------+ + +Enumerations +------------ + +.. _enum_LinkButton_UnderlineMode: + +.. _class_LinkButton_constant_UNDERLINE_MODE_ALWAYS: + +.. _class_LinkButton_constant_UNDERLINE_MODE_ON_HOVER: + +.. _class_LinkButton_constant_UNDERLINE_MODE_NEVER: + +enum **UnderlineMode**: + +- **UNDERLINE_MODE_ALWAYS** = **0** --- The LinkButton will always show an underline at the bottom of its text. + +- **UNDERLINE_MODE_ON_HOVER** = **1** --- The LinkButton will show an underline at the bottom of its text when the mouse cursor is over it. + +- **UNDERLINE_MODE_NEVER** = **2** --- The LinkButton will never show an underline at the bottom of its text. + +Property Descriptions +--------------------- + +.. _class_LinkButton_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The button's text that will be displayed inside the button's area. + +---- + +.. _class_LinkButton_property_underline: + +- :ref:`UnderlineMode` **underline** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_underline_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_underline_mode() | ++-----------+---------------------------+ + +Determines when to show the underline. See :ref:`UnderlineMode` for options. + +Theme Property Descriptions +--------------------------- + +.. _class_LinkButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the ``LinkButton``. + +---- + +.. _class_LinkButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``LinkButton`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_LinkButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``LinkButton`` is being hovered. + +---- + +.. _class_LinkButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``LinkButton`` is being pressed. + +---- + +.. _class_LinkButton_theme_constant_underline_spacing: + +- :ref:`int` **underline_spacing** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The vertical space between the baseline of text and the underline. + +---- + +.. _class_LinkButton_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``LinkButton``'s text. + +---- + +.. _class_LinkButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``LinkButton`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +.. |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.)` diff --git a/classes/class_listener.rst b/classes/class_listener.rst new file mode 100644 index 0000000..f45f273 --- /dev/null +++ b/classes/class_listener.rst @@ -0,0 +1,71 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Listener.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Listener: + +Listener +======== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Overrides the location sounds are heard from. + +Description +----------- + +Once added to the scene tree and enabled using :ref:`make_current`, this node will override the location sounds are heard from. This can be used to listen from a location different from the :ref:`Camera`. + +Methods +------- + ++-----------------------------------+-------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_current` **(** **)** | ++-----------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_listener_transform` **(** **)** |const| | ++-----------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_current` **(** **)** |const| | ++-----------------------------------+-------------------------------------------------------------------------------------------------+ +| void | :ref:`make_current` **(** **)** | ++-----------------------------------+-------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Listener_method_clear_current: + +- void **clear_current** **(** **)** + +Disables the listener to use the current camera's listener instead. + +---- + +.. _class_Listener_method_get_listener_transform: + +- :ref:`Transform` **get_listener_transform** **(** **)** |const| + +Returns the listener's global orthonormalized :ref:`Transform`. + +---- + +.. _class_Listener_method_is_current: + +- :ref:`bool` **is_current** **(** **)** |const| + +Returns ``true`` if the listener was made current using :ref:`make_current`, ``false`` otherwise. + +**Note:** There may be more than one Listener marked as "current" in the scene tree, but only the one that was made current last will be used. + +---- + +.. _class_Listener_method_make_current: + +- void **make_current** **(** **)** + +Enables the listener. This will override the current camera's listener. + +.. |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.)` diff --git a/classes/class_listener2d.rst b/classes/class_listener2d.rst new file mode 100644 index 0000000..01d893b --- /dev/null +++ b/classes/class_listener2d.rst @@ -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 Listener2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Listener2D: + +Listener2D +========== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Overrides the location sounds are heard from. + +Description +----------- + +Once added to the scene tree and enabled using :ref:`make_current`, this node will override the location sounds are heard from. Only one ``Listener2D`` can be current. Using :ref:`make_current` will disable the previous ``Listener2D``. + +If there is no active ``Listener2D`` in the current :ref:`Viewport`, center of the screen will be used as a hearing point for the audio. ``Listener2D`` needs to be inside :ref:`SceneTree` to function. + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------+ +| void | :ref:`clear_current` **(** **)** | ++-------------------------+---------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_current` **(** **)** |const| | ++-------------------------+---------------------------------------------------------------------------+ +| void | :ref:`make_current` **(** **)** | ++-------------------------+---------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Listener2D_method_clear_current: + +- void **clear_current** **(** **)** + +Disables the ``Listener2D``. If it's not set as current, this method will have no effect. + +---- + +.. _class_Listener2D_method_is_current: + +- :ref:`bool` **is_current** **(** **)** |const| + +Returns ``true`` if this ``Listener2D`` is currently active. + +---- + +.. _class_Listener2D_method_make_current: + +- void **make_current** **(** **)** + +Makes the ``Listener2D`` active, setting it as the hearing point for the sounds. If there is already another active ``Listener2D``, it will be disabled. + +This method will have no effect if the ``Listener2D`` is not added to :ref:`SceneTree`. + +.. |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.)` diff --git a/classes/class_mainloop.rst b/classes/class_mainloop.rst new file mode 100644 index 0000000..b80529a --- /dev/null +++ b/classes/class_mainloop.rst @@ -0,0 +1,306 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MainLoop.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MainLoop: + +MainLoop +======== + +**Inherits:** :ref:`Object` + +**Inherited By:** :ref:`SceneTree` + +Abstract base class for the game's main loop. + +Description +----------- + +``MainLoop`` is the abstract base class for a Godot project's game loop. It is inherited by :ref:`SceneTree`, which is the default game loop implementation used in Godot projects, though it is also possible to write and use one's own ``MainLoop`` subclass instead of the scene tree. + +Upon the application start, a ``MainLoop`` implementation must be provided to the OS; otherwise, the application will exit. This happens automatically (and a :ref:`SceneTree` is created) unless a main :ref:`Script` is provided from the command line (with e.g. ``godot -s my_loop.gd``, which should then be a ``MainLoop`` implementation. + +Here is an example script implementing a simple ``MainLoop``: + +:: + + extends MainLoop + + var time_elapsed = 0 + var keys_typed = [] + var quit = false + + func _initialize(): + print("Initialized:") + print(" Starting time: %s" % str(time_elapsed)) + + func _idle(delta): + time_elapsed += delta + # Return true to end the main loop. + return quit + + func _input_event(event): + # Record keys. + if event is InputEventKey and event.pressed and !event.echo: + keys_typed.append(OS.get_scancode_string(event.scancode)) + # Quit on Escape press. + if event.scancode == KEY_ESCAPE: + quit = true + # Quit on any mouse click. + if event is InputEventMouseButton: + quit = true + + func _finalize(): + print("Finalized:") + print(" End time: %s" % str(time_elapsed)) + print(" Keys typed: %s" % var2str(keys_typed)) + +Methods +------- + ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_drop_files` **(** :ref:`PoolStringArray` files, :ref:`int` from_screen **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_finalize` **(** **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_global_menu_action` **(** :ref:`Variant` id, :ref:`Variant` meta **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_idle` **(** :ref:`float` delta **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_initialize` **(** **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_input_event` **(** :ref:`InputEvent` event **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_input_text` **(** :ref:`String` text **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_iteration` **(** :ref:`float` delta **)** |virtual| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`finish` **(** **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`idle` **(** :ref:`float` delta **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`init` **(** **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`input_event` **(** :ref:`InputEvent` event **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`input_text` **(** :ref:`String` text **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`iteration` **(** :ref:`float` delta **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_MainLoop_signal_on_request_permissions_result: + +- **on_request_permissions_result** **(** :ref:`String` permission, :ref:`bool` granted **)** + +Emitted when a user responds to a permission request. + +Constants +--------- + +.. _class_MainLoop_constant_NOTIFICATION_WM_MOUSE_ENTER: + +.. _class_MainLoop_constant_NOTIFICATION_WM_MOUSE_EXIT: + +.. _class_MainLoop_constant_NOTIFICATION_WM_FOCUS_IN: + +.. _class_MainLoop_constant_NOTIFICATION_WM_FOCUS_OUT: + +.. _class_MainLoop_constant_NOTIFICATION_WM_QUIT_REQUEST: + +.. _class_MainLoop_constant_NOTIFICATION_WM_GO_BACK_REQUEST: + +.. _class_MainLoop_constant_NOTIFICATION_WM_UNFOCUS_REQUEST: + +.. _class_MainLoop_constant_NOTIFICATION_OS_MEMORY_WARNING: + +.. _class_MainLoop_constant_NOTIFICATION_TRANSLATION_CHANGED: + +.. _class_MainLoop_constant_NOTIFICATION_WM_ABOUT: + +.. _class_MainLoop_constant_NOTIFICATION_CRASH: + +.. _class_MainLoop_constant_NOTIFICATION_OS_IME_UPDATE: + +.. _class_MainLoop_constant_NOTIFICATION_APP_RESUMED: + +.. _class_MainLoop_constant_NOTIFICATION_APP_PAUSED: + +- **NOTIFICATION_WM_MOUSE_ENTER** = **1002** --- Notification received from the OS when the mouse enters the game window. + +Implemented on desktop and web platforms. + +- **NOTIFICATION_WM_MOUSE_EXIT** = **1003** --- Notification received from the OS when the mouse leaves the game window. + +Implemented on desktop and web platforms. + +- **NOTIFICATION_WM_FOCUS_IN** = **1004** --- Notification received from the OS when the game window is focused. + +Implemented on all platforms. + +- **NOTIFICATION_WM_FOCUS_OUT** = **1005** --- Notification received from the OS when the game window is unfocused. + +Implemented on all platforms. + +- **NOTIFICATION_WM_QUIT_REQUEST** = **1006** --- Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). + +Implemented on desktop platforms. + +- **NOTIFICATION_WM_GO_BACK_REQUEST** = **1007** --- Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). + +Specific to the Android platform. + +- **NOTIFICATION_WM_UNFOCUS_REQUEST** = **1008** --- Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). + +No supported platforms currently send this notification. + +- **NOTIFICATION_OS_MEMORY_WARNING** = **1009** --- Notification received from the OS when the application is exceeding its allocated memory. + +Specific to the iOS platform. + +- **NOTIFICATION_TRANSLATION_CHANGED** = **1010** --- Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like :ref:`Object.tr`. + +- **NOTIFICATION_WM_ABOUT** = **1011** --- Notification received from the OS when a request for "About" information is sent. + +Specific to the macOS platform. + +- **NOTIFICATION_CRASH** = **1012** --- Notification received from Godot's crash handler when the engine is about to crash. + +Implemented on desktop platforms if the crash handler is enabled. + +- **NOTIFICATION_OS_IME_UPDATE** = **1013** --- Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + +Specific to the macOS platform. + +- **NOTIFICATION_APP_RESUMED** = **1014** --- Notification received from the OS when the app is resumed. + +Specific to the Android platform. + +- **NOTIFICATION_APP_PAUSED** = **1015** --- Notification received from the OS when the app is paused. + +Specific to the Android platform. + +Method Descriptions +------------------- + +.. _class_MainLoop_method__drop_files: + +- void **_drop_files** **(** :ref:`PoolStringArray` files, :ref:`int` from_screen **)** |virtual| + +Called when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. + +---- + +.. _class_MainLoop_method__finalize: + +- void **_finalize** **(** **)** |virtual| + +Called before the program exits. + +---- + +.. _class_MainLoop_method__global_menu_action: + +- void **_global_menu_action** **(** :ref:`Variant` id, :ref:`Variant` meta **)** |virtual| + +Called when the user performs an action in the system global menu (e.g. the Mac OS menu bar). + +---- + +.. _class_MainLoop_method__idle: + +- :ref:`bool` **_idle** **(** :ref:`float` delta **)** |virtual| + +Called each idle frame with the time since the last idle frame as argument (in seconds). Equivalent to :ref:`Node._process`. + +If implemented, the method must return a boolean value. ``true`` ends the main loop, while ``false`` lets it proceed to the next frame. + +---- + +.. _class_MainLoop_method__initialize: + +- void **_initialize** **(** **)** |virtual| + +Called once during initialization. + +---- + +.. _class_MainLoop_method__input_event: + +- void **_input_event** **(** :ref:`InputEvent` event **)** |virtual| + +Called whenever an :ref:`InputEvent` is received by the main loop. + +---- + +.. _class_MainLoop_method__input_text: + +- void **_input_text** **(** :ref:`String` text **)** |virtual| + +Deprecated callback, does not do anything. Use :ref:`_input_event` to parse text input. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method__iteration: + +- :ref:`bool` **_iteration** **(** :ref:`float` delta **)** |virtual| + +Called each physics frame with the time since the last physics frame as argument (``delta``, in seconds). Equivalent to :ref:`Node._physics_process`. + +If implemented, the method must return a boolean value. ``true`` ends the main loop, while ``false`` lets it proceed to the next frame. + +---- + +.. _class_MainLoop_method_finish: + +- void **finish** **(** **)** + +Should not be called manually, override :ref:`_finalize` instead. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method_idle: + +- :ref:`bool` **idle** **(** :ref:`float` delta **)** + +Should not be called manually, override :ref:`_idle` instead. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method_init: + +- void **init** **(** **)** + +Should not be called manually, override :ref:`_initialize` instead. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method_input_event: + +- void **input_event** **(** :ref:`InputEvent` event **)** + +Should not be called manually, override :ref:`_input_event` instead. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method_input_text: + +- void **input_text** **(** :ref:`String` text **)** + +Should not be called manually, override :ref:`_input_text` instead. Will be removed in Godot 4.0. + +---- + +.. _class_MainLoop_method_iteration: + +- :ref:`bool` **iteration** **(** :ref:`float` delta **)** + +Should not be called manually, override :ref:`_iteration` instead. Will be removed in Godot 4.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.)` diff --git a/classes/class_margincontainer.rst b/classes/class_margincontainer.rst new file mode 100644 index 0000000..cfe9cff --- /dev/null +++ b/classes/class_margincontainer.rst @@ -0,0 +1,96 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MarginContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MarginContainer: + +MarginContainer +=============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Simple margin container. + +Description +----------- + +Adds a top, left, bottom, and right margin to all :ref:`Control` nodes that are direct children of the container. To control the ``MarginContainer``'s margin, use the ``margin_*`` theme properties listed below. + +**Note:** Be careful, :ref:`Control` margin values are different than the constant margin values. If you want to change the custom margin values of the ``MarginContainer`` by code, you should use the following examples: + +:: + + # This code sample assumes the current script is extending MarginContainer. + var margin_value = 100 + add_constant_override("margin_top", margin_value) + add_constant_override("margin_left", margin_value) + add_constant_override("margin_bottom", margin_value) + add_constant_override("margin_right", margin_value) + +Theme Properties +---------------- + ++-----------------------+--------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`margin_bottom` | ``0`` | ++-----------------------+--------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`margin_left` | ``0`` | ++-----------------------+--------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`margin_right` | ``0`` | ++-----------------------+--------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`margin_top` | ``0`` | ++-----------------------+--------------------------------------------------------------------------+-------+ + +Theme Property Descriptions +--------------------------- + +.. _class_MarginContainer_theme_constant_margin_bottom: + +- :ref:`int` **margin_bottom** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +All direct children of ``MarginContainer`` will have a bottom margin of ``margin_bottom`` pixels. + +---- + +.. _class_MarginContainer_theme_constant_margin_left: + +- :ref:`int` **margin_left** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +All direct children of ``MarginContainer`` will have a left margin of ``margin_left`` pixels. + +---- + +.. _class_MarginContainer_theme_constant_margin_right: + +- :ref:`int` **margin_right** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +All direct children of ``MarginContainer`` will have a right margin of ``margin_right`` pixels. + +---- + +.. _class_MarginContainer_theme_constant_margin_top: + +- :ref:`int` **margin_top** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +All direct children of ``MarginContainer`` will have a top margin of ``margin_top`` pixels. + +.. |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.)` diff --git a/classes/class_marshalls.rst b/classes/class_marshalls.rst new file mode 100644 index 0000000..2705a0f --- /dev/null +++ b/classes/class_marshalls.rst @@ -0,0 +1,91 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Marshalls.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Marshalls: + +Marshalls +========= + +**Inherits:** :ref:`Object` + +Data transformation (marshalling) and encoding helpers. + +Description +----------- + +Provides data transformation and encoding utility functions. + +Methods +------- + ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`base64_to_raw` **(** :ref:`String` base64_str **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`base64_to_utf8` **(** :ref:`String` base64_str **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`base64_to_variant` **(** :ref:`String` base64_str, :ref:`bool` allow_objects=false **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`raw_to_base64` **(** :ref:`PoolByteArray` array **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`utf8_to_base64` **(** :ref:`String` utf8_str **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`variant_to_base64` **(** :ref:`Variant` variant, :ref:`bool` full_objects=false **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Marshalls_method_base64_to_raw: + +- :ref:`PoolByteArray` **base64_to_raw** **(** :ref:`String` base64_str **)** + +Returns a decoded :ref:`PoolByteArray` corresponding to the Base64-encoded string ``base64_str``. + +---- + +.. _class_Marshalls_method_base64_to_utf8: + +- :ref:`String` **base64_to_utf8** **(** :ref:`String` base64_str **)** + +Returns a decoded string corresponding to the Base64-encoded string ``base64_str``. + +---- + +.. _class_Marshalls_method_base64_to_variant: + +- :ref:`Variant` **base64_to_variant** **(** :ref:`String` base64_str, :ref:`bool` allow_objects=false **)** + +Returns a decoded :ref:`Variant` corresponding to the Base64-encoded string ``base64_str``. If ``allow_objects`` is ``true``, decoding objects is allowed. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_Marshalls_method_raw_to_base64: + +- :ref:`String` **raw_to_base64** **(** :ref:`PoolByteArray` array **)** + +Returns a Base64-encoded string of a given :ref:`PoolByteArray`. + +---- + +.. _class_Marshalls_method_utf8_to_base64: + +- :ref:`String` **utf8_to_base64** **(** :ref:`String` utf8_str **)** + +Returns a Base64-encoded string of the UTF-8 string ``utf8_str``. + +---- + +.. _class_Marshalls_method_variant_to_base64: + +- :ref:`String` **variant_to_base64** **(** :ref:`Variant` variant, :ref:`bool` full_objects=false **)** + +Returns a Base64-encoded string of the :ref:`Variant` ``variant``. If ``full_objects`` is ``true``, encoding objects is allowed (and can potentially include code). + +.. |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.)` diff --git a/classes/class_material.rst b/classes/class_material.rst new file mode 100644 index 0000000..83b5c68 --- /dev/null +++ b/classes/class_material.rst @@ -0,0 +1,87 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Material.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Material: + +Material +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`CanvasItemMaterial`, :ref:`ParticlesMaterial`, :ref:`ShaderMaterial`, :ref:`SpatialMaterial` + +Abstract base :ref:`Resource` for coloring and shading geometry. + +Description +----------- + +Material is a base :ref:`Resource` used for coloring and shading geometry. All materials inherit from it and almost all :ref:`VisualInstance` derived nodes carry a Material. A few flags and parameters are shared between all material types and are configured here. + +Tutorials +--------- + +- `3D Material Testers Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------------+-----------------------------------------------------------------+-------+ +| :ref:`Material` | :ref:`next_pass` | | ++---------------------------------+-----------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`render_priority` | ``0`` | ++---------------------------------+-----------------------------------------------------------------+-------+ + +Constants +--------- + +.. _class_Material_constant_RENDER_PRIORITY_MAX: + +.. _class_Material_constant_RENDER_PRIORITY_MIN: + +- **RENDER_PRIORITY_MAX** = **127** --- Maximum value for the :ref:`render_priority` parameter. + +- **RENDER_PRIORITY_MIN** = **-128** --- Minimum value for the :ref:`render_priority` parameter. + +Property Descriptions +--------------------- + +.. _class_Material_property_next_pass: + +- :ref:`Material` **next_pass** + ++----------+----------------------+ +| *Setter* | set_next_pass(value) | ++----------+----------------------+ +| *Getter* | get_next_pass() | ++----------+----------------------+ + +Sets the ``Material`` to be used for the next pass. This renders the object again using a different material. + +**Note:** This only applies to :ref:`SpatialMaterial`\ s and :ref:`ShaderMaterial`\ s with type "Spatial". + +---- + +.. _class_Material_property_render_priority: + +- :ref:`int` **render_priority** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_render_priority(value) | ++-----------+----------------------------+ +| *Getter* | get_render_priority() | ++-----------+----------------------------+ + +Sets the render priority for transparent objects in 3D scenes. Higher priority objects will be sorted in front of lower priority objects. + +**Note:** This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority). + +.. |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.)` diff --git a/classes/class_menubutton.rst b/classes/class_menubutton.rst new file mode 100644 index 0000000..547e2bd --- /dev/null +++ b/classes/class_menubutton.rst @@ -0,0 +1,246 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MenuButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MenuButton: + +MenuButton +========== + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Special button that brings up a :ref:`PopupMenu` when clicked. + +Description +----------- + +Special button that brings up a :ref:`PopupMenu` when clicked. + +New items can be created inside this :ref:`PopupMenu` using ``get_popup().add_item("My Item Name")``. You can also create them directly from the editor. To do so, select the ``MenuButton`` node, then in the toolbar at the top of the 2D editor, click **Items** then click **Add** in the popup. You will be able to give each item new properties. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Properties +---------- + ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ +| :ref:`ActionMode` | action_mode | ``0`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | flat | ``true`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ +| :ref:`FocusMode` | focus_mode | ``0`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`switch_on_hover` | ``false`` | ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | toggle_mode | ``true`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PopupMenu` | :ref:`get_popup` **(** **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_shortcuts` **(** :ref:`bool` disabled **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 1, 1, 1, 0.3 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``3`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_MenuButton_signal_about_to_show: + +- **about_to_show** **(** **)** + +Emitted when :ref:`PopupMenu` of this MenuButton is about to show. + +Property Descriptions +--------------------- + +.. _class_MenuButton_property_switch_on_hover: + +- :ref:`bool` **switch_on_hover** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_switch_on_hover(value) | ++-----------+----------------------------+ +| *Getter* | is_switch_on_hover() | ++-----------+----------------------------+ + +If ``true``, when the cursor hovers above another ``MenuButton`` within the same parent which also has ``switch_on_hover`` enabled, it will close the current ``MenuButton`` and open the other one. + +Method Descriptions +------------------- + +.. _class_MenuButton_method_get_popup: + +- :ref:`PopupMenu` **get_popup** **(** **)** |const| + +Returns the :ref:`PopupMenu` contained in this button. + +**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` property. + +---- + +.. _class_MenuButton_method_set_disable_shortcuts: + +- void **set_disable_shortcuts** **(** :ref:`bool` disabled **)** + +If ``true``, shortcuts are disabled and cannot be used to trigger the button. + +Theme Property Descriptions +--------------------------- + +.. _class_MenuButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the ``MenuButton``. + +---- + +.. _class_MenuButton_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------+ +| *Default* | ``Color( 1, 1, 1, 0.3 )`` | ++-----------+---------------------------+ + +Text :ref:`Color` used when the ``MenuButton`` is disabled. + +---- + +.. _class_MenuButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``MenuButton`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_MenuButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``MenuButton`` is being hovered. + +---- + +.. _class_MenuButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``MenuButton`` is being pressed. + +---- + +.. _class_MenuButton_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The horizontal space between ``MenuButton``'s icon and text. + +---- + +.. _class_MenuButton_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``MenuButton``'s text. + +---- + +.. _class_MenuButton_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +:ref:`StyleBox` used when the ``MenuButton`` is disabled. + +---- + +.. _class_MenuButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``MenuButton`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +---- + +.. _class_MenuButton_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` used when the ``MenuButton`` is being hovered. + +---- + +.. _class_MenuButton_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default :ref:`StyleBox` for the ``MenuButton``. + +---- + +.. _class_MenuButton_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +:ref:`StyleBox` used when the ``MenuButton`` is being pressed. + +.. |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.)` diff --git a/classes/class_mesh.rst b/classes/class_mesh.rst new file mode 100644 index 0000000..af59552 --- /dev/null +++ b/classes/class_mesh.rst @@ -0,0 +1,377 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Mesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Mesh: + +Mesh +==== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`ArrayMesh`, :ref:`PrimitiveMesh` + +A :ref:`Resource` that contains vertex array-based geometry. + +Description +----------- + +Mesh is a type of :ref:`Resource` that contains vertex array-based geometry, divided in *surfaces*. Each surface contains a completely separate array and a material used to draw it. Design wise, a mesh with multiple surfaces is preferred to a single surface, because objects created in 3D editing software commonly contain multiple materials. + +Tutorials +--------- + +- `3D Material Testers Demo `__ + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`lightmap_size_hint` | ``Vector2( 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Shape` | :ref:`create_convex_shape` **(** :ref:`bool` clean=true, :ref:`bool` simplify=false **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`create_outline` **(** :ref:`float` margin **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Shape` | :ref:`create_trimesh_shape` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TriangleMesh` | :ref:`generate_triangle_mesh` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`get_aabb` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_faces` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_surface_count` **(** **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`surface_get_arrays` **(** :ref:`int` surf_idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`surface_get_blend_shape_arrays` **(** :ref:`int` surf_idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Material` | :ref:`surface_get_material` **(** :ref:`int` surf_idx **)** |const| | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`surface_set_material` **(** :ref:`int` surf_idx, :ref:`Material` material **)** | ++-------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Mesh_PrimitiveType: + +.. _class_Mesh_constant_PRIMITIVE_POINTS: + +.. _class_Mesh_constant_PRIMITIVE_LINES: + +.. _class_Mesh_constant_PRIMITIVE_LINE_STRIP: + +.. _class_Mesh_constant_PRIMITIVE_LINE_LOOP: + +.. _class_Mesh_constant_PRIMITIVE_TRIANGLES: + +.. _class_Mesh_constant_PRIMITIVE_TRIANGLE_STRIP: + +.. _class_Mesh_constant_PRIMITIVE_TRIANGLE_FAN: + +enum **PrimitiveType**: + +- **PRIMITIVE_POINTS** = **0** --- Render array as points (one vertex equals one point). + +- **PRIMITIVE_LINES** = **1** --- Render array as lines (every two vertices a line is created). + +- **PRIMITIVE_LINE_STRIP** = **2** --- Render array as line strip. + +- **PRIMITIVE_LINE_LOOP** = **3** --- Render array as line loop (like line strip, but closed). + +- **PRIMITIVE_TRIANGLES** = **4** --- Render array as triangles (every three vertices a triangle is created). + +- **PRIMITIVE_TRIANGLE_STRIP** = **5** --- Render array as triangle strips. + +- **PRIMITIVE_TRIANGLE_FAN** = **6** --- Render array as triangle fans. + +---- + +.. _enum_Mesh_BlendShapeMode: + +.. _class_Mesh_constant_BLEND_SHAPE_MODE_NORMALIZED: + +.. _class_Mesh_constant_BLEND_SHAPE_MODE_RELATIVE: + +enum **BlendShapeMode**: + +- **BLEND_SHAPE_MODE_NORMALIZED** = **0** --- Blend shapes are normalized. + +- **BLEND_SHAPE_MODE_RELATIVE** = **1** --- Blend shapes are relative to base weight. + +---- + +.. _enum_Mesh_ArrayFormat: + +.. _class_Mesh_constant_ARRAY_FORMAT_VERTEX: + +.. _class_Mesh_constant_ARRAY_FORMAT_NORMAL: + +.. _class_Mesh_constant_ARRAY_FORMAT_TANGENT: + +.. _class_Mesh_constant_ARRAY_FORMAT_COLOR: + +.. _class_Mesh_constant_ARRAY_FORMAT_TEX_UV: + +.. _class_Mesh_constant_ARRAY_FORMAT_TEX_UV2: + +.. _class_Mesh_constant_ARRAY_FORMAT_BONES: + +.. _class_Mesh_constant_ARRAY_FORMAT_WEIGHTS: + +.. _class_Mesh_constant_ARRAY_FORMAT_INDEX: + +.. _class_Mesh_constant_ARRAY_COMPRESS_BASE: + +.. _class_Mesh_constant_ARRAY_COMPRESS_VERTEX: + +.. _class_Mesh_constant_ARRAY_COMPRESS_NORMAL: + +.. _class_Mesh_constant_ARRAY_COMPRESS_TANGENT: + +.. _class_Mesh_constant_ARRAY_COMPRESS_COLOR: + +.. _class_Mesh_constant_ARRAY_COMPRESS_TEX_UV: + +.. _class_Mesh_constant_ARRAY_COMPRESS_TEX_UV2: + +.. _class_Mesh_constant_ARRAY_COMPRESS_BONES: + +.. _class_Mesh_constant_ARRAY_COMPRESS_WEIGHTS: + +.. _class_Mesh_constant_ARRAY_COMPRESS_INDEX: + +.. _class_Mesh_constant_ARRAY_FLAG_USE_2D_VERTICES: + +.. _class_Mesh_constant_ARRAY_FLAG_USE_16_BIT_BONES: + +.. _class_Mesh_constant_ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION: + +.. _class_Mesh_constant_ARRAY_COMPRESS_DEFAULT: + +enum **ArrayFormat**: + +- **ARRAY_FORMAT_VERTEX** = **1** --- Mesh array contains vertices. All meshes require a vertex array so this should always be present. + +- **ARRAY_FORMAT_NORMAL** = **2** --- Mesh array contains normals. + +- **ARRAY_FORMAT_TANGENT** = **4** --- Mesh array contains tangents. + +- **ARRAY_FORMAT_COLOR** = **8** --- Mesh array contains colors. + +- **ARRAY_FORMAT_TEX_UV** = **16** --- Mesh array contains UVs. + +- **ARRAY_FORMAT_TEX_UV2** = **32** --- Mesh array contains second UV. + +- **ARRAY_FORMAT_BONES** = **64** --- Mesh array contains bones. + +- **ARRAY_FORMAT_WEIGHTS** = **128** --- Mesh array contains bone weights. + +- **ARRAY_FORMAT_INDEX** = **256** --- Mesh array uses indices. + +- **ARRAY_COMPRESS_BASE** = **9** --- Used internally to calculate other ``ARRAY_COMPRESS_*`` enum values. Do not use. + +- **ARRAY_COMPRESS_VERTEX** = **512** --- Flag used to mark a compressed (half float) vertex array. + +- **ARRAY_COMPRESS_NORMAL** = **1024** --- Flag used to mark a compressed (half float) normal array. + +- **ARRAY_COMPRESS_TANGENT** = **2048** --- Flag used to mark a compressed (half float) tangent array. + +- **ARRAY_COMPRESS_COLOR** = **4096** --- Flag used to mark a compressed (half float) color array. + +- **ARRAY_COMPRESS_TEX_UV** = **8192** --- Flag used to mark a compressed (half float) UV coordinates array. + +- **ARRAY_COMPRESS_TEX_UV2** = **16384** --- Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates. + +- **ARRAY_COMPRESS_BONES** = **32768** --- Flag used to mark a compressed bone array. + +- **ARRAY_COMPRESS_WEIGHTS** = **65536** --- Flag used to mark a compressed (half float) weight array. + +- **ARRAY_COMPRESS_INDEX** = **131072** --- Flag used to mark a compressed index array. + +- **ARRAY_FLAG_USE_2D_VERTICES** = **262144** --- Flag used to mark that the array contains 2D vertices. + +- **ARRAY_FLAG_USE_16_BIT_BONES** = **524288** --- Flag used to mark that the array uses 16-bit bones instead of 8-bit. + +- **ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION** = **2097152** --- Flag used to mark that the array uses an octahedral representation of normal and tangent vectors rather than cartesian. + +- **ARRAY_COMPRESS_DEFAULT** = **2194432** --- Used to set flags :ref:`ARRAY_COMPRESS_VERTEX`, :ref:`ARRAY_COMPRESS_NORMAL`, :ref:`ARRAY_COMPRESS_TANGENT`, :ref:`ARRAY_COMPRESS_COLOR`, :ref:`ARRAY_COMPRESS_TEX_UV`, :ref:`ARRAY_COMPRESS_TEX_UV2`, :ref:`ARRAY_COMPRESS_WEIGHTS`, and :ref:`ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION` quickly. + +---- + +.. _enum_Mesh_ArrayType: + +.. _class_Mesh_constant_ARRAY_VERTEX: + +.. _class_Mesh_constant_ARRAY_NORMAL: + +.. _class_Mesh_constant_ARRAY_TANGENT: + +.. _class_Mesh_constant_ARRAY_COLOR: + +.. _class_Mesh_constant_ARRAY_TEX_UV: + +.. _class_Mesh_constant_ARRAY_TEX_UV2: + +.. _class_Mesh_constant_ARRAY_BONES: + +.. _class_Mesh_constant_ARRAY_WEIGHTS: + +.. _class_Mesh_constant_ARRAY_INDEX: + +.. _class_Mesh_constant_ARRAY_MAX: + +enum **ArrayType**: + +- **ARRAY_VERTEX** = **0** --- Array of vertices. + +- **ARRAY_NORMAL** = **1** --- Array of normals. + +- **ARRAY_TANGENT** = **2** --- Array of tangents as an array of floats, 4 floats per tangent. + +- **ARRAY_COLOR** = **3** --- Array of colors. + +- **ARRAY_TEX_UV** = **4** --- Array of UV coordinates. + +- **ARRAY_TEX_UV2** = **5** --- Array of second set of UV coordinates. + +- **ARRAY_BONES** = **6** --- Array of bone data. + +- **ARRAY_WEIGHTS** = **7** --- Array of weights. + +- **ARRAY_INDEX** = **8** --- Array of indices. + +- **ARRAY_MAX** = **9** --- Represents the size of the :ref:`ArrayType` enum. + +Property Descriptions +--------------------- + +.. _class_Mesh_property_lightmap_size_hint: + +- :ref:`Vector2` **lightmap_size_hint** + ++-----------+-------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------------+ +| *Setter* | set_lightmap_size_hint(value) | ++-----------+-------------------------------+ +| *Getter* | get_lightmap_size_hint() | ++-----------+-------------------------------+ + +Sets a hint to be used for lightmap resolution in :ref:`BakedLightmap`. Overrides :ref:`BakedLightmap.default_texels_per_unit`. + +Method Descriptions +------------------- + +.. _class_Mesh_method_create_convex_shape: + +- :ref:`Shape` **create_convex_shape** **(** :ref:`bool` clean=true, :ref:`bool` simplify=false **)** |const| + +Calculate a :ref:`ConvexPolygonShape` from the mesh. + +If ``clean`` is ``true`` (default), duplicate and interior vertices are removed automatically. You can set it to ``false`` to make the process faster if not needed. + +If ``simplify`` is ``true``, the geometry can be further simplified to reduce the amount of vertices. Disabled by default. + +---- + +.. _class_Mesh_method_create_outline: + +- :ref:`Mesh` **create_outline** **(** :ref:`float` margin **)** |const| + +Calculate an outline mesh at a defined offset (margin) from the original mesh. + +**Note:** This method typically returns the vertices in reverse order (e.g. clockwise to counterclockwise). + +---- + +.. _class_Mesh_method_create_trimesh_shape: + +- :ref:`Shape` **create_trimesh_shape** **(** **)** |const| + +Calculate a :ref:`ConcavePolygonShape` from the mesh. + +---- + +.. _class_Mesh_method_generate_triangle_mesh: + +- :ref:`TriangleMesh` **generate_triangle_mesh** **(** **)** |const| + +Generate a :ref:`TriangleMesh` from the mesh. + +---- + +.. _class_Mesh_method_get_aabb: + +- :ref:`AABB` **get_aabb** **(** **)** |const| + +Returns the smallest :ref:`AABB` enclosing this mesh in local space. Not affected by ``custom_aabb``. See also :ref:`VisualInstance.get_transformed_aabb`. + +**Note:** This is only implemented for :ref:`ArrayMesh` and :ref:`PrimitiveMesh`. + +---- + +.. _class_Mesh_method_get_faces: + +- :ref:`PoolVector3Array` **get_faces** **(** **)** |const| + +Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle. + +---- + +.. _class_Mesh_method_get_surface_count: + +- :ref:`int` **get_surface_count** **(** **)** |const| + +Returns the amount of surfaces that the ``Mesh`` holds. + +---- + +.. _class_Mesh_method_surface_get_arrays: + +- :ref:`Array` **surface_get_arrays** **(** :ref:`int` surf_idx **)** |const| + +Returns the arrays for the vertices, normals, uvs, etc. that make up the requested surface (see :ref:`ArrayMesh.add_surface_from_arrays`). + +---- + +.. _class_Mesh_method_surface_get_blend_shape_arrays: + +- :ref:`Array` **surface_get_blend_shape_arrays** **(** :ref:`int` surf_idx **)** |const| + +Returns the blend shape arrays for the requested surface. + +---- + +.. _class_Mesh_method_surface_get_material: + +- :ref:`Material` **surface_get_material** **(** :ref:`int` surf_idx **)** |const| + +Returns a :ref:`Material` in a given surface. Surface is rendered using this material. + +---- + +.. _class_Mesh_method_surface_set_material: + +- void **surface_set_material** **(** :ref:`int` surf_idx, :ref:`Material` material **)** + +Sets a :ref:`Material` for a given surface. Surface will be rendered using this material. + +.. |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.)` diff --git a/classes/class_meshdatatool.rst b/classes/class_meshdatatool.rst new file mode 100644 index 0000000..4279660 --- /dev/null +++ b/classes/class_meshdatatool.rst @@ -0,0 +1,445 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MeshDataTool.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MeshDataTool: + +MeshDataTool +============ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper tool to access and edit :ref:`Mesh` data. + +Description +----------- + +MeshDataTool provides access to individual vertices in a :ref:`Mesh`. It allows users to read and edit vertex data of meshes. It also creates an array of faces and edges. + +To use MeshDataTool, load a mesh with :ref:`create_from_surface`. When you are finished editing the data commit the data to a mesh with :ref:`commit_to_surface`. + +Below is an example of how MeshDataTool may be used. + +:: + + var mesh = ArrayMesh.new() + mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, CubeMesh.new().get_mesh_arrays()) + var mdt = MeshDataTool.new() + mdt.create_from_surface(mesh, 0) + for i in range(mdt.get_vertex_count()): + var vertex = mdt.get_vertex(i) + # In this example we extend the mesh by one unit, which results in separated faces as it is flat shaded. + vertex += mdt.get_vertex_normal(i) + # Save your change. + mdt.set_vertex(i, vertex) + mesh.surface_remove(0) + mdt.commit_to_surface(mesh) + var mi = MeshInstance.new() + mi.mesh = mesh + add_child(mi) + +See also :ref:`ArrayMesh`, :ref:`ImmediateGeometry` and :ref:`SurfaceTool` for procedural geometry generation. + +**Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. + +Methods +------- + ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`commit_to_surface` **(** :ref:`ArrayMesh` mesh **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_from_surface` **(** :ref:`ArrayMesh` mesh, :ref:`int` surface **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_edge_count` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_edge_faces` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_edge_meta` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_edge_vertex` **(** :ref:`int` idx, :ref:`int` vertex **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_face_count` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_face_edge` **(** :ref:`int` idx, :ref:`int` edge **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_face_meta` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_face_normal` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_face_vertex` **(** :ref:`int` idx, :ref:`int` vertex **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_format` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Material` | :ref:`get_material` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_vertex` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_vertex_bones` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_vertex_color` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_vertex_count` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_vertex_edges` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_vertex_faces` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_vertex_meta` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_vertex_normal` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`get_vertex_tangent` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_vertex_uv` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_vertex_uv2` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`get_vertex_weights` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_edge_meta` **(** :ref:`int` idx, :ref:`Variant` meta **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_face_meta` **(** :ref:`int` idx, :ref:`Variant` meta **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_material` **(** :ref:`Material` material **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex` **(** :ref:`int` idx, :ref:`Vector3` vertex **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_bones` **(** :ref:`int` idx, :ref:`PoolIntArray` bones **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_color` **(** :ref:`int` idx, :ref:`Color` color **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_meta` **(** :ref:`int` idx, :ref:`Variant` meta **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_normal` **(** :ref:`int` idx, :ref:`Vector3` normal **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_tangent` **(** :ref:`int` idx, :ref:`Plane` tangent **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_uv` **(** :ref:`int` idx, :ref:`Vector2` uv **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_uv2` **(** :ref:`int` idx, :ref:`Vector2` uv2 **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertex_weights` **(** :ref:`int` idx, :ref:`PoolRealArray` weights **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_MeshDataTool_method_clear: + +- void **clear** **(** **)** + +Clears all data currently in MeshDataTool. + +---- + +.. _class_MeshDataTool_method_commit_to_surface: + +- :ref:`Error` **commit_to_surface** **(** :ref:`ArrayMesh` mesh **)** + +Adds a new surface to specified :ref:`Mesh` with edited data. + +---- + +.. _class_MeshDataTool_method_create_from_surface: + +- :ref:`Error` **create_from_surface** **(** :ref:`ArrayMesh` mesh, :ref:`int` surface **)** + +Uses specified surface of given :ref:`Mesh` to populate data for MeshDataTool. + +Requires :ref:`Mesh` with primitive type :ref:`Mesh.PRIMITIVE_TRIANGLES`. + +---- + +.. _class_MeshDataTool_method_get_edge_count: + +- :ref:`int` **get_edge_count** **(** **)** |const| + +Returns the number of edges in this :ref:`Mesh`. + +---- + +.. _class_MeshDataTool_method_get_edge_faces: + +- :ref:`PoolIntArray` **get_edge_faces** **(** :ref:`int` idx **)** |const| + +Returns array of faces that touch given edge. + +---- + +.. _class_MeshDataTool_method_get_edge_meta: + +- :ref:`Variant` **get_edge_meta** **(** :ref:`int` idx **)** |const| + +Returns meta information assigned to given edge. + +---- + +.. _class_MeshDataTool_method_get_edge_vertex: + +- :ref:`int` **get_edge_vertex** **(** :ref:`int` idx, :ref:`int` vertex **)** |const| + +Returns index of specified vertex connected to given edge. + +Vertex argument can only be 0 or 1 because edges are comprised of two vertices. + +---- + +.. _class_MeshDataTool_method_get_face_count: + +- :ref:`int` **get_face_count** **(** **)** |const| + +Returns the number of faces in this :ref:`Mesh`. + +---- + +.. _class_MeshDataTool_method_get_face_edge: + +- :ref:`int` **get_face_edge** **(** :ref:`int` idx, :ref:`int` edge **)** |const| + +Returns specified edge associated with given face. + +Edge argument must be either 0, 1, or 2 because a face only has three edges. + +---- + +.. _class_MeshDataTool_method_get_face_meta: + +- :ref:`Variant` **get_face_meta** **(** :ref:`int` idx **)** |const| + +Returns the metadata associated with the given face. + +---- + +.. _class_MeshDataTool_method_get_face_normal: + +- :ref:`Vector3` **get_face_normal** **(** :ref:`int` idx **)** |const| + +Calculates and returns the face normal of the given face. + +---- + +.. _class_MeshDataTool_method_get_face_vertex: + +- :ref:`int` **get_face_vertex** **(** :ref:`int` idx, :ref:`int` vertex **)** |const| + +Returns the specified vertex of the given face. + +Vertex argument must be either 0, 1, or 2 because faces contain three vertices. + +---- + +.. _class_MeshDataTool_method_get_format: + +- :ref:`int` **get_format** **(** **)** |const| + +Returns the :ref:`Mesh`'s format. Format is an integer made up of :ref:`Mesh` format flags combined together. For example, a mesh containing both vertices and normals would return a format of ``3`` because :ref:`ArrayMesh.ARRAY_FORMAT_VERTEX` is ``1`` and :ref:`ArrayMesh.ARRAY_FORMAT_NORMAL` is ``2``. + +See :ref:`ArrayFormat` for a list of format flags. + +---- + +.. _class_MeshDataTool_method_get_material: + +- :ref:`Material` **get_material** **(** **)** |const| + +Returns the material assigned to the :ref:`Mesh`. + +---- + +.. _class_MeshDataTool_method_get_vertex: + +- :ref:`Vector3` **get_vertex** **(** :ref:`int` idx **)** |const| + +Returns the vertex at given index. + +---- + +.. _class_MeshDataTool_method_get_vertex_bones: + +- :ref:`PoolIntArray` **get_vertex_bones** **(** :ref:`int` idx **)** |const| + +Returns the bones of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_color: + +- :ref:`Color` **get_vertex_color** **(** :ref:`int` idx **)** |const| + +Returns the color of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_count: + +- :ref:`int` **get_vertex_count** **(** **)** |const| + +Returns the total number of vertices in :ref:`Mesh`. + +---- + +.. _class_MeshDataTool_method_get_vertex_edges: + +- :ref:`PoolIntArray` **get_vertex_edges** **(** :ref:`int` idx **)** |const| + +Returns an array of edges that share the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_faces: + +- :ref:`PoolIntArray` **get_vertex_faces** **(** :ref:`int` idx **)** |const| + +Returns an array of faces that share the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_meta: + +- :ref:`Variant` **get_vertex_meta** **(** :ref:`int` idx **)** |const| + +Returns the metadata associated with the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_normal: + +- :ref:`Vector3` **get_vertex_normal** **(** :ref:`int` idx **)** |const| + +Returns the normal of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_tangent: + +- :ref:`Plane` **get_vertex_tangent** **(** :ref:`int` idx **)** |const| + +Returns the tangent of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_uv: + +- :ref:`Vector2` **get_vertex_uv** **(** :ref:`int` idx **)** |const| + +Returns the UV of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_uv2: + +- :ref:`Vector2` **get_vertex_uv2** **(** :ref:`int` idx **)** |const| + +Returns the UV2 of the given vertex. + +---- + +.. _class_MeshDataTool_method_get_vertex_weights: + +- :ref:`PoolRealArray` **get_vertex_weights** **(** :ref:`int` idx **)** |const| + +Returns bone weights of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_edge_meta: + +- void **set_edge_meta** **(** :ref:`int` idx, :ref:`Variant` meta **)** + +Sets the metadata of the given edge. + +---- + +.. _class_MeshDataTool_method_set_face_meta: + +- void **set_face_meta** **(** :ref:`int` idx, :ref:`Variant` meta **)** + +Sets the metadata of the given face. + +---- + +.. _class_MeshDataTool_method_set_material: + +- void **set_material** **(** :ref:`Material` material **)** + +Sets the material to be used by newly-constructed :ref:`Mesh`. + +---- + +.. _class_MeshDataTool_method_set_vertex: + +- void **set_vertex** **(** :ref:`int` idx, :ref:`Vector3` vertex **)** + +Sets the position of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_bones: + +- void **set_vertex_bones** **(** :ref:`int` idx, :ref:`PoolIntArray` bones **)** + +Sets the bones of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_color: + +- void **set_vertex_color** **(** :ref:`int` idx, :ref:`Color` color **)** + +Sets the color of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_meta: + +- void **set_vertex_meta** **(** :ref:`int` idx, :ref:`Variant` meta **)** + +Sets the metadata associated with the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_normal: + +- void **set_vertex_normal** **(** :ref:`int` idx, :ref:`Vector3` normal **)** + +Sets the normal of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_tangent: + +- void **set_vertex_tangent** **(** :ref:`int` idx, :ref:`Plane` tangent **)** + +Sets the tangent of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_uv: + +- void **set_vertex_uv** **(** :ref:`int` idx, :ref:`Vector2` uv **)** + +Sets the UV of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_uv2: + +- void **set_vertex_uv2** **(** :ref:`int` idx, :ref:`Vector2` uv2 **)** + +Sets the UV2 of the given vertex. + +---- + +.. _class_MeshDataTool_method_set_vertex_weights: + +- void **set_vertex_weights** **(** :ref:`int` idx, :ref:`PoolRealArray` weights **)** + +Sets the bone weights of the given vertex. + +.. |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.)` diff --git a/classes/class_meshinstance.rst b/classes/class_meshinstance.rst new file mode 100644 index 0000000..a58d75f --- /dev/null +++ b/classes/class_meshinstance.rst @@ -0,0 +1,202 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MeshInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MeshInstance: + +MeshInstance +============ + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`SoftBody` + +Node that instances meshes into a scenario. + +Description +----------- + +MeshInstance is a node that takes a :ref:`Mesh` resource and adds it to the current scenario by creating an instance of it. This is the class most often used to get 3D geometry rendered and can be used to instance a single :ref:`Mesh` in many places. This allows to reuse geometry and save on resources. When a :ref:`Mesh` has to be instanced more than thousands of times at close proximity, consider using a :ref:`MultiMesh` in a :ref:`MultiMeshInstance` instead. + +Tutorials +--------- + +- `3D Material Testers Demo `__ + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`Mesh` | :ref:`mesh` | | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`NodePath` | :ref:`skeleton` | ``NodePath("..")`` | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`Skin` | :ref:`skin` | | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ +| :ref:`bool` | :ref:`software_skinning_transform_normals` | ``true`` | ++---------------------------------+-------------------------------------------------------------------------------------------------------------+--------------------+ + +Methods +------- + ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_convex_collision` **(** :ref:`bool` clean=true, :ref:`bool` simplify=false **)** | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_debug_tangents` **(** **)** | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_multiple_convex_collisions` **(** **)** | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_trimesh_collision` **(** **)** | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Material` | :ref:`get_active_material` **(** :ref:`int` surface **)** |const| | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Material` | :ref:`get_surface_material` **(** :ref:`int` surface **)** |const| | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_surface_material_count` **(** **)** |const| | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_surface_material` **(** :ref:`int` surface, :ref:`Material` material **)** | ++---------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_MeshInstance_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +The :ref:`Mesh` resource for the instance. + +---- + +.. _class_MeshInstance_property_skeleton: + +- :ref:`NodePath` **skeleton** + ++-----------+--------------------------+ +| *Default* | ``NodePath("..")`` | ++-----------+--------------------------+ +| *Setter* | set_skeleton_path(value) | ++-----------+--------------------------+ +| *Getter* | get_skeleton_path() | ++-----------+--------------------------+ + +:ref:`NodePath` to the :ref:`Skeleton` associated with the instance. + +---- + +.. _class_MeshInstance_property_skin: + +- :ref:`Skin` **skin** + ++----------+-----------------+ +| *Setter* | set_skin(value) | ++----------+-----------------+ +| *Getter* | get_skin() | ++----------+-----------------+ + +Sets the skin to be used by this instance. + +---- + +.. _class_MeshInstance_property_software_skinning_transform_normals: + +- :ref:`bool` **software_skinning_transform_normals** + ++-----------+--------------------------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------------------------+ +| *Setter* | set_software_skinning_transform_normals(value) | ++-----------+--------------------------------------------------+ +| *Getter* | is_software_skinning_transform_normals_enabled() | ++-----------+--------------------------------------------------+ + +If ``true``, normals are transformed when software skinning is used. Set to ``false`` when normals are not needed for better performance. + +See :ref:`ProjectSettings.rendering/quality/skinning/software_skinning_fallback` for details about how software skinning is enabled. + +Method Descriptions +------------------- + +.. _class_MeshInstance_method_create_convex_collision: + +- void **create_convex_collision** **(** :ref:`bool` clean=true, :ref:`bool` simplify=false **)** + +This helper creates a :ref:`StaticBody` child node with a :ref:`ConvexPolygonShape` collision shape calculated from the mesh geometry. It's mainly used for testing. + +If ``clean`` is ``true`` (default), duplicate and interior vertices are removed automatically. You can set it to ``false`` to make the process faster if not needed. + +If ``simplify`` is ``true``, the geometry can be further simplified to reduce the amount of vertices. Disabled by default. + +---- + +.. _class_MeshInstance_method_create_debug_tangents: + +- void **create_debug_tangents** **(** **)** + +This helper creates a ``MeshInstance`` child node with gizmos at every vertex calculated from the mesh geometry. It's mainly used for testing. + +---- + +.. _class_MeshInstance_method_create_multiple_convex_collisions: + +- void **create_multiple_convex_collisions** **(** **)** + +This helper creates a :ref:`StaticBody` child node with multiple :ref:`ConvexPolygonShape` collision shapes calculated from the mesh geometry via convex decomposition. It's mainly used for testing. + +---- + +.. _class_MeshInstance_method_create_trimesh_collision: + +- void **create_trimesh_collision** **(** **)** + +This helper creates a :ref:`StaticBody` child node with a :ref:`ConcavePolygonShape` collision shape calculated from the mesh geometry. It's mainly used for testing. + +---- + +.. _class_MeshInstance_method_get_active_material: + +- :ref:`Material` **get_active_material** **(** :ref:`int` surface **)** |const| + +Returns the :ref:`Material` that will be used by the :ref:`Mesh` when drawing. This can return the :ref:`GeometryInstance.material_override`, the surface override :ref:`Material` defined in this ``MeshInstance``, or the surface :ref:`Material` defined in the :ref:`Mesh`. For example, if :ref:`GeometryInstance.material_override` is used, all surfaces will return the override material. + +---- + +.. _class_MeshInstance_method_get_surface_material: + +- :ref:`Material` **get_surface_material** **(** :ref:`int` surface **)** |const| + +Returns the :ref:`Material` for a surface of the :ref:`Mesh` resource. + +---- + +.. _class_MeshInstance_method_get_surface_material_count: + +- :ref:`int` **get_surface_material_count** **(** **)** |const| + +Returns the number of surface materials. + +---- + +.. _class_MeshInstance_method_set_surface_material: + +- void **set_surface_material** **(** :ref:`int` surface, :ref:`Material` material **)** + +Sets the :ref:`Material` for a surface of the :ref:`Mesh` resource. + +.. |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.)` diff --git a/classes/class_meshinstance2d.rst b/classes/class_meshinstance2d.rst new file mode 100644 index 0000000..ace222f --- /dev/null +++ b/classes/class_meshinstance2d.rst @@ -0,0 +1,93 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MeshInstance2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MeshInstance2D: + +MeshInstance2D +============== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Node used for displaying a :ref:`Mesh` in 2D. + +Description +----------- + +Node used for displaying a :ref:`Mesh` in 2D. Can be constructed from an existing :ref:`Sprite` via a tool in the editor toolbar. Select "Sprite" then "Convert to Mesh2D", select settings in popup and press "Create Mesh2D". + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_meshes` + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`mesh` | ++-------------------------------+-------------------------------------------------------------+ +| :ref:`Texture` | :ref:`normal_map` | ++-------------------------------+-------------------------------------------------------------+ +| :ref:`Texture` | :ref:`texture` | ++-------------------------------+-------------------------------------------------------------+ + +Signals +------- + +.. _class_MeshInstance2D_signal_texture_changed: + +- **texture_changed** **(** **)** + +Emitted when the :ref:`texture` is changed. + +Property Descriptions +--------------------- + +.. _class_MeshInstance2D_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +The :ref:`Mesh` that will be drawn by the ``MeshInstance2D``. + +---- + +.. _class_MeshInstance2D_property_normal_map: + +- :ref:`Texture` **normal_map** + ++----------+-----------------------+ +| *Setter* | set_normal_map(value) | ++----------+-----------------------+ +| *Getter* | get_normal_map() | ++----------+-----------------------+ + +The normal map that will be used if using the default :ref:`CanvasItemMaterial`. + +**Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_MeshInstance2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The :ref:`Texture` that will be used if using the default :ref:`CanvasItemMaterial`. Can be accessed as ``TEXTURE`` in CanvasItem shader. + +.. |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.)` diff --git a/classes/class_meshlibrary.rst b/classes/class_meshlibrary.rst new file mode 100644 index 0000000..b3ec0b4 --- /dev/null +++ b/classes/class_meshlibrary.rst @@ -0,0 +1,244 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MeshLibrary.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MeshLibrary: + +MeshLibrary +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Library of meshes. + +Description +----------- + +A library of meshes. Contains a list of :ref:`Mesh` resources, each with a name and ID. Each item can also include collision and navigation shapes. This resource is used in :ref:`GridMap`. + +Tutorials +--------- + +- `3D Kinematic Character Demo `__ + +- `3D Platformer Demo `__ + +Methods +------- + ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_item` **(** :ref:`int` id **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_item_by_name` **(** :ref:`String` name **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_item_list` **(** **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`get_item_mesh` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_item_mesh_transform` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_name` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NavigationMesh` | :ref:`get_item_navmesh` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_item_navmesh_transform` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_item_preview` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_item_shapes` **(** :ref:`int` id **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_unused_item_id` **(** **)** |const| | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_item` **(** :ref:`int` id **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_mesh` **(** :ref:`int` id, :ref:`Mesh` mesh **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_mesh_transform` **(** :ref:`int` id, :ref:`Transform` mesh_transform **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_name` **(** :ref:`int` id, :ref:`String` name **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_navmesh` **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_navmesh_transform` **(** :ref:`int` id, :ref:`Transform` navmesh **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_preview` **(** :ref:`int` id, :ref:`Texture` texture **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | ++---------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_MeshLibrary_method_clear: + +- void **clear** **(** **)** + +Clears the library. + +---- + +.. _class_MeshLibrary_method_create_item: + +- void **create_item** **(** :ref:`int` id **)** + +Creates a new item in the library with the given ID. + +You can get an unused ID from :ref:`get_last_unused_item_id`. + +---- + +.. _class_MeshLibrary_method_find_item_by_name: + +- :ref:`int` **find_item_by_name** **(** :ref:`String` name **)** |const| + +Returns the first item with the given name. + +---- + +.. _class_MeshLibrary_method_get_item_list: + +- :ref:`PoolIntArray` **get_item_list** **(** **)** |const| + +Returns the list of item IDs in use. + +---- + +.. _class_MeshLibrary_method_get_item_mesh: + +- :ref:`Mesh` **get_item_mesh** **(** :ref:`int` id **)** |const| + +Returns the item's mesh. + +---- + +.. _class_MeshLibrary_method_get_item_mesh_transform: + +- :ref:`Transform` **get_item_mesh_transform** **(** :ref:`int` id **)** |const| + +Returns the transform applied to the item's mesh. + +---- + +.. _class_MeshLibrary_method_get_item_name: + +- :ref:`String` **get_item_name** **(** :ref:`int` id **)** |const| + +Returns the item's name. + +---- + +.. _class_MeshLibrary_method_get_item_navmesh: + +- :ref:`NavigationMesh` **get_item_navmesh** **(** :ref:`int` id **)** |const| + +Returns the item's navigation mesh. + +---- + +.. _class_MeshLibrary_method_get_item_navmesh_transform: + +- :ref:`Transform` **get_item_navmesh_transform** **(** :ref:`int` id **)** |const| + +Returns the transform applied to the item's navigation mesh. + +---- + +.. _class_MeshLibrary_method_get_item_preview: + +- :ref:`Texture` **get_item_preview** **(** :ref:`int` id **)** |const| + +When running in the editor, returns a generated item preview (a 3D rendering in isometric perspective). When used in a running project, returns the manually-defined item preview which can be set using :ref:`set_item_preview`. Returns an empty :ref:`Texture` if no preview was manually set in a running project. + +---- + +.. _class_MeshLibrary_method_get_item_shapes: + +- :ref:`Array` **get_item_shapes** **(** :ref:`int` id **)** |const| + +Returns an item's collision shapes. + +The array consists of each :ref:`Shape` followed by its :ref:`Transform`. + +---- + +.. _class_MeshLibrary_method_get_last_unused_item_id: + +- :ref:`int` **get_last_unused_item_id** **(** **)** |const| + +Gets an unused ID for a new item. + +---- + +.. _class_MeshLibrary_method_remove_item: + +- void **remove_item** **(** :ref:`int` id **)** + +Removes the item. + +---- + +.. _class_MeshLibrary_method_set_item_mesh: + +- void **set_item_mesh** **(** :ref:`int` id, :ref:`Mesh` mesh **)** + +Sets the item's mesh. + +---- + +.. _class_MeshLibrary_method_set_item_mesh_transform: + +- void **set_item_mesh_transform** **(** :ref:`int` id, :ref:`Transform` mesh_transform **)** + +Sets the transform to apply to the item's mesh. + +---- + +.. _class_MeshLibrary_method_set_item_name: + +- void **set_item_name** **(** :ref:`int` id, :ref:`String` name **)** + +Sets the item's name. + +This name is shown in the editor. It can also be used to look up the item later using :ref:`find_item_by_name`. + +---- + +.. _class_MeshLibrary_method_set_item_navmesh: + +- void **set_item_navmesh** **(** :ref:`int` id, :ref:`NavigationMesh` navmesh **)** + +Sets the item's navigation mesh. + +---- + +.. _class_MeshLibrary_method_set_item_navmesh_transform: + +- void **set_item_navmesh_transform** **(** :ref:`int` id, :ref:`Transform` navmesh **)** + +Sets the transform to apply to the item's navigation mesh. + +---- + +.. _class_MeshLibrary_method_set_item_preview: + +- void **set_item_preview** **(** :ref:`int` id, :ref:`Texture` texture **)** + +Sets a texture to use as the item's preview icon in the editor. + +---- + +.. _class_MeshLibrary_method_set_item_shapes: + +- void **set_item_shapes** **(** :ref:`int` id, :ref:`Array` shapes **)** + +Sets an item's collision shapes. + +The array should consist of :ref:`Shape` objects, each followed by a :ref:`Transform` that will be applied to it. For shapes that should not have a transform, use :ref:`Transform.IDENTITY`. + +.. |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.)` diff --git a/classes/class_meshtexture.rst b/classes/class_meshtexture.rst new file mode 100644 index 0000000..b208b69 --- /dev/null +++ b/classes/class_meshtexture.rst @@ -0,0 +1,81 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MeshTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MeshTexture: + +MeshTexture +=========== + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Simple texture that uses a mesh to draw itself. + +Description +----------- + +Simple texture that uses a mesh to draw itself. It's limited because flags can't be changed and region drawing is not supported. + +Properties +---------- + ++-------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`base_texture` | | ++-------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`Vector2` | :ref:`image_size` | ``Vector2( 0, 0 )`` | ++-------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`Mesh` | :ref:`mesh` | | ++-------------------------------+--------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_MeshTexture_property_base_texture: + +- :ref:`Texture` **base_texture** + ++----------+-------------------------+ +| *Setter* | set_base_texture(value) | ++----------+-------------------------+ +| *Getter* | get_base_texture() | ++----------+-------------------------+ + +Sets the base texture that the Mesh will use to draw. + +---- + +.. _class_MeshTexture_property_image_size: + +- :ref:`Vector2` **image_size** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-----------------------+ +| *Setter* | set_image_size(value) | ++-----------+-----------------------+ +| *Getter* | get_image_size() | ++-----------+-----------------------+ + +Sets the size of the image, needed for reference. + +---- + +.. _class_MeshTexture_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +Sets the mesh used to draw. It must be a mesh using 2D vertices. + +.. |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.)` diff --git a/classes/class_mobilevrinterface.rst b/classes/class_mobilevrinterface.rst new file mode 100644 index 0000000..46512b6 --- /dev/null +++ b/classes/class_mobilevrinterface.rst @@ -0,0 +1,165 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MobileVRInterface.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MobileVRInterface: + +MobileVRInterface +================= + +**Inherits:** :ref:`ARVRInterface` **<** :ref:`Reference` **<** :ref:`Object` + +Generic mobile VR implementation. + +Description +----------- + +This is a generic mobile VR implementation where you need to provide details about the phone and HMD used. It does not rely on any existing framework. This is the most basic interface we have. For the best effect, you need a mobile phone with a gyroscope and accelerometer. + +Note that even though there is no positional tracking, the camera will assume the headset is at a height of 1.85 meters. You can change this by setting :ref:`eye_height`. + +You can initialise this interface as follows: + +:: + + var interface = ARVRServer.find_interface("Native mobile") + if interface and interface.initialize(): + get_viewport().arvr = true + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`display_to_lens` | ``4.0`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`display_width` | ``14.5`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`eye_height` | ``1.85`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`iod` | ``6.0`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`k1` | ``0.215`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`k2` | ``0.215`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`oversample` | ``1.5`` | ++---------------------------+--------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_MobileVRInterface_property_display_to_lens: + +- :ref:`float` **display_to_lens** + ++-----------+----------------------------+ +| *Default* | ``4.0`` | ++-----------+----------------------------+ +| *Setter* | set_display_to_lens(value) | ++-----------+----------------------------+ +| *Getter* | get_display_to_lens() | ++-----------+----------------------------+ + +The distance between the display and the lenses inside of the device in centimeters. + +---- + +.. _class_MobileVRInterface_property_display_width: + +- :ref:`float` **display_width** + ++-----------+--------------------------+ +| *Default* | ``14.5`` | ++-----------+--------------------------+ +| *Setter* | set_display_width(value) | ++-----------+--------------------------+ +| *Getter* | get_display_width() | ++-----------+--------------------------+ + +The width of the display in centimeters. + +---- + +.. _class_MobileVRInterface_property_eye_height: + +- :ref:`float` **eye_height** + ++-----------+-----------------------+ +| *Default* | ``1.85`` | ++-----------+-----------------------+ +| *Setter* | set_eye_height(value) | ++-----------+-----------------------+ +| *Getter* | get_eye_height() | ++-----------+-----------------------+ + +The height at which the camera is placed in relation to the ground (i.e. :ref:`ARVROrigin` node). + +---- + +.. _class_MobileVRInterface_property_iod: + +- :ref:`float` **iod** + ++-----------+----------------+ +| *Default* | ``6.0`` | ++-----------+----------------+ +| *Setter* | set_iod(value) | ++-----------+----------------+ +| *Getter* | get_iod() | ++-----------+----------------+ + +The interocular distance, also known as the interpupillary distance. The distance between the pupils of the left and right eye. + +---- + +.. _class_MobileVRInterface_property_k1: + +- :ref:`float` **k1** + ++-----------+---------------+ +| *Default* | ``0.215`` | ++-----------+---------------+ +| *Setter* | set_k1(value) | ++-----------+---------------+ +| *Getter* | get_k1() | ++-----------+---------------+ + +The k1 lens factor is one of the two constants that define the strength of the lens used and directly influences the lens distortion effect. + +---- + +.. _class_MobileVRInterface_property_k2: + +- :ref:`float` **k2** + ++-----------+---------------+ +| *Default* | ``0.215`` | ++-----------+---------------+ +| *Setter* | set_k2(value) | ++-----------+---------------+ +| *Getter* | get_k2() | ++-----------+---------------+ + +The k2 lens factor, see k1. + +---- + +.. _class_MobileVRInterface_property_oversample: + +- :ref:`float` **oversample** + ++-----------+-----------------------+ +| *Default* | ``1.5`` | ++-----------+-----------------------+ +| *Setter* | set_oversample(value) | ++-----------+-----------------------+ +| *Getter* | get_oversample() | ++-----------+-----------------------+ + +The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. + +.. |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.)` diff --git a/classes/class_multimesh.rst b/classes/class_multimesh.rst new file mode 100644 index 0000000..56f16ea --- /dev/null +++ b/classes/class_multimesh.rst @@ -0,0 +1,311 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MultiMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MultiMesh: + +MultiMesh +========= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Provides high-performance mesh instancing. + +Description +----------- + +MultiMesh provides low-level mesh instancing. Drawing thousands of :ref:`MeshInstance` nodes can be slow, since each object is submitted to the GPU then drawn individually. + +MultiMesh is much faster as it can draw thousands of instances with a single draw call, resulting in less API overhead. + +As a drawback, if the instances are too far away from each other, performance may be reduced as every single instance will always render (they are spatially indexed as one, for the whole object). + +Since instances may have any behavior, the AABB used for visibility must be provided by the user. + +Tutorials +--------- + +- :doc:`../tutorials/performance/vertex_animation/animating_thousands_of_fish` + +- :doc:`../tutorials/performance/using_multimesh` + +Properties +---------- + ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`ColorFormat` | :ref:`color_format` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`CustomDataFormat` | :ref:`custom_data_format` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`instance_count` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`Mesh` | :ref:`mesh` | | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`TransformFormat` | :ref:`transform_format` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`visible_instance_count` | ``-1`` | ++----------------------------------------------------------+--------------------------------------------------------------------------------+--------+ + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`get_aabb` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_instance_color` **(** :ref:`int` instance **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_instance_custom_data` **(** :ref:`int` instance **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_instance_transform` **(** :ref:`int` instance **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_instance_transform_2d` **(** :ref:`int` instance **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_as_bulk_array` **(** :ref:`PoolRealArray` array **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance_color` **(** :ref:`int` instance, :ref:`Color` color **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance_custom_data` **(** :ref:`int` instance, :ref:`Color` custom_data **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance_transform` **(** :ref:`int` instance, :ref:`Transform` transform **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance_transform_2d` **(** :ref:`int` instance, :ref:`Transform2D` transform **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_MultiMesh_TransformFormat: + +.. _class_MultiMesh_constant_TRANSFORM_2D: + +.. _class_MultiMesh_constant_TRANSFORM_3D: + +enum **TransformFormat**: + +- **TRANSFORM_2D** = **0** --- Use this when using 2D transforms. + +- **TRANSFORM_3D** = **1** --- Use this when using 3D transforms. + +---- + +.. _enum_MultiMesh_ColorFormat: + +.. _class_MultiMesh_constant_COLOR_NONE: + +.. _class_MultiMesh_constant_COLOR_8BIT: + +.. _class_MultiMesh_constant_COLOR_FLOAT: + +enum **ColorFormat**: + +- **COLOR_NONE** = **0** --- Use when you are not using per-instance :ref:`Color`\ s. + +- **COLOR_8BIT** = **1** --- Compress :ref:`Color` data into 8 bits when passing to shader. This uses less memory and can be faster, but the :ref:`Color` loses precision. + +- **COLOR_FLOAT** = **2** --- The :ref:`Color` passed into :ref:`set_instance_color` will use 4 floats. Use this for highest precision :ref:`Color`. + +---- + +.. _enum_MultiMesh_CustomDataFormat: + +.. _class_MultiMesh_constant_CUSTOM_DATA_NONE: + +.. _class_MultiMesh_constant_CUSTOM_DATA_8BIT: + +.. _class_MultiMesh_constant_CUSTOM_DATA_FLOAT: + +enum **CustomDataFormat**: + +- **CUSTOM_DATA_NONE** = **0** --- Use when you are not using per-instance custom data. + +- **CUSTOM_DATA_8BIT** = **1** --- Compress custom_data into 8 bits when passing to shader. This uses less memory and can be faster, but loses precision and range. Floats packed into 8 bits can only represent values between 0 and 1, numbers outside that range will be clamped. + +- **CUSTOM_DATA_FLOAT** = **2** --- The :ref:`Color` passed into :ref:`set_instance_custom_data` will use 4 floats. Use this for highest precision. + +Property Descriptions +--------------------- + +.. _class_MultiMesh_property_color_format: + +- :ref:`ColorFormat` **color_format** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_color_format(value) | ++-----------+-------------------------+ +| *Getter* | get_color_format() | ++-----------+-------------------------+ + +Format of colors in color array that gets passed to shader. + +---- + +.. _class_MultiMesh_property_custom_data_format: + +- :ref:`CustomDataFormat` **custom_data_format** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_custom_data_format(value) | ++-----------+-------------------------------+ +| *Getter* | get_custom_data_format() | ++-----------+-------------------------------+ + +Format of custom data in custom data array that gets passed to shader. + +---- + +.. _class_MultiMesh_property_instance_count: + +- :ref:`int` **instance_count** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_instance_count(value) | ++-----------+---------------------------+ +| *Getter* | get_instance_count() | ++-----------+---------------------------+ + +Number of instances that will get drawn. This clears and (re)sizes the buffers. By default, all instances are drawn but you can limit this with :ref:`visible_instance_count`. + +---- + +.. _class_MultiMesh_property_mesh: + +- :ref:`Mesh` **mesh** + ++----------+-----------------+ +| *Setter* | set_mesh(value) | ++----------+-----------------+ +| *Getter* | get_mesh() | ++----------+-----------------+ + +Mesh to be drawn. + +---- + +.. _class_MultiMesh_property_transform_format: + +- :ref:`TransformFormat` **transform_format** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_transform_format(value) | ++-----------+-----------------------------+ +| *Getter* | get_transform_format() | ++-----------+-----------------------------+ + +Format of transform used to transform mesh, either 2D or 3D. + +---- + +.. _class_MultiMesh_property_visible_instance_count: + +- :ref:`int` **visible_instance_count** + ++-----------+-----------------------------------+ +| *Default* | ``-1`` | ++-----------+-----------------------------------+ +| *Setter* | set_visible_instance_count(value) | ++-----------+-----------------------------------+ +| *Getter* | get_visible_instance_count() | ++-----------+-----------------------------------+ + +Limits the number of instances drawn, -1 draws all instances. Changing this does not change the sizes of the buffers. + +Method Descriptions +------------------- + +.. _class_MultiMesh_method_get_aabb: + +- :ref:`AABB` **get_aabb** **(** **)** |const| + +Returns the visibility axis-aligned bounding box in local space. See also :ref:`VisualInstance.get_transformed_aabb`. + +---- + +.. _class_MultiMesh_method_get_instance_color: + +- :ref:`Color` **get_instance_color** **(** :ref:`int` instance **)** |const| + +Gets a specific instance's color. + +---- + +.. _class_MultiMesh_method_get_instance_custom_data: + +- :ref:`Color` **get_instance_custom_data** **(** :ref:`int` instance **)** |const| + +Returns the custom data that has been set for a specific instance. + +---- + +.. _class_MultiMesh_method_get_instance_transform: + +- :ref:`Transform` **get_instance_transform** **(** :ref:`int` instance **)** |const| + +Returns the :ref:`Transform` of a specific instance. + +---- + +.. _class_MultiMesh_method_get_instance_transform_2d: + +- :ref:`Transform2D` **get_instance_transform_2d** **(** :ref:`int` instance **)** |const| + +Returns the :ref:`Transform2D` of a specific instance. + +---- + +.. _class_MultiMesh_method_set_as_bulk_array: + +- void **set_as_bulk_array** **(** :ref:`PoolRealArray` array **)** + +Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative. + +All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc... + +:ref:`Transform` is stored as 12 floats, :ref:`Transform2D` is stored as 8 floats, ``COLOR_8BIT`` / ``CUSTOM_DATA_8BIT`` is stored as 1 float (4 bytes as is) and ``COLOR_FLOAT`` / ``CUSTOM_DATA_FLOAT`` is stored as 4 floats. + +---- + +.. _class_MultiMesh_method_set_instance_color: + +- void **set_instance_color** **(** :ref:`int` instance, :ref:`Color` color **)** + +Sets the color of a specific instance by *multiplying* the mesh's existing vertex colors. + +For the color to take effect, ensure that :ref:`color_format` is non-``null`` on the ``MultiMesh`` and :ref:`SpatialMaterial.vertex_color_use_as_albedo` is ``true`` on the material. + +---- + +.. _class_MultiMesh_method_set_instance_custom_data: + +- void **set_instance_custom_data** **(** :ref:`int` instance, :ref:`Color` custom_data **)** + +Sets custom data for a specific instance. Although :ref:`Color` is used, it is just a container for 4 floating point numbers. The format of the number can change depending on the :ref:`CustomDataFormat` used. + +---- + +.. _class_MultiMesh_method_set_instance_transform: + +- void **set_instance_transform** **(** :ref:`int` instance, :ref:`Transform` transform **)** + +Sets the :ref:`Transform` for a specific instance. + +---- + +.. _class_MultiMesh_method_set_instance_transform_2d: + +- void **set_instance_transform_2d** **(** :ref:`int` instance, :ref:`Transform2D` transform **)** + +Sets the :ref:`Transform2D` for a specific instance. + +.. |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.)` diff --git a/classes/class_multimeshinstance.rst b/classes/class_multimeshinstance.rst new file mode 100644 index 0000000..7113c7b --- /dev/null +++ b/classes/class_multimeshinstance.rst @@ -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 MultiMeshInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MultiMeshInstance: + +MultiMeshInstance +================= + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Node that instances a :ref:`MultiMesh`. + +Description +----------- + +``MultiMeshInstance`` is a specialized node to instance :ref:`GeometryInstance`\ s based on a :ref:`MultiMesh` resource. + +This is useful to optimize the rendering of a high amount of instances of a given mesh (for example trees in a forest or grass strands). + +Tutorials +--------- + +- :doc:`../tutorials/performance/vertex_animation/animating_thousands_of_fish` + +- :doc:`../tutorials/3d/using_multi_mesh_instance` + +- :doc:`../tutorials/performance/using_multimesh` + +Properties +---------- + ++-----------------------------------+--------------------------------------------------------------+ +| :ref:`MultiMesh` | :ref:`multimesh` | ++-----------------------------------+--------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_MultiMeshInstance_property_multimesh: + +- :ref:`MultiMesh` **multimesh** + ++----------+----------------------+ +| *Setter* | set_multimesh(value) | ++----------+----------------------+ +| *Getter* | get_multimesh() | ++----------+----------------------+ + +The :ref:`MultiMesh` resource that will be used and shared among all instances of the ``MultiMeshInstance``. + +.. |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.)` diff --git a/classes/class_multimeshinstance2d.rst b/classes/class_multimeshinstance2d.rst new file mode 100644 index 0000000..4a7196c --- /dev/null +++ b/classes/class_multimeshinstance2d.rst @@ -0,0 +1,90 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MultiMeshInstance2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MultiMeshInstance2D: + +MultiMeshInstance2D +=================== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Node that instances a :ref:`MultiMesh` in 2D. + +Description +----------- + +``MultiMeshInstance2D`` is a specialized node to instance a :ref:`MultiMesh` resource in 2D. + +Usage is the same as :ref:`MultiMeshInstance`. + +Properties +---------- + ++-----------------------------------+------------------------------------------------------------------+ +| :ref:`MultiMesh` | :ref:`multimesh` | ++-----------------------------------+------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`normal_map` | ++-----------------------------------+------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`texture` | ++-----------------------------------+------------------------------------------------------------------+ + +Signals +------- + +.. _class_MultiMeshInstance2D_signal_texture_changed: + +- **texture_changed** **(** **)** + +Emitted when the :ref:`texture` is changed. + +Property Descriptions +--------------------- + +.. _class_MultiMeshInstance2D_property_multimesh: + +- :ref:`MultiMesh` **multimesh** + ++----------+----------------------+ +| *Setter* | set_multimesh(value) | ++----------+----------------------+ +| *Getter* | get_multimesh() | ++----------+----------------------+ + +The :ref:`MultiMesh` that will be drawn by the ``MultiMeshInstance2D``. + +---- + +.. _class_MultiMeshInstance2D_property_normal_map: + +- :ref:`Texture` **normal_map** + ++----------+-----------------------+ +| *Setter* | set_normal_map(value) | ++----------+-----------------------+ +| *Getter* | get_normal_map() | ++----------+-----------------------+ + +The normal map that will be used if using the default :ref:`CanvasItemMaterial`. + +**Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_MultiMeshInstance2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The :ref:`Texture` that will be used if using the default :ref:`CanvasItemMaterial`. Can be accessed as ``TEXTURE`` in CanvasItem shader. + +.. |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.)` diff --git a/classes/class_multiplayerapi.rst b/classes/class_multiplayerapi.rst new file mode 100644 index 0000000..2142d42 --- /dev/null +++ b/classes/class_multiplayerapi.rst @@ -0,0 +1,289 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the MultiplayerAPI.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MultiplayerAPI: + +MultiplayerAPI +============== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +High-level multiplayer API. + +Description +----------- + +This class implements most of the logic behind the high-level multiplayer API. See also :ref:`NetworkedMultiplayerPeer`. + +By default, :ref:`SceneTree` has a reference to this class that is used to provide multiplayer capabilities (i.e. RPC/RSET) across the whole scene. + +It is possible to override the MultiplayerAPI instance used by specific Nodes by setting the :ref:`Node.custom_multiplayer` property, effectively allowing to run both client and server in the same scene. + +**Note:** The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. + +Properties +---------- + ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`allow_object_decoding` | ``false`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`NetworkedMultiplayerPeer` | :ref:`network_peer` | | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`refuse_new_network_connections` | ``false`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Node` | :ref:`root_node` | | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_network_connected_peers` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_network_unique_id` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_rpc_sender_id` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_network_peer` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_network_server` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`send_bytes` **(** :ref:`PoolByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2 **)** | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_MultiplayerAPI_signal_connected_to_server: + +- **connected_to_server** **(** **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` successfully connected to a server. Only emitted on clients. + +---- + +.. _class_MultiplayerAPI_signal_connection_failed: + +- **connection_failed** **(** **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` fails to establish a connection to a server. Only emitted on clients. + +---- + +.. _class_MultiplayerAPI_signal_network_peer_connected: + +- **network_peer_connected** **(** :ref:`int` id **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). + +---- + +.. _class_MultiplayerAPI_signal_network_peer_disconnected: + +- **network_peer_disconnected** **(** :ref:`int` id **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` disconnects from a peer. Clients get notified when other clients disconnect from the same server. + +---- + +.. _class_MultiplayerAPI_signal_network_peer_packet: + +- **network_peer_packet** **(** :ref:`int` id, :ref:`PoolByteArray` packet **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` receive a ``packet`` with custom data (see :ref:`send_bytes`). ID is the peer ID of the peer that sent the packet. + +---- + +.. _class_MultiplayerAPI_signal_server_disconnected: + +- **server_disconnected** **(** **)** + +Emitted when this MultiplayerAPI's :ref:`network_peer` disconnects from server. Only emitted on clients. + +Enumerations +------------ + +.. _enum_MultiplayerAPI_RPCMode: + +.. _class_MultiplayerAPI_constant_RPC_MODE_DISABLED: + +.. _class_MultiplayerAPI_constant_RPC_MODE_REMOTE: + +.. _class_MultiplayerAPI_constant_RPC_MODE_MASTER: + +.. _class_MultiplayerAPI_constant_RPC_MODE_PUPPET: + +.. _class_MultiplayerAPI_constant_RPC_MODE_SLAVE: + +.. _class_MultiplayerAPI_constant_RPC_MODE_REMOTESYNC: + +.. _class_MultiplayerAPI_constant_RPC_MODE_SYNC: + +.. _class_MultiplayerAPI_constant_RPC_MODE_MASTERSYNC: + +.. _class_MultiplayerAPI_constant_RPC_MODE_PUPPETSYNC: + +enum **RPCMode**: + +- **RPC_MODE_DISABLED** = **0** --- Used with :ref:`Node.rpc_config` or :ref:`Node.rset_config` to disable a method or property for all RPC calls, making it unavailable. Default for all methods. + +- **RPC_MODE_REMOTE** = **1** --- Used with :ref:`Node.rpc_config` or :ref:`Node.rset_config` to set a method to be called or a property to be changed only on the remote end, not locally. Analogous to the ``remote`` keyword. Calls and property changes are accepted from all remote peers, no matter if they are node's master or puppets. + +- **RPC_MODE_MASTER** = **2** --- Used with :ref:`Node.rpc_config` or :ref:`Node.rset_config` to set a method to be called or a property to be changed only on the network master for this node. Analogous to the ``master`` keyword. Only accepts calls or property changes from the node's network puppets, see :ref:`Node.set_network_master`. + +- **RPC_MODE_PUPPET** = **3** --- Used with :ref:`Node.rpc_config` or :ref:`Node.rset_config` to set a method to be called or a property to be changed only on puppets for this node. Analogous to the ``puppet`` keyword. Only accepts calls or property changes from the node's network master, see :ref:`Node.set_network_master`. + +- **RPC_MODE_SLAVE** = **3** --- *Deprecated.* Use :ref:`RPC_MODE_PUPPET` instead. Analogous to the ``slave`` keyword. + +- **RPC_MODE_REMOTESYNC** = **4** --- Behave like :ref:`RPC_MODE_REMOTE` but also make the call or property change locally. Analogous to the ``remotesync`` keyword. + +- **RPC_MODE_SYNC** = **4** --- *Deprecated.* Use :ref:`RPC_MODE_REMOTESYNC` instead. Analogous to the ``sync`` keyword. + +- **RPC_MODE_MASTERSYNC** = **5** --- Behave like :ref:`RPC_MODE_MASTER` but also make the call or property change locally. Analogous to the ``mastersync`` keyword. + +- **RPC_MODE_PUPPETSYNC** = **6** --- Behave like :ref:`RPC_MODE_PUPPET` but also make the call or property change locally. Analogous to the ``puppetsync`` keyword. + +Property Descriptions +--------------------- + +.. _class_MultiplayerAPI_property_allow_object_decoding: + +- :ref:`bool` **allow_object_decoding** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_allow_object_decoding(value) | ++-----------+----------------------------------+ +| *Getter* | is_object_decoding_allowed() | ++-----------+----------------------------------+ + +If ``true`` (or if the :ref:`network_peer` has :ref:`PacketPeer.allow_object_decoding` set to ``true``), the MultiplayerAPI will allow encoding and decoding of object during RPCs/RSETs. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_MultiplayerAPI_property_network_peer: + +- :ref:`NetworkedMultiplayerPeer` **network_peer** + ++----------+-------------------------+ +| *Setter* | set_network_peer(value) | ++----------+-------------------------+ +| *Getter* | get_network_peer() | ++----------+-------------------------+ + +The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the MultiplayerAPI will become a network server (check with :ref:`is_network_server`) and will set root node's network mode to master, or it will become a regular peer with root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to MultiplayerAPI's signals. + +---- + +.. _class_MultiplayerAPI_property_refuse_new_network_connections: + +- :ref:`bool` **refuse_new_network_connections** + ++-----------+-------------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------------+ +| *Setter* | set_refuse_new_network_connections(value) | ++-----------+-------------------------------------------+ +| *Getter* | is_refusing_new_network_connections() | ++-----------+-------------------------------------------+ + +If ``true``, the MultiplayerAPI's :ref:`network_peer` refuses new incoming connections. + +---- + +.. _class_MultiplayerAPI_property_root_node: + +- :ref:`Node` **root_node** + ++----------+----------------------+ +| *Setter* | set_root_node(value) | ++----------+----------------------+ +| *Getter* | get_root_node() | ++----------+----------------------+ + +The root node to use for RPCs. Instead of an absolute path, a relative path will be used to find the node upon which the RPC should be executed. + +This effectively allows to have different branches of the scene tree to be managed by different MultiplayerAPI, allowing for example to run both client and server in the same scene. + +Method Descriptions +------------------- + +.. _class_MultiplayerAPI_method_clear: + +- void **clear** **(** **)** + +Clears the current MultiplayerAPI network state (you shouldn't call this unless you know what you are doing). + +---- + +.. _class_MultiplayerAPI_method_get_network_connected_peers: + +- :ref:`PoolIntArray` **get_network_connected_peers** **(** **)** |const| + +Returns the peer IDs of all connected peers of this MultiplayerAPI's :ref:`network_peer`. + +---- + +.. _class_MultiplayerAPI_method_get_network_unique_id: + +- :ref:`int` **get_network_unique_id** **(** **)** |const| + +Returns the unique peer ID of this MultiplayerAPI's :ref:`network_peer`. + +---- + +.. _class_MultiplayerAPI_method_get_rpc_sender_id: + +- :ref:`int` **get_rpc_sender_id** **(** **)** |const| + +Returns the sender's peer ID for the RPC currently being executed. + +**Note:** If not inside an RPC this method will return 0. + +---- + +.. _class_MultiplayerAPI_method_has_network_peer: + +- :ref:`bool` **has_network_peer** **(** **)** |const| + +Returns ``true`` if there is a :ref:`network_peer` set. + +---- + +.. _class_MultiplayerAPI_method_is_network_server: + +- :ref:`bool` **is_network_server** **(** **)** |const| + +Returns ``true`` if this MultiplayerAPI's :ref:`network_peer` is in server mode (listening for connections). + +---- + +.. _class_MultiplayerAPI_method_poll: + +- void **poll** **(** **)** + +Method used for polling the MultiplayerAPI. You only need to worry about this if you are using :ref:`Node.custom_multiplayer` override or you set :ref:`SceneTree.multiplayer_poll` to ``false``. By default, :ref:`SceneTree` will poll its MultiplayerAPI for you. + +**Note:** This method results in RPCs and RSETs being called, so they will be executed in the same context of this function (e.g. ``_process``, ``physics``, :ref:`Thread`). + +---- + +.. _class_MultiplayerAPI_method_send_bytes: + +- :ref:`Error` **send_bytes** **(** :ref:`PoolByteArray` bytes, :ref:`int` id=0, :ref:`TransferMode` mode=2 **)** + +Sends the given raw ``bytes`` to a specific peer identified by ``id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Default ID is ``0``, i.e. broadcast to all peers. + +.. |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.)` diff --git a/classes/class_multiplayerpeergdnative.rst b/classes/class_multiplayerpeergdnative.rst new file mode 100644 index 0000000..7e38291 --- /dev/null +++ b/classes/class_multiplayerpeergdnative.rst @@ -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 MultiplayerPeerGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_MultiplayerPeerGDNative: + +MultiplayerPeerGDNative +======================= + +**Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_mutex.rst b/classes/class_mutex.rst new file mode 100644 index 0000000..eedfac8 --- /dev/null +++ b/classes/class_mutex.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Mutex.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Mutex: + +Mutex +===== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A synchronization mutex (mutual exclusion). + +Description +----------- + +A synchronization mutex (mutual exclusion). This is used to synchronize multiple :ref:`Thread`\ s, and is equivalent to a binary :ref:`Semaphore`. It guarantees that only one thread can ever acquire the lock at a time. A mutex can be used to protect a critical section; however, be careful to avoid deadlocks. + +Tutorials +--------- + +- :doc:`../tutorials/performance/threads/using_multiple_threads` + +Methods +------- + ++---------------------------------------+----------------------------------------------------------+ +| void | :ref:`lock` **(** **)** | ++---------------------------------------+----------------------------------------------------------+ +| :ref:`Error` | :ref:`try_lock` **(** **)** | ++---------------------------------------+----------------------------------------------------------+ +| void | :ref:`unlock` **(** **)** | ++---------------------------------------+----------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Mutex_method_lock: + +- void **lock** **(** **)** + +Locks this ``Mutex``, blocks until it is unlocked by the current owner. + +**Note:** This function returns without blocking if the thread already has ownership of the mutex. + +---- + +.. _class_Mutex_method_try_lock: + +- :ref:`Error` **try_lock** **(** **)** + +Tries locking this ``Mutex``, but does not block. Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_BUSY` otherwise. + +**Note:** This function returns :ref:`@GlobalScope.OK` if the thread already has ownership of the mutex. + +---- + +.. _class_Mutex_method_unlock: + +- void **unlock** **(** **)** + +Unlocks this ``Mutex``, leaving it to other threads. + +**Note:** If a thread called :ref:`lock` or :ref:`try_lock` multiple times while already having ownership of the mutex, it must also call :ref:`unlock` the same number of times in order to unlock it correctly. + +.. |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.)` diff --git a/classes/class_nativescript.rst b/classes/class_nativescript.rst new file mode 100644 index 0000000..e257bde --- /dev/null +++ b/classes/class_nativescript.rst @@ -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 NativeScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NativeScript: + +NativeScript +============ + +**Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`class_name` | ``""`` | ++-----------------------------------------------+-----------------------------------------------------------------------------------+--------+ +| :ref:`GDNativeLibrary` | :ref:`library` | | ++-----------------------------------------------+-----------------------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`script_class_icon_path` | ``""`` | ++-----------------------------------------------+-----------------------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`script_class_name` | ``""`` | ++-----------------------------------------------+-----------------------------------------------------------------------------------+--------+ + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_class_documentation` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_method_documentation` **(** :ref:`String` method **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_property_documentation` **(** :ref:`String` path **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_signal_documentation` **(** :ref:`String` signal_name **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`new` **(** ... **)** |vararg| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_NativeScript_property_class_name: + +- :ref:`String` **class_name** + ++-----------+-----------------------+ +| *Default* | ``""`` | ++-----------+-----------------------+ +| *Setter* | set_class_name(value) | ++-----------+-----------------------+ +| *Getter* | get_class_name() | ++-----------+-----------------------+ + +---- + +.. _class_NativeScript_property_library: + +- :ref:`GDNativeLibrary` **library** + ++----------+--------------------+ +| *Setter* | set_library(value) | ++----------+--------------------+ +| *Getter* | get_library() | ++----------+--------------------+ + +---- + +.. _class_NativeScript_property_script_class_icon_path: + +- :ref:`String` **script_class_icon_path** + ++-----------+-----------------------------------+ +| *Default* | ``""`` | ++-----------+-----------------------------------+ +| *Setter* | set_script_class_icon_path(value) | ++-----------+-----------------------------------+ +| *Getter* | get_script_class_icon_path() | ++-----------+-----------------------------------+ + +---- + +.. _class_NativeScript_property_script_class_name: + +- :ref:`String` **script_class_name** + ++-----------+------------------------------+ +| *Default* | ``""`` | ++-----------+------------------------------+ +| *Setter* | set_script_class_name(value) | ++-----------+------------------------------+ +| *Getter* | get_script_class_name() | ++-----------+------------------------------+ + +Method Descriptions +------------------- + +.. _class_NativeScript_method_get_class_documentation: + +- :ref:`String` **get_class_documentation** **(** **)** |const| + +Returns the documentation string that was previously set with ``godot_nativescript_set_class_documentation``. + +---- + +.. _class_NativeScript_method_get_method_documentation: + +- :ref:`String` **get_method_documentation** **(** :ref:`String` method **)** |const| + +Returns the documentation string that was previously set with ``godot_nativescript_set_method_documentation``. + +---- + +.. _class_NativeScript_method_get_property_documentation: + +- :ref:`String` **get_property_documentation** **(** :ref:`String` path **)** |const| + +Returns the documentation string that was previously set with ``godot_nativescript_set_property_documentation``. + +---- + +.. _class_NativeScript_method_get_signal_documentation: + +- :ref:`String` **get_signal_documentation** **(** :ref:`String` signal_name **)** |const| + +Returns the documentation string that was previously set with ``godot_nativescript_set_signal_documentation``. + +---- + +.. _class_NativeScript_method_new: + +- :ref:`Variant` **new** **(** ... **)** |vararg| + +Constructs a new object of the base type with a script of this type already attached. + +**Note:** Any arguments passed to this function will be ignored and not passed to the native constructor function. This will change with in a future API extension. + +.. |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.)` diff --git a/classes/class_navigation.rst b/classes/class_navigation.rst new file mode 100644 index 0000000..77c2595 --- /dev/null +++ b/classes/class_navigation.rst @@ -0,0 +1,142 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Navigation.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Navigation: + +Navigation +========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Mesh-based navigation and pathfinding node. + +Description +----------- + +Provides navigation and pathfinding within a collection of :ref:`NavigationMesh`\ es. By default, these will be automatically collected from child :ref:`NavigationMeshInstance` nodes, but they can also be added on the fly with :ref:`navmesh_add`. In addition to basic pathfinding, this class also assists with aligning navigation agents with the meshes they are navigating on. + +**Note:** The current navigation system has many known issues and will not always return optimal paths as expected. These issues will be fixed in Godot 4.0. + +Tutorials +--------- + +- `3D Navmesh Demo `__ + +Properties +---------- + ++-------------------------------+-------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`up_vector` | ``Vector3( 0, 1, 0 )`` | ++-------------------------------+-------------------------------------------------------+------------------------+ + +Methods +------- + ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point` **(** :ref:`Vector3` to_point **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point_normal` **(** :ref:`Vector3` to_point **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_closest_point_owner` **(** :ref:`Vector3` to_point **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_closest_point_to_segment` **(** :ref:`Vector3` start, :ref:`Vector3` end, :ref:`bool` use_collision=false **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_simple_path` **(** :ref:`Vector3` start, :ref:`Vector3` end, :ref:`bool` optimize=true **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`navmesh_add` **(** :ref:`NavigationMesh` mesh, :ref:`Transform` xform, :ref:`Object` owner=null **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`navmesh_remove` **(** :ref:`int` id **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`navmesh_set_transform` **(** :ref:`int` id, :ref:`Transform` xform **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Navigation_property_up_vector: + +- :ref:`Vector3` **up_vector** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 1, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_up_vector(value) | ++-----------+------------------------+ +| *Getter* | get_up_vector() | ++-----------+------------------------+ + +Defines which direction is up. By default, this is ``(0, 1, 0)``, which is the world's "up" direction. + +Method Descriptions +------------------- + +.. _class_Navigation_method_get_closest_point: + +- :ref:`Vector3` **get_closest_point** **(** :ref:`Vector3` to_point **)** + +Returns the navigation point closest to the point given. Points are in local coordinate space. + +---- + +.. _class_Navigation_method_get_closest_point_normal: + +- :ref:`Vector3` **get_closest_point_normal** **(** :ref:`Vector3` to_point **)** + +Returns the surface normal at the navigation point closest to the point given. Useful for rotating a navigation agent according to the navigation mesh it moves on. + +---- + +.. _class_Navigation_method_get_closest_point_owner: + +- :ref:`Object` **get_closest_point_owner** **(** :ref:`Vector3` to_point **)** + +Returns the owner of the :ref:`NavigationMesh` which contains the navigation point closest to the point given. This is usually a :ref:`NavigationMeshInstance`. For meshes added via :ref:`navmesh_add`, returns the owner that was given (or ``null`` if the ``owner`` parameter was omitted). + +---- + +.. _class_Navigation_method_get_closest_point_to_segment: + +- :ref:`Vector3` **get_closest_point_to_segment** **(** :ref:`Vector3` start, :ref:`Vector3` end, :ref:`bool` use_collision=false **)** + +Returns the navigation point closest to the given line segment. When enabling ``use_collision``, only considers intersection points between segment and navigation meshes. If multiple intersection points are found, the one closest to the segment start point is returned. + +---- + +.. _class_Navigation_method_get_simple_path: + +- :ref:`PoolVector3Array` **get_simple_path** **(** :ref:`Vector3` start, :ref:`Vector3` end, :ref:`bool` optimize=true **)** + +Returns the path between two given points. Points are in local coordinate space. If ``optimize`` is ``true`` (the default), the agent properties associated with each :ref:`NavigationMesh` (radius, height, etc.) are considered in the path calculation, otherwise they are ignored. + +**Note:** This method has known issues and will often return non-optimal paths. These issues will be fixed in Godot 4.0. + +---- + +.. _class_Navigation_method_navmesh_add: + +- :ref:`int` **navmesh_add** **(** :ref:`NavigationMesh` mesh, :ref:`Transform` xform, :ref:`Object` owner=null **)** + +Adds a :ref:`NavigationMesh`. Returns an ID for use with :ref:`navmesh_remove` or :ref:`navmesh_set_transform`. If given, a :ref:`Transform2D` is applied to the polygon. The optional ``owner`` is used as return value for :ref:`get_closest_point_owner`. + +---- + +.. _class_Navigation_method_navmesh_remove: + +- void **navmesh_remove** **(** :ref:`int` id **)** + +Removes the :ref:`NavigationMesh` with the given ID. + +---- + +.. _class_Navigation_method_navmesh_set_transform: + +- void **navmesh_set_transform** **(** :ref:`int` id, :ref:`Transform` xform **)** + +Sets the transform applied to the :ref:`NavigationMesh` with the given ID. + +.. |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.)` diff --git a/classes/class_navigation2d.rst b/classes/class_navigation2d.rst new file mode 100644 index 0000000..43f6875 --- /dev/null +++ b/classes/class_navigation2d.rst @@ -0,0 +1,98 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Navigation2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Navigation2D: + +Navigation2D +============ + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +2D navigation and pathfinding node. + +Description +----------- + +Navigation2D provides navigation and pathfinding within a 2D area, specified as a collection of :ref:`NavigationPolygon` resources. By default, these are automatically collected from child :ref:`NavigationPolygonInstance` nodes, but they can also be added on the fly with :ref:`navpoly_add`. + +**Note:** The current navigation system has many known issues and will not always return optimal paths as expected. These issues will be fixed in Godot 4.0. + +Tutorials +--------- + +- `2D Navigation Demo `__ + +Methods +------- + ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point` **(** :ref:`Vector2` to_point **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_closest_point_owner` **(** :ref:`Vector2` to_point **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_simple_path` **(** :ref:`Vector2` start, :ref:`Vector2` end, :ref:`bool` optimize=true **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`navpoly_add` **(** :ref:`NavigationPolygon` mesh, :ref:`Transform2D` xform, :ref:`Object` owner=null **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`navpoly_remove` **(** :ref:`int` id **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`navpoly_set_transform` **(** :ref:`int` id, :ref:`Transform2D` xform **)** | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Navigation2D_method_get_closest_point: + +- :ref:`Vector2` **get_closest_point** **(** :ref:`Vector2` to_point **)** + +Returns the navigation point closest to the point given. Points are in local coordinate space. + +---- + +.. _class_Navigation2D_method_get_closest_point_owner: + +- :ref:`Object` **get_closest_point_owner** **(** :ref:`Vector2` to_point **)** + +Returns the owner of the :ref:`NavigationPolygon` which contains the navigation point closest to the point given. This is usually a :ref:`NavigationPolygonInstance`. For polygons added via :ref:`navpoly_add`, returns the owner that was given (or ``null`` if the ``owner`` parameter was omitted). + +---- + +.. _class_Navigation2D_method_get_simple_path: + +- :ref:`PoolVector2Array` **get_simple_path** **(** :ref:`Vector2` start, :ref:`Vector2` end, :ref:`bool` optimize=true **)** + +Returns the path between two given points. Points are in local coordinate space. If ``optimize`` is ``true`` (the default), the path is smoothed by merging path segments where possible. + +**Note:** This method has known issues and will often return non-optimal paths. These issues will be fixed in Godot 4.0. + +---- + +.. _class_Navigation2D_method_navpoly_add: + +- :ref:`int` **navpoly_add** **(** :ref:`NavigationPolygon` mesh, :ref:`Transform2D` xform, :ref:`Object` owner=null **)** + +Adds a :ref:`NavigationPolygon`. Returns an ID for use with :ref:`navpoly_remove` or :ref:`navpoly_set_transform`. If given, a :ref:`Transform2D` is applied to the polygon. The optional ``owner`` is used as return value for :ref:`get_closest_point_owner`. + +---- + +.. _class_Navigation2D_method_navpoly_remove: + +- void **navpoly_remove** **(** :ref:`int` id **)** + +Removes the :ref:`NavigationPolygon` with the given ID. + +---- + +.. _class_Navigation2D_method_navpoly_set_transform: + +- void **navpoly_set_transform** **(** :ref:`int` id, :ref:`Transform2D` xform **)** + +Sets the transform applied to the :ref:`NavigationPolygon` with the given ID. + +.. |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.)` diff --git a/classes/class_navigationmesh.rst b/classes/class_navigationmesh.rst new file mode 100644 index 0000000..beb4d39 --- /dev/null +++ b/classes/class_navigationmesh.rst @@ -0,0 +1,589 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NavigationMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NavigationMesh: + +NavigationMesh +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A mesh to approximate the walkable areas and obstacles. + +Description +----------- + +A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces. + +Tutorials +--------- + +- `3D Navmesh Demo `__ + +Properties +---------- + ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`agent/height` | ``2.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`agent/max_climb` | ``0.9`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`agent/max_slope` | ``45.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`agent/radius` | ``0.6`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`cell/height` | ``0.2`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`cell/size` | ``0.3`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`detail/sample_distance` | ``6.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`detail/sample_max_error` | ``1.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`edge/max_error` | ``1.3`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`edge/max_length` | ``12.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`filter/filter_walkable_low_height_spans` | ``false`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`filter/ledge_spans` | ``false`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`filter/low_hanging_obstacles` | ``false`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`geometry/collision_mask` | | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`ParsedGeometryType` | :ref:`geometry/parsed_geometry_type` | ``0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`SourceGeometryMode` | :ref:`geometry/source_geometry_mode` | ``0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`geometry/source_group_name` | | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`polygon/verts_per_poly` | ``6.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`region/merge_size` | ``20.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`region/min_size` | ``8.0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ +| :ref:`SamplePartitionType` | :ref:`sample_partition_type/sample_partition_type` | ``0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_polygon` **(** :ref:`PoolIntArray` polygon **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_polygons` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from_mesh` **(** :ref:`Mesh` mesh **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_polygon` **(** :ref:`int` idx **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_polygon_count` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`get_vertices` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertices` **(** :ref:`PoolVector3Array` vertices **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_NavigationMesh_SamplePartitionType: + +.. _class_NavigationMesh_constant_SAMPLE_PARTITION_WATERSHED: + +.. _class_NavigationMesh_constant_SAMPLE_PARTITION_MONOTONE: + +.. _class_NavigationMesh_constant_SAMPLE_PARTITION_LAYERS: + +.. _class_NavigationMesh_constant_SAMPLE_PARTITION_MAX: + +enum **SamplePartitionType**: + +- **SAMPLE_PARTITION_WATERSHED** = **0** --- Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas. + +- **SAMPLE_PARTITION_MONOTONE** = **1** --- Monotone partitioning. Use this if you want fast navigation mesh generation. + +- **SAMPLE_PARTITION_LAYERS** = **2** --- Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles. + +- **SAMPLE_PARTITION_MAX** = **3** --- Represents the size of the :ref:`SamplePartitionType` enum. + +---- + +.. _enum_NavigationMesh_ParsedGeometryType: + +.. _class_NavigationMesh_constant_PARSED_GEOMETRY_MESH_INSTANCES: + +.. _class_NavigationMesh_constant_PARSED_GEOMETRY_STATIC_COLLIDERS: + +.. _class_NavigationMesh_constant_PARSED_GEOMETRY_BOTH: + +.. _class_NavigationMesh_constant_PARSED_GEOMETRY_MAX: + +enum **ParsedGeometryType**: + +- **PARSED_GEOMETRY_MESH_INSTANCES** = **0** --- Parses mesh instances as geometry. This includes :ref:`MeshInstance`, :ref:`CSGShape`, and :ref:`GridMap` nodes. + +- **PARSED_GEOMETRY_STATIC_COLLIDERS** = **1** --- Parses :ref:`StaticBody` colliders as geometry. The collider should be in any of the layers specified by :ref:`geometry/collision_mask`. + +- **PARSED_GEOMETRY_BOTH** = **2** --- Both :ref:`PARSED_GEOMETRY_MESH_INSTANCES` and :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS`. + +- **PARSED_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`ParsedGeometryType` enum. + +---- + +.. _enum_NavigationMesh_SourceGeometryMode: + +.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_NAVMESH_CHILDREN: + +.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN: + +.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_GROUPS_EXPLICIT: + +.. _class_NavigationMesh_constant_SOURCE_GEOMETRY_MAX: + +enum **SourceGeometryMode**: + +- **SOURCE_GEOMETRY_NAVMESH_CHILDREN** = **0** --- Scans the child nodes of :ref:`NavigationMeshInstance` recursively for geometry. + +- **SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN** = **1** --- Scans nodes in a group and their child nodes recursively for geometry. The group is specified by :ref:`geometry/source_group_name`. + +- **SOURCE_GEOMETRY_GROUPS_EXPLICIT** = **2** --- Uses nodes in a group for geometry. The group is specified by :ref:`geometry/source_group_name`. + +- **SOURCE_GEOMETRY_MAX** = **3** --- Represents the size of the :ref:`SourceGeometryMode` enum. + +Property Descriptions +--------------------- + +.. _class_NavigationMesh_property_agent/height: + +- :ref:`float` **agent/height** + ++-----------+-------------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------------+ +| *Setter* | set_agent_height(value) | ++-----------+-------------------------+ +| *Getter* | get_agent_height() | ++-----------+-------------------------+ + +The minimum floor to ceiling height that will still allow the floor area to be considered walkable. + +**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/height`. + +---- + +.. _class_NavigationMesh_property_agent/max_climb: + +- :ref:`float` **agent/max_climb** + ++-----------+----------------------------+ +| *Default* | ``0.9`` | ++-----------+----------------------------+ +| *Setter* | set_agent_max_climb(value) | ++-----------+----------------------------+ +| *Getter* | get_agent_max_climb() | ++-----------+----------------------------+ + +The minimum ledge height that is considered to still be traversable. + +**Note:** While baking, this value will be rounded down to the nearest multiple of :ref:`cell/height`. + +---- + +.. _class_NavigationMesh_property_agent/max_slope: + +- :ref:`float` **agent/max_slope** + ++-----------+----------------------------+ +| *Default* | ``45.0`` | ++-----------+----------------------------+ +| *Setter* | set_agent_max_slope(value) | ++-----------+----------------------------+ +| *Getter* | get_agent_max_slope() | ++-----------+----------------------------+ + +The maximum slope that is considered walkable, in degrees. + +---- + +.. _class_NavigationMesh_property_agent/radius: + +- :ref:`float` **agent/radius** + ++-----------+-------------------------+ +| *Default* | ``0.6`` | ++-----------+-------------------------+ +| *Setter* | set_agent_radius(value) | ++-----------+-------------------------+ +| *Getter* | get_agent_radius() | ++-----------+-------------------------+ + +The distance to erode/shrink the walkable area of the heightfield away from obstructions. + +**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size`. + +---- + +.. _class_NavigationMesh_property_cell/height: + +- :ref:`float` **cell/height** + ++-----------+------------------------+ +| *Default* | ``0.2`` | ++-----------+------------------------+ +| *Setter* | set_cell_height(value) | ++-----------+------------------------+ +| *Getter* | get_cell_height() | ++-----------+------------------------+ + +The Y axis cell size to use for fields. + +---- + +.. _class_NavigationMesh_property_cell/size: + +- :ref:`float` **cell/size** + ++-----------+----------------------+ +| *Default* | ``0.3`` | ++-----------+----------------------+ +| *Setter* | set_cell_size(value) | ++-----------+----------------------+ +| *Getter* | get_cell_size() | ++-----------+----------------------+ + +The XZ plane cell size to use for fields. + +---- + +.. _class_NavigationMesh_property_detail/sample_distance: + +- :ref:`float` **detail/sample_distance** + ++-----------+-----------------------------------+ +| *Default* | ``6.0`` | ++-----------+-----------------------------------+ +| *Setter* | set_detail_sample_distance(value) | ++-----------+-----------------------------------+ +| *Getter* | get_detail_sample_distance() | ++-----------+-----------------------------------+ + +The sampling distance to use when generating the detail mesh, in cell unit. + +---- + +.. _class_NavigationMesh_property_detail/sample_max_error: + +- :ref:`float` **detail/sample_max_error** + ++-----------+------------------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------------------+ +| *Setter* | set_detail_sample_max_error(value) | ++-----------+------------------------------------+ +| *Getter* | get_detail_sample_max_error() | ++-----------+------------------------------------+ + +The maximum distance the detail mesh surface should deviate from heightfield, in cell unit. + +---- + +.. _class_NavigationMesh_property_edge/max_error: + +- :ref:`float` **edge/max_error** + ++-----------+---------------------------+ +| *Default* | ``1.3`` | ++-----------+---------------------------+ +| *Setter* | set_edge_max_error(value) | ++-----------+---------------------------+ +| *Getter* | get_edge_max_error() | ++-----------+---------------------------+ + +The maximum distance a simplfied contour's border edges should deviate the original raw contour. + +---- + +.. _class_NavigationMesh_property_edge/max_length: + +- :ref:`float` **edge/max_length** + ++-----------+----------------------------+ +| *Default* | ``12.0`` | ++-----------+----------------------------+ +| *Setter* | set_edge_max_length(value) | ++-----------+----------------------------+ +| *Getter* | get_edge_max_length() | ++-----------+----------------------------+ + +The maximum allowed length for contour edges along the border of the mesh. + +**Note:** While baking, this value will be rounded up to the nearest multiple of :ref:`cell/size`. + +---- + +.. _class_NavigationMesh_property_filter/filter_walkable_low_height_spans: + +- :ref:`bool` **filter/filter_walkable_low_height_spans** + ++-----------+---------------------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------------------+ +| *Setter* | set_filter_walkable_low_height_spans(value) | ++-----------+---------------------------------------------+ +| *Getter* | get_filter_walkable_low_height_spans() | ++-----------+---------------------------------------------+ + +If ``true``, marks walkable spans as not walkable if the clearance above the span is less than :ref:`agent/height`. + +---- + +.. _class_NavigationMesh_property_filter/ledge_spans: + +- :ref:`bool` **filter/ledge_spans** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_filter_ledge_spans(value) | ++-----------+-------------------------------+ +| *Getter* | get_filter_ledge_spans() | ++-----------+-------------------------------+ + +If ``true``, marks spans that are ledges as non-walkable. + +---- + +.. _class_NavigationMesh_property_filter/low_hanging_obstacles: + +- :ref:`bool` **filter/low_hanging_obstacles** + ++-----------+-----------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------+ +| *Setter* | set_filter_low_hanging_obstacles(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_filter_low_hanging_obstacles() | ++-----------+-----------------------------------------+ + +If ``true``, marks non-walkable spans as walkable if their maximum is within :ref:`agent/max_climb` of a walkable neighbor. + +---- + +.. _class_NavigationMesh_property_geometry/collision_mask: + +- :ref:`int` **geometry/collision_mask** + ++----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++----------+---------------------------+ +| *Getter* | get_collision_mask() | ++----------+---------------------------+ + +The physics layers to scan for static colliders. + +Only used when :ref:`geometry/parsed_geometry_type` is :ref:`PARSED_GEOMETRY_STATIC_COLLIDERS` or :ref:`PARSED_GEOMETRY_BOTH`. + +---- + +.. _class_NavigationMesh_property_geometry/parsed_geometry_type: + +- :ref:`ParsedGeometryType` **geometry/parsed_geometry_type** + ++-----------+---------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------+ +| *Setter* | set_parsed_geometry_type(value) | ++-----------+---------------------------------+ +| *Getter* | get_parsed_geometry_type() | ++-----------+---------------------------------+ + +Determines which type of nodes will be parsed as geometry. See :ref:`ParsedGeometryType` for possible values. + +---- + +.. _class_NavigationMesh_property_geometry/source_geometry_mode: + +- :ref:`SourceGeometryMode` **geometry/source_geometry_mode** + ++-----------+---------------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------------+ +| *Setter* | set_source_geometry_mode(value) | ++-----------+---------------------------------+ +| *Getter* | get_source_geometry_mode() | ++-----------+---------------------------------+ + +The source of the geometry used when baking. See :ref:`SourceGeometryMode` for possible values. + +---- + +.. _class_NavigationMesh_property_geometry/source_group_name: + +- :ref:`String` **geometry/source_group_name** + ++----------+------------------------------+ +| *Setter* | set_source_group_name(value) | ++----------+------------------------------+ +| *Getter* | get_source_group_name() | ++----------+------------------------------+ + +The name of the group to scan for geometry. + +Only used when :ref:`geometry/source_geometry_mode` is :ref:`SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN` or :ref:`SOURCE_GEOMETRY_GROUPS_EXPLICIT`. + +---- + +.. _class_NavigationMesh_property_polygon/verts_per_poly: + +- :ref:`float` **polygon/verts_per_poly** + ++-----------+---------------------------+ +| *Default* | ``6.0`` | ++-----------+---------------------------+ +| *Setter* | set_verts_per_poly(value) | ++-----------+---------------------------+ +| *Getter* | get_verts_per_poly() | ++-----------+---------------------------+ + +The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process. + +---- + +.. _class_NavigationMesh_property_region/merge_size: + +- :ref:`float` **region/merge_size** + ++-----------+------------------------------+ +| *Default* | ``20.0`` | ++-----------+------------------------------+ +| *Setter* | set_region_merge_size(value) | ++-----------+------------------------------+ +| *Getter* | get_region_merge_size() | ++-----------+------------------------------+ + +Any regions with a size smaller than this will be merged with larger regions if possible. + +**Note:** This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400. + +---- + +.. _class_NavigationMesh_property_region/min_size: + +- :ref:`float` **region/min_size** + ++-----------+----------------------------+ +| *Default* | ``8.0`` | ++-----------+----------------------------+ +| *Setter* | set_region_min_size(value) | ++-----------+----------------------------+ +| *Getter* | get_region_min_size() | ++-----------+----------------------------+ + +The minimum size of a region for it to be created. + +**Note:** This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64. + +---- + +.. _class_NavigationMesh_property_sample_partition_type/sample_partition_type: + +- :ref:`SamplePartitionType` **sample_partition_type/sample_partition_type** + ++-----------+----------------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------------+ +| *Setter* | set_sample_partition_type(value) | ++-----------+----------------------------------+ +| *Getter* | get_sample_partition_type() | ++-----------+----------------------------------+ + +Partitioning algorithm for creating the navigation mesh polys. See :ref:`SamplePartitionType` for possible values. + +Method Descriptions +------------------- + +.. _class_NavigationMesh_method_add_polygon: + +- void **add_polygon** **(** :ref:`PoolIntArray` polygon **)** + +Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices`. + +---- + +.. _class_NavigationMesh_method_clear_polygons: + +- void **clear_polygons** **(** **)** + +Clears the array of polygons, but it doesn't clear the array of vertices. + +---- + +.. _class_NavigationMesh_method_create_from_mesh: + +- void **create_from_mesh** **(** :ref:`Mesh` mesh **)** + +Initializes the navigation mesh by setting the vertices and indices according to a :ref:`Mesh`. + +---- + +.. _class_NavigationMesh_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns whether the specified ``bit`` of the :ref:`geometry/collision_mask` is set. + +---- + +.. _class_NavigationMesh_method_get_polygon: + +- :ref:`PoolIntArray` **get_polygon** **(** :ref:`int` idx **)** + +Returns a :ref:`PoolIntArray` containing the indices of the vertices of a created polygon. + +---- + +.. _class_NavigationMesh_method_get_polygon_count: + +- :ref:`int` **get_polygon_count** **(** **)** |const| + +Returns the number of polygons in the navigation mesh. + +---- + +.. _class_NavigationMesh_method_get_vertices: + +- :ref:`PoolVector3Array` **get_vertices** **(** **)** |const| + +Returns a :ref:`PoolVector3Array` containing all the vertices being used to create the polygons. + +---- + +.. _class_NavigationMesh_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +If ``value`` is ``true``, sets the specified ``bit`` in the :ref:`geometry/collision_mask`. + +If ``value`` is ``false``, clears the specified ``bit`` in the :ref:`geometry/collision_mask`. + +---- + +.. _class_NavigationMesh_method_set_vertices: + +- void **set_vertices** **(** :ref:`PoolVector3Array` vertices **)** + +Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon` method. + +.. |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.)` diff --git a/classes/class_navigationmeshinstance.rst b/classes/class_navigationmeshinstance.rst new file mode 100644 index 0000000..998a818 --- /dev/null +++ b/classes/class_navigationmeshinstance.rst @@ -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 NavigationMeshInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NavigationMeshInstance: + +NavigationMeshInstance +====================== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Node that instances navigation meshes into a scenario. + +Description +----------- + +NavigationMeshInstance is a node that takes a :ref:`NavigationMesh` resource and adds it to the current scenario by creating an instance of it. + +Properties +---------- + ++---------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`enabled` | ``true`` | ++---------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`NavigationMesh` | :ref:`navmesh` | | ++---------------------------------------------+---------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_NavigationMeshInstance_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_enabled(value) | ++-----------+--------------------+ +| *Getter* | is_enabled() | ++-----------+--------------------+ + +If ``true``, the navigation mesh will be used by :ref:`Navigation`. + +---- + +.. _class_NavigationMeshInstance_property_navmesh: + +- :ref:`NavigationMesh` **navmesh** + ++----------+----------------------------+ +| *Setter* | set_navigation_mesh(value) | ++----------+----------------------------+ +| *Getter* | get_navigation_mesh() | ++----------+----------------------------+ + +The :ref:`NavigationMesh` resource for the instance. + +.. |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.)` diff --git a/classes/class_navigationpolygon.rst b/classes/class_navigationpolygon.rst new file mode 100644 index 0000000..97aa13f --- /dev/null +++ b/classes/class_navigationpolygon.rst @@ -0,0 +1,195 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NavigationPolygon.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NavigationPolygon: + +NavigationPolygon +================= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A node that has methods to draw outlines or use indices of vertices to create navigation polygons. + +Description +----------- + +There are two ways to create polygons. Either by using the :ref:`add_outline` method, or using the :ref:`add_polygon` method. + +Using :ref:`add_outline`: + +:: + + var polygon = NavigationPolygon.new() + var outline = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) + polygon.add_outline(outline) + polygon.make_polygons_from_outlines() + $NavigationPolygonInstance.navpoly = polygon + +Using :ref:`add_polygon` and indices of the vertices array. + +:: + + var polygon = NavigationPolygon.new() + var vertices = PoolVector2Array([Vector2(0, 0), Vector2(0, 50), Vector2(50, 50), Vector2(50, 0)]) + polygon.set_vertices(vertices) + var indices = PoolIntArray([0, 1, 2, 3]) + polygon.add_polygon(indices) + $NavigationPolygonInstance.navpoly = polygon + +Tutorials +--------- + +- `2D Navigation Demo `__ + +Methods +------- + ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_outline` **(** :ref:`PoolVector2Array` outline **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_outline_at_index` **(** :ref:`PoolVector2Array` outline, :ref:`int` index **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_polygon` **(** :ref:`PoolIntArray` polygon **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_outlines` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_polygons` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_outline` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_outline_count` **(** **)** |const| | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_polygon` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_polygon_count` **(** **)** |const| | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_vertices` **(** **)** |const| | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`make_polygons_from_outlines` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_outline` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_outline` **(** :ref:`int` idx, :ref:`PoolVector2Array` outline **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_vertices` **(** :ref:`PoolVector2Array` vertices **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_NavigationPolygon_method_add_outline: + +- void **add_outline** **(** :ref:`PoolVector2Array` outline **)** + +Appends a :ref:`PoolVector2Array` that contains the vertices of an outline to the internal array that contains all the outlines. You have to call :ref:`make_polygons_from_outlines` in order for this array to be converted to polygons that the engine will use. + +---- + +.. _class_NavigationPolygon_method_add_outline_at_index: + +- void **add_outline_at_index** **(** :ref:`PoolVector2Array` outline, :ref:`int` index **)** + +Adds a :ref:`PoolVector2Array` that contains the vertices of an outline to the internal array that contains all the outlines at a fixed position. You have to call :ref:`make_polygons_from_outlines` in order for this array to be converted to polygons that the engine will use. + +---- + +.. _class_NavigationPolygon_method_add_polygon: + +- void **add_polygon** **(** :ref:`PoolIntArray` polygon **)** + +Adds a polygon using the indices of the vertices you get when calling :ref:`get_vertices`. + +---- + +.. _class_NavigationPolygon_method_clear_outlines: + +- void **clear_outlines** **(** **)** + +Clears the array of the outlines, but it doesn't clear the vertices and the polygons that were created by them. + +---- + +.. _class_NavigationPolygon_method_clear_polygons: + +- void **clear_polygons** **(** **)** + +Clears the array of polygons, but it doesn't clear the array of outlines and vertices. + +---- + +.. _class_NavigationPolygon_method_get_outline: + +- :ref:`PoolVector2Array` **get_outline** **(** :ref:`int` idx **)** |const| + +Returns a :ref:`PoolVector2Array` containing the vertices of an outline that was created in the editor or by script. + +---- + +.. _class_NavigationPolygon_method_get_outline_count: + +- :ref:`int` **get_outline_count** **(** **)** |const| + +Returns the number of outlines that were created in the editor or by script. + +---- + +.. _class_NavigationPolygon_method_get_polygon: + +- :ref:`PoolIntArray` **get_polygon** **(** :ref:`int` idx **)** + +Returns a :ref:`PoolIntArray` containing the indices of the vertices of a created polygon. + +---- + +.. _class_NavigationPolygon_method_get_polygon_count: + +- :ref:`int` **get_polygon_count** **(** **)** |const| + +Returns the count of all polygons. + +---- + +.. _class_NavigationPolygon_method_get_vertices: + +- :ref:`PoolVector2Array` **get_vertices** **(** **)** |const| + +Returns a :ref:`PoolVector2Array` containing all the vertices being used to create the polygons. + +---- + +.. _class_NavigationPolygon_method_make_polygons_from_outlines: + +- void **make_polygons_from_outlines** **(** **)** + +Creates polygons from the outlines added in the editor or by script. + +---- + +.. _class_NavigationPolygon_method_remove_outline: + +- void **remove_outline** **(** :ref:`int` idx **)** + +Removes an outline created in the editor or by script. You have to call :ref:`make_polygons_from_outlines` for the polygons to update. + +---- + +.. _class_NavigationPolygon_method_set_outline: + +- void **set_outline** **(** :ref:`int` idx, :ref:`PoolVector2Array` outline **)** + +Changes an outline created in the editor or by script. You have to call :ref:`make_polygons_from_outlines` for the polygons to update. + +---- + +.. _class_NavigationPolygon_method_set_vertices: + +- void **set_vertices** **(** :ref:`PoolVector2Array` vertices **)** + +Sets the vertices that can be then indexed to create polygons with the :ref:`add_polygon` method. + +.. |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.)` diff --git a/classes/class_navigationpolygoninstance.rst b/classes/class_navigationpolygoninstance.rst new file mode 100644 index 0000000..2987d02 --- /dev/null +++ b/classes/class_navigationpolygoninstance.rst @@ -0,0 +1,54 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NavigationPolygonInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NavigationPolygonInstance: + +NavigationPolygonInstance +========================= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------------------------------+------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`enabled` | ``true`` | ++---------------------------------------------------+------------------------------------------------------------------+----------+ +| :ref:`NavigationPolygon` | :ref:`navpoly` | | ++---------------------------------------------------+------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_NavigationPolygonInstance_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_enabled(value) | ++-----------+--------------------+ +| *Getter* | is_enabled() | ++-----------+--------------------+ + +---- + +.. _class_NavigationPolygonInstance_property_navpoly: + +- :ref:`NavigationPolygon` **navpoly** + ++----------+-------------------------------+ +| *Setter* | set_navigation_polygon(value) | ++----------+-------------------------------+ +| *Getter* | get_navigation_polygon() | ++----------+-------------------------------+ + +.. |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.)` diff --git a/classes/class_networkedmultiplayerenet.rst b/classes/class_networkedmultiplayerenet.rst new file mode 100644 index 0000000..a15e227 --- /dev/null +++ b/classes/class_networkedmultiplayerenet.rst @@ -0,0 +1,351 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NetworkedMultiplayerENet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NetworkedMultiplayerENet: + +NetworkedMultiplayerENet +======================== + +**Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +PacketPeer implementation using the `ENet `__ library. + +Description +----------- + +A PacketPeer implementation that should be passed to :ref:`SceneTree.network_peer` after being initialized as either a client or server. Events can then be handled by connecting to :ref:`SceneTree` signals. + +ENet's purpose is to provide a relatively thin, simple and robust network communication layer on top of UDP (User Datagram Protocol). + +**Note:** ENet only uses UDP, not TCP. When forwarding the server port to make your server accessible on the public Internet, you only need to forward the server port in UDP. You can use the :ref:`UPNP` class to try to forward the server port automatically when starting the server. + +Tutorials +--------- + +- :doc:`../tutorials/networking/high_level_multiplayer` + +- `http://enet.bespin.org/usergroup0.html `__ + +Properties +---------- + ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`always_ordered` | ``false`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`channel_count` | ``3`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`CompressionMode` | :ref:`compression_mode` | ``1`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`String` | :ref:`dtls_hostname` | ``""`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`dtls_verify` | ``true`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | refuse_new_connections | ``false`` *(parent override)* | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`server_relay` | ``true`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`transfer_channel` | ``-1`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`TransferMode` | transfer_mode | ``2`` *(parent override)* | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`use_dtls` | ``false`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------------------------------+ + +Methods +------- + ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close_connection` **(** :ref:`int` wait_usec=100 **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_client` **(** :ref:`String` address, :ref:`int` port, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0, :ref:`int` client_port=0 **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_server` **(** :ref:`int` port, :ref:`int` max_clients=32, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0 **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_peer` **(** :ref:`int` id, :ref:`bool` now=false **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_packet_channel` **(** **)** |const| | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_packet_channel` **(** **)** |const| | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_peer_address` **(** :ref:`int` id **)** |const| | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_peer_port` **(** :ref:`int` id **)** |const| | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_ip` **(** :ref:`String` ip **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_dtls_certificate` **(** :ref:`X509Certificate` certificate **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_dtls_key` **(** :ref:`CryptoKey` key **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_peer_timeout` **(** :ref:`int` id, :ref:`int` timeout_limit, :ref:`int` timeout_min, :ref:`int` timeout_max **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_NetworkedMultiplayerENet_CompressionMode: + +.. _class_NetworkedMultiplayerENet_constant_COMPRESS_NONE: + +.. _class_NetworkedMultiplayerENet_constant_COMPRESS_RANGE_CODER: + +.. _class_NetworkedMultiplayerENet_constant_COMPRESS_FASTLZ: + +.. _class_NetworkedMultiplayerENet_constant_COMPRESS_ZLIB: + +.. _class_NetworkedMultiplayerENet_constant_COMPRESS_ZSTD: + +enum **CompressionMode**: + +- **COMPRESS_NONE** = **0** --- No compression. This uses the most bandwidth, but has the upside of requiring the fewest CPU resources. This option may also be used to make network debugging using tools like Wireshark easier. + +- **COMPRESS_RANGE_CODER** = **1** --- ENet's built-in range encoding. Works well on small packets, but is not the most efficient algorithm on packets larger than 4 KB. + +- **COMPRESS_FASTLZ** = **2** --- `FastLZ `__ compression. This option uses less CPU resources compared to :ref:`COMPRESS_ZLIB`, at the expense of using more bandwidth. + +- **COMPRESS_ZLIB** = **3** --- `Zlib `__ compression. This option uses less bandwidth compared to :ref:`COMPRESS_FASTLZ`, at the expense of using more CPU resources. Note that this algorithm is not very efficient on packets smaller than 4 KB. Therefore, it's recommended to use other compression algorithms in most cases. + +- **COMPRESS_ZSTD** = **4** --- `Zstandard `__ compression. + +Property Descriptions +--------------------- + +.. _class_NetworkedMultiplayerENet_property_always_ordered: + +- :ref:`bool` **always_ordered** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_always_ordered(value) | ++-----------+---------------------------+ +| *Getter* | is_always_ordered() | ++-----------+---------------------------+ + +Enforce ordered packets when using :ref:`NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE` (thus behaving similarly to :ref:`NetworkedMultiplayerPeer.TRANSFER_MODE_UNRELIABLE_ORDERED`). This is the only way to use ordering with the RPC system. + +---- + +.. _class_NetworkedMultiplayerENet_property_channel_count: + +- :ref:`int` **channel_count** + ++-----------+--------------------------+ +| *Default* | ``3`` | ++-----------+--------------------------+ +| *Setter* | set_channel_count(value) | ++-----------+--------------------------+ +| *Getter* | get_channel_count() | ++-----------+--------------------------+ + +The number of channels to be used by ENet. Channels are used to separate different kinds of data. In reliable or ordered mode, for example, the packet delivery order is ensured on a per-channel basis. This is done to combat latency and reduces ordering restrictions on packets. The delivery status of a packet in one channel won't stall the delivery of other packets in another channel. + +---- + +.. _class_NetworkedMultiplayerENet_property_compression_mode: + +- :ref:`CompressionMode` **compression_mode** + ++-----------+-----------------------------+ +| *Default* | ``1`` | ++-----------+-----------------------------+ +| *Setter* | set_compression_mode(value) | ++-----------+-----------------------------+ +| *Getter* | get_compression_mode() | ++-----------+-----------------------------+ + +The compression method used for network packets. These have different tradeoffs of compression speed versus bandwidth, you may need to test which one works best for your use case if you use compression at all. + +**Note:** Most games' network design involve sending many small packets frequently (smaller than 4 KB each). If in doubt, it is recommended to keep the default compression algorithm as it works best on these small packets. + +**Note:** :ref:`compression_mode` must be set to the same value on both the server and all its clients. Clients will fail to connect if the :ref:`compression_mode` set on the client differs from the one set on the server. Prior to Godot 3.4, the default :ref:`compression_mode` was :ref:`COMPRESS_NONE`. Nonetheless, mixing engine versions between clients and server is not recommended and not officially supported. + +---- + +.. _class_NetworkedMultiplayerENet_property_dtls_hostname: + +- :ref:`String` **dtls_hostname** + ++-----------+--------------------------+ +| *Default* | ``""`` | ++-----------+--------------------------+ +| *Setter* | set_dtls_hostname(value) | ++-----------+--------------------------+ +| *Getter* | get_dtls_hostname() | ++-----------+--------------------------+ + +The hostname used for DTLS verification, to be compared against the "CN" value in the certificate provided by the server. + +When set to an empty string, the ``address`` parameter passed to :ref:`create_client` is used instead. + +---- + +.. _class_NetworkedMultiplayerENet_property_dtls_verify: + +- :ref:`bool` **dtls_verify** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_dtls_verify_enabled(value) | ++-----------+--------------------------------+ +| *Getter* | is_dtls_verify_enabled() | ++-----------+--------------------------------+ + +Enable or disable certificate verification when :ref:`use_dtls` ``true``. + +---- + +.. _class_NetworkedMultiplayerENet_property_server_relay: + +- :ref:`bool` **server_relay** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_server_relay_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_server_relay_enabled() | ++-----------+---------------------------------+ + +Enable or disable the server feature that notifies clients of other peers' connection/disconnection, and relays messages between them. When this option is ``false``, clients won't be automatically notified of other peers and won't be able to send them packets through the server. + +---- + +.. _class_NetworkedMultiplayerENet_property_transfer_channel: + +- :ref:`int` **transfer_channel** + ++-----------+-----------------------------+ +| *Default* | ``-1`` | ++-----------+-----------------------------+ +| *Setter* | set_transfer_channel(value) | ++-----------+-----------------------------+ +| *Getter* | get_transfer_channel() | ++-----------+-----------------------------+ + +Set the default channel to be used to transfer data. By default, this value is ``-1`` which means that ENet will only use 2 channels: one for reliable packets, and one for unreliable packets. The channel ``0`` is reserved and cannot be used. Setting this member to any value between ``0`` and :ref:`channel_count` (excluded) will force ENet to use that channel for sending data. See :ref:`channel_count` for more information about ENet channels. + +---- + +.. _class_NetworkedMultiplayerENet_property_use_dtls: + +- :ref:`bool` **use_dtls** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_dtls_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_dtls_enabled() | ++-----------+-------------------------+ + +When enabled, the client or server created by this peer, will use :ref:`PacketPeerDTLS` instead of raw UDP sockets for communicating with the remote peer. This will make the communication encrypted with DTLS at the cost of higher resource usage and potentially larger packet size. + +**Note:** When creating a DTLS server, make sure you setup the key/certificate pair via :ref:`set_dtls_key` and :ref:`set_dtls_certificate`. For DTLS clients, have a look at the :ref:`dtls_verify` option, and configure the certificate accordingly via :ref:`set_dtls_certificate`. + +Method Descriptions +------------------- + +.. _class_NetworkedMultiplayerENet_method_close_connection: + +- void **close_connection** **(** :ref:`int` wait_usec=100 **)** + +Closes the connection. Ignored if no connection is currently established. If this is a server it tries to notify all clients before forcibly disconnecting them. If this is a client it simply closes the connection to the server. + +---- + +.. _class_NetworkedMultiplayerENet_method_create_client: + +- :ref:`Error` **create_client** **(** :ref:`String` address, :ref:`int` port, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0, :ref:`int` client_port=0 **)** + +Create client that connects to a server at ``address`` using specified ``port``. The given address needs to be either a fully qualified domain name (e.g. ``"www.example.com"``) or an IP address in IPv4 or IPv6 format (e.g. ``"192.168.1.1"``). The ``port`` is the port the server is listening on. The ``in_bandwidth`` and ``out_bandwidth`` parameters can be used to limit the incoming and outgoing bandwidth to the given number of bytes per second. The default of 0 means unlimited bandwidth. Note that ENet will strategically drop packets on specific sides of a connection between peers to ensure the peer's bandwidth is not overwhelmed. The bandwidth parameters also determine the window size of a connection which limits the amount of reliable packets that may be in transit at any given time. Returns :ref:`@GlobalScope.OK` if a client was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call :ref:`close_connection` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the client could not be created. If ``client_port`` is specified, the client will also listen to the given port; this is useful for some NAT traversal techniques. + +---- + +.. _class_NetworkedMultiplayerENet_method_create_server: + +- :ref:`Error` **create_server** **(** :ref:`int` port, :ref:`int` max_clients=32, :ref:`int` in_bandwidth=0, :ref:`int` out_bandwidth=0 **)** + +Create server that listens to connections via ``port``. The port needs to be an available, unused port between 0 and 65535. Note that ports below 1024 are privileged and may require elevated permissions depending on the platform. To change the interface the server listens on, use :ref:`set_bind_ip`. The default IP is the wildcard ``"*"``, which listens on all available interfaces. ``max_clients`` is the maximum number of clients that are allowed at once, any number up to 4095 may be used, although the achievable number of simultaneous clients may be far lower and depends on the application. For additional details on the bandwidth parameters, see :ref:`create_client`. Returns :ref:`@GlobalScope.OK` if a server was created, :ref:`@GlobalScope.ERR_ALREADY_IN_USE` if this NetworkedMultiplayerENet instance already has an open connection (in which case you need to call :ref:`close_connection` first) or :ref:`@GlobalScope.ERR_CANT_CREATE` if the server could not be created. + +---- + +.. _class_NetworkedMultiplayerENet_method_disconnect_peer: + +- void **disconnect_peer** **(** :ref:`int` id, :ref:`bool` now=false **)** + +Disconnect the given peer. If "now" is set to ``true``, the connection will be closed immediately without flushing queued messages. + +---- + +.. _class_NetworkedMultiplayerENet_method_get_last_packet_channel: + +- :ref:`int` **get_last_packet_channel** **(** **)** |const| + +Returns the channel of the last packet fetched via :ref:`PacketPeer.get_packet`. + +---- + +.. _class_NetworkedMultiplayerENet_method_get_packet_channel: + +- :ref:`int` **get_packet_channel** **(** **)** |const| + +Returns the channel of the next packet that will be retrieved via :ref:`PacketPeer.get_packet`. + +---- + +.. _class_NetworkedMultiplayerENet_method_get_peer_address: + +- :ref:`String` **get_peer_address** **(** :ref:`int` id **)** |const| + +Returns the IP address of the given peer. + +---- + +.. _class_NetworkedMultiplayerENet_method_get_peer_port: + +- :ref:`int` **get_peer_port** **(** :ref:`int` id **)** |const| + +Returns the remote port of the given peer. + +---- + +.. _class_NetworkedMultiplayerENet_method_set_bind_ip: + +- void **set_bind_ip** **(** :ref:`String` ip **)** + +The IP used when creating a server. This is set to the wildcard ``"*"`` by default, which binds to all available interfaces. The given IP needs to be in IPv4 or IPv6 address format, for example: ``"192.168.1.1"``. + +---- + +.. _class_NetworkedMultiplayerENet_method_set_dtls_certificate: + +- void **set_dtls_certificate** **(** :ref:`X509Certificate` certificate **)** + +Configure the :ref:`X509Certificate` to use when :ref:`use_dtls` is ``true``. For servers, you must also setup the :ref:`CryptoKey` via :ref:`set_dtls_key`. + +---- + +.. _class_NetworkedMultiplayerENet_method_set_dtls_key: + +- void **set_dtls_key** **(** :ref:`CryptoKey` key **)** + +Configure the :ref:`CryptoKey` to use when :ref:`use_dtls` is ``true``. Remember to also call :ref:`set_dtls_certificate` to setup your :ref:`X509Certificate`. + +---- + +.. _class_NetworkedMultiplayerENet_method_set_peer_timeout: + +- void **set_peer_timeout** **(** :ref:`int` id, :ref:`int` timeout_limit, :ref:`int` timeout_min, :ref:`int` timeout_max **)** + +Sets the timeout parameters for a peer. The timeout parameters control how and when a peer will timeout from a failure to acknowledge reliable traffic. Timeout values are expressed in milliseconds. + +The ``timeout_limit`` is a factor that, multiplied by a value based on the average round trip time, will determine the timeout limit for a reliable packet. When that limit is reached, the timeout will be doubled, and the peer will be disconnected if that limit has reached ``timeout_min``. The ``timeout_max`` parameter, on the other hand, defines a fixed timeout for which any packet must be acknowledged or the peer will be dropped. + +.. |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.)` diff --git a/classes/class_networkedmultiplayerpeer.rst b/classes/class_networkedmultiplayerpeer.rst new file mode 100644 index 0000000..6784e95 --- /dev/null +++ b/classes/class_networkedmultiplayerpeer.rst @@ -0,0 +1,223 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NetworkedMultiplayerPeer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NetworkedMultiplayerPeer: + +NetworkedMultiplayerPeer +======================== + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`MultiplayerPeerGDNative`, :ref:`NetworkedMultiplayerENet`, :ref:`WebRTCMultiplayer`, :ref:`WebSocketMultiplayerPeer` + +A high-level network interface to simplify multiplayer interactions. + +Description +----------- + +Manages the connection to network peers. Assigns unique IDs to each client connected to the server. See also :ref:`MultiplayerAPI`. + +**Note:** The high-level multiplayer API protocol is an implementation detail and isn't meant to be used by non-Godot servers. It may change without notice. + +Tutorials +--------- + +- :doc:`../tutorials/networking/high_level_multiplayer` + +- `WebRTC Signaling Demo `__ + +Properties +---------- + ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`refuse_new_connections` | ``true`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------+ +| :ref:`TransferMode` | :ref:`transfer_mode` | ``0`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------------------------+----------+ + +Methods +------- + ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`ConnectionStatus` | :ref:`get_connection_status` **(** **)** |const| | ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_packet_peer` **(** **)** |const| | ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unique_id` **(** **)** |const| | ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_target_peer` **(** :ref:`int` id **)** | ++-------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_NetworkedMultiplayerPeer_signal_connection_failed: + +- **connection_failed** **(** **)** + +Emitted when a connection attempt fails. + +---- + +.. _class_NetworkedMultiplayerPeer_signal_connection_succeeded: + +- **connection_succeeded** **(** **)** + +Emitted when a connection attempt succeeds. + +---- + +.. _class_NetworkedMultiplayerPeer_signal_peer_connected: + +- **peer_connected** **(** :ref:`int` id **)** + +Emitted by the server when a client connects. + +---- + +.. _class_NetworkedMultiplayerPeer_signal_peer_disconnected: + +- **peer_disconnected** **(** :ref:`int` id **)** + +Emitted by the server when a client disconnects. + +---- + +.. _class_NetworkedMultiplayerPeer_signal_server_disconnected: + +- **server_disconnected** **(** **)** + +Emitted by clients when the server disconnects. + +Enumerations +------------ + +.. _enum_NetworkedMultiplayerPeer_TransferMode: + +.. _class_NetworkedMultiplayerPeer_constant_TRANSFER_MODE_UNRELIABLE: + +.. _class_NetworkedMultiplayerPeer_constant_TRANSFER_MODE_UNRELIABLE_ORDERED: + +.. _class_NetworkedMultiplayerPeer_constant_TRANSFER_MODE_RELIABLE: + +enum **TransferMode**: + +- **TRANSFER_MODE_UNRELIABLE** = **0** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets may arrive in any order. Potentially faster than :ref:`TRANSFER_MODE_UNRELIABLE_ORDERED`. Use for non-critical data, and always consider whether the order matters. + +- **TRANSFER_MODE_UNRELIABLE_ORDERED** = **1** --- Packets are not acknowledged, no resend attempts are made for lost packets. Packets are received in the order they were sent in. Potentially faster than :ref:`TRANSFER_MODE_RELIABLE`. Use for non-critical data or data that would be outdated if received late due to resend attempt(s) anyway, for example movement and positional data. + +- **TRANSFER_MODE_RELIABLE** = **2** --- Packets must be received and resend attempts should be made until the packets are acknowledged. Packets must be received in the order they were sent in. Most reliable transfer mode, but potentially the slowest due to the overhead. Use for critical data that must be transmitted and arrive in order, for example an ability being triggered or a chat message. Consider carefully if the information really is critical, and use sparingly. + +---- + +.. _enum_NetworkedMultiplayerPeer_ConnectionStatus: + +.. _class_NetworkedMultiplayerPeer_constant_CONNECTION_DISCONNECTED: + +.. _class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTING: + +.. _class_NetworkedMultiplayerPeer_constant_CONNECTION_CONNECTED: + +enum **ConnectionStatus**: + +- **CONNECTION_DISCONNECTED** = **0** --- The ongoing connection disconnected. + +- **CONNECTION_CONNECTING** = **1** --- A connection attempt is ongoing. + +- **CONNECTION_CONNECTED** = **2** --- The connection attempt succeeded. + +Constants +--------- + +.. _class_NetworkedMultiplayerPeer_constant_TARGET_PEER_BROADCAST: + +.. _class_NetworkedMultiplayerPeer_constant_TARGET_PEER_SERVER: + +- **TARGET_PEER_BROADCAST** = **0** --- Packets are sent to the server and then redistributed to other peers. + +- **TARGET_PEER_SERVER** = **1** --- Packets are sent to the server alone. + +Property Descriptions +--------------------- + +.. _class_NetworkedMultiplayerPeer_property_refuse_new_connections: + +- :ref:`bool` **refuse_new_connections** + ++-----------+-----------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------+ +| *Setter* | set_refuse_new_connections(value) | ++-----------+-----------------------------------+ +| *Getter* | is_refusing_new_connections() | ++-----------+-----------------------------------+ + +If ``true``, this ``NetworkedMultiplayerPeer`` refuses new connections. + +---- + +.. _class_NetworkedMultiplayerPeer_property_transfer_mode: + +- :ref:`TransferMode` **transfer_mode** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_transfer_mode(value) | ++-----------+--------------------------+ +| *Getter* | get_transfer_mode() | ++-----------+--------------------------+ + +The manner in which to send packets to the ``target_peer``. See :ref:`TransferMode`. + +Method Descriptions +------------------- + +.. _class_NetworkedMultiplayerPeer_method_get_connection_status: + +- :ref:`ConnectionStatus` **get_connection_status** **(** **)** |const| + +Returns the current state of the connection. See :ref:`ConnectionStatus`. + +---- + +.. _class_NetworkedMultiplayerPeer_method_get_packet_peer: + +- :ref:`int` **get_packet_peer** **(** **)** |const| + +Returns the ID of the ``NetworkedMultiplayerPeer`` who sent the most recent packet. + +---- + +.. _class_NetworkedMultiplayerPeer_method_get_unique_id: + +- :ref:`int` **get_unique_id** **(** **)** |const| + +Returns the ID of this ``NetworkedMultiplayerPeer``. + +---- + +.. _class_NetworkedMultiplayerPeer_method_poll: + +- void **poll** **(** **)** + +Waits up to 1 second to receive a new network event. + +---- + +.. _class_NetworkedMultiplayerPeer_method_set_target_peer: + +- void **set_target_peer** **(** :ref:`int` id **)** + +Sets the peer to which packets will be sent. + +The ``id`` can be one of: :ref:`TARGET_PEER_BROADCAST` to send to all connected peers, :ref:`TARGET_PEER_SERVER` to send to the peer acting as server, a valid peer ID to send to that specific peer, a negative peer ID to send to all peers except that one. By default, the target peer is :ref:`TARGET_PEER_BROADCAST`. + +.. |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.)` diff --git a/classes/class_ninepatchrect.rst b/classes/class_ninepatchrect.rst new file mode 100644 index 0000000..19d4f6b --- /dev/null +++ b/classes/class_ninepatchrect.rst @@ -0,0 +1,249 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NinePatchRect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NinePatchRect: + +NinePatchRect +============= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Scalable texture-based frame that tiles the texture's centers and sides, but keeps the corners' original size. Perfect for panels and dialog boxes. + +Description +----------- + +Also known as 9-slice panels, NinePatchRect produces clean panels of any size, based on a small texture. To do so, it splits the texture in a 3×3 grid. When you scale the node, it tiles the texture's sides horizontally or vertically, the center on both axes but it doesn't scale or tile the corners. + +Properties +---------- + ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`AxisStretchMode` | :ref:`axis_stretch_horizontal` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`AxisStretchMode` | :ref:`axis_stretch_vertical` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`draw_center` | ``true`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``2`` *(parent override)* | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`patch_margin_bottom` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`patch_margin_left` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`patch_margin_right` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`patch_margin_top` | ``0`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Rect2` | :ref:`region_rect` | ``Rect2( 0, 0, 0, 0 )`` | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++------------------------------------------------------------+--------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_patch_margin` **(** :ref:`Margin` margin **)** |const| | ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_patch_margin` **(** :ref:`Margin` margin, :ref:`int` value **)** | ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_NinePatchRect_signal_texture_changed: + +- **texture_changed** **(** **)** + +Emitted when the node's texture changes. + +Enumerations +------------ + +.. _enum_NinePatchRect_AxisStretchMode: + +.. _class_NinePatchRect_constant_AXIS_STRETCH_MODE_STRETCH: + +.. _class_NinePatchRect_constant_AXIS_STRETCH_MODE_TILE: + +.. _class_NinePatchRect_constant_AXIS_STRETCH_MODE_TILE_FIT: + +enum **AxisStretchMode**: + +- **AXIS_STRETCH_MODE_STRETCH** = **0** --- Stretches the center texture across the NinePatchRect. This may cause the texture to be distorted. + +- **AXIS_STRETCH_MODE_TILE** = **1** --- Repeats the center texture across the NinePatchRect. This won't cause any visible distortion. The texture must be seamless for this to work without displaying artifacts between edges. + +**Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like :ref:`AXIS_STRETCH_MODE_STRETCH`. + +- **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Repeats the center texture across the NinePatchRect, but will also stretch the texture to make sure each tile is visible in full. This may cause the texture to be distorted, but less than :ref:`AXIS_STRETCH_MODE_STRETCH`. The texture must be seamless for this to work without displaying artifacts between edges. + +**Note:** Only supported when using the GLES3 renderer. When using the GLES2 renderer, this will behave like :ref:`AXIS_STRETCH_MODE_STRETCH`. + +Property Descriptions +--------------------- + +.. _class_NinePatchRect_property_axis_stretch_horizontal: + +- :ref:`AxisStretchMode` **axis_stretch_horizontal** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_h_axis_stretch_mode(value) | ++-----------+--------------------------------+ +| *Getter* | get_h_axis_stretch_mode() | ++-----------+--------------------------------+ + +The stretch mode to use for horizontal stretching/tiling. See :ref:`AxisStretchMode` for possible values. + +---- + +.. _class_NinePatchRect_property_axis_stretch_vertical: + +- :ref:`AxisStretchMode` **axis_stretch_vertical** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_v_axis_stretch_mode(value) | ++-----------+--------------------------------+ +| *Getter* | get_v_axis_stretch_mode() | ++-----------+--------------------------------+ + +The stretch mode to use for vertical stretching/tiling. See :ref:`AxisStretchMode` for possible values. + +---- + +.. _class_NinePatchRect_property_draw_center: + +- :ref:`bool` **draw_center** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_draw_center(value) | ++-----------+--------------------------+ +| *Getter* | is_draw_center_enabled() | ++-----------+--------------------------+ + +If ``true``, draw the panel's center. Else, only draw the 9-slice's borders. + +---- + +.. _class_NinePatchRect_property_patch_margin_bottom: + +- :ref:`int` **patch_margin_bottom** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_patch_margin(value) | ++-----------+-------------------------+ +| *Getter* | get_patch_margin() | ++-----------+-------------------------+ + +The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + +---- + +.. _class_NinePatchRect_property_patch_margin_left: + +- :ref:`int` **patch_margin_left** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_patch_margin(value) | ++-----------+-------------------------+ +| *Getter* | get_patch_margin() | ++-----------+-------------------------+ + +The width of the 9-slice's left column. A margin of 16 means the 9-slice's left corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + +---- + +.. _class_NinePatchRect_property_patch_margin_right: + +- :ref:`int` **patch_margin_right** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_patch_margin(value) | ++-----------+-------------------------+ +| *Getter* | get_patch_margin() | ++-----------+-------------------------+ + +The width of the 9-slice's right column. A margin of 16 means the 9-slice's right corners and side will have a width of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + +---- + +.. _class_NinePatchRect_property_patch_margin_top: + +- :ref:`int` **patch_margin_top** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_patch_margin(value) | ++-----------+-------------------------+ +| *Getter* | get_patch_margin() | ++-----------+-------------------------+ + +The height of the 9-slice's top row. A margin of 16 means the 9-slice's top corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + +---- + +.. _class_NinePatchRect_property_region_rect: + +- :ref:`Rect2` **region_rect** + ++-----------+-------------------------+ +| *Default* | ``Rect2( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_region_rect(value) | ++-----------+-------------------------+ +| *Getter* | get_region_rect() | ++-----------+-------------------------+ + +Rectangular region of the texture to sample from. If you're working with an atlas, use this property to define the area the 9-slice should use. All other properties are relative to this one. If the rect is empty, NinePatchRect will use the whole texture. + +---- + +.. _class_NinePatchRect_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The node's texture resource. + +Method Descriptions +------------------- + +.. _class_NinePatchRect_method_get_patch_margin: + +- :ref:`int` **get_patch_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the size of the margin identified by the given :ref:`Margin` constant. + +---- + +.. _class_NinePatchRect_method_set_patch_margin: + +- void **set_patch_margin** **(** :ref:`Margin` margin, :ref:`int` value **)** + +Sets the size of the margin identified by the given :ref:`Margin` constant to ``value`` in pixels. + +.. |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.)` diff --git a/classes/class_node.rst b/classes/class_node.rst new file mode 100644 index 0000000..ebb1925 --- /dev/null +++ b/classes/class_node.rst @@ -0,0 +1,1415 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Node.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Node: + +Node +==== + +**Inherits:** :ref:`Object` + +**Inherited By:** :ref:`AnimationPlayer`, :ref:`AnimationTree`, :ref:`AnimationTreePlayer`, :ref:`AudioStreamPlayer`, :ref:`CanvasItem`, :ref:`CanvasLayer`, :ref:`EditorFileSystem`, :ref:`EditorInterface`, :ref:`EditorPlugin`, :ref:`EditorResourcePreview`, :ref:`HTTPRequest`, :ref:`InstancePlaceholder`, :ref:`ResourcePreloader`, :ref:`SkeletonIK`, :ref:`Spatial`, :ref:`Timer`, :ref:`Tween`, :ref:`Viewport`, :ref:`WorldEnvironment` + +Base class for all *scene* objects. + +Description +----------- + +Nodes are Godot's building blocks. They can be assigned as the child of another node, resulting in a tree arrangement. A given node can contain any number of nodes as children with the requirement that all siblings (direct children of a node) should have unique names. + +A tree of nodes is called a *scene*. Scenes can be saved to the disk and then instanced into other scenes. This allows for very high flexibility in the architecture and data model of Godot projects. + +**Scene tree:** The :ref:`SceneTree` contains the active tree of nodes. When a node is added to the scene tree, it receives the :ref:`NOTIFICATION_ENTER_TREE` notification and its :ref:`_enter_tree` callback is triggered. Child nodes are always added *after* their parent node, i.e. the :ref:`_enter_tree` callback of a parent node will be triggered before its child's. + +Once all nodes have been added in the scene tree, they receive the :ref:`NOTIFICATION_READY` notification and their respective :ref:`_ready` callbacks are triggered. For groups of nodes, the :ref:`_ready` callback is called in reverse order, starting with the children and moving up to the parent nodes. + +This means that when adding a node to the scene tree, the following order will be used for the callbacks: :ref:`_enter_tree` of the parent, :ref:`_enter_tree` of the children, :ref:`_ready` of the children and finally :ref:`_ready` of the parent (recursively for the entire scene tree). + +**Processing:** Nodes can override the "process" state, so that they receive a callback on each frame requesting them to process (do something). Normal processing (callback :ref:`_process`, toggled with :ref:`set_process`) happens as fast as possible and is dependent on the frame rate, so the processing time *delta* (in seconds) is passed as an argument. Physics processing (callback :ref:`_physics_process`, toggled with :ref:`set_physics_process`) happens a fixed number of times per second (60 by default) and is useful for code related to the physics engine. + +Nodes can also process input events. When present, the :ref:`_input` function will be called for each input that the program receives. In many cases, this can be overkill (unless used for simple projects), and the :ref:`_unhandled_input` function might be preferred; it is called when the input event was not handled by anyone else (typically, GUI :ref:`Control` nodes), ensuring that the node only receives the events that were meant for it. + +To keep track of the scene hierarchy (especially when instancing scenes into other scenes), an "owner" can be set for the node with the :ref:`owner` property. This keeps track of who instanced what. This is mostly useful when writing editors and tools, though. + +Finally, when a node is freed with :ref:`Object.free` or :ref:`queue_free`, it will also free all its children. + +**Groups:** Nodes can be added to as many groups as you want to be easy to manage, you could create groups like "enemies" or "collectables" for example, depending on your game. See :ref:`add_to_group`, :ref:`is_in_group` and :ref:`remove_from_group`. You can then retrieve all nodes in these groups, iterate them and even call methods on groups via the methods on :ref:`SceneTree`. + +**Networking with nodes:** After connecting to a server (or making one, see :ref:`NetworkedMultiplayerENet`), it is possible to use the built-in RPC (remote procedure call) system to communicate over the network. By calling :ref:`rpc` with a method name, it will be called locally and in all connected peers (peers = clients and the server that accepts connections). To identify which node receives the RPC call, Godot will use its :ref:`NodePath` (make sure node names are the same on all peers). Also, take a look at the high-level networking tutorial and corresponding demos. + +Tutorials +--------- + +- :doc:`../getting_started/step_by_step/nodes_and_scenes` + +- `All Demos `__ + +Properties +---------- + ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`MultiplayerAPI` | :ref:`custom_multiplayer` | | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`String` | :ref:`filename` | | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`MultiplayerAPI` | :ref:`multiplayer` | | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`String` | :ref:`name` | | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`Node` | :ref:`owner` | | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`PauseMode` | :ref:`pause_mode` | ``0`` | ++---------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`process_priority` | ``0`` | ++---------------------------------------------+-------------------------------------------------------------------+-------+ + +Methods +------- + ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_enter_tree` **(** **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_exit_tree` **(** **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_configuration_warning` **(** **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_input` **(** :ref:`InputEvent` event **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_physics_process` **(** :ref:`float` delta **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_process` **(** :ref:`float` delta **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_ready` **(** **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_unhandled_input` **(** :ref:`InputEvent` event **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_unhandled_key_input` **(** :ref:`InputEventKey` event **)** |virtual| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_child` **(** :ref:`Node` node, :ref:`bool` legible_unique_name=false **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_child_below_node` **(** :ref:`Node` node, :ref:`Node` child_node, :ref:`bool` legible_unique_name=false **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_to_group` **(** :ref:`String` group, :ref:`bool` persistent=false **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_process` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`duplicate` **(** :ref:`int` flags=15 **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`find_node` **(** :ref:`String` mask, :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`find_parent` **(** :ref:`String` mask **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_child` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_child_count` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_children` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_groups` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_index` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_network_master` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_node` **(** :ref:`NodePath` path **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_node_and_resource` **(** :ref:`NodePath` path **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_node_or_null` **(** :ref:`NodePath` path **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_parent` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_path` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_path_to` **(** :ref:`Node` node **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_physics_process_delta_time` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_position_in_parent` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_process_delta_time` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_scene_instance_load_placeholder` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SceneTree` | :ref:`get_tree` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Viewport` | :ref:`get_viewport` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node` **(** :ref:`NodePath` path **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node_and_resource` **(** :ref:`NodePath` path **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_a_parent_of` **(** :ref:`Node` node **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_displayed_folded` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_greater_than` **(** :ref:`Node` node **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_in_group` **(** :ref:`String` group **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_inside_tree` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_network_master` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_physics_processing` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_physics_processing_internal` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_processing` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_processing_input` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_processing_internal` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_processing_unhandled_input` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_processing_unhandled_key_input` **(** **)** |const| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_child` **(** :ref:`Node` child_node, :ref:`int` to_position **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_stray_nodes` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_tree` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_tree_pretty` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`propagate_call` **(** :ref:`String` method, :ref:`Array` args=[ ], :ref:`bool` parent_first=false **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`propagate_notification` **(** :ref:`int` what **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_free` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`raise` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_and_skip` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_child` **(** :ref:`Node` node **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_from_group` **(** :ref:`String` group **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`replace_by` **(** :ref:`Node` node, :ref:`bool` keep_data=false **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`request_ready` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`rpc` **(** :ref:`String` method, ... **)** |vararg| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rpc_config` **(** :ref:`String` method, :ref:`RPCMode` mode **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`rpc_id` **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`rpc_unreliable` **(** :ref:`String` method, ... **)** |vararg| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`rpc_unreliable_id` **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rset` **(** :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rset_config` **(** :ref:`String` property, :ref:`RPCMode` mode **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rset_id` **(** :ref:`int` peer_id, :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rset_unreliable` **(** :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rset_unreliable_id` **(** :ref:`int` peer_id, :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_display_folded` **(** :ref:`bool` fold **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_network_master` **(** :ref:`int` id, :ref:`bool` recursive=true **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_physics_process` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_physics_process_internal` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_process` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_process_input` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_process_internal` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_process_unhandled_input` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_process_unhandled_key_input` **(** :ref:`bool` enable **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_scene_instance_load_placeholder` **(** :ref:`bool` load_placeholder **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_configuration_warning` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Node_signal_ready: + +- **ready** **(** **)** + +Emitted when the node is ready. + +---- + +.. _class_Node_signal_renamed: + +- **renamed** **(** **)** + +Emitted when the node is renamed. + +---- + +.. _class_Node_signal_tree_entered: + +- **tree_entered** **(** **)** + +Emitted when the node enters the tree. + +---- + +.. _class_Node_signal_tree_exited: + +- **tree_exited** **(** **)** + +Emitted after the node exits the tree and is no longer active. + +---- + +.. _class_Node_signal_tree_exiting: + +- **tree_exiting** **(** **)** + +Emitted when the node is still active but about to exit the tree. This is the right place for de-initialization (or a "destructor", if you will). + +Enumerations +------------ + +.. _enum_Node_PauseMode: + +.. _class_Node_constant_PAUSE_MODE_INHERIT: + +.. _class_Node_constant_PAUSE_MODE_STOP: + +.. _class_Node_constant_PAUSE_MODE_PROCESS: + +enum **PauseMode**: + +- **PAUSE_MODE_INHERIT** = **0** --- Inherits pause mode from the node's parent. For the root node, it is equivalent to :ref:`PAUSE_MODE_STOP`. Default. + +- **PAUSE_MODE_STOP** = **1** --- Stops processing when the :ref:`SceneTree` is paused. + +- **PAUSE_MODE_PROCESS** = **2** --- Continue to process regardless of the :ref:`SceneTree` pause state. + +---- + +.. _enum_Node_DuplicateFlags: + +.. _class_Node_constant_DUPLICATE_SIGNALS: + +.. _class_Node_constant_DUPLICATE_GROUPS: + +.. _class_Node_constant_DUPLICATE_SCRIPTS: + +.. _class_Node_constant_DUPLICATE_USE_INSTANCING: + +enum **DuplicateFlags**: + +- **DUPLICATE_SIGNALS** = **1** --- Duplicate the node's signals. + +- **DUPLICATE_GROUPS** = **2** --- Duplicate the node's groups. + +- **DUPLICATE_SCRIPTS** = **4** --- Duplicate the node's scripts. + +- **DUPLICATE_USE_INSTANCING** = **8** --- Duplicate using instancing. + +An instance stays linked to the original so when the original changes, the instance changes too. + +Constants +--------- + +.. _class_Node_constant_NOTIFICATION_ENTER_TREE: + +.. _class_Node_constant_NOTIFICATION_EXIT_TREE: + +.. _class_Node_constant_NOTIFICATION_MOVED_IN_PARENT: + +.. _class_Node_constant_NOTIFICATION_READY: + +.. _class_Node_constant_NOTIFICATION_PAUSED: + +.. _class_Node_constant_NOTIFICATION_UNPAUSED: + +.. _class_Node_constant_NOTIFICATION_PHYSICS_PROCESS: + +.. _class_Node_constant_NOTIFICATION_PROCESS: + +.. _class_Node_constant_NOTIFICATION_PARENTED: + +.. _class_Node_constant_NOTIFICATION_UNPARENTED: + +.. _class_Node_constant_NOTIFICATION_INSTANCED: + +.. _class_Node_constant_NOTIFICATION_DRAG_BEGIN: + +.. _class_Node_constant_NOTIFICATION_DRAG_END: + +.. _class_Node_constant_NOTIFICATION_PATH_CHANGED: + +.. _class_Node_constant_NOTIFICATION_INTERNAL_PROCESS: + +.. _class_Node_constant_NOTIFICATION_INTERNAL_PHYSICS_PROCESS: + +.. _class_Node_constant_NOTIFICATION_POST_ENTER_TREE: + +.. _class_Node_constant_NOTIFICATION_WM_MOUSE_ENTER: + +.. _class_Node_constant_NOTIFICATION_WM_MOUSE_EXIT: + +.. _class_Node_constant_NOTIFICATION_WM_FOCUS_IN: + +.. _class_Node_constant_NOTIFICATION_WM_FOCUS_OUT: + +.. _class_Node_constant_NOTIFICATION_WM_QUIT_REQUEST: + +.. _class_Node_constant_NOTIFICATION_WM_GO_BACK_REQUEST: + +.. _class_Node_constant_NOTIFICATION_WM_UNFOCUS_REQUEST: + +.. _class_Node_constant_NOTIFICATION_OS_MEMORY_WARNING: + +.. _class_Node_constant_NOTIFICATION_TRANSLATION_CHANGED: + +.. _class_Node_constant_NOTIFICATION_WM_ABOUT: + +.. _class_Node_constant_NOTIFICATION_CRASH: + +.. _class_Node_constant_NOTIFICATION_OS_IME_UPDATE: + +.. _class_Node_constant_NOTIFICATION_APP_RESUMED: + +.. _class_Node_constant_NOTIFICATION_APP_PAUSED: + +- **NOTIFICATION_ENTER_TREE** = **10** --- Notification received when the node enters a :ref:`SceneTree`. + +- **NOTIFICATION_EXIT_TREE** = **11** --- Notification received when the node is about to exit a :ref:`SceneTree`. + +- **NOTIFICATION_MOVED_IN_PARENT** = **12** --- Notification received when the node is moved in the parent. + +- **NOTIFICATION_READY** = **13** --- Notification received when the node is ready. See :ref:`_ready`. + +- **NOTIFICATION_PAUSED** = **14** --- Notification received when the node is paused. + +- **NOTIFICATION_UNPAUSED** = **15** --- Notification received when the node is unpaused. + +- **NOTIFICATION_PHYSICS_PROCESS** = **16** --- Notification received every frame when the physics process flag is set (see :ref:`set_physics_process`). + +- **NOTIFICATION_PROCESS** = **17** --- Notification received every frame when the process flag is set (see :ref:`set_process`). + +- **NOTIFICATION_PARENTED** = **18** --- Notification received when a node is set as a child of another node. + +**Note:** This doesn't mean that a node entered the :ref:`SceneTree`. + +- **NOTIFICATION_UNPARENTED** = **19** --- Notification received when a node is unparented (parent removed it from the list of children). + +- **NOTIFICATION_INSTANCED** = **20** --- Notification received when the node is instanced. + +- **NOTIFICATION_DRAG_BEGIN** = **21** --- Notification received when a drag begins. + +- **NOTIFICATION_DRAG_END** = **22** --- Notification received when a drag ends. + +- **NOTIFICATION_PATH_CHANGED** = **23** --- Notification received when the node's :ref:`NodePath` changed. + +- **NOTIFICATION_INTERNAL_PROCESS** = **25** --- Notification received every frame when the internal process flag is set (see :ref:`set_process_internal`). + +- **NOTIFICATION_INTERNAL_PHYSICS_PROCESS** = **26** --- Notification received every frame when the internal physics process flag is set (see :ref:`set_physics_process_internal`). + +- **NOTIFICATION_POST_ENTER_TREE** = **27** --- Notification received when the node is ready, just before :ref:`NOTIFICATION_READY` is received. Unlike the latter, it's sent every time the node enters tree, instead of only once. + +- **NOTIFICATION_WM_MOUSE_ENTER** = **1002** --- Notification received from the OS when the mouse enters the game window. + +Implemented on desktop and web platforms. + +- **NOTIFICATION_WM_MOUSE_EXIT** = **1003** --- Notification received from the OS when the mouse leaves the game window. + +Implemented on desktop and web platforms. + +- **NOTIFICATION_WM_FOCUS_IN** = **1004** --- Notification received from the OS when the game window is focused. + +Implemented on all platforms. + +- **NOTIFICATION_WM_FOCUS_OUT** = **1005** --- Notification received from the OS when the game window is unfocused. + +Implemented on all platforms. + +- **NOTIFICATION_WM_QUIT_REQUEST** = **1006** --- Notification received from the OS when a quit request is sent (e.g. closing the window with a "Close" button or Alt+F4). + +Implemented on desktop platforms. + +- **NOTIFICATION_WM_GO_BACK_REQUEST** = **1007** --- Notification received from the OS when a go back request is sent (e.g. pressing the "Back" button on Android). + +Specific to the Android platform. + +- **NOTIFICATION_WM_UNFOCUS_REQUEST** = **1008** --- Notification received from the OS when an unfocus request is sent (e.g. another OS window wants to take the focus). + +No supported platforms currently send this notification. + +- **NOTIFICATION_OS_MEMORY_WARNING** = **1009** --- Notification received from the OS when the application is exceeding its allocated memory. + +Specific to the iOS platform. + +- **NOTIFICATION_TRANSLATION_CHANGED** = **1010** --- Notification received when translations may have changed. Can be triggered by the user changing the locale. Can be used to respond to language changes, for example to change the UI strings on the fly. Useful when working with the built-in translation support, like :ref:`Object.tr`. + +- **NOTIFICATION_WM_ABOUT** = **1011** --- Notification received from the OS when a request for "About" information is sent. + +Specific to the macOS platform. + +- **NOTIFICATION_CRASH** = **1012** --- Notification received from Godot's crash handler when the engine is about to crash. + +Implemented on desktop platforms if the crash handler is enabled. + +- **NOTIFICATION_OS_IME_UPDATE** = **1013** --- Notification received from the OS when an update of the Input Method Engine occurs (e.g. change of IME cursor position or composition string). + +Specific to the macOS platform. + +- **NOTIFICATION_APP_RESUMED** = **1014** --- Notification received from the OS when the app is resumed. + +Specific to the Android platform. + +- **NOTIFICATION_APP_PAUSED** = **1015** --- Notification received from the OS when the app is paused. + +Specific to the Android platform. + +Property Descriptions +--------------------- + +.. _class_Node_property_custom_multiplayer: + +- :ref:`MultiplayerAPI` **custom_multiplayer** + ++----------+-------------------------------+ +| *Setter* | set_custom_multiplayer(value) | ++----------+-------------------------------+ +| *Getter* | get_custom_multiplayer() | ++----------+-------------------------------+ + +The override to the default :ref:`MultiplayerAPI`. Set to ``null`` to use the default :ref:`SceneTree` one. + +---- + +.. _class_Node_property_filename: + +- :ref:`String` **filename** + ++----------+---------------------+ +| *Setter* | set_filename(value) | ++----------+---------------------+ +| *Getter* | get_filename() | ++----------+---------------------+ + +If a scene is instantiated from a file, its topmost node contains the absolute file path from which it was loaded in :ref:`filename` (e.g. ``res://levels/1.tscn``). Otherwise, :ref:`filename` is set to an empty string. + +---- + +.. _class_Node_property_multiplayer: + +- :ref:`MultiplayerAPI` **multiplayer** + ++----------+-------------------+ +| *Getter* | get_multiplayer() | ++----------+-------------------+ + +The :ref:`MultiplayerAPI` instance associated with this node. Either the :ref:`custom_multiplayer`, or the default SceneTree one (if inside tree). + +---- + +.. _class_Node_property_name: + +- :ref:`String` **name** + ++----------+-----------------+ +| *Setter* | set_name(value) | ++----------+-----------------+ +| *Getter* | get_name() | ++----------+-----------------+ + +The name of the node. This name is unique among the siblings (other child nodes from the same parent). When set to an existing name, the node will be automatically renamed. + +**Note:** Auto-generated names might include the ``@`` character, which is reserved for unique names when using :ref:`add_child`. When setting the name manually, any ``@`` will be removed. + +---- + +.. _class_Node_property_owner: + +- :ref:`Node` **owner** + ++----------+------------------+ +| *Setter* | set_owner(value) | ++----------+------------------+ +| *Getter* | get_owner() | ++----------+------------------+ + +The node owner. A node can have any other node as owner (as long as it is a valid parent, grandparent, etc. ascending in the tree). When saving a node (using :ref:`PackedScene`), all the nodes it owns will be saved with it. This allows for the creation of complex :ref:`SceneTree`\ s, with instancing and subinstancing. + +---- + +.. _class_Node_property_pause_mode: + +- :ref:`PauseMode` **pause_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_pause_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_pause_mode() | ++-----------+-----------------------+ + +Pause mode. How the node will behave if the :ref:`SceneTree` is paused. + +---- + +.. _class_Node_property_process_priority: + +- :ref:`int` **process_priority** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_process_priority(value) | ++-----------+-----------------------------+ +| *Getter* | get_process_priority() | ++-----------+-----------------------------+ + +The node's priority in the execution order of the enabled processing callbacks (i.e. :ref:`NOTIFICATION_PROCESS`, :ref:`NOTIFICATION_PHYSICS_PROCESS` and their internal counterparts). Nodes whose process priority value is *lower* will have their processing callbacks executed first. + +Method Descriptions +------------------- + +.. _class_Node_method__enter_tree: + +- void **_enter_tree** **(** **)** |virtual| + +Called when the node enters the :ref:`SceneTree` (e.g. upon instancing, scene changing, or after calling :ref:`add_child` in a script). If the node has children, its :ref:`_enter_tree` callback will be called first, and then that of the children. + +Corresponds to the :ref:`NOTIFICATION_ENTER_TREE` notification in :ref:`Object._notification`. + +---- + +.. _class_Node_method__exit_tree: + +- void **_exit_tree** **(** **)** |virtual| + +Called when the node is about to leave the :ref:`SceneTree` (e.g. upon freeing, scene changing, or after calling :ref:`remove_child` in a script). If the node has children, its :ref:`_exit_tree` callback will be called last, after all its children have left the tree. + +Corresponds to the :ref:`NOTIFICATION_EXIT_TREE` notification in :ref:`Object._notification` and signal :ref:`tree_exiting`. To get notified when the node has already left the active tree, connect to the :ref:`tree_exited`. + +---- + +.. _class_Node_method__get_configuration_warning: + +- :ref:`String` **_get_configuration_warning** **(** **)** |virtual| + +The string returned from this method is displayed as a warning in the Scene Dock if the script that overrides it is a ``tool`` script. + +Returning an empty string produces no warning. + +Call :ref:`update_configuration_warning` when the warning needs to be updated for this node. + +---- + +.. _class_Node_method__input: + +- void **_input** **(** :ref:`InputEvent` event **)** |virtual| + +Called when there is an input event. The input event propagates up through the node tree until a node consumes it. + +It is only called if input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_input`. + +To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled` can be called. + +For gameplay input, :ref:`_unhandled_input` and :ref:`_unhandled_key_input` are usually a better fit as they allow the GUI to intercept the events first. + +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + +---- + +.. _class_Node_method__physics_process: + +- void **_physics_process** **(** :ref:`float` delta **)** |virtual| + +Called during the physics processing step of the main loop. Physics processing means that the frame rate is synced to the physics, i.e. the ``delta`` variable should be constant. ``delta`` is in seconds. + +It is only called if physics processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_physics_process`. + +Corresponds to the :ref:`NOTIFICATION_PHYSICS_PROCESS` notification in :ref:`Object._notification`. + +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + +---- + +.. _class_Node_method__process: + +- void **_process** **(** :ref:`float` delta **)** |virtual| + +Called during the processing step of the main loop. Processing happens at every frame and as fast as possible, so the ``delta`` time since the previous frame is not constant. ``delta`` is in seconds. + +It is only called if processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process`. + +Corresponds to the :ref:`NOTIFICATION_PROCESS` notification in :ref:`Object._notification`. + +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + +---- + +.. _class_Node_method__ready: + +- void **_ready** **(** **)** |virtual| + +Called when the node is "ready", i.e. when both the node and its children have entered the scene tree. If the node has children, their :ref:`_ready` callbacks get triggered first, and the parent node will receive the ready notification afterwards. + +Corresponds to the :ref:`NOTIFICATION_READY` notification in :ref:`Object._notification`. See also the ``onready`` keyword for variables. + +Usually used for initialization. For even earlier initialization, :ref:`Object._init` may be used. See also :ref:`_enter_tree`. + +**Note:** :ref:`_ready` may be called only once for each node. After removing a node from the scene tree and adding again, ``_ready`` will not be called for the second time. This can be bypassed with requesting another call with :ref:`request_ready`, which may be called anywhere before adding the node again. + +---- + +.. _class_Node_method__unhandled_input: + +- void **_unhandled_input** **(** :ref:`InputEvent` event **)** |virtual| + +Called when an :ref:`InputEvent` hasn't been consumed by :ref:`_input` or any GUI. The input event propagates up through the node tree until a node consumes it. + +It is only called if unhandled input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_input`. + +To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled` can be called. + +For gameplay input, this and :ref:`_unhandled_key_input` are usually a better fit than :ref:`_input` as they allow the GUI to intercept the events first. + +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + +---- + +.. _class_Node_method__unhandled_key_input: + +- void **_unhandled_key_input** **(** :ref:`InputEventKey` event **)** |virtual| + +Called when an :ref:`InputEventKey` hasn't been consumed by :ref:`_input` or any GUI. The input event propagates up through the node tree until a node consumes it. + +It is only called if unhandled key input processing is enabled, which is done automatically if this method is overridden, and can be toggled with :ref:`set_process_unhandled_key_input`. + +To consume the input event and stop it propagating further to other nodes, :ref:`SceneTree.set_input_as_handled` can be called. + +For gameplay input, this and :ref:`_unhandled_input` are usually a better fit than :ref:`_input` as they allow the GUI to intercept the events first. + +**Note:** This method is only called if the node is present in the scene tree (i.e. if it's not orphan). + +---- + +.. _class_Node_method_add_child: + +- void **add_child** **(** :ref:`Node` node, :ref:`bool` legible_unique_name=false **)** + +Adds a child node. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. + +If ``legible_unique_name`` is ``true``, the child node will have a human-readable name based on the name of the node being instanced instead of its type. + +**Note:** If the child node already has a parent, the function will fail. Use :ref:`remove_child` first to remove the node from its current parent. For example: + +:: + + if child_node.get_parent(): + child_node.get_parent().remove_child(child_node) + add_child(child_node) + +**Note:** If you want a child to be persisted to a :ref:`PackedScene`, you must set :ref:`owner` in addition to calling :ref:`add_child`. This is typically relevant for `tool scripts `__ and `editor plugins `__. If :ref:`add_child` is called without setting :ref:`owner`, the newly added ``Node`` will not be visible in the scene tree, though it will be visible in the 2D/3D view. + +---- + +.. _class_Node_method_add_child_below_node: + +- void **add_child_below_node** **(** :ref:`Node` node, :ref:`Node` child_node, :ref:`bool` legible_unique_name=false **)** + +Adds ``child_node`` as a child. The child is placed below the given ``node`` in the list of children. + +If ``legible_unique_name`` is ``true``, the child node will have a human-readable name based on the name of the node being instanced instead of its type. + +---- + +.. _class_Node_method_add_to_group: + +- void **add_to_group** **(** :ref:`String` group, :ref:`bool` persistent=false **)** + +Adds the node to a group. Groups are helpers to name and organize a subset of nodes, for example "enemies" or "collectables". A node can be in any number of groups. Nodes can be assigned a group at any time, but will not be added until they are inside the scene tree (see :ref:`is_inside_tree`). See notes in the description, and the group methods in :ref:`SceneTree`. + +The ``persistent`` option is used when packing node to :ref:`PackedScene` and saving to file. Non-persistent groups aren't stored. + +**Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs. + +---- + +.. _class_Node_method_can_process: + +- :ref:`bool` **can_process** **(** **)** |const| + +Returns ``true`` if the node can process while the scene tree is paused (see :ref:`pause_mode`). Always returns ``true`` if the scene tree is not paused, and ``false`` if the node is not in the tree. + +---- + +.. _class_Node_method_duplicate: + +- :ref:`Node` **duplicate** **(** :ref:`int` flags=15 **)** |const| + +Duplicates the node, returning a new node. + +You can fine-tune the behavior using the ``flags`` (see :ref:`DuplicateFlags`). + +**Note:** It will not work properly if the node contains a script with constructor arguments (i.e. needs to supply arguments to :ref:`Object._init` method). In that case, the node will be duplicated without a script. + +---- + +.. _class_Node_method_find_node: + +- :ref:`Node` **find_node** **(** :ref:`String` mask, :ref:`bool` recursive=true, :ref:`bool` owned=true **)** |const| + +Finds a descendant of this node whose name matches ``mask`` as in :ref:`String.match` (i.e. case-sensitive, but ``"*"`` matches zero or more characters and ``"?"`` matches any single character except ``"."``). Returns ``null`` if no matching ``Node`` is found. + +**Note:** It does not match against the full path, just against individual node names. + +If ``owned`` is ``true``, this method only finds nodes whose owner is this node. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. + +**Note:** As this method walks through all the descendants of the node, it is the slowest way to get a reference to another node. Whenever possible, consider using :ref:`get_node` instead. To avoid using :ref:`find_node` too often, consider caching the node reference into a variable. + +---- + +.. _class_Node_method_find_parent: + +- :ref:`Node` **find_parent** **(** :ref:`String` mask **)** |const| + +Finds the first parent of the current node whose name matches ``mask`` as in :ref:`String.match` (i.e. case-sensitive, but ``"*"`` matches zero or more characters and ``"?"`` matches any single character except ``"."``). + +**Note:** It does not match against the full path, just against individual node names. + +**Note:** As this method walks upwards in the scene tree, it can be slow in large, deeply nested scene trees. Whenever possible, consider using :ref:`get_node` instead. To avoid using :ref:`find_parent` too often, consider caching the node reference into a variable. + +---- + +.. _class_Node_method_get_child: + +- :ref:`Node` **get_child** **(** :ref:`int` idx **)** |const| + +Returns a child node by its index (see :ref:`get_child_count`). This method is often used for iterating all children of a node. + +To access a child node via its name, use :ref:`get_node`. + +---- + +.. _class_Node_method_get_child_count: + +- :ref:`int` **get_child_count** **(** **)** |const| + +Returns the number of child nodes. + +---- + +.. _class_Node_method_get_children: + +- :ref:`Array` **get_children** **(** **)** |const| + +Returns an array of references to node's children. + +---- + +.. _class_Node_method_get_groups: + +- :ref:`Array` **get_groups** **(** **)** |const| + +Returns an array listing the groups that the node is a member of. + +**Note:** For performance reasons, the order of node groups is *not* guaranteed. The order of node groups should not be relied upon as it can vary across project runs. + +**Note:** The engine uses some group names internally (all starting with an underscore). To avoid conflicts with internal groups, do not add custom groups whose name starts with an underscore. To exclude internal groups while looping over :ref:`get_groups`, use the following snippet: + +:: + + # Stores the node's non-internal groups only (as an array of Strings). + var non_internal_groups = [] + for group in get_groups(): + if not group.begins_with("_"): + non_internal_groups.push_back(group) + +---- + +.. _class_Node_method_get_index: + +- :ref:`int` **get_index** **(** **)** |const| + +Returns the node's index, i.e. its position among the siblings of its parent. + +---- + +.. _class_Node_method_get_network_master: + +- :ref:`int` **get_network_master** **(** **)** |const| + +Returns the peer ID of the network master for this node. See :ref:`set_network_master`. + +---- + +.. _class_Node_method_get_node: + +- :ref:`Node` **get_node** **(** :ref:`NodePath` path **)** |const| + +Fetches a node. The :ref:`NodePath` can be either a relative path (from the current node) or an absolute path (in the scene tree) to a node. If the path does not exist, a ``null instance`` is returned and an error is logged. Attempts to access methods on the return value will result in an "Attempt to call on a null instance." error. + +**Note:** Fetching absolute paths only works when the node is inside the scene tree (see :ref:`is_inside_tree`). + +**Example:** Assume your current node is Character and the following tree: + +:: + + /root + /root/Character + /root/Character/Sword + /root/Character/Backpack/Dagger + /root/MyGame + /root/Swamp/Alligator + /root/Swamp/Mosquito + /root/Swamp/Goblin + +Possible paths are: + +:: + + get_node("Sword") + get_node("Backpack/Dagger") + get_node("../Swamp/Alligator") + get_node("/root/MyGame") + +---- + +.. _class_Node_method_get_node_and_resource: + +- :ref:`Array` **get_node_and_resource** **(** :ref:`NodePath` path **)** + +Fetches a node and one of its resources as specified by the :ref:`NodePath`'s subname (e.g. ``Area2D/CollisionShape2D:shape``). If several nested resources are specified in the :ref:`NodePath`, the last one will be fetched. + +The return value is an array of size 3: the first index points to the ``Node`` (or ``null`` if not found), the second index points to the :ref:`Resource` (or ``null`` if not found), and the third index is the remaining :ref:`NodePath`, if any. + +For example, assuming that ``Area2D/CollisionShape2D`` is a valid node and that its ``shape`` property has been assigned a :ref:`RectangleShape2D` resource, one could have this kind of output: + +:: + + print(get_node_and_resource("Area2D/CollisionShape2D")) # [[CollisionShape2D:1161], Null, ] + print(get_node_and_resource("Area2D/CollisionShape2D:shape")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], ] + print(get_node_and_resource("Area2D/CollisionShape2D:shape:extents")) # [[CollisionShape2D:1161], [RectangleShape2D:1156], :extents] + +---- + +.. _class_Node_method_get_node_or_null: + +- :ref:`Node` **get_node_or_null** **(** :ref:`NodePath` path **)** |const| + +Similar to :ref:`get_node`, but does not log an error if ``path`` does not point to a valid ``Node``. + +---- + +.. _class_Node_method_get_parent: + +- :ref:`Node` **get_parent** **(** **)** |const| + +Returns the parent node of the current node, or a ``null instance`` if the node lacks a parent. + +---- + +.. _class_Node_method_get_path: + +- :ref:`NodePath` **get_path** **(** **)** |const| + +Returns the absolute path of the current node. This only works if the current node is inside the scene tree (see :ref:`is_inside_tree`). + +---- + +.. _class_Node_method_get_path_to: + +- :ref:`NodePath` **get_path_to** **(** :ref:`Node` node **)** |const| + +Returns the relative :ref:`NodePath` from this node to the specified ``node``. Both nodes must be in the same scene or the function will fail. + +---- + +.. _class_Node_method_get_physics_process_delta_time: + +- :ref:`float` **get_physics_process_delta_time** **(** **)** |const| + +Returns the time elapsed (in seconds) since the last physics-bound frame (see :ref:`_physics_process`). This is always a constant value in physics processing unless the frames per second is changed via :ref:`Engine.iterations_per_second`. + +---- + +.. _class_Node_method_get_position_in_parent: + +- :ref:`int` **get_position_in_parent** **(** **)** |const| + +Returns the node's order in the scene tree branch. For example, if called on the first child node the position is ``0``. + +---- + +.. _class_Node_method_get_process_delta_time: + +- :ref:`float` **get_process_delta_time** **(** **)** |const| + +Returns the time elapsed (in seconds) since the last process callback. This value may vary from frame to frame. + +---- + +.. _class_Node_method_get_scene_instance_load_placeholder: + +- :ref:`bool` **get_scene_instance_load_placeholder** **(** **)** |const| + +Returns ``true`` if this is an instance load placeholder. See :ref:`InstancePlaceholder`. + +---- + +.. _class_Node_method_get_tree: + +- :ref:`SceneTree` **get_tree** **(** **)** |const| + +Returns the :ref:`SceneTree` that contains this node. + +---- + +.. _class_Node_method_get_viewport: + +- :ref:`Viewport` **get_viewport** **(** **)** |const| + +Returns the node's :ref:`Viewport`. + +---- + +.. _class_Node_method_has_node: + +- :ref:`bool` **has_node** **(** :ref:`NodePath` path **)** |const| + +Returns ``true`` if the node that the :ref:`NodePath` points to exists. + +---- + +.. _class_Node_method_has_node_and_resource: + +- :ref:`bool` **has_node_and_resource** **(** :ref:`NodePath` path **)** |const| + +Returns ``true`` if the :ref:`NodePath` points to a valid node and its subname points to a valid resource, e.g. ``Area2D/CollisionShape2D:shape``. Properties with a non-:ref:`Resource` type (e.g. nodes or primitive math types) are not considered resources. + +---- + +.. _class_Node_method_is_a_parent_of: + +- :ref:`bool` **is_a_parent_of** **(** :ref:`Node` node **)** |const| + +Returns ``true`` if the given node is a direct or indirect child of the current node. + +---- + +.. _class_Node_method_is_displayed_folded: + +- :ref:`bool` **is_displayed_folded** **(** **)** |const| + +Returns ``true`` if the node is folded (collapsed) in the Scene dock. + +---- + +.. _class_Node_method_is_greater_than: + +- :ref:`bool` **is_greater_than** **(** :ref:`Node` node **)** |const| + +Returns ``true`` if the given node occurs later in the scene hierarchy than the current node. + +---- + +.. _class_Node_method_is_in_group: + +- :ref:`bool` **is_in_group** **(** :ref:`String` group **)** |const| + +Returns ``true`` if this node is in the specified group. See notes in the description, and the group methods in :ref:`SceneTree`. + +---- + +.. _class_Node_method_is_inside_tree: + +- :ref:`bool` **is_inside_tree** **(** **)** |const| + +Returns ``true`` if this node is currently inside a :ref:`SceneTree`. + +---- + +.. _class_Node_method_is_network_master: + +- :ref:`bool` **is_network_master** **(** **)** |const| + +Returns ``true`` if the local system is the master of this node. + +---- + +.. _class_Node_method_is_physics_processing: + +- :ref:`bool` **is_physics_processing** **(** **)** |const| + +Returns ``true`` if physics processing is enabled (see :ref:`set_physics_process`). + +---- + +.. _class_Node_method_is_physics_processing_internal: + +- :ref:`bool` **is_physics_processing_internal** **(** **)** |const| + +Returns ``true`` if internal physics processing is enabled (see :ref:`set_physics_process_internal`). + +---- + +.. _class_Node_method_is_processing: + +- :ref:`bool` **is_processing** **(** **)** |const| + +Returns ``true`` if processing is enabled (see :ref:`set_process`). + +---- + +.. _class_Node_method_is_processing_input: + +- :ref:`bool` **is_processing_input** **(** **)** |const| + +Returns ``true`` if the node is processing input (see :ref:`set_process_input`). + +---- + +.. _class_Node_method_is_processing_internal: + +- :ref:`bool` **is_processing_internal** **(** **)** |const| + +Returns ``true`` if internal processing is enabled (see :ref:`set_process_internal`). + +---- + +.. _class_Node_method_is_processing_unhandled_input: + +- :ref:`bool` **is_processing_unhandled_input** **(** **)** |const| + +Returns ``true`` if the node is processing unhandled input (see :ref:`set_process_unhandled_input`). + +---- + +.. _class_Node_method_is_processing_unhandled_key_input: + +- :ref:`bool` **is_processing_unhandled_key_input** **(** **)** |const| + +Returns ``true`` if the node is processing unhandled key input (see :ref:`set_process_unhandled_key_input`). + +---- + +.. _class_Node_method_move_child: + +- void **move_child** **(** :ref:`Node` child_node, :ref:`int` to_position **)** + +Moves a child node to a different position (order) among the other children. Since calls, signals, etc are performed by tree order, changing the order of children nodes may be useful. + +---- + +.. _class_Node_method_print_stray_nodes: + +- void **print_stray_nodes** **(** **)** + +Prints all stray nodes (nodes outside the :ref:`SceneTree`). Used for debugging. Works only in debug builds. + +---- + +.. _class_Node_method_print_tree: + +- void **print_tree** **(** **)** + +Prints the tree to stdout. Used mainly for debugging purposes. This version displays the path relative to the current node, and is good for copy/pasting into the :ref:`get_node` function. + +**Example output:** + +:: + + TheGame + TheGame/Menu + TheGame/Menu/Label + TheGame/Menu/Camera2D + TheGame/SplashScreen + TheGame/SplashScreen/Camera2D + +---- + +.. _class_Node_method_print_tree_pretty: + +- void **print_tree_pretty** **(** **)** + +Similar to :ref:`print_tree`, this prints the tree to stdout. This version displays a more graphical representation similar to what is displayed in the scene inspector. It is useful for inspecting larger trees. + +**Example output:** + +:: + + ┖╴TheGame + ┠╴Menu + ┃ ┠╴Label + ┃ ┖╴Camera2D + ┖╴SplashScreen + ┖╴Camera2D + +---- + +.. _class_Node_method_propagate_call: + +- void **propagate_call** **(** :ref:`String` method, :ref:`Array` args=[ ], :ref:`bool` parent_first=false **)** + +Calls the given method (if present) with the arguments given in ``args`` on this node and recursively on all its children. If the ``parent_first`` argument is ``true``, the method will be called on the current node first, then on all its children. If ``parent_first`` is ``false``, the children will be called first. + +---- + +.. _class_Node_method_propagate_notification: + +- void **propagate_notification** **(** :ref:`int` what **)** + +Notifies the current node and all its children recursively by calling :ref:`Object.notification` on all of them. + +---- + +.. _class_Node_method_queue_free: + +- void **queue_free** **(** **)** + +Queues a node for deletion at the end of the current frame. When deleted, all of its child nodes will be deleted as well. This method ensures it's safe to delete the node, contrary to :ref:`Object.free`. Use :ref:`Object.is_queued_for_deletion` to check whether a node will be deleted at the end of the frame. + +**Important:** If you have a variable pointing to a node, it will *not* be assigned to ``null`` once the node is freed. Instead, it will point to a *previously freed instance* and you should validate it with :ref:`@GDScript.is_instance_valid` before attempting to call its methods or access its properties. + +---- + +.. _class_Node_method_raise: + +- void **raise** **(** **)** + +Moves this node to the bottom of parent node's children hierarchy. This is often useful in GUIs (:ref:`Control` nodes), because their order of drawing depends on their order in the tree. The top Node is drawn first, then any siblings below the top Node in the hierarchy are successively drawn on top of it. After using ``raise``, a Control will be drawn on top of its siblings. + +---- + +.. _class_Node_method_remove_and_skip: + +- void **remove_and_skip** **(** **)** + +Removes a node and sets all its children as children of the parent node (if it exists). All event subscriptions that pass by the removed node will be unsubscribed. + +---- + +.. _class_Node_method_remove_child: + +- void **remove_child** **(** :ref:`Node` node **)** + +Removes a child node. The node is NOT deleted and must be deleted manually. + +**Note:** This function may set the :ref:`owner` of the removed Node (or its descendants) to be ``null``, if that :ref:`owner` is no longer a parent or ancestor. + +---- + +.. _class_Node_method_remove_from_group: + +- void **remove_from_group** **(** :ref:`String` group **)** + +Removes a node from a group. See notes in the description, and the group methods in :ref:`SceneTree`. + +---- + +.. _class_Node_method_replace_by: + +- void **replace_by** **(** :ref:`Node` node, :ref:`bool` keep_data=false **)** + +Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost. + +Note that the replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using :ref:`Object.free`. + +---- + +.. _class_Node_method_request_ready: + +- void **request_ready** **(** **)** + +Requests that ``_ready`` be called again. Note that the method won't be called immediately, but is scheduled for when the node is added to the scene tree again (see :ref:`_ready`). ``_ready`` is called only for the node which requested it, which means that you need to request ready for each child if you want them to call ``_ready`` too (in which case, ``_ready`` will be called in the same order as it would normally). + +---- + +.. _class_Node_method_rpc: + +- :ref:`Variant` **rpc** **(** :ref:`String` method, ... **)** |vararg| + +Sends a remote procedure call request for the given ``method`` to peers on the network (and locally), optionally sending all additional arguments as arguments to the method called by the RPC. The call request will only be received by nodes with the same :ref:`NodePath`, including the exact same node name. Behaviour depends on the RPC configuration for the given method, see :ref:`rpc_config`. Methods are not exposed to RPCs by default. See also :ref:`rset` and :ref:`rset_config` for properties. Returns an empty :ref:`Variant`. + +**Note:** You can only safely use RPCs on clients after you received the ``connected_to_server`` signal from the :ref:`SceneTree`. You also need to keep track of the connection state, either by the :ref:`SceneTree` signals like ``server_disconnected`` or by checking ``SceneTree.network_peer.get_connection_status() == CONNECTION_CONNECTED``. + +---- + +.. _class_Node_method_rpc_config: + +- void **rpc_config** **(** :ref:`String` method, :ref:`RPCMode` mode **)** + +Changes the RPC mode for the given ``method`` to the given ``mode``. See :ref:`RPCMode`. An alternative is annotating methods and properties with the corresponding keywords (``remote``, ``master``, ``puppet``, ``remotesync``, ``mastersync``, ``puppetsync``). By default, methods are not exposed to networking (and RPCs). See also :ref:`rset` and :ref:`rset_config` for properties. + +---- + +.. _class_Node_method_rpc_id: + +- :ref:`Variant` **rpc_id** **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| + +Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns an empty :ref:`Variant`. + +---- + +.. _class_Node_method_rpc_unreliable: + +- :ref:`Variant` **rpc_unreliable** **(** :ref:`String` method, ... **)** |vararg| + +Sends a :ref:`rpc` using an unreliable protocol. Returns an empty :ref:`Variant`. + +---- + +.. _class_Node_method_rpc_unreliable_id: + +- :ref:`Variant` **rpc_unreliable_id** **(** :ref:`int` peer_id, :ref:`String` method, ... **)** |vararg| + +Sends a :ref:`rpc` to a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). Returns an empty :ref:`Variant`. + +---- + +.. _class_Node_method_rset: + +- void **rset** **(** :ref:`String` property, :ref:`Variant` value **)** + +Remotely changes a property's value on other peers (and locally). Behaviour depends on the RPC configuration for the given property, see :ref:`rset_config`. See also :ref:`rpc` for RPCs for methods, most information applies to this method as well. + +---- + +.. _class_Node_method_rset_config: + +- void **rset_config** **(** :ref:`String` property, :ref:`RPCMode` mode **)** + +Changes the RPC mode for the given ``property`` to the given ``mode``. See :ref:`RPCMode`. An alternative is annotating methods and properties with the corresponding keywords (``remote``, ``master``, ``puppet``, ``remotesync``, ``mastersync``, ``puppetsync``). By default, properties are not exposed to networking (and RPCs). See also :ref:`rpc` and :ref:`rpc_config` for methods. + +---- + +.. _class_Node_method_rset_id: + +- void **rset_id** **(** :ref:`int` peer_id, :ref:`String` property, :ref:`Variant` value **)** + +Remotely changes the property's value on a specific peer identified by ``peer_id`` (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). + +---- + +.. _class_Node_method_rset_unreliable: + +- void **rset_unreliable** **(** :ref:`String` property, :ref:`Variant` value **)** + +Remotely changes the property's value on other peers (and locally) using an unreliable protocol. + +---- + +.. _class_Node_method_rset_unreliable_id: + +- void **rset_unreliable_id** **(** :ref:`int` peer_id, :ref:`String` property, :ref:`Variant` value **)** + +Remotely changes property's value on a specific peer identified by ``peer_id`` using an unreliable protocol (see :ref:`NetworkedMultiplayerPeer.set_target_peer`). + +---- + +.. _class_Node_method_set_display_folded: + +- void **set_display_folded** **(** :ref:`bool` fold **)** + +Sets the folded state of the node in the Scene dock. + +---- + +.. _class_Node_method_set_network_master: + +- void **set_network_master** **(** :ref:`int` id, :ref:`bool` recursive=true **)** + +Sets the node's network master to the peer with the given peer ID. The network master is the peer that has authority over the node on the network. Useful in conjunction with the ``master`` and ``puppet`` keywords. Inherited from the parent node by default, which ultimately defaults to peer ID 1 (the server). If ``recursive``, the given peer is recursively set as the master for all children of this node. + +---- + +.. _class_Node_method_set_physics_process: + +- void **set_physics_process** **(** :ref:`bool` enable **)** + +Enables or disables physics (i.e. fixed framerate) processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PHYSICS_PROCESS` at a fixed (usually 60 FPS, see :ref:`Engine.iterations_per_second` to change) interval (and the :ref:`_physics_process` callback will be called if exists). Enabled automatically if :ref:`_physics_process` is overridden. Any calls to this before :ref:`_ready` will be ignored. + +---- + +.. _class_Node_method_set_physics_process_internal: + +- void **set_physics_process_internal** **(** :ref:`bool` enable **)** + +Enables or disables internal physics for this node. Internal physics processing happens in isolation from the normal :ref:`_physics_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or physics processing is disabled for scripting (:ref:`set_physics_process`). Only useful for advanced uses to manipulate built-in nodes' behavior. + +**Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. + +---- + +.. _class_Node_method_set_process: + +- void **set_process** **(** :ref:`bool` enable **)** + +Enables or disables processing. When a node is being processed, it will receive a :ref:`NOTIFICATION_PROCESS` on every drawn frame (and the :ref:`_process` callback will be called if exists). Enabled automatically if :ref:`_process` is overridden. Any calls to this before :ref:`_ready` will be ignored. + +---- + +.. _class_Node_method_set_process_input: + +- void **set_process_input** **(** :ref:`bool` enable **)** + +Enables or disables input processing. This is not required for GUI controls! Enabled automatically if :ref:`_input` is overridden. Any calls to this before :ref:`_ready` will be ignored. + +---- + +.. _class_Node_method_set_process_internal: + +- void **set_process_internal** **(** :ref:`bool` enable **)** + +Enables or disabled internal processing for this node. Internal processing happens in isolation from the normal :ref:`_process` calls and is used by some nodes internally to guarantee proper functioning even if the node is paused or processing is disabled for scripting (:ref:`set_process`). Only useful for advanced uses to manipulate built-in nodes' behavior. + +**Warning:** Built-in Nodes rely on the internal processing for their own logic, so changing this value from your code may lead to unexpected behavior. Script access to this internal logic is provided for specific advanced uses, but is unsafe and not supported. + +---- + +.. _class_Node_method_set_process_unhandled_input: + +- void **set_process_unhandled_input** **(** :ref:`bool` enable **)** + +Enables unhandled input processing. This is not required for GUI controls! It enables the node to receive all input that was not previously handled (usually by a :ref:`Control`). Enabled automatically if :ref:`_unhandled_input` is overridden. Any calls to this before :ref:`_ready` will be ignored. + +---- + +.. _class_Node_method_set_process_unhandled_key_input: + +- void **set_process_unhandled_key_input** **(** :ref:`bool` enable **)** + +Enables unhandled key input processing. Enabled automatically if :ref:`_unhandled_key_input` is overridden. Any calls to this before :ref:`_ready` will be ignored. + +---- + +.. _class_Node_method_set_scene_instance_load_placeholder: + +- void **set_scene_instance_load_placeholder** **(** :ref:`bool` load_placeholder **)** + +Sets whether this is an instance load placeholder. See :ref:`InstancePlaceholder`. + +---- + +.. _class_Node_method_update_configuration_warning: + +- void **update_configuration_warning** **(** **)** + +Updates the warning displayed for this node in the Scene Dock. + +Use :ref:`_get_configuration_warning` to setup the warning message to display. + +.. |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.)` diff --git a/classes/class_node2d.rst b/classes/class_node2d.rst new file mode 100644 index 0000000..c7582f0 --- /dev/null +++ b/classes/class_node2d.rst @@ -0,0 +1,360 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Node2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Node2D: + +Node2D +====== + +**Inherits:** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`AnimatedSprite`, :ref:`AudioStreamPlayer2D`, :ref:`BackBufferCopy`, :ref:`Bone2D`, :ref:`CPUParticles2D`, :ref:`Camera2D`, :ref:`CanvasModulate`, :ref:`CollisionObject2D`, :ref:`CollisionPolygon2D`, :ref:`CollisionShape2D`, :ref:`Joint2D`, :ref:`Light2D`, :ref:`LightOccluder2D`, :ref:`Line2D`, :ref:`Listener2D`, :ref:`MeshInstance2D`, :ref:`MultiMeshInstance2D`, :ref:`Navigation2D`, :ref:`NavigationPolygonInstance`, :ref:`ParallaxLayer`, :ref:`Particles2D`, :ref:`Path2D`, :ref:`PathFollow2D`, :ref:`Polygon2D`, :ref:`Position2D`, :ref:`RayCast2D`, :ref:`RemoteTransform2D`, :ref:`Skeleton2D`, :ref:`Sprite`, :ref:`TileMap`, :ref:`TouchScreenButton`, :ref:`VisibilityNotifier2D`, :ref:`YSort` + +A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. + +Description +----------- + +A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. + +Tutorials +--------- + +- :doc:`../tutorials/2d/custom_drawing_in_2d` + +- `All 2D Demos `__ + +Properties +---------- + ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`global_position` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`global_rotation` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`global_rotation_degrees` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`global_scale` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Transform2D` | :ref:`global_transform` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`rotation` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`rotation_degrees` | ``0.0`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`scale` | ``Vector2( 1, 1 )`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`Transform2D` | :ref:`transform` | | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`z_as_relative` | ``true`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`z_index` | ``0`` | ++---------------------------------------+-------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_scale` **(** :ref:`Vector2` ratio **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_angle_to` **(** :ref:`Vector2` point **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_relative_transform_to_parent` **(** :ref:`Node` parent **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_translate` **(** :ref:`Vector2` offset **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`look_at` **(** :ref:`Vector2` point **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_local_x` **(** :ref:`float` delta, :ref:`bool` scaled=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_local_y` **(** :ref:`float` delta, :ref:`bool` scaled=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate` **(** :ref:`float` radians **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`to_global` **(** :ref:`Vector2` local_point **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`to_local` **(** :ref:`Vector2` global_point **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`translate` **(** :ref:`Vector2` offset **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Node2D_property_global_position: + +- :ref:`Vector2` **global_position** + ++----------+----------------------------+ +| *Setter* | set_global_position(value) | ++----------+----------------------------+ +| *Getter* | get_global_position() | ++----------+----------------------------+ + +Global position. + +---- + +.. _class_Node2D_property_global_rotation: + +- :ref:`float` **global_rotation** + ++----------+----------------------------+ +| *Setter* | set_global_rotation(value) | ++----------+----------------------------+ +| *Getter* | get_global_rotation() | ++----------+----------------------------+ + +Global rotation in radians. + +---- + +.. _class_Node2D_property_global_rotation_degrees: + +- :ref:`float` **global_rotation_degrees** + ++----------+------------------------------------+ +| *Setter* | set_global_rotation_degrees(value) | ++----------+------------------------------------+ +| *Getter* | get_global_rotation_degrees() | ++----------+------------------------------------+ + +Global rotation in degrees. + +---- + +.. _class_Node2D_property_global_scale: + +- :ref:`Vector2` **global_scale** + ++----------+-------------------------+ +| *Setter* | set_global_scale(value) | ++----------+-------------------------+ +| *Getter* | get_global_scale() | ++----------+-------------------------+ + +Global scale. + +---- + +.. _class_Node2D_property_global_transform: + +- :ref:`Transform2D` **global_transform** + ++----------+-----------------------------+ +| *Setter* | set_global_transform(value) | ++----------+-----------------------------+ +| *Getter* | get_global_transform() | ++----------+-----------------------------+ + +Global :ref:`Transform2D`. + +---- + +.. _class_Node2D_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_position(value) | ++-----------+---------------------+ +| *Getter* | get_position() | ++-----------+---------------------+ + +Position, relative to the node's parent. + +---- + +.. _class_Node2D_property_rotation: + +- :ref:`float` **rotation** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_rotation(value) | ++-----------+---------------------+ +| *Getter* | get_rotation() | ++-----------+---------------------+ + +Rotation in radians, relative to the node's parent. + +---- + +.. _class_Node2D_property_rotation_degrees: + +- :ref:`float` **rotation_degrees** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_rotation_degrees(value) | ++-----------+-----------------------------+ +| *Getter* | get_rotation_degrees() | ++-----------+-----------------------------+ + +Rotation in degrees, relative to the node's parent. + +---- + +.. _class_Node2D_property_scale: + +- :ref:`Vector2` **scale** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_scale(value) | ++-----------+---------------------+ +| *Getter* | get_scale() | ++-----------+---------------------+ + +The node's scale. Unscaled value: ``(1, 1)``. + +---- + +.. _class_Node2D_property_transform: + +- :ref:`Transform2D` **transform** + ++----------+----------------------+ +| *Setter* | set_transform(value) | ++----------+----------------------+ +| *Getter* | get_transform() | ++----------+----------------------+ + +Local :ref:`Transform2D`. + +---- + +.. _class_Node2D_property_z_as_relative: + +- :ref:`bool` **z_as_relative** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_z_as_relative(value) | ++-----------+--------------------------+ +| *Getter* | is_z_relative() | ++-----------+--------------------------+ + +If ``true``, the node's Z index is relative to its parent's Z index. If this node's Z index is 2 and its parent's effective Z index is 3, then this node's effective Z index will be 2 + 3 = 5. + +---- + +.. _class_Node2D_property_z_index: + +- :ref:`int` **z_index** + ++-----------+--------------------+ +| *Default* | ``0`` | ++-----------+--------------------+ +| *Setter* | set_z_index(value) | ++-----------+--------------------+ +| *Getter* | get_z_index() | ++-----------+--------------------+ + +Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. Must be between :ref:`VisualServer.CANVAS_ITEM_Z_MIN` and :ref:`VisualServer.CANVAS_ITEM_Z_MAX` (inclusive). + +Method Descriptions +------------------- + +.. _class_Node2D_method_apply_scale: + +- void **apply_scale** **(** :ref:`Vector2` ratio **)** + +Multiplies the current scale by the ``ratio`` vector. + +---- + +.. _class_Node2D_method_get_angle_to: + +- :ref:`float` **get_angle_to** **(** :ref:`Vector2` point **)** |const| + +Returns the angle between the node and the ``point`` in radians. + +`Illustration of the returned angle. `__ + +---- + +.. _class_Node2D_method_get_relative_transform_to_parent: + +- :ref:`Transform2D` **get_relative_transform_to_parent** **(** :ref:`Node` parent **)** |const| + +Returns the :ref:`Transform2D` relative to this node's parent. + +---- + +.. _class_Node2D_method_global_translate: + +- void **global_translate** **(** :ref:`Vector2` offset **)** + +Adds the ``offset`` vector to the node's global position. + +---- + +.. _class_Node2D_method_look_at: + +- void **look_at** **(** :ref:`Vector2` point **)** + +Rotates the node so it points towards the ``point``, which is expected to use global coordinates. + +---- + +.. _class_Node2D_method_move_local_x: + +- void **move_local_x** **(** :ref:`float` delta, :ref:`bool` scaled=false **)** + +Applies a local translation on the node's X axis based on the :ref:`Node._process`'s ``delta``. If ``scaled`` is ``false``, normalizes the movement. + +---- + +.. _class_Node2D_method_move_local_y: + +- void **move_local_y** **(** :ref:`float` delta, :ref:`bool` scaled=false **)** + +Applies a local translation on the node's Y axis based on the :ref:`Node._process`'s ``delta``. If ``scaled`` is ``false``, normalizes the movement. + +---- + +.. _class_Node2D_method_rotate: + +- void **rotate** **(** :ref:`float` radians **)** + +Applies a rotation to the node, in radians, starting from its current rotation. + +---- + +.. _class_Node2D_method_to_global: + +- :ref:`Vector2` **to_global** **(** :ref:`Vector2` local_point **)** |const| + +Transforms the provided local position into a position in global coordinate space. The input is expected to be local relative to the ``Node2D`` it is called on. e.g. Applying this method to the positions of child nodes will correctly transform their positions into the global coordinate space, but applying it to a node's own position will give an incorrect result, as it will incorporate the node's own transformation into its global position. + +---- + +.. _class_Node2D_method_to_local: + +- :ref:`Vector2` **to_local** **(** :ref:`Vector2` global_point **)** |const| + +Transforms the provided global position into a position in local coordinate space. The output will be local relative to the ``Node2D`` it is called on. e.g. It is appropriate for determining the positions of child nodes, but it is not appropriate for determining its own position relative to its parent. + +---- + +.. _class_Node2D_method_translate: + +- void **translate** **(** :ref:`Vector2` offset **)** + +Translates the node by the given ``offset`` in local coordinates. + +.. |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.)` diff --git a/classes/class_nodepath.rst b/classes/class_nodepath.rst new file mode 100644 index 0000000..8c84e39 --- /dev/null +++ b/classes/class_nodepath.rst @@ -0,0 +1,192 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the NodePath.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NodePath: + +NodePath +======== + +Pre-parsed scene tree path. + +Description +----------- + +A pre-parsed relative or absolute path in a scene tree, for use with :ref:`Node.get_node` and similar functions. It can reference a node, a resource within a node, or a property of a node or resource. For instance, ``"Path2D/PathFollow2D/Sprite:texture:size"`` would refer to the ``size`` property of the ``texture`` resource on the node named ``"Sprite"`` which is a child of the other named nodes in the path. + +You will usually just pass a string to :ref:`Node.get_node` and it will be automatically converted, but you may occasionally want to parse a path ahead of time with ``NodePath`` or the literal syntax ``@"path"``. Exporting a ``NodePath`` variable will give you a node selection widget in the properties panel of the editor, which can often be useful. + +A ``NodePath`` is composed of a list of slash-separated node names (like a filesystem path) and an optional colon-separated list of "subnames" which can be resources or properties. + +Some examples of NodePaths include the following: + +:: + + # No leading slash means it is relative to the current node. + @"A" # Immediate child A + @"A/B" # A's child B + @"." # The current node. + @".." # The parent node. + @"../C" # A sibling node C. + # A leading slash means it is absolute from the SceneTree. + @"/root" # Equivalent to get_tree().get_root(). + @"/root/Main" # If your main scene's root node were named "Main". + @"/root/MyAutoload" # If you have an autoloaded node or scene. + +**Note:** In the editor, ``NodePath`` properties are automatically updated when moving, renaming or deleting a node in the scene tree, but they are never updated at runtime. + +Tutorials +--------- + +- `2D Role Playing Game Demo `__ + +Methods +------- + ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`NodePath` **(** :ref:`String` from **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_as_property_path` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_concatenated_subnames` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** :ref:`int` idx **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_name_count` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_subname` **(** :ref:`int` idx **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_subname_count` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_absolute` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_NodePath_method_NodePath: + +- :ref:`NodePath` **NodePath** **(** :ref:`String` from **)** + +Creates a NodePath from a string, e.g. ``"Path2D/PathFollow2D/Sprite:texture:size"``. A path is absolute if it starts with a slash. Absolute paths are only valid in the global scene tree, not within individual scenes. In a relative path, ``"."`` and ``".."`` indicate the current node and its parent. + +The "subnames" optionally included after the path to the target node can point to resources or properties, and can also be nested. + +Examples of valid NodePaths (assuming that those nodes exist and have the referenced resources or properties): + +:: + + # Points to the Sprite node + "Path2D/PathFollow2D/Sprite" + # Points to the Sprite node and its "texture" resource. + # get_node() would retrieve "Sprite", while get_node_and_resource() + # would retrieve both the Sprite node and the "texture" resource. + "Path2D/PathFollow2D/Sprite:texture" + # Points to the Sprite node and its "position" property. + "Path2D/PathFollow2D/Sprite:position" + # Points to the Sprite node and the "x" component of its "position" property. + "Path2D/PathFollow2D/Sprite:position:x" + # Absolute path (from "root") + "/root/Level/Path2D" + +---- + +.. _class_NodePath_method_get_as_property_path: + +- :ref:`NodePath` **get_as_property_path** **(** **)** + +Returns a node path with a colon character (``:``) prepended, transforming it to a pure property path with no node name (defaults to resolving from the current node). + +:: + + # This will be parsed as a node path to the "x" property in the "position" node + var node_path = NodePath("position:x") + # This will be parsed as a node path to the "x" component of the "position" property in the current node + var property_path = node_path.get_as_property_path() + print(property_path) # :position:x + +---- + +.. _class_NodePath_method_get_concatenated_subnames: + +- :ref:`String` **get_concatenated_subnames** **(** **)** + +Returns all subnames concatenated with a colon character (``:``) as separator, i.e. the right side of the first colon in a node path. + +:: + + var nodepath = NodePath("Path2D/PathFollow2D/Sprite:texture:load_path") + print(nodepath.get_concatenated_subnames()) # texture:load_path + +---- + +.. _class_NodePath_method_get_name: + +- :ref:`String` **get_name** **(** :ref:`int` idx **)** + +Gets the node name indicated by ``idx`` (0 to :ref:`get_name_count`). + +:: + + var node_path = NodePath("Path2D/PathFollow2D/Sprite") + print(node_path.get_name(0)) # Path2D + print(node_path.get_name(1)) # PathFollow2D + print(node_path.get_name(2)) # Sprite + +---- + +.. _class_NodePath_method_get_name_count: + +- :ref:`int` **get_name_count** **(** **)** + +Gets the number of node names which make up the path. Subnames (see :ref:`get_subname_count`) are not included. + +For example, ``"Path2D/PathFollow2D/Sprite"`` has 3 names. + +---- + +.. _class_NodePath_method_get_subname: + +- :ref:`String` **get_subname** **(** :ref:`int` idx **)** + +Gets the resource or property name indicated by ``idx`` (0 to :ref:`get_subname_count`). + +:: + + var node_path = NodePath("Path2D/PathFollow2D/Sprite:texture:load_path") + print(node_path.get_subname(0)) # texture + print(node_path.get_subname(1)) # load_path + +---- + +.. _class_NodePath_method_get_subname_count: + +- :ref:`int` **get_subname_count** **(** **)** + +Gets the number of resource or property names ("subnames") in the path. Each subname is listed after a colon character (``:``) in the node path. + +For example, ``"Path2D/PathFollow2D/Sprite:texture:load_path"`` has 2 subnames. + +---- + +.. _class_NodePath_method_is_absolute: + +- :ref:`bool` **is_absolute** **(** **)** + +Returns ``true`` if the node path is absolute (as opposed to relative), which means that it starts with a slash character (``/``). Absolute node paths can be used to access the root node (``"/root"``) or autoloads (e.g. ``"/global"`` if a "global" autoload was registered). + +---- + +.. _class_NodePath_method_is_empty: + +- :ref:`bool` **is_empty** **(** **)** + +Returns ``true`` if the node path is empty. + +.. |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.)` diff --git a/classes/class_noisetexture.rst b/classes/class_noisetexture.rst new file mode 100644 index 0000000..28d2d8a --- /dev/null +++ b/classes/class_noisetexture.rst @@ -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 NoiseTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_NoiseTexture: + +NoiseTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`OpenSimplexNoise` filled texture. + +Description +----------- + +Uses an :ref:`OpenSimplexNoise` to fill the texture data. You can specify the texture size but keep in mind that larger textures will take longer to generate and seamless noise only works with square sized textures. + +NoiseTexture can also generate normalmap textures. + +The class uses :ref:`Thread`\ s to generate the texture data internally, so :ref:`Texture.get_data` may return ``null`` if the generation process has not completed yet. In that case, you need to wait for the texture to be generated before accessing the data: + +:: + + var texture = preload("res://noise.tres") + yield(texture, "changed") + var image = texture.get_data() + +Properties +---------- + ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`as_normalmap` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`bump_strength` | ``8.0`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``7`` *(parent override)* | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`height` | ``512`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`OpenSimplexNoise` | :ref:`noise` | | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`Vector2` | :ref:`noise_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`seamless` | ``false`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`width` | ``512`` | ++-------------------------------------------------+-----------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_NoiseTexture_property_as_normalmap: + +- :ref:`bool` **as_normalmap** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_as_normalmap(value) | ++-----------+-------------------------+ +| *Getter* | is_normalmap() | ++-----------+-------------------------+ + +If ``true``, the resulting texture contains a normal map created from the original noise interpreted as a bump map. + +---- + +.. _class_NoiseTexture_property_bump_strength: + +- :ref:`float` **bump_strength** + ++-----------+--------------------------+ +| *Default* | ``8.0`` | ++-----------+--------------------------+ +| *Setter* | set_bump_strength(value) | ++-----------+--------------------------+ +| *Getter* | get_bump_strength() | ++-----------+--------------------------+ + +Strength of the bump maps used in this texture. A higher value will make the bump maps appear larger while a lower value will make them appear softer. + +---- + +.. _class_NoiseTexture_property_height: + +- :ref:`int` **height** + ++-----------+-------------------+ +| *Default* | ``512`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +Height of the generated texture. + +---- + +.. _class_NoiseTexture_property_noise: + +- :ref:`OpenSimplexNoise` **noise** + ++----------+------------------+ +| *Setter* | set_noise(value) | ++----------+------------------+ +| *Getter* | get_noise() | ++----------+------------------+ + +The :ref:`OpenSimplexNoise` instance used to generate the noise. + +---- + +.. _class_NoiseTexture_property_noise_offset: + +- :ref:`Vector2` **noise_offset** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_noise_offset(value) | ++-----------+-------------------------+ +| *Getter* | get_noise_offset() | ++-----------+-------------------------+ + +An offset used to specify the noise space coordinate of the top left corner of the generated noise. This value is ignored if :ref:`seamless` is enabled. + +---- + +.. _class_NoiseTexture_property_seamless: + +- :ref:`bool` **seamless** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_seamless(value) | ++-----------+---------------------+ +| *Getter* | get_seamless() | ++-----------+---------------------+ + +Whether the texture can be tiled without visible seams or not. Seamless textures take longer to generate. + +**Note:** Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise. + +---- + +.. _class_NoiseTexture_property_width: + +- :ref:`int` **width** + ++-----------+------------------+ +| *Default* | ``512`` | ++-----------+------------------+ +| *Setter* | set_width(value) | ++-----------+------------------+ +| *Getter* | get_width() | ++-----------+------------------+ + +Width of the generated texture. + +.. |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.)` diff --git a/classes/class_object.rst b/classes/class_object.rst new file mode 100644 index 0000000..46bef38 --- /dev/null +++ b/classes/class_object.rst @@ -0,0 +1,669 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Object.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Object: + +Object +====== + +**Inherited By:** :ref:`ARVRServer`, :ref:`AudioServer`, :ref:`CameraServer`, :ref:`ClassDB`, :ref:`EditorFileSystemDirectory`, :ref:`EditorNavigationMeshGenerator`, :ref:`EditorSelection`, :ref:`EditorVCSInterface`, :ref:`Engine`, :ref:`Geometry`, :ref:`GodotSharp`, :ref:`IP`, :ref:`Input`, :ref:`InputMap`, :ref:`JNISingleton`, :ref:`JSON`, :ref:`JSONRPC`, :ref:`JavaClassWrapper`, :ref:`JavaScript`, :ref:`MainLoop`, :ref:`Marshalls`, :ref:`Node`, :ref:`OS`, :ref:`Performance`, :ref:`Physics2DDirectBodyState`, :ref:`Physics2DDirectSpaceState`, :ref:`Physics2DServer`, :ref:`PhysicsDirectBodyState`, :ref:`PhysicsDirectSpaceState`, :ref:`PhysicsServer`, :ref:`ProjectSettings`, :ref:`Reference`, :ref:`ResourceLoader`, :ref:`ResourceSaver`, :ref:`TranslationServer`, :ref:`TreeItem`, :ref:`UndoRedo`, :ref:`VisualScriptEditor`, :ref:`VisualServer` + +Base class for all non-built-in types. + +Description +----------- + +Every class which is not a built-in type inherits from this class. + +You can construct Objects from scripting languages, using ``Object.new()`` in GDScript, ``new Object`` in C#, or the "Construct Object" node in VisualScript. + +Objects do not manage memory. If a class inherits from Object, you will have to delete instances of it manually. To do so, call the :ref:`free` method from your script or delete the instance from C++. + +Some classes that extend Object add memory management. This is the case of :ref:`Reference`, which counts references and deletes itself automatically when no longer referenced. :ref:`Node`, another fundamental type, deletes all its children when freed from memory. + +Objects export properties, which are mainly useful for storage and editing, but not really so much in programming. Properties are exported in :ref:`_get_property_list` and handled in :ref:`_get` and :ref:`_set`. However, scripting languages and C++ have simpler means to export them. + +Property membership can be tested directly in GDScript using ``in``: + +:: + + var n = Node2D.new() + print("position" in n) # Prints "True". + print("other_property" in n) # Prints "False". + +The ``in`` operator will evaluate to ``true`` as long as the key exists, even if the value is ``null``. + +Objects also receive notifications. Notifications are a simple way to notify the object about different events, so they can all be handled together. See :ref:`_notification`. + +**Note:** Unlike references to a :ref:`Reference`, references to an Object stored in a variable can become invalid without warning. Therefore, it's recommended to use :ref:`Reference` for data classes instead of ``Object``. + +**Note:** Due to a bug, you can't create a "plain" Object using ``Object.new()``. Instead, use ``ClassDB.instance("Object")``. This bug only applies to Object itself, not any of its descendents like :ref:`Reference`. + +Tutorials +--------- + +- :doc:`../tutorials/best_practices/node_alternatives` + +- `#advanced-exports <../tutorials/scripting/gdscript/gdscript_exports.html#advanced-exports>`_ in :doc:`../tutorials/scripting/gdscript/gdscript_exports` + +Methods +------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`_get` **(** :ref:`String` property **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`_get_property_list` **(** **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_init` **(** **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_notification` **(** :ref:`int` what **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_set` **(** :ref:`String` property, :ref:`Variant` value **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_to_string` **(** **)** |virtual| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_user_signal` **(** :ref:`String` signal, :ref:`Array` arguments=[ ] **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call` **(** :ref:`String` method, ... **)** |vararg| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`call_deferred` **(** :ref:`String` method, ... **)** |vararg| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`callv` **(** :ref:`String` method, :ref:`Array` arg_array **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_translate_messages` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect` **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method, :ref:`Array` binds=[ ], :ref:`int` flags=0 **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect` **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`emit_signal` **(** :ref:`String` signal, ... **)** |vararg| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`free` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get` **(** :ref:`String` property **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_class` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_incoming_connections` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_indexed` **(** :ref:`NodePath` property **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_instance_id` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_meta` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_meta_list` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_method_list` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_property_list` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Reference` | :ref:`get_script` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_signal_connection_list` **(** :ref:`String` signal **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_signal_list` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_meta` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_method` **(** :ref:`String` method **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_signal` **(** :ref:`String` signal **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_user_signal` **(** :ref:`String` signal **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_blocking_signals` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_class` **(** :ref:`String` class **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connected` **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_queued_for_deletion` **(** **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`notification` **(** :ref:`int` what, :ref:`bool` reversed=false **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`property_list_changed_notify` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_meta` **(** :ref:`String` name **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_block_signals` **(** :ref:`bool` enable **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_deferred` **(** :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_indexed` **(** :ref:`NodePath` property, :ref:`Variant` value **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_message_translation` **(** :ref:`bool` enable **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_meta` **(** :ref:`String` name, :ref:`Variant` value **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_script` **(** :ref:`Reference` script **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_string` **(** **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`tr` **(** :ref:`String` message **)** |const| | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Object_signal_script_changed: + +- **script_changed** **(** **)** + +Emitted whenever the object's script is changed. + +Enumerations +------------ + +.. _enum_Object_ConnectFlags: + +.. _class_Object_constant_CONNECT_DEFERRED: + +.. _class_Object_constant_CONNECT_PERSIST: + +.. _class_Object_constant_CONNECT_ONESHOT: + +.. _class_Object_constant_CONNECT_REFERENCE_COUNTED: + +enum **ConnectFlags**: + +- **CONNECT_DEFERRED** = **1** --- Connects a signal in deferred mode. This way, signal emissions are stored in a queue, then set on idle time. + +- **CONNECT_PERSIST** = **2** --- Persisting connections are saved when the object is serialized to file. + +- **CONNECT_ONESHOT** = **4** --- One-shot connections disconnect themselves after emission. + +- **CONNECT_REFERENCE_COUNTED** = **8** --- Connect a signal as reference-counted. This means that a given signal can be connected several times to the same target, and will only be fully disconnected once no references are left. + +Constants +--------- + +.. _class_Object_constant_NOTIFICATION_POSTINITIALIZE: + +.. _class_Object_constant_NOTIFICATION_PREDELETE: + +- **NOTIFICATION_POSTINITIALIZE** = **0** --- Called right when the object is initialized. Not available in script. + +- **NOTIFICATION_PREDELETE** = **1** --- Called before the object is about to be deleted. + +Method Descriptions +------------------- + +.. _class_Object_method__get: + +- :ref:`Variant` **_get** **(** :ref:`String` property **)** |virtual| + +Virtual method which can be overridden to customize the return value of :ref:`get`. + +Returns the given property. Returns ``null`` if the ``property`` does not exist. + +---- + +.. _class_Object_method__get_property_list: + +- :ref:`Array` **_get_property_list** **(** **)** |virtual| + +Virtual method which can be overridden to customize the return value of :ref:`get_property_list`. + +Returns the object's property list as an :ref:`Array` of dictionaries. + +Each property's :ref:`Dictionary` must contain at least ``name: String`` and ``type: int`` (see :ref:`Variant.Type`) entries. Optionally, it can also include ``hint: int`` (see :ref:`PropertyHint`), ``hint_string: String``, and ``usage: int`` (see :ref:`PropertyUsageFlags`). + +---- + +.. _class_Object_method__init: + +- void **_init** **(** **)** |virtual| + +Called when the object is initialized. + +---- + +.. _class_Object_method__notification: + +- void **_notification** **(** :ref:`int` what **)** |virtual| + +Called whenever the object receives a notification, which is identified in ``what`` by a constant. The base ``Object`` has two constants :ref:`NOTIFICATION_POSTINITIALIZE` and :ref:`NOTIFICATION_PREDELETE`, but subclasses such as :ref:`Node` define a lot more notifications which are also received by this method. + +---- + +.. _class_Object_method__set: + +- :ref:`bool` **_set** **(** :ref:`String` property, :ref:`Variant` value **)** |virtual| + +Virtual method which can be overridden to customize the return value of :ref:`set`. + +Sets a property. Returns ``true`` if the ``property`` exists. + +---- + +.. _class_Object_method__to_string: + +- :ref:`String` **_to_string** **(** **)** |virtual| + +Virtual method which can be overridden to customize the return value of :ref:`to_string`, and thus the object's representation where it is converted to a string, e.g. with ``print(obj)``. + +Returns a :ref:`String` representing the object. If not overridden, defaults to ``"[ClassName:RID]"``. + +---- + +.. _class_Object_method_add_user_signal: + +- void **add_user_signal** **(** :ref:`String` signal, :ref:`Array` arguments=[ ] **)** + +Adds a user-defined ``signal``. Arguments are optional, but can be added as an :ref:`Array` of dictionaries, each containing ``name: String`` and ``type: int`` (see :ref:`Variant.Type`) entries. + +---- + +.. _class_Object_method_call: + +- :ref:`Variant` **call** **(** :ref:`String` method, ... **)** |vararg| + +Calls the ``method`` on the object and returns the result. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + +:: + + call("set", "position", Vector2(42.0, 0.0)) + +**Note:** In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). + +---- + +.. _class_Object_method_call_deferred: + +- void **call_deferred** **(** :ref:`String` method, ... **)** |vararg| + +Calls the ``method`` on the object during idle time. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + +:: + + call_deferred("set", "position", Vector2(42.0, 0.0)) + +**Note:** In C#, the method name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined methods where you should use the same convention as in the C# source (typically PascalCase). + +---- + +.. _class_Object_method_callv: + +- :ref:`Variant` **callv** **(** :ref:`String` method, :ref:`Array` arg_array **)** + +Calls the ``method`` on the object and returns the result. Contrarily to :ref:`call`, this method does not support a variable number of arguments but expects all parameters to be via a single :ref:`Array`. + +:: + + callv("set", [ "position", Vector2(42.0, 0.0) ]) + +---- + +.. _class_Object_method_can_translate_messages: + +- :ref:`bool` **can_translate_messages** **(** **)** |const| + +Returns ``true`` if the object can translate strings. See :ref:`set_message_translation` and :ref:`tr`. + +---- + +.. _class_Object_method_connect: + +- :ref:`Error` **connect** **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method, :ref:`Array` binds=[ ], :ref:`int` flags=0 **)** + +Connects a ``signal`` to a ``method`` on a ``target`` object. Pass optional ``binds`` to the call as an :ref:`Array` of parameters. These parameters will be passed to the method after any parameter used in the call to :ref:`emit_signal`. Use ``flags`` to set deferred or one-shot connections. See :ref:`ConnectFlags` constants. + +A ``signal`` can only be connected once to a ``method``. It will throw an error if already connected, unless the signal was connected with :ref:`CONNECT_REFERENCE_COUNTED`. To avoid this, first, use :ref:`is_connected` to check for existing connections. + +If the ``target`` is destroyed in the game's lifecycle, the connection will be lost. + +Examples: + +:: + + connect("pressed", self, "_on_Button_pressed") # BaseButton signal + connect("text_entered", self, "_on_LineEdit_text_entered") # LineEdit signal + connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # User-defined signal + +An example of the relationship between ``binds`` passed to :ref:`connect` and parameters used when calling :ref:`emit_signal`: + +:: + + connect("hit", self, "_on_Player_hit", [ weapon_type, damage ]) # weapon_type and damage are passed last + emit_signal("hit", "Dark lord", 5) # "Dark lord" and 5 are passed first + func _on_Player_hit(hit_by, level, weapon_type, damage): + print("Hit by %s (lvl %d) with weapon %s for %d damage" % [hit_by, level, weapon_type, damage]) + +---- + +.. _class_Object_method_disconnect: + +- void **disconnect** **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method **)** + +Disconnects a ``signal`` from a ``method`` on the given ``target``. + +If you try to disconnect a connection that does not exist, the method will throw an error. Use :ref:`is_connected` to ensure that the connection exists. + +---- + +.. _class_Object_method_emit_signal: + +- void **emit_signal** **(** :ref:`String` signal, ... **)** |vararg| + +Emits the given ``signal``. The signal must exist, so it should be a built-in signal of this class or one of its parent classes, or a user-defined signal. This method supports a variable number of arguments, so parameters are passed as a comma separated list. Example: + +:: + + emit_signal("hit", weapon_type, damage) + emit_signal("game_over") + +---- + +.. _class_Object_method_free: + +- void **free** **(** **)** + +Deletes the object from memory immediately. For :ref:`Node`\ s, you may want to use :ref:`Node.queue_free` to queue the node for safe deletion at the end of the current frame. + +**Important:** If you have a variable pointing to an object, it will *not* be assigned to ``null`` once the object is freed. Instead, it will point to a *previously freed instance* and you should validate it with :ref:`@GDScript.is_instance_valid` before attempting to call its methods or access its properties. + +---- + +.. _class_Object_method_get: + +- :ref:`Variant` **get** **(** :ref:`String` property **)** |const| + +Returns the :ref:`Variant` value of the given ``property``. If the ``property`` doesn't exist, this will return ``null``. + +**Note:** In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + +---- + +.. _class_Object_method_get_class: + +- :ref:`String` **get_class** **(** **)** |const| + +Returns the object's class as a :ref:`String`. See also :ref:`is_class`. + +**Note:** :ref:`get_class` does not take ``class_name`` declarations into account. If the object has a ``class_name`` defined, the base class name will be returned instead. + +---- + +.. _class_Object_method_get_incoming_connections: + +- :ref:`Array` **get_incoming_connections** **(** **)** |const| + +Returns an :ref:`Array` of dictionaries with information about signals that are connected to the object. + +Each :ref:`Dictionary` contains three String entries: + +- ``source`` is a reference to the signal emitter. + +- ``signal_name`` is the name of the connected signal. + +- ``method_name`` is the name of the method to which the signal is connected. + +---- + +.. _class_Object_method_get_indexed: + +- :ref:`Variant` **get_indexed** **(** :ref:`NodePath` property **)** |const| + +Gets the object's property indexed by the given :ref:`NodePath`. The node path should be relative to the current object and can use the colon character (``:``) to access nested properties. Examples: ``"position:x"`` or ``"material:next_pass:blend_mode"``. + +**Note:** Even though the method takes :ref:`NodePath` argument, it doesn't support actual paths to :ref:`Node`\ s in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use :ref:`Node.get_node_and_resource` instead. + +---- + +.. _class_Object_method_get_instance_id: + +- :ref:`int` **get_instance_id** **(** **)** |const| + +Returns the object's unique instance ID. + +This ID can be saved in :ref:`EncodedObjectAsID`, and can be used to retrieve the object instance with :ref:`@GDScript.instance_from_id`. + +---- + +.. _class_Object_method_get_meta: + +- :ref:`Variant` **get_meta** **(** :ref:`String` name **)** |const| + +Returns the object's metadata entry for the given ``name``. + +---- + +.. _class_Object_method_get_meta_list: + +- :ref:`PoolStringArray` **get_meta_list** **(** **)** |const| + +Returns the object's metadata as a :ref:`PoolStringArray`. + +---- + +.. _class_Object_method_get_method_list: + +- :ref:`Array` **get_method_list** **(** **)** |const| + +Returns the object's methods and their signatures as an :ref:`Array`. + +---- + +.. _class_Object_method_get_property_list: + +- :ref:`Array` **get_property_list** **(** **)** |const| + +Returns the object's property list as an :ref:`Array` of dictionaries. + +Each property's :ref:`Dictionary` contain at least ``name: String`` and ``type: int`` (see :ref:`Variant.Type`) entries. Optionally, it can also include ``hint: int`` (see :ref:`PropertyHint`), ``hint_string: String``, and ``usage: int`` (see :ref:`PropertyUsageFlags`). + +---- + +.. _class_Object_method_get_script: + +- :ref:`Reference` **get_script** **(** **)** |const| + +Returns the object's :ref:`Script` instance, or ``null`` if none is assigned. + +---- + +.. _class_Object_method_get_signal_connection_list: + +- :ref:`Array` **get_signal_connection_list** **(** :ref:`String` signal **)** |const| + +Returns an :ref:`Array` of connections for the given ``signal``. + +---- + +.. _class_Object_method_get_signal_list: + +- :ref:`Array` **get_signal_list** **(** **)** |const| + +Returns the list of signals as an :ref:`Array` of dictionaries. + +---- + +.. _class_Object_method_has_meta: + +- :ref:`bool` **has_meta** **(** :ref:`String` name **)** |const| + +Returns ``true`` if a metadata entry is found with the given ``name``. + +---- + +.. _class_Object_method_has_method: + +- :ref:`bool` **has_method** **(** :ref:`String` method **)** |const| + +Returns ``true`` if the object contains the given ``method``. + +---- + +.. _class_Object_method_has_signal: + +- :ref:`bool` **has_signal** **(** :ref:`String` signal **)** |const| + +Returns ``true`` if the given ``signal`` exists. + +---- + +.. _class_Object_method_has_user_signal: + +- :ref:`bool` **has_user_signal** **(** :ref:`String` signal **)** |const| + +Returns ``true`` if the given user-defined ``signal`` exists. Only signals added using :ref:`add_user_signal` are taken into account. + +---- + +.. _class_Object_method_is_blocking_signals: + +- :ref:`bool` **is_blocking_signals** **(** **)** |const| + +Returns ``true`` if signal emission blocking is enabled. + +---- + +.. _class_Object_method_is_class: + +- :ref:`bool` **is_class** **(** :ref:`String` class **)** |const| + +Returns ``true`` if the object inherits from the given ``class``. See also :ref:`get_class`. + +**Note:** :ref:`is_class` does not take ``class_name`` declarations into account. If the object has a ``class_name`` defined, :ref:`is_class` will return ``false`` for that name. + +---- + +.. _class_Object_method_is_connected: + +- :ref:`bool` **is_connected** **(** :ref:`String` signal, :ref:`Object` target, :ref:`String` method **)** |const| + +Returns ``true`` if a connection exists for a given ``signal``, ``target``, and ``method``. + +---- + +.. _class_Object_method_is_queued_for_deletion: + +- :ref:`bool` **is_queued_for_deletion** **(** **)** |const| + +Returns ``true`` if the :ref:`Node.queue_free` method was called for the object. + +---- + +.. _class_Object_method_notification: + +- void **notification** **(** :ref:`int` what, :ref:`bool` reversed=false **)** + +Send a given notification to the object, which will also trigger a call to the :ref:`_notification` method of all classes that the object inherits from. + +If ``reversed`` is ``true``, :ref:`_notification` is called first on the object's own class, and then up to its successive parent classes. If ``reversed`` is ``false``, :ref:`_notification` is called first on the highest ancestor (``Object`` itself), and then down to its successive inheriting classes. + +---- + +.. _class_Object_method_property_list_changed_notify: + +- void **property_list_changed_notify** **(** **)** + +Notify the editor that the property list has changed, so that editor plugins can take the new values into account. Does nothing on export builds. + +---- + +.. _class_Object_method_remove_meta: + +- void **remove_meta** **(** :ref:`String` name **)** + +Removes a given entry from the object's metadata. See also :ref:`set_meta`. + +---- + +.. _class_Object_method_set: + +- void **set** **(** :ref:`String` property, :ref:`Variant` value **)** + +Assigns a new value to the given property. If the ``property`` does not exist or the given value's type doesn't match, nothing will happen. + +**Note:** In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + +---- + +.. _class_Object_method_set_block_signals: + +- void **set_block_signals** **(** :ref:`bool` enable **)** + +If set to ``true``, signal emission is blocked. + +---- + +.. _class_Object_method_set_deferred: + +- void **set_deferred** **(** :ref:`String` property, :ref:`Variant` value **)** + +Assigns a new value to the given property, after the current frame's physics step. This is equivalent to calling :ref:`set` via :ref:`call_deferred`, i.e. ``call_deferred("set", property, value)``. + +**Note:** In C#, the property name must be specified as snake_case if it is defined by a built-in Godot node. This doesn't apply to user-defined properties where you should use the same convention as in the C# source (typically PascalCase). + +---- + +.. _class_Object_method_set_indexed: + +- void **set_indexed** **(** :ref:`NodePath` property, :ref:`Variant` value **)** + +Assigns a new value to the property identified by the :ref:`NodePath`. The node path should be relative to the current object and can use the colon character (``:``) to access nested properties. Example: + +:: + + set_indexed("position", Vector2(42, 0)) + set_indexed("position:y", -10) + print(position) # (42, -10) + +---- + +.. _class_Object_method_set_message_translation: + +- void **set_message_translation** **(** :ref:`bool` enable **)** + +Defines whether the object can translate strings (with calls to :ref:`tr`). Enabled by default. + +---- + +.. _class_Object_method_set_meta: + +- void **set_meta** **(** :ref:`String` name, :ref:`Variant` value **)** + +Adds, changes or removes a given entry in the object's metadata. Metadata are serialized and can take any :ref:`Variant` value. + +To remove a given entry from the object's metadata, use :ref:`remove_meta`. Metadata is also removed if its value is set to ``null``. This means you can also use ``set_meta("name", null)`` to remove metadata for ``"name"``. + +---- + +.. _class_Object_method_set_script: + +- void **set_script** **(** :ref:`Reference` script **)** + +Assigns a script to the object. Each object can have a single script assigned to it, which are used to extend its functionality. + +If the object already had a script, the previous script instance will be freed and its variables and state will be lost. The new script's :ref:`_init` method will be called. + +---- + +.. _class_Object_method_to_string: + +- :ref:`String` **to_string** **(** **)** + +Returns a :ref:`String` representing the object. If not overridden, defaults to ``"[ClassName:RID]"``. + +Override the method :ref:`_to_string` to customize the :ref:`String` representation. + +---- + +.. _class_Object_method_tr: + +- :ref:`String` **tr** **(** :ref:`String` message **)** |const| + +Translates a message using translation catalogs configured in the Project Settings. + +Only works if message translation is enabled (which it is by default), otherwise it returns the ``message`` unchanged. See :ref:`set_message_translation`. + +.. |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.)` diff --git a/classes/class_occluder.rst b/classes/class_occluder.rst new file mode 100644 index 0000000..ea250a2 --- /dev/null +++ b/classes/class_occluder.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Occluder.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Occluder: + +Occluder +======== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Allows :ref:`OccluderShape`\ s to be used for occlusion culling. + +Description +----------- + +``Occluder``\ s that are placed within your scene will automatically cull objects that are hidden from view by the occluder. This can increase performance by decreasing the amount of objects drawn. + +``Occluder``\ s are totally dynamic, you can move them as you wish. This means you can for example, place occluders on a moving spaceship, and have it occlude objects as it flies past. + +You can place a large number of ``Occluder``\ s within a scene. As it would be counterproductive to cull against hundreds of occluders, the system will automatically choose a selection of these for active use during any given frame, based a screen space metric. Larger occluders are favored, as well as those close to the camera. Note that a small occluder close to the camera may be a better occluder in terms of screen space than a large occluder far in the distance. + +The type of occlusion primitive is determined by the :ref:`OccluderShape` that you add to the ``Occluder``. Some :ref:`OccluderShape`\ s may allow more than one primitive in a single, node, for greater efficiency. + +Although ``Occluder``\ s work in general use, they also become even more powerful when used in conjunction with the portal system. Occluders are placed in rooms (based on their origin), and can block portals (and thus entire rooms) as well as objects from rendering. + +Properties +---------- + ++-------------------------------------------+---------------------------------------------+ +| :ref:`OccluderShape` | :ref:`shape` | ++-------------------------------------------+---------------------------------------------+ + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resource_changed` **(** :ref:`Resource` resource **)** | ++------+----------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Occluder_property_shape: + +- :ref:`OccluderShape` **shape** + ++----------+------------------+ +| *Setter* | set_shape(value) | ++----------+------------------+ +| *Getter* | get_shape() | ++----------+------------------+ + +Method Descriptions +------------------- + +.. _class_Occluder_method_resource_changed: + +- void **resource_changed** **(** :ref:`Resource` resource **)** + +.. |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.)` diff --git a/classes/class_occluderpolygon2d.rst b/classes/class_occluderpolygon2d.rst new file mode 100644 index 0000000..8b561ca --- /dev/null +++ b/classes/class_occluderpolygon2d.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OccluderPolygon2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OccluderPolygon2D: + +OccluderPolygon2D +================= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Defines a 2D polygon for LightOccluder2D. + +Description +----------- + +Editor facility that helps you draw a 2D polygon used as resource for :ref:`LightOccluder2D`. + +Properties +---------- + ++--------------------------------------------------+--------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`closed` | ``true`` | ++--------------------------------------------------+--------------------------------------------------------------+--------------------------+ +| :ref:`CullMode` | :ref:`cull_mode` | ``0`` | ++--------------------------------------------------+--------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`polygon` | ``PoolVector2Array( )`` | ++--------------------------------------------------+--------------------------------------------------------------+--------------------------+ + +Enumerations +------------ + +.. _enum_OccluderPolygon2D_CullMode: + +.. _class_OccluderPolygon2D_constant_CULL_DISABLED: + +.. _class_OccluderPolygon2D_constant_CULL_CLOCKWISE: + +.. _class_OccluderPolygon2D_constant_CULL_COUNTER_CLOCKWISE: + +enum **CullMode**: + +- **CULL_DISABLED** = **0** --- Culling is disabled. See :ref:`cull_mode`. + +- **CULL_CLOCKWISE** = **1** --- Culling is performed in the clockwise direction. See :ref:`cull_mode`. + +- **CULL_COUNTER_CLOCKWISE** = **2** --- Culling is performed in the counterclockwise direction. See :ref:`cull_mode`. + +Property Descriptions +--------------------- + +.. _class_OccluderPolygon2D_property_closed: + +- :ref:`bool` **closed** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_closed(value) | ++-----------+-------------------+ +| *Getter* | is_closed() | ++-----------+-------------------+ + +If ``true``, closes the polygon. A closed OccluderPolygon2D occludes the light coming from any direction. An opened OccluderPolygon2D occludes the light only at its outline's direction. + +---- + +.. _class_OccluderPolygon2D_property_cull_mode: + +- :ref:`CullMode` **cull_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_cull_mode(value) | ++-----------+----------------------+ +| *Getter* | get_cull_mode() | ++-----------+----------------------+ + +The culling mode to use. + +---- + +.. _class_OccluderPolygon2D_property_polygon: + +- :ref:`PoolVector2Array` **polygon** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_polygon(value) | ++-----------+--------------------------+ +| *Getter* | get_polygon() | ++-----------+--------------------------+ + +A :ref:`Vector2` array with the index for polygon's vertices positions. + +**Note:** The returned value is a copy of the underlying array, rather than a reference. + +.. |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.)` diff --git a/classes/class_occludershape.rst b/classes/class_occludershape.rst new file mode 100644 index 0000000..e3ba7b5 --- /dev/null +++ b/classes/class_occludershape.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OccluderShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OccluderShape: + +OccluderShape +============= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`OccluderShapeSphere` + +Base class for shapes used for occlusion culling by the :ref:`Occluder` node. + +Description +----------- + +:ref:`Occluder`\ s can use any primitive shape derived from ``OccluderShape``. + +.. |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.)` diff --git a/classes/class_occludershapesphere.rst b/classes/class_occludershapesphere.rst new file mode 100644 index 0000000..0ca07f5 --- /dev/null +++ b/classes/class_occludershapesphere.rst @@ -0,0 +1,75 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OccluderShapeSphere.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OccluderShapeSphere: + +OccluderShapeSphere +=================== + +**Inherits:** :ref:`OccluderShape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Spherical occlusion primitive for use with the :ref:`Occluder` node. + +Description +----------- + +:ref:`OccluderShape`\ s are resources used by :ref:`Occluder` nodes, allowing geometric occlusion culling. + +This shape can include multiple spheres. These can be created and deleted either in the Editor inspector or by calling ``set_spheres``. The sphere positions can be set by dragging the handle in the Editor viewport. The radius can be set with the smaller handle. + +Properties +---------- + ++---------------------------+------------------------------------------------------------+----------+ +| :ref:`Array` | :ref:`spheres` | ``[ ]`` | ++---------------------------+------------------------------------------------------------+----------+ + +Methods +------- + ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_sphere_position` **(** :ref:`int` index, :ref:`Vector3` position **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_sphere_radius` **(** :ref:`int` index, :ref:`float` radius **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_OccluderShapeSphere_property_spheres: + +- :ref:`Array` **spheres** + ++-----------+--------------------+ +| *Default* | ``[ ]`` | ++-----------+--------------------+ +| *Setter* | set_spheres(value) | ++-----------+--------------------+ +| *Getter* | get_spheres() | ++-----------+--------------------+ + +The sphere data can be accessed as an array of :ref:`Plane`\ s. The position of each sphere is stored in the ``normal``, and the radius is stored in the ``d`` value of the plane. + +Method Descriptions +------------------- + +.. _class_OccluderShapeSphere_method_set_sphere_position: + +- void **set_sphere_position** **(** :ref:`int` index, :ref:`Vector3` position **)** + +Sets an individual sphere's position. + +---- + +.. _class_OccluderShapeSphere_method_set_sphere_radius: + +- void **set_sphere_radius** **(** :ref:`int` index, :ref:`float` radius **)** + +Sets an individual sphere's radius. + +.. |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.)` diff --git a/classes/class_omnilight.rst b/classes/class_omnilight.rst new file mode 100644 index 0000000..09eccd8 --- /dev/null +++ b/classes/class_omnilight.rst @@ -0,0 +1,137 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OmniLight.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OmniLight: + +OmniLight +========= + +**Inherits:** :ref:`Light` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Omnidirectional light, such as a light bulb or a candle. + +Description +----------- + +An Omnidirectional light is a type of :ref:`Light` that emits light in all directions. The light is attenuated by distance and this attenuation can be configured by changing its energy, radius, and attenuation parameters. + +**Note:** By default, only 32 OmniLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase :ref:`ProjectSettings.rendering/limits/rendering/max_lights_per_object` at the cost of shader compilation times. + +Tutorials +--------- + +- :doc:`../tutorials/3d/lights_and_shadows` + +Properties +---------- + ++--------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`omni_attenuation` | ``1.0`` | ++--------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`omni_range` | ``5.0`` | ++--------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`ShadowDetail` | :ref:`omni_shadow_detail` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------+---------+ +| :ref:`ShadowMode` | :ref:`omni_shadow_mode` | ``1`` | ++--------------------------------------------------+------------------------------------------------------------------------+---------+ + +Enumerations +------------ + +.. _enum_OmniLight_ShadowMode: + +.. _class_OmniLight_constant_SHADOW_DUAL_PARABOLOID: + +.. _class_OmniLight_constant_SHADOW_CUBE: + +enum **ShadowMode**: + +- **SHADOW_DUAL_PARABOLOID** = **0** --- Shadows are rendered to a dual-paraboloid texture. Faster than :ref:`SHADOW_CUBE`, but lower-quality. + +- **SHADOW_CUBE** = **1** --- Shadows are rendered to a cubemap. Slower than :ref:`SHADOW_DUAL_PARABOLOID`, but higher-quality. + +---- + +.. _enum_OmniLight_ShadowDetail: + +.. _class_OmniLight_constant_SHADOW_DETAIL_VERTICAL: + +.. _class_OmniLight_constant_SHADOW_DETAIL_HORIZONTAL: + +enum **ShadowDetail**: + +- **SHADOW_DETAIL_VERTICAL** = **0** --- Use more detail vertically when computing the shadow. + +- **SHADOW_DETAIL_HORIZONTAL** = **1** --- Use more detail horizontally when computing the shadow. + +Property Descriptions +--------------------- + +.. _class_OmniLight_property_omni_attenuation: + +- :ref:`float` **omni_attenuation** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The light's attenuation (drop-off) curve. A number of presets are available in the **Inspector** by right-clicking the curve. + +---- + +.. _class_OmniLight_property_omni_range: + +- :ref:`float` **omni_range** + ++-----------+------------------+ +| *Default* | ``5.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The light's radius. Note that the effectively lit area may appear to be smaller depending on the :ref:`omni_attenuation` in use. No matter the :ref:`omni_attenuation` in use, the light will never reach anything outside this radius. + +---- + +.. _class_OmniLight_property_omni_shadow_detail: + +- :ref:`ShadowDetail` **omni_shadow_detail** + ++-----------+--------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------+ +| *Setter* | set_shadow_detail(value) | ++-----------+--------------------------+ +| *Getter* | get_shadow_detail() | ++-----------+--------------------------+ + +See :ref:`ShadowDetail`. + +---- + +.. _class_OmniLight_property_omni_shadow_mode: + +- :ref:`ShadowMode` **omni_shadow_mode** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_shadow_mode(value) | ++-----------+------------------------+ +| *Getter* | get_shadow_mode() | ++-----------+------------------------+ + +See :ref:`ShadowMode`. + +.. |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.)` diff --git a/classes/class_opensimplexnoise.rst b/classes/class_opensimplexnoise.rst new file mode 100644 index 0000000..555185f --- /dev/null +++ b/classes/class_opensimplexnoise.rst @@ -0,0 +1,227 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OpenSimplexNoise.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OpenSimplexNoise: + +OpenSimplexNoise +================ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Noise generator based on Open Simplex. + +Description +----------- + +This resource allows you to configure and sample a fractal noise space. Here is a brief usage example that configures an OpenSimplexNoise and gets samples at various positions and dimensions: + +:: + + var noise = OpenSimplexNoise.new() + + # Configure + noise.seed = randi() + noise.octaves = 4 + noise.period = 20.0 + noise.persistence = 0.8 + + # Sample + print("Values:") + print(noise.get_noise_2d(1.0, 1.0)) + print(noise.get_noise_3d(0.5, 3.0, 15.0)) + print(noise.get_noise_4d(0.5, 1.9, 4.7, 0.0)) + +Properties +---------- + ++---------------------------+-----------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`lacunarity` | ``2.0`` | ++---------------------------+-----------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`octaves` | ``3`` | ++---------------------------+-----------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`period` | ``64.0`` | ++---------------------------+-----------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`persistence` | ``0.5`` | ++---------------------------+-----------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`seed` | ``0`` | ++---------------------------+-----------------------------------------------------------------+----------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_image` **(** :ref:`int` width, :ref:`int` height, :ref:`Vector2` noise_offset=Vector2( 0, 0 ) **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_1d` **(** :ref:`float` x **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_2d` **(** :ref:`float` x, :ref:`float` y **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_2dv` **(** :ref:`Vector2` pos **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_3d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_3dv` **(** :ref:`Vector3` pos **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_noise_4d` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_seamless_image` **(** :ref:`int` size **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_OpenSimplexNoise_property_lacunarity: + +- :ref:`float` **lacunarity** + ++-----------+-----------------------+ +| *Default* | ``2.0`` | ++-----------+-----------------------+ +| *Setter* | set_lacunarity(value) | ++-----------+-----------------------+ +| *Getter* | get_lacunarity() | ++-----------+-----------------------+ + +Difference in period between :ref:`octaves`. + +---- + +.. _class_OpenSimplexNoise_property_octaves: + +- :ref:`int` **octaves** + ++-----------+--------------------+ +| *Default* | ``3`` | ++-----------+--------------------+ +| *Setter* | set_octaves(value) | ++-----------+--------------------+ +| *Getter* | get_octaves() | ++-----------+--------------------+ + +Number of OpenSimplex noise layers that are sampled to get the fractal noise. Higher values result in more detailed noise but take more time to generate. + +**Note:** The maximum allowed value is 9. + +---- + +.. _class_OpenSimplexNoise_property_period: + +- :ref:`float` **period** + ++-----------+-------------------+ +| *Default* | ``64.0`` | ++-----------+-------------------+ +| *Setter* | set_period(value) | ++-----------+-------------------+ +| *Getter* | get_period() | ++-----------+-------------------+ + +Period of the base octave. A lower period results in a higher-frequency noise (more value changes across the same distance). + +---- + +.. _class_OpenSimplexNoise_property_persistence: + +- :ref:`float` **persistence** + ++-----------+------------------------+ +| *Default* | ``0.5`` | ++-----------+------------------------+ +| *Setter* | set_persistence(value) | ++-----------+------------------------+ +| *Getter* | get_persistence() | ++-----------+------------------------+ + +Contribution factor of the different octaves. A ``persistence`` value of 1 means all the octaves have the same contribution, a value of 0.5 means each octave contributes half as much as the previous one. + +---- + +.. _class_OpenSimplexNoise_property_seed: + +- :ref:`int` **seed** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_seed(value) | ++-----------+-----------------+ +| *Getter* | get_seed() | ++-----------+-----------------+ + +Seed used to generate random values, different seeds will generate different noise maps. + +Method Descriptions +------------------- + +.. _class_OpenSimplexNoise_method_get_image: + +- :ref:`Image` **get_image** **(** :ref:`int` width, :ref:`int` height, :ref:`Vector2` noise_offset=Vector2( 0, 0 ) **)** |const| + +Generate a noise image in :ref:`Image.FORMAT_L8` format with the requested ``width`` and ``height``, based on the current noise parameters. If ``noise_offset`` is specified, then the offset value is used as the coordinates of the top-left corner of the generated noise. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_1d: + +- :ref:`float` **get_noise_1d** **(** :ref:`float` x **)** |const| + +Returns the 1D noise value ``[-1,1]`` at the given x-coordinate. + +**Note:** This method actually returns the 2D noise value ``[-1,1]`` with fixed y-coordinate value 0.0. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_2d: + +- :ref:`float` **get_noise_2d** **(** :ref:`float` x, :ref:`float` y **)** |const| + +Returns the 2D noise value ``[-1,1]`` at the given position. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_2dv: + +- :ref:`float` **get_noise_2dv** **(** :ref:`Vector2` pos **)** |const| + +Returns the 2D noise value ``[-1,1]`` at the given position. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_3d: + +- :ref:`float` **get_noise_3d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** |const| + +Returns the 3D noise value ``[-1,1]`` at the given position. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_3dv: + +- :ref:`float` **get_noise_3dv** **(** :ref:`Vector3` pos **)** |const| + +Returns the 3D noise value ``[-1,1]`` at the given position. + +---- + +.. _class_OpenSimplexNoise_method_get_noise_4d: + +- :ref:`float` **get_noise_4d** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** |const| + +Returns the 4D noise value ``[-1,1]`` at the given position. + +---- + +.. _class_OpenSimplexNoise_method_get_seamless_image: + +- :ref:`Image` **get_seamless_image** **(** :ref:`int` size **)** |const| + +Generate a tileable noise image in :ref:`Image.FORMAT_L8` format, based on the current noise parameters. Generated seamless images are always square (``size`` × ``size``). + +**Note:** Seamless noise has a lower contrast compared to non-seamless noise. This is due to the way noise uses higher dimensions for generating seamless noise. + +.. |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.)` diff --git a/classes/class_optionbutton.rst b/classes/class_optionbutton.rst new file mode 100644 index 0000000..30feb6b --- /dev/null +++ b/classes/class_optionbutton.rst @@ -0,0 +1,464 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OptionButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OptionButton: + +OptionButton +============ + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Button control that provides selectable options when pressed. + +Description +----------- + +OptionButton is a type button that provides a selectable list of items when pressed. The item selected becomes the "current" item and is displayed as the button text. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Properties +---------- + ++-----------------------------------------------+-------------------------------------------------------+------------------------------+ +| :ref:`ActionMode` | action_mode | ``0`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------+------------------------------+ +| :ref:`TextAlign` | align | ``0`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`selected` | ``-1`` | ++-----------------------------------------------+-------------------------------------------------------+------------------------------+ +| :ref:`bool` | toggle_mode | ``true`` *(parent override)* | ++-----------------------------------------------+-------------------------------------------------------+------------------------------+ + +Methods +------- + ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_item` **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1 **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_item` **(** :ref:`String` label, :ref:`int` id=-1 **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_separator` **(** **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_count` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_item_icon` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_id` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_index` **(** :ref:`int` id **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PopupMenu` | :ref:`get_popup` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selected_id` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_selected_metadata` **(** **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** |const| | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_item` **(** :ref:`int` idx **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` idx **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture` texture **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_id` **(** :ref:`int` idx, :ref:`int` id **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | ++-----------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`arrow_margin` | ``2`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``2`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`arrow` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_OptionButton_signal_item_focused: + +- **item_focused** **(** :ref:`int` index **)** + +Emitted when the user navigates to an item using the ``ui_up`` or ``ui_down`` actions. The index of the item selected is passed as argument. + +---- + +.. _class_OptionButton_signal_item_selected: + +- **item_selected** **(** :ref:`int` index **)** + +Emitted when the current item has been changed by the user. The index of the item selected is passed as argument. + +Property Descriptions +--------------------- + +.. _class_OptionButton_property_selected: + +- :ref:`int` **selected** + ++-----------+----------------+ +| *Default* | ``-1`` | ++-----------+----------------+ +| *Getter* | get_selected() | ++-----------+----------------+ + +The index of the currently selected item, or ``-1`` if no item is selected. + +Method Descriptions +------------------- + +.. _class_OptionButton_method_add_icon_item: + +- void **add_icon_item** **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1 **)** + +Adds an item, with a ``texture`` icon, text ``label`` and (optionally) ``id``. If no ``id`` is passed, the item index will be used as the item's ID. New items are appended at the end. + +---- + +.. _class_OptionButton_method_add_item: + +- void **add_item** **(** :ref:`String` label, :ref:`int` id=-1 **)** + +Adds an item, with text ``label`` and (optionally) ``id``. If no ``id`` is passed, the item index will be used as the item's ID. New items are appended at the end. + +---- + +.. _class_OptionButton_method_add_separator: + +- void **add_separator** **(** **)** + +Adds a separator to the list of items. Separators help to group items. Separator also takes up an index and is appended at the end. + +---- + +.. _class_OptionButton_method_clear: + +- void **clear** **(** **)** + +Clears all the items in the ``OptionButton``. + +---- + +.. _class_OptionButton_method_get_item_count: + +- :ref:`int` **get_item_count** **(** **)** |const| + +Returns the amount of items in the OptionButton, including separators. + +---- + +.. _class_OptionButton_method_get_item_icon: + +- :ref:`Texture` **get_item_icon** **(** :ref:`int` idx **)** |const| + +Returns the icon of the item at index ``idx``. + +---- + +.. _class_OptionButton_method_get_item_id: + +- :ref:`int` **get_item_id** **(** :ref:`int` idx **)** |const| + +Returns the ID of the item at index ``idx``. + +---- + +.. _class_OptionButton_method_get_item_index: + +- :ref:`int` **get_item_index** **(** :ref:`int` id **)** |const| + +Returns the index of the item with the given ``id``. + +---- + +.. _class_OptionButton_method_get_item_metadata: + +- :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** |const| + +Retrieves the metadata of an item. Metadata may be any type and can be used to store extra information about an item, such as an external string ID. + +---- + +.. _class_OptionButton_method_get_item_text: + +- :ref:`String` **get_item_text** **(** :ref:`int` idx **)** |const| + +Returns the text of the item at index ``idx``. + +---- + +.. _class_OptionButton_method_get_popup: + +- :ref:`PopupMenu` **get_popup** **(** **)** |const| + +Returns the :ref:`PopupMenu` contained in this button. + +**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` property. + +---- + +.. _class_OptionButton_method_get_selected_id: + +- :ref:`int` **get_selected_id** **(** **)** |const| + +Returns the ID of the selected item, or ``0`` if no item is selected. + +---- + +.. _class_OptionButton_method_get_selected_metadata: + +- :ref:`Variant` **get_selected_metadata** **(** **)** |const| + +Gets the metadata of the selected item. Metadata for items can be set using :ref:`set_item_metadata`. + +---- + +.. _class_OptionButton_method_is_item_disabled: + +- :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at index ``idx`` is disabled. + +---- + +.. _class_OptionButton_method_remove_item: + +- void **remove_item** **(** :ref:`int` idx **)** + +Removes the item at index ``idx``. + +---- + +.. _class_OptionButton_method_select: + +- void **select** **(** :ref:`int` idx **)** + +Selects an item by index and makes it the current item. This will work even if the item is disabled. + +---- + +.. _class_OptionButton_method_set_item_disabled: + +- void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** + +Sets whether the item at index ``idx`` is disabled. + +Disabled items are drawn differently in the dropdown and are not selectable by the user. If the current selected item is set as disabled, it will remain selected. + +---- + +.. _class_OptionButton_method_set_item_icon: + +- void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture` texture **)** + +Sets the icon of the item at index ``idx``. + +---- + +.. _class_OptionButton_method_set_item_id: + +- void **set_item_id** **(** :ref:`int` idx, :ref:`int` id **)** + +Sets the ID of the item at index ``idx``. + +---- + +.. _class_OptionButton_method_set_item_metadata: + +- void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** + +Sets the metadata of an item. Metadata may be of any type and can be used to store extra information about an item, such as an external string ID. + +---- + +.. _class_OptionButton_method_set_item_text: + +- void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** + +Sets the text of the item at index ``idx``. + +Theme Property Descriptions +--------------------------- + +.. _class_OptionButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the ``OptionButton``. + +---- + +.. _class_OptionButton_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +Text :ref:`Color` used when the ``OptionButton`` is disabled. + +---- + +.. _class_OptionButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``OptionButton`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_OptionButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``OptionButton`` is being hovered. + +---- + +.. _class_OptionButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``OptionButton`` is being pressed. + +---- + +.. _class_OptionButton_theme_constant_arrow_margin: + +- :ref:`int` **arrow_margin** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The horizontal space between the arrow icon and the right edge of the button. + +---- + +.. _class_OptionButton_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The horizontal space between ``OptionButton``'s icon and text. + +---- + +.. _class_OptionButton_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``OptionButton``'s text. + +---- + +.. _class_OptionButton_theme_icon_arrow: + +- :ref:`Texture` **arrow** + +The arrow icon to be drawn on the right end of the button. + +---- + +.. _class_OptionButton_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +:ref:`StyleBox` used when the ``OptionButton`` is disabled. + +---- + +.. _class_OptionButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``OptionButton`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +---- + +.. _class_OptionButton_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` used when the ``OptionButton`` is being hovered. + +---- + +.. _class_OptionButton_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default :ref:`StyleBox` for the ``OptionButton``. + +---- + +.. _class_OptionButton_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +:ref:`StyleBox` used when the ``OptionButton`` is being pressed. + +.. |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.)` diff --git a/classes/class_os.rst b/classes/class_os.rst new file mode 100644 index 0000000..60bebf0 --- /dev/null +++ b/classes/class_os.rst @@ -0,0 +1,2134 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the OS.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_OS: + +OS +== + +**Inherits:** :ref:`Object` + +Operating System functions. + +Description +----------- + +Operating System functions. OS wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, date and time, timers, environment variables, execution of binaries, command line, etc. + +Tutorials +--------- + +- `OS Test Demo `__ + +Properties +---------- + ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`clipboard` | ``""`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`current_screen` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`delta_smoothing` | ``true`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`exit_code` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`keep_screen_on` | ``true`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`low_processor_usage_mode` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`low_processor_usage_mode_sleep_usec` | ``6900`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`max_window_size` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`min_window_size` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`ScreenOrientation` | :ref:`screen_orientation` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`String` | :ref:`tablet_driver` | ``""`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`vsync_enabled` | ``true`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`vsync_via_compositor` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_borderless` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_fullscreen` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_maximized` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_minimized` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_per_pixel_transparency_enabled` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`window_position` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`window_resizable` | ``true`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`window_size` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`alert` **(** :ref:`String` text, :ref:`String` title="Alert!" **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_draw` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_use_threads` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`center_window` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close_midi_inputs` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delay_msec` **(** :ref:`int` msec **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`delay_usec` **(** :ref:`int` usec **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`dump_memory_to_file` **(** :ref:`String` file **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`dump_resources_to_file` **(** :ref:`String` file **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`execute` **(** :ref:`String` path, :ref:`PoolStringArray` arguments, :ref:`bool` blocking=true, :ref:`Array` output=[ ], :ref:`bool` read_stderr=false **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_scancode_from_string` **(** :ref:`String` string **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_audio_driver_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_audio_driver_name` **(** :ref:`int` driver **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_cache_dir` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_cmdline_args` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_config_dir` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_connected_midi_inputs` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VideoDriver` | :ref:`get_current_video_driver` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_data_dir` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_date` **(** :ref:`bool` utc=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_datetime` **(** :ref:`bool` utc=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_datetime_from_unix_time` **(** :ref:`int` unix_time_val **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_dynamic_memory_usage` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_environment` **(** :ref:`String` variable **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_executable_path` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_granted_permissions` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_ime_selection` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_ime_text` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_latin_keyboard_variant` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_locale` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_locale_language` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_model_name` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_name` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_native_handle` **(** :ref:`HandleType` handle_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_power_percent_left` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_power_seconds_left` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PowerState` | :ref:`get_power_state` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_process_id` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_processor_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_real_window_size` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_scancode_string` **(** :ref:`int` code **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_screen_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_screen_dpi` **(** :ref:`int` screen=-1 **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_screen_max_scale` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_screen_position` **(** :ref:`int` screen=-1 **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_screen_scale` **(** :ref:`int` screen=-1 **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_screen_size` **(** :ref:`int` screen=-1 **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_splash_tick_msec` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_static_memory_peak_usage` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_static_memory_usage` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_system_dir` **(** :ref:`SystemDir` dir, :ref:`bool` shared_storage=true **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_system_time_msecs` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_system_time_secs` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tablet_driver_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tablet_driver_name` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_thread_caller_id` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_ticks_msec` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_ticks_usec` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_time` **(** :ref:`bool` utc=false **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_time_zone_info` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_unique_id` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unix_time` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_unix_time_from_datetime` **(** :ref:`Dictionary` datetime **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_user_data_dir` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_video_driver_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_video_driver_name` **(** :ref:`VideoDriver` driver **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_virtual_keyboard_height` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_window_safe_area` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_menu_add_item` **(** :ref:`String` menu, :ref:`String` label, :ref:`Variant` id, :ref:`Variant` meta **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_menu_add_separator` **(** :ref:`String` menu **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_menu_clear` **(** :ref:`String` menu **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_menu_remove_item` **(** :ref:`String` menu, :ref:`int` idx **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_environment` **(** :ref:`String` variable **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_feature` **(** :ref:`String` tag_name **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_touchscreen_ui_hint` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_virtual_keyboard` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hide_virtual_keyboard` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_debug_build` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_ok_left_and_cancel_right` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_scancode_unicode` **(** :ref:`int` code **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_stdout_verbose` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_userfs_persistent` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_window_always_on_top` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_window_focused` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`keyboard_get_current_layout` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`keyboard_get_layout_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`keyboard_get_layout_language` **(** :ref:`int` index **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`keyboard_get_layout_name` **(** :ref:`int` index **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`keyboard_set_current_layout` **(** :ref:`int` index **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`kill` **(** :ref:`int` pid **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_window_to_foreground` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`native_video_is_playing` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`native_video_pause` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`native_video_play` **(** :ref:`String` path, :ref:`float` volume, :ref:`String` audio_track, :ref:`String` subtitle_track **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`native_video_stop` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`native_video_unpause` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`open_midi_inputs` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_all_resources` **(** :ref:`String` tofile="" **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_all_textures_by_size` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_resources_by_type` **(** :ref:`PoolStringArray` types **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`print_resources_in_use` **(** :ref:`bool` short=false **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`request_attention` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`request_permission` **(** :ref:`String` name **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`request_permissions` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`set_environment` **(** :ref:`String` variable, :ref:`String` value **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon` **(** :ref:`Image` icon **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_ime_active` **(** :ref:`bool` active **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_ime_position` **(** :ref:`Vector2` position **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_native_icon` **(** :ref:`String` filename **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`set_thread_name` **(** :ref:`String` name **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_use_file_access_save_and_swap` **(** :ref:`bool` enabled **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_window_always_on_top` **(** :ref:`bool` enabled **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_window_mouse_passthrough` **(** :ref:`PoolVector2Array` region **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_window_title` **(** :ref:`String` title **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`shell_open` **(** :ref:`String` uri **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`show_virtual_keyboard` **(** :ref:`String` existing_text="", :ref:`bool` multiline=false **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_OS_VideoDriver: + +.. _class_OS_constant_VIDEO_DRIVER_GLES2: + +.. _class_OS_constant_VIDEO_DRIVER_GLES3: + +enum **VideoDriver**: + +- **VIDEO_DRIVER_GLES2** = **1** --- The GLES2 rendering backend. It uses OpenGL ES 2.0 on mobile devices, OpenGL 2.1 on desktop platforms and WebGL 1.0 on the web. + +- **VIDEO_DRIVER_GLES3** = **0** --- The GLES3 rendering backend. It uses OpenGL ES 3.0 on mobile devices, OpenGL 3.3 on desktop platforms and WebGL 2.0 on the web. + +---- + +.. _enum_OS_Weekday: + +.. _class_OS_constant_DAY_SUNDAY: + +.. _class_OS_constant_DAY_MONDAY: + +.. _class_OS_constant_DAY_TUESDAY: + +.. _class_OS_constant_DAY_WEDNESDAY: + +.. _class_OS_constant_DAY_THURSDAY: + +.. _class_OS_constant_DAY_FRIDAY: + +.. _class_OS_constant_DAY_SATURDAY: + +enum **Weekday**: + +- **DAY_SUNDAY** = **0** --- Sunday. + +- **DAY_MONDAY** = **1** --- Monday. + +- **DAY_TUESDAY** = **2** --- Tuesday. + +- **DAY_WEDNESDAY** = **3** --- Wednesday. + +- **DAY_THURSDAY** = **4** --- Thursday. + +- **DAY_FRIDAY** = **5** --- Friday. + +- **DAY_SATURDAY** = **6** --- Saturday. + +---- + +.. _enum_OS_Month: + +.. _class_OS_constant_MONTH_JANUARY: + +.. _class_OS_constant_MONTH_FEBRUARY: + +.. _class_OS_constant_MONTH_MARCH: + +.. _class_OS_constant_MONTH_APRIL: + +.. _class_OS_constant_MONTH_MAY: + +.. _class_OS_constant_MONTH_JUNE: + +.. _class_OS_constant_MONTH_JULY: + +.. _class_OS_constant_MONTH_AUGUST: + +.. _class_OS_constant_MONTH_SEPTEMBER: + +.. _class_OS_constant_MONTH_OCTOBER: + +.. _class_OS_constant_MONTH_NOVEMBER: + +.. _class_OS_constant_MONTH_DECEMBER: + +enum **Month**: + +- **MONTH_JANUARY** = **1** --- January. + +- **MONTH_FEBRUARY** = **2** --- February. + +- **MONTH_MARCH** = **3** --- March. + +- **MONTH_APRIL** = **4** --- April. + +- **MONTH_MAY** = **5** --- May. + +- **MONTH_JUNE** = **6** --- June. + +- **MONTH_JULY** = **7** --- July. + +- **MONTH_AUGUST** = **8** --- August. + +- **MONTH_SEPTEMBER** = **9** --- September. + +- **MONTH_OCTOBER** = **10** --- October. + +- **MONTH_NOVEMBER** = **11** --- November. + +- **MONTH_DECEMBER** = **12** --- December. + +---- + +.. _enum_OS_HandleType: + +.. _class_OS_constant_APPLICATION_HANDLE: + +.. _class_OS_constant_DISPLAY_HANDLE: + +.. _class_OS_constant_WINDOW_HANDLE: + +.. _class_OS_constant_WINDOW_VIEW: + +.. _class_OS_constant_OPENGL_CONTEXT: + +enum **HandleType**: + +- **APPLICATION_HANDLE** = **0** --- Application handle: + +- Windows: ``HINSTANCE`` of the application + +- MacOS: ``NSApplication*`` of the application (not yet implemented) + +- Android: ``JNIEnv*`` of the application (not yet implemented) + +- **DISPLAY_HANDLE** = **1** --- Display handle: + +- Linux: ``X11::Display*`` for the display + +- **WINDOW_HANDLE** = **2** --- Window handle: + +- Windows: ``HWND`` of the main window + +- Linux: ``X11::Window*`` of the main window + +- MacOS: ``NSWindow*`` of the main window (not yet implemented) + +- Android: ``jObject`` the main android activity (not yet implemented) + +- **WINDOW_VIEW** = **3** --- Window view: + +- Windows: ``HDC`` of the main window drawing context + +- MacOS: ``NSView*`` of the main windows view (not yet implemented) + +- **OPENGL_CONTEXT** = **4** --- OpenGL Context: + +- Windows: ``HGLRC`` + +- Linux: ``X11::GLXContext`` + +- MacOS: ``NSOpenGLContext*`` (not yet implemented) + +---- + +.. _enum_OS_ScreenOrientation: + +.. _class_OS_constant_SCREEN_ORIENTATION_LANDSCAPE: + +.. _class_OS_constant_SCREEN_ORIENTATION_PORTRAIT: + +.. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_LANDSCAPE: + +.. _class_OS_constant_SCREEN_ORIENTATION_REVERSE_PORTRAIT: + +.. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_LANDSCAPE: + +.. _class_OS_constant_SCREEN_ORIENTATION_SENSOR_PORTRAIT: + +.. _class_OS_constant_SCREEN_ORIENTATION_SENSOR: + +enum **ScreenOrientation**: + +- **SCREEN_ORIENTATION_LANDSCAPE** = **0** --- Landscape screen orientation. + +- **SCREEN_ORIENTATION_PORTRAIT** = **1** --- Portrait screen orientation. + +- **SCREEN_ORIENTATION_REVERSE_LANDSCAPE** = **2** --- Reverse landscape screen orientation. + +- **SCREEN_ORIENTATION_REVERSE_PORTRAIT** = **3** --- Reverse portrait screen orientation. + +- **SCREEN_ORIENTATION_SENSOR_LANDSCAPE** = **4** --- Uses landscape or reverse landscape based on the hardware sensor. + +- **SCREEN_ORIENTATION_SENSOR_PORTRAIT** = **5** --- Uses portrait or reverse portrait based on the hardware sensor. + +- **SCREEN_ORIENTATION_SENSOR** = **6** --- Uses most suitable orientation based on the hardware sensor. + +---- + +.. _enum_OS_SystemDir: + +.. _class_OS_constant_SYSTEM_DIR_DESKTOP: + +.. _class_OS_constant_SYSTEM_DIR_DCIM: + +.. _class_OS_constant_SYSTEM_DIR_DOCUMENTS: + +.. _class_OS_constant_SYSTEM_DIR_DOWNLOADS: + +.. _class_OS_constant_SYSTEM_DIR_MOVIES: + +.. _class_OS_constant_SYSTEM_DIR_MUSIC: + +.. _class_OS_constant_SYSTEM_DIR_PICTURES: + +.. _class_OS_constant_SYSTEM_DIR_RINGTONES: + +enum **SystemDir**: + +- **SYSTEM_DIR_DESKTOP** = **0** --- Desktop directory path. + +- **SYSTEM_DIR_DCIM** = **1** --- DCIM (Digital Camera Images) directory path. + +- **SYSTEM_DIR_DOCUMENTS** = **2** --- Documents directory path. + +- **SYSTEM_DIR_DOWNLOADS** = **3** --- Downloads directory path. + +- **SYSTEM_DIR_MOVIES** = **4** --- Movies directory path. + +- **SYSTEM_DIR_MUSIC** = **5** --- Music directory path. + +- **SYSTEM_DIR_PICTURES** = **6** --- Pictures directory path. + +- **SYSTEM_DIR_RINGTONES** = **7** --- Ringtones directory path. + +---- + +.. _enum_OS_PowerState: + +.. _class_OS_constant_POWERSTATE_UNKNOWN: + +.. _class_OS_constant_POWERSTATE_ON_BATTERY: + +.. _class_OS_constant_POWERSTATE_NO_BATTERY: + +.. _class_OS_constant_POWERSTATE_CHARGING: + +.. _class_OS_constant_POWERSTATE_CHARGED: + +enum **PowerState**: + +- **POWERSTATE_UNKNOWN** = **0** --- Unknown powerstate. + +- **POWERSTATE_ON_BATTERY** = **1** --- Unplugged, running on battery. + +- **POWERSTATE_NO_BATTERY** = **2** --- Plugged in, no battery available. + +- **POWERSTATE_CHARGING** = **3** --- Plugged in, battery charging. + +- **POWERSTATE_CHARGED** = **4** --- Plugged in, battery fully charged. + +Property Descriptions +--------------------- + +.. _class_OS_property_clipboard: + +- :ref:`String` **clipboard** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_clipboard(value) | ++-----------+----------------------+ +| *Getter* | get_clipboard() | ++-----------+----------------------+ + +The clipboard from the host OS. Might be unavailable on some platforms. + +---- + +.. _class_OS_property_current_screen: + +- :ref:`int` **current_screen** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_current_screen(value) | ++-----------+---------------------------+ +| *Getter* | get_current_screen() | ++-----------+---------------------------+ + +The current screen index (starting from 0). + +---- + +.. _class_OS_property_delta_smoothing: + +- :ref:`bool` **delta_smoothing** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_delta_smoothing(value) | ++-----------+------------------------------+ +| *Getter* | is_delta_smoothing_enabled() | ++-----------+------------------------------+ + +If ``true``, the engine filters the time delta measured between each frame, and attempts to compensate for random variation. This will only operate on systems where V-Sync is active. + +---- + +.. _class_OS_property_exit_code: + +- :ref:`int` **exit_code** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_exit_code(value) | ++-----------+----------------------+ +| *Getter* | get_exit_code() | ++-----------+----------------------+ + +The exit code passed to the OS when the main loop exits. By convention, an exit code of ``0`` indicates success whereas a non-zero exit code indicates an error. For portability reasons, the exit code should be set between 0 and 125 (inclusive). + +**Note:** This value will be ignored if using :ref:`SceneTree.quit` with an ``exit_code`` argument passed. + +---- + +.. _class_OS_property_keep_screen_on: + +- :ref:`bool` **keep_screen_on** + ++-----------+---------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------+ +| *Setter* | set_keep_screen_on(value) | ++-----------+---------------------------+ +| *Getter* | is_keep_screen_on() | ++-----------+---------------------------+ + +If ``true``, the engine tries to keep the screen on while the game is running. Useful on mobile. + +---- + +.. _class_OS_property_low_processor_usage_mode: + +- :ref:`bool` **low_processor_usage_mode** + ++-----------+-------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------+ +| *Setter* | set_low_processor_usage_mode(value) | ++-----------+-------------------------------------+ +| *Getter* | is_in_low_processor_usage_mode() | ++-----------+-------------------------------------+ + +If ``true``, the engine optimizes for low processor usage by only refreshing the screen if needed. Can improve battery consumption on mobile. + +---- + +.. _class_OS_property_low_processor_usage_mode_sleep_usec: + +- :ref:`int` **low_processor_usage_mode_sleep_usec** + ++-----------+------------------------------------------------+ +| *Default* | ``6900`` | ++-----------+------------------------------------------------+ +| *Setter* | set_low_processor_usage_mode_sleep_usec(value) | ++-----------+------------------------------------------------+ +| *Getter* | get_low_processor_usage_mode_sleep_usec() | ++-----------+------------------------------------------------+ + +The amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. + +---- + +.. _class_OS_property_max_window_size: + +- :ref:`Vector2` **max_window_size** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_max_window_size(value) | ++-----------+----------------------------+ +| *Getter* | get_max_window_size() | ++-----------+----------------------------+ + +The maximum size of the window (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system default value. + +---- + +.. _class_OS_property_min_window_size: + +- :ref:`Vector2` **min_window_size** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_min_window_size(value) | ++-----------+----------------------------+ +| *Getter* | get_min_window_size() | ++-----------+----------------------------+ + +The minimum size of the window in pixels (without counting window manager decorations). Does not affect fullscreen mode. Set to ``(0, 0)`` to reset to the system's default value. + +**Note:** By default, the project window has a minimum size of ``Vector2(64, 64)``. This prevents issues that can arise when the window is resized to a near-zero size. + +---- + +.. _class_OS_property_screen_orientation: + +- :ref:`ScreenOrientation` **screen_orientation** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_screen_orientation(value) | ++-----------+-------------------------------+ +| *Getter* | get_screen_orientation() | ++-----------+-------------------------------+ + +The current screen orientation. + +---- + +.. _class_OS_property_tablet_driver: + +- :ref:`String` **tablet_driver** + ++-----------+----------------------------------+ +| *Default* | ``""`` | ++-----------+----------------------------------+ +| *Setter* | set_current_tablet_driver(value) | ++-----------+----------------------------------+ +| *Getter* | get_current_tablet_driver() | ++-----------+----------------------------------+ + +The current tablet driver in use. + +---- + +.. _class_OS_property_vsync_enabled: + +- :ref:`bool` **vsync_enabled** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_use_vsync(value) | ++-----------+----------------------+ +| *Getter* | is_vsync_enabled() | ++-----------+----------------------+ + +If ``true``, vertical synchronization (Vsync) is enabled. + +---- + +.. _class_OS_property_vsync_via_compositor: + +- :ref:`bool` **vsync_via_compositor** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_vsync_via_compositor(value) | ++-----------+-----------------------------------+ +| *Getter* | is_vsync_via_compositor_enabled() | ++-----------+-----------------------------------+ + +If ``true`` and ``vsync_enabled`` is true, the operating system's window compositor will be used for vsync when the compositor is enabled and the game is in windowed mode. + +**Note:** This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. + +**Note:** This property is only implemented on Windows. + +---- + +.. _class_OS_property_window_borderless: + +- :ref:`bool` **window_borderless** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_borderless_window(value) | ++-----------+------------------------------+ +| *Getter* | get_borderless_window() | ++-----------+------------------------------+ + +If ``true``, removes the window frame. + +**Note:** Setting ``window_borderless`` to ``false`` disables per-pixel transparency. + +---- + +.. _class_OS_property_window_fullscreen: + +- :ref:`bool` **window_fullscreen** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_window_fullscreen(value) | ++-----------+------------------------------+ +| *Getter* | is_window_fullscreen() | ++-----------+------------------------------+ + +If ``true``, the window is fullscreen. + +---- + +.. _class_OS_property_window_maximized: + +- :ref:`bool` **window_maximized** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_window_maximized(value) | ++-----------+-----------------------------+ +| *Getter* | is_window_maximized() | ++-----------+-----------------------------+ + +If ``true``, the window is maximized. + +---- + +.. _class_OS_property_window_minimized: + +- :ref:`bool` **window_minimized** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_window_minimized(value) | ++-----------+-----------------------------+ +| *Getter* | is_window_minimized() | ++-----------+-----------------------------+ + +If ``true``, the window is minimized. + +---- + +.. _class_OS_property_window_per_pixel_transparency_enabled: + +- :ref:`bool` **window_per_pixel_transparency_enabled** + ++-----------+--------------------------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------------------------+ +| *Setter* | set_window_per_pixel_transparency_enabled(value) | ++-----------+--------------------------------------------------+ +| *Getter* | get_window_per_pixel_transparency_enabled() | ++-----------+--------------------------------------------------+ + +If ``true``, the window background is transparent and the window frame is removed. + +Use ``get_tree().get_root().set_transparent_background(true)`` to disable main viewport background rendering. + +**Note:** This property has no effect if :ref:`ProjectSettings.display/window/per_pixel_transparency/allowed` setting is disabled. + +**Note:** This property is implemented on HTML5, Linux, macOS, Windows, and Android. It can't be changed at runtime for Android. Use :ref:`ProjectSettings.display/window/per_pixel_transparency/enabled` to set it at startup instead. + +---- + +.. _class_OS_property_window_position: + +- :ref:`Vector2` **window_position** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_window_position(value) | ++-----------+----------------------------+ +| *Getter* | get_window_position() | ++-----------+----------------------------+ + +The window position relative to the screen, the origin is the top left corner, +Y axis goes to the bottom and +X axis goes to the right. + +---- + +.. _class_OS_property_window_resizable: + +- :ref:`bool` **window_resizable** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_window_resizable(value) | ++-----------+-----------------------------+ +| *Getter* | is_window_resizable() | ++-----------+-----------------------------+ + +If ``true``, the window is resizable by the user. + +---- + +.. _class_OS_property_window_size: + +- :ref:`Vector2` **window_size** + ++-----------+------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_window_size(value) | ++-----------+------------------------+ +| *Getter* | get_window_size() | ++-----------+------------------------+ + +The size of the window (without counting window manager decorations). + +Method Descriptions +------------------- + +.. _class_OS_method_alert: + +- void **alert** **(** :ref:`String` text, :ref:`String` title="Alert!" **)** + +Displays a modal dialog box using the host OS' facilities. Execution is blocked until the dialog is closed. + +---- + +.. _class_OS_method_can_draw: + +- :ref:`bool` **can_draw** **(** **)** |const| + +Returns ``true`` if the host OS allows drawing. + +---- + +.. _class_OS_method_can_use_threads: + +- :ref:`bool` **can_use_threads** **(** **)** |const| + +Returns ``true`` if the current host platform is using multiple threads. + +---- + +.. _class_OS_method_center_window: + +- void **center_window** **(** **)** + +Centers the window on the screen if in windowed mode. + +---- + +.. _class_OS_method_close_midi_inputs: + +- void **close_midi_inputs** **(** **)** + +Shuts down system MIDI driver. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_delay_msec: + +- void **delay_msec** **(** :ref:`int` msec **)** |const| + +Delays execution of the current thread by ``msec`` milliseconds. ``msec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_msec` will do nothing and will print an error message. + +**Note:** :ref:`delay_msec` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer`. Yielding with :ref:`SceneTree.create_timer` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin`\ s and :ref:`EditorScript`\ s). + +**Note:** When :ref:`delay_msec` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_msec` as part of an :ref:`EditorPlugin` or :ref:`EditorScript`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process). + +---- + +.. _class_OS_method_delay_usec: + +- void **delay_usec** **(** :ref:`int` usec **)** |const| + +Delays execution of the current thread by ``usec`` microseconds. ``usec`` must be greater than or equal to ``0``. Otherwise, :ref:`delay_usec` will do nothing and will print an error message. + +**Note:** :ref:`delay_usec` is a *blocking* way to delay code execution. To delay code execution in a non-blocking way, see :ref:`SceneTree.create_timer`. Yielding with :ref:`SceneTree.create_timer` will delay the execution of code placed below the ``yield`` without affecting the rest of the project (or editor, for :ref:`EditorPlugin`\ s and :ref:`EditorScript`\ s). + +**Note:** When :ref:`delay_usec` is called on the main thread, it will freeze the project and will prevent it from redrawing and registering input until the delay has passed. When using :ref:`delay_usec` as part of an :ref:`EditorPlugin` or :ref:`EditorScript`, it will freeze the editor but won't freeze the project if it is currently running (since the project is an independent child process). + +---- + +.. _class_OS_method_dump_memory_to_file: + +- void **dump_memory_to_file** **(** :ref:`String` file **)** + +Dumps the memory allocation ringlist to a file (only works in debug). + +Entry format per line: "Address - Size - Description". + +---- + +.. _class_OS_method_dump_resources_to_file: + +- void **dump_resources_to_file** **(** :ref:`String` file **)** + +Dumps all used resources to file (only works in debug). + +Entry format per line: "Resource Type : Resource Location". + +At the end of the file is a statistic of all used Resource Types. + +---- + +.. _class_OS_method_execute: + +- :ref:`int` **execute** **(** :ref:`String` path, :ref:`PoolStringArray` arguments, :ref:`bool` blocking=true, :ref:`Array` output=[ ], :ref:`bool` read_stderr=false **)** + +Execute the file at the given path with the arguments passed as an array of strings. Platform path resolution will take place. The resolved file must exist and be executable. + +The arguments are used in the given order and separated by a space, so ``OS.execute("ping", ["-w", "3", "godotengine.org"], false)`` will resolve to ``ping -w 3 godotengine.org`` in the system's shell. + +This method has slightly different behavior based on whether the ``blocking`` mode is enabled. + +If ``blocking`` is ``true``, the Godot thread will pause its execution while waiting for the process to terminate. The shell output of the process will be written to the ``output`` array as a single string. When the process terminates, the Godot thread will resume execution. + +If ``blocking`` is ``false``, the Godot thread will continue while the new process runs. It is not possible to retrieve the shell output in non-blocking mode, so ``output`` will be empty. + +The return value also depends on the blocking mode. When blocking, the method will return an exit code of the process. When non-blocking, the method returns a process ID, which you can use to monitor the process (and potentially terminate it with :ref:`kill`). If the process forking (non-blocking) or opening (blocking) fails, the method will return ``-1`` or another exit code. + +Example of blocking mode and retrieving the shell output: + +:: + + var output = [] + var exit_code = OS.execute("ls", ["-l", "/tmp"], true, output) + +Example of non-blocking mode, running another instance of the project and storing its process ID: + +:: + + var pid = OS.execute(OS.get_executable_path(), [], false) + +If you wish to access a shell built-in or perform a composite command, a platform-specific shell can be invoked. For example: + +:: + + OS.execute("CMD.exe", ["/C", "cd %TEMP% && dir"], true, output) + +**Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. + +**Note:** To execute a Windows command interpreter built-in command, specify ``cmd.exe`` in ``path``, ``/c`` as the first argument, and the desired command as the second argument. + +**Note:** To execute a PowerShell built-in command, specify ``powershell.exe`` in ``path``, ``-Command`` as the first argument, and the desired command as the second argument. + +**Note:** To execute a Unix shell built-in command, specify shell executable name in ``path``, ``-c`` as the first argument, and the desired command as the second argument. + +---- + +.. _class_OS_method_find_scancode_from_string: + +- :ref:`int` **find_scancode_from_string** **(** :ref:`String` string **)** |const| + +Returns the scancode of the given string (e.g. "Escape"). + +---- + +.. _class_OS_method_get_audio_driver_count: + +- :ref:`int` **get_audio_driver_count** **(** **)** |const| + +Returns the total number of available audio drivers. + +---- + +.. _class_OS_method_get_audio_driver_name: + +- :ref:`String` **get_audio_driver_name** **(** :ref:`int` driver **)** |const| + +Returns the audio driver name for the given index. + +---- + +.. _class_OS_method_get_cache_dir: + +- :ref:`String` **get_cache_dir** **(** **)** |const| + +Returns the *global* cache data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_CACHE_HOME`` environment variable before starting the project. See `File paths in Godot projects `__ in the documentation for more information. See also :ref:`get_config_dir` and :ref:`get_data_dir`. + +Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. + +---- + +.. _class_OS_method_get_cmdline_args: + +- :ref:`PoolStringArray` **get_cmdline_args** **(** **)** + +Returns the command-line arguments passed to the engine. + +Command-line arguments can be written in any form, including both ``--key value`` and ``--key=value`` forms so they can be properly parsed, as long as custom command-line arguments do not conflict with engine arguments. + +You can also incorporate environment variables using the :ref:`get_environment` method. + +You can set :ref:`ProjectSettings.editor/main_run_args` to define command-line arguments to be passed by the editor when running the project. + +Here's a minimal example on how to parse command-line arguments into a dictionary using the ``--key=value`` form for arguments: + +:: + + var arguments = {} + for argument in OS.get_cmdline_args(): + if argument.find("=") > -1: + var key_value = argument.split("=") + arguments[key_value[0].lstrip("--")] = key_value[1] + +---- + +.. _class_OS_method_get_config_dir: + +- :ref:`String` **get_config_dir** **(** **)** |const| + +Returns the *global* user configuration directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_CONFIG_HOME`` environment variable before starting the project. See `File paths in Godot projects `__ in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_data_dir`. + +Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. + +---- + +.. _class_OS_method_get_connected_midi_inputs: + +- :ref:`PoolStringArray` **get_connected_midi_inputs** **(** **)** + +Returns an array of MIDI device names. + +The returned array will be empty if the system MIDI driver has not previously been initialised with :ref:`open_midi_inputs`. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_get_current_video_driver: + +- :ref:`VideoDriver` **get_current_video_driver** **(** **)** |const| + +Returns the currently used video driver, using one of the values from :ref:`VideoDriver`. + +---- + +.. _class_OS_method_get_data_dir: + +- :ref:`String` **get_data_dir** **(** **)** |const| + +Returns the *global* user data directory according to the operating system's standards. On desktop platforms, this path can be overridden by setting the ``XDG_DATA_HOME`` environment variable before starting the project. See `File paths in Godot projects `__ in the documentation for more information. See also :ref:`get_cache_dir` and :ref:`get_config_dir`. + +Not to be confused with :ref:`get_user_data_dir`, which returns the *project-specific* user data path. + +---- + +.. _class_OS_method_get_date: + +- :ref:`Dictionary` **get_date** **(** :ref:`bool` utc=false **)** |const| + +Returns current date as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time). + +---- + +.. _class_OS_method_get_datetime: + +- :ref:`Dictionary` **get_datetime** **(** :ref:`bool` utc=false **)** |const| + +Returns current datetime as a dictionary of keys: ``year``, ``month``, ``day``, ``weekday``, ``dst`` (Daylight Savings Time), ``hour``, ``minute``, ``second``. + +---- + +.. _class_OS_method_get_datetime_from_unix_time: + +- :ref:`Dictionary` **get_datetime_from_unix_time** **(** :ref:`int` unix_time_val **)** |const| + +Gets a dictionary of time values corresponding to the given UNIX epoch time (in seconds). + +The returned Dictionary's values will be the same as :ref:`get_datetime`, with the exception of Daylight Savings Time as it cannot be determined from the epoch. + +---- + +.. _class_OS_method_get_dynamic_memory_usage: + +- :ref:`int` **get_dynamic_memory_usage** **(** **)** |const| + +Returns the total amount of dynamic memory used (only works in debug). + +---- + +.. _class_OS_method_get_environment: + +- :ref:`String` **get_environment** **(** :ref:`String` variable **)** |const| + +Returns the value of an environment variable. Returns an empty string if the environment variable doesn't exist. + +**Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows. + +---- + +.. _class_OS_method_get_executable_path: + +- :ref:`String` **get_executable_path** **(** **)** |const| + +Returns the path to the current engine executable. + +---- + +.. _class_OS_method_get_granted_permissions: + +- :ref:`PoolStringArray` **get_granted_permissions** **(** **)** |const| + +With this function, you can get the list of dangerous permissions that have been granted to the Android application. + +**Note:** This method is implemented on Android. + +---- + +.. _class_OS_method_get_ime_selection: + +- :ref:`Vector2` **get_ime_selection** **(** **)** |const| + +Returns the IME cursor position (the currently-edited portion of the string) relative to the characters in the composition string. + +:ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE` is sent to the application to notify it of changes to the IME cursor position. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_get_ime_text: + +- :ref:`String` **get_ime_text** **(** **)** |const| + +Returns the IME intermediate composition string. + +:ref:`MainLoop.NOTIFICATION_OS_IME_UPDATE` is sent to the application to notify it of changes to the IME composition string. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_get_latin_keyboard_variant: + +- :ref:`String` **get_latin_keyboard_variant** **(** **)** |const| + +Returns the current latin keyboard variant as a String. + +Possible return values are: ``"QWERTY"``, ``"AZERTY"``, ``"QZERTY"``, ``"DVORAK"``, ``"NEO"``, ``"COLEMAK"`` or ``"ERROR"``. + +**Note:** This method is implemented on Linux, macOS and Windows. Returns ``"QWERTY"`` on unsupported platforms. + +---- + +.. _class_OS_method_get_locale: + +- :ref:`String` **get_locale** **(** **)** |const| + +Returns the host OS locale as a string of the form ``language_Script_COUNTRY_VARIANT@extra``. If you want only the language code and not the fully specified locale from the OS, you can use :ref:`get_locale_language`. + +``language`` - 2 or 3-letter `language code `__, in lower case. + +``Script`` - optional, 4-letter `script code `__, in title case. + +``COUNTRY`` - optional, 2 or 3-letter `country code `__, in upper case. + +``VARIANT`` - optional, language variant, region and sort order. Variant can have any number of underscored keywords. + +``extra`` - optional, semicolon separated list of additional key words. Currency, calendar, sort order and numbering system information. + +---- + +.. _class_OS_method_get_locale_language: + +- :ref:`String` **get_locale_language** **(** **)** |const| + +Returns the host OS locale's 2 or 3-letter `language code `__ as a string which should be consistent on all platforms. This is equivalent to extracting the ``language`` part of the :ref:`get_locale` string. + +This can be used to narrow down fully specified locale strings to only the "common" language code, when you don't need the additional information about country code or variants. For example, for a French Canadian user with ``fr_CA`` locale, this would return ``fr``. + +---- + +.. _class_OS_method_get_model_name: + +- :ref:`String` **get_model_name** **(** **)** |const| + +Returns the model name of the current device. + +**Note:** This method is implemented on Android and iOS. Returns ``"GenericDevice"`` on unsupported platforms. + +---- + +.. _class_OS_method_get_name: + +- :ref:`String` **get_name** **(** **)** |const| + +Returns the name of the host OS. Possible values are: ``"Android"``, ``"iOS"``, ``"HTML5"``, ``"OSX"``, ``"Server"``, ``"Windows"``, ``"UWP"``, ``"X11"``. + +---- + +.. _class_OS_method_get_native_handle: + +- :ref:`int` **get_native_handle** **(** :ref:`HandleType` handle_type **)** + +Returns internal structure pointers for use in GDNative plugins. + +**Note:** This method is implemented on Linux and Windows (other OSs will soon be supported). + +---- + +.. _class_OS_method_get_power_percent_left: + +- :ref:`int` **get_power_percent_left** **(** **)** + +Returns the amount of battery left in the device as a percentage. Returns ``-1`` if power state is unknown. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_get_power_seconds_left: + +- :ref:`int` **get_power_seconds_left** **(** **)** + +Returns an estimate of the time left in seconds before the device runs out of battery. Returns ``-1`` if power state is unknown. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_get_power_state: + +- :ref:`PowerState` **get_power_state** **(** **)** + +Returns the current state of the device regarding battery and power. See :ref:`PowerState` constants. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_get_process_id: + +- :ref:`int` **get_process_id** **(** **)** |const| + +Returns the project's process ID. + +**Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. + +---- + +.. _class_OS_method_get_processor_count: + +- :ref:`int` **get_processor_count** **(** **)** |const| + +Returns the number of threads available on the host machine. + +---- + +.. _class_OS_method_get_real_window_size: + +- :ref:`Vector2` **get_real_window_size** **(** **)** |const| + +Returns the window size including decorations like window borders. + +---- + +.. _class_OS_method_get_scancode_string: + +- :ref:`String` **get_scancode_string** **(** :ref:`int` code **)** |const| + +Returns the given scancode as a string (e.g. Return values: ``"Escape"``, ``"Shift+Escape"``). + +See also :ref:`InputEventKey.scancode` and :ref:`InputEventKey.get_scancode_with_modifiers`. + +---- + +.. _class_OS_method_get_screen_count: + +- :ref:`int` **get_screen_count** **(** **)** |const| + +Returns the number of displays attached to the host machine. + +---- + +.. _class_OS_method_get_screen_dpi: + +- :ref:`int` **get_screen_dpi** **(** :ref:`int` screen=-1 **)** |const| + +Returns the dots per inch density of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used. + +**Note:** On macOS, returned value is inaccurate if fractional display scaling mode is used. + +**Note:** On Android devices, the actual screen densities are grouped into six generalized densities: + +:: + + ldpi - 120 dpi + mdpi - 160 dpi + hdpi - 240 dpi + xhdpi - 320 dpi + xxhdpi - 480 dpi + xxxhdpi - 640 dpi + +**Note:** This method is implemented on Android, Linux, macOS and Windows. Returns ``72`` on unsupported platforms. + +---- + +.. _class_OS_method_get_screen_max_scale: + +- :ref:`float` **get_screen_max_scale** **(** **)** |const| + +Return the greatest scale factor of all screens. + +**Note:** On macOS returned value is ``2.0`` if there is at least one hiDPI (Retina) screen in the system, and ``1.0`` in all other cases. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_get_screen_position: + +- :ref:`Vector2` **get_screen_position** **(** :ref:`int` screen=-1 **)** |const| + +Returns the position of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used. + +---- + +.. _class_OS_method_get_screen_scale: + +- :ref:`float` **get_screen_scale** **(** :ref:`int` screen=-1 **)** |const| + +Return the scale factor of the specified screen by index. If ``screen`` is ``-1`` (the default value), the current screen will be used. + +**Note:** On macOS returned value is ``2.0`` for hiDPI (Retina) screen, and ``1.0`` for all other cases. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_get_screen_size: + +- :ref:`Vector2` **get_screen_size** **(** :ref:`int` screen=-1 **)** |const| + +Returns the dimensions in pixels of the specified screen. If ``screen`` is ``-1`` (the default value), the current screen will be used. + +---- + +.. _class_OS_method_get_splash_tick_msec: + +- :ref:`int` **get_splash_tick_msec** **(** **)** |const| + +Returns the amount of time in milliseconds it took for the boot logo to appear. + +---- + +.. _class_OS_method_get_static_memory_peak_usage: + +- :ref:`int` **get_static_memory_peak_usage** **(** **)** |const| + +Returns the maximum amount of static memory used (only works in debug). + +---- + +.. _class_OS_method_get_static_memory_usage: + +- :ref:`int` **get_static_memory_usage** **(** **)** |const| + +Returns the amount of static memory being used by the program in bytes (only works in debug). + +---- + +.. _class_OS_method_get_system_dir: + +- :ref:`String` **get_system_dir** **(** :ref:`SystemDir` dir, :ref:`bool` shared_storage=true **)** |const| + +Returns the actual path to commonly used folders across different platforms. Available locations are specified in :ref:`SystemDir`. + +**Note:** This method is implemented on Android, Linux, macOS and Windows. + +**Note:** Shared storage is implemented on Android and allows to differentiate between app specific and shared directories. Shared directories have additional restrictions on Android. + +---- + +.. _class_OS_method_get_system_time_msecs: + +- :ref:`int` **get_system_time_msecs** **(** **)** |const| + +Returns the epoch time of the operating system in milliseconds. + +---- + +.. _class_OS_method_get_system_time_secs: + +- :ref:`int` **get_system_time_secs** **(** **)** |const| + +Returns the epoch time of the operating system in seconds. + +---- + +.. _class_OS_method_get_tablet_driver_count: + +- :ref:`int` **get_tablet_driver_count** **(** **)** |const| + +Returns the total number of available tablet drivers. + +**Note:** This method is implemented on Windows. + +---- + +.. _class_OS_method_get_tablet_driver_name: + +- :ref:`String` **get_tablet_driver_name** **(** :ref:`int` idx **)** |const| + +Returns the tablet driver name for the given index. + +**Note:** This method is implemented on Windows. + +---- + +.. _class_OS_method_get_thread_caller_id: + +- :ref:`int` **get_thread_caller_id** **(** **)** |const| + +Returns the ID of the current thread. This can be used in logs to ease debugging of multi-threaded applications. + +**Note:** Thread IDs are not deterministic and may be reused across application restarts. + +---- + +.. _class_OS_method_get_ticks_msec: + +- :ref:`int` **get_ticks_msec** **(** **)** |const| + +Returns the amount of time passed in milliseconds since the engine started. + +---- + +.. _class_OS_method_get_ticks_usec: + +- :ref:`int` **get_ticks_usec** **(** **)** |const| + +Returns the amount of time passed in microseconds since the engine started. + +---- + +.. _class_OS_method_get_time: + +- :ref:`Dictionary` **get_time** **(** :ref:`bool` utc=false **)** |const| + +Returns current time as a dictionary of keys: hour, minute, second. + +---- + +.. _class_OS_method_get_time_zone_info: + +- :ref:`Dictionary` **get_time_zone_info** **(** **)** |const| + +Returns the current time zone as a dictionary with the keys: bias and name. + +---- + +.. _class_OS_method_get_unique_id: + +- :ref:`String` **get_unique_id** **(** **)** |const| + +Returns a string that is unique to the device. + +**Note:** This string may change without notice if the user reinstalls/upgrades their operating system or changes their hardware. This means it should generally not be used to encrypt persistent data as the data saved before an unexpected ID change would become inaccessible. The returned string may also be falsified using external programs, so do not rely on the string returned by :ref:`get_unique_id` for security purposes. + +**Note:** Returns an empty string on HTML5 and UWP, as this method isn't implemented on those platforms yet. + +---- + +.. _class_OS_method_get_unix_time: + +- :ref:`int` **get_unix_time** **(** **)** |const| + +Returns the current UNIX epoch timestamp in seconds. + +**Important:** This is the system clock that the user can manually set. **Never use** this method for precise time calculation since its results are also subject to automatic adjustments by the operating system. **Always use** :ref:`get_ticks_usec` or :ref:`get_ticks_msec` for precise time calculation instead, since they are guaranteed to be monotonic (i.e. never decrease). + +---- + +.. _class_OS_method_get_unix_time_from_datetime: + +- :ref:`int` **get_unix_time_from_datetime** **(** :ref:`Dictionary` datetime **)** |const| + +Gets an epoch time value from a dictionary of time values. + +``datetime`` must be populated with the following keys: ``year``, ``month``, ``day``, ``hour``, ``minute``, ``second``. + +If the dictionary is empty ``0`` is returned. If some keys are omitted, they default to the equivalent values for the UNIX epoch timestamp 0 (1970-01-01 at 00:00:00 UTC). + +You can pass the output from :ref:`get_datetime_from_unix_time` directly into this function. Daylight Savings Time (``dst``), if present, is ignored. + +---- + +.. _class_OS_method_get_user_data_dir: + +- :ref:`String` **get_user_data_dir** **(** **)** |const| + +Returns the absolute directory path where user data is written (``user://``). + +On Linux, this is ``~/.local/share/godot/app_userdata/[project_name]``, or ``~/.local/share/[custom_name]`` if ``use_custom_user_dir`` is set. + +On macOS, this is ``~/Library/Application Support/Godot/app_userdata/[project_name]``, or ``~/Library/Application Support/[custom_name]`` if ``use_custom_user_dir`` is set. + +On Windows, this is ``%APPDATA%\Godot\app_userdata\[project_name]``, or ``%APPDATA%\[custom_name]`` if ``use_custom_user_dir`` is set. ``%APPDATA%`` expands to ``%USERPROFILE%\AppData\Roaming``. + +If the project name is empty, ``user://`` falls back to ``res://``. + +Not to be confused with :ref:`get_data_dir`, which returns the *global* (non-project-specific) user data directory. + +---- + +.. _class_OS_method_get_video_driver_count: + +- :ref:`int` **get_video_driver_count** **(** **)** |const| + +Returns the number of video drivers supported on the current platform. + +---- + +.. _class_OS_method_get_video_driver_name: + +- :ref:`String` **get_video_driver_name** **(** :ref:`VideoDriver` driver **)** |const| + +Returns the name of the video driver matching the given ``driver`` index. This index is a value from :ref:`VideoDriver`, and you can use :ref:`get_current_video_driver` to get the current backend's index. + +---- + +.. _class_OS_method_get_virtual_keyboard_height: + +- :ref:`int` **get_virtual_keyboard_height** **(** **)** + +Returns the on-screen keyboard's height in pixels. Returns 0 if there is no keyboard or if it is currently hidden. + +---- + +.. _class_OS_method_get_window_safe_area: + +- :ref:`Rect2` **get_window_safe_area** **(** **)** |const| + +Returns unobscured area of the window where interactive controls should be rendered. + +---- + +.. _class_OS_method_global_menu_add_item: + +- void **global_menu_add_item** **(** :ref:`String` menu, :ref:`String` label, :ref:`Variant` id, :ref:`Variant` meta **)** + +Add a new item with text "label" to global menu. Use "_dock" menu to add item to the macOS dock icon menu. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_global_menu_add_separator: + +- void **global_menu_add_separator** **(** :ref:`String` menu **)** + +Add a separator between items. Separators also occupy an index. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_global_menu_clear: + +- void **global_menu_clear** **(** :ref:`String` menu **)** + +Clear the global menu, in effect removing all items. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_global_menu_remove_item: + +- void **global_menu_remove_item** **(** :ref:`String` menu, :ref:`int` idx **)** + +Removes the item at index "idx" from the global menu. Note that the indexes of items after the removed item are going to be shifted by one. + +**Note:** This method is implemented on macOS. + +---- + +.. _class_OS_method_has_environment: + +- :ref:`bool` **has_environment** **(** :ref:`String` variable **)** |const| + +Returns ``true`` if the environment variable with the name ``variable`` exists. + +**Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows. + +---- + +.. _class_OS_method_has_feature: + +- :ref:`bool` **has_feature** **(** :ref:`String` tag_name **)** |const| + +Returns ``true`` if the feature for the given feature tag is supported in the currently running instance, depending on the platform, build etc. Can be used to check whether you're currently running a debug build, on a certain platform or arch, etc. Refer to the `Feature Tags `__ documentation for more details. + +**Note:** Tag names are case-sensitive. + +---- + +.. _class_OS_method_has_touchscreen_ui_hint: + +- :ref:`bool` **has_touchscreen_ui_hint** **(** **)** |const| + +Returns ``true`` if the device has a touchscreen or emulates one. + +---- + +.. _class_OS_method_has_virtual_keyboard: + +- :ref:`bool` **has_virtual_keyboard** **(** **)** |const| + +Returns ``true`` if the platform has a virtual keyboard, ``false`` otherwise. + +---- + +.. _class_OS_method_hide_virtual_keyboard: + +- void **hide_virtual_keyboard** **(** **)** + +Hides the virtual keyboard if it is shown, does nothing otherwise. + +---- + +.. _class_OS_method_is_debug_build: + +- :ref:`bool` **is_debug_build** **(** **)** |const| + +Returns ``true`` if the Godot binary used to run the project is a *debug* export template, or when running in the editor. + +Returns ``false`` if the Godot binary used to run the project is a *release* export template. + +To check whether the Godot binary used to run the project is an export template (debug or release), use ``OS.has_feature("standalone")`` instead. + +---- + +.. _class_OS_method_is_ok_left_and_cancel_right: + +- :ref:`bool` **is_ok_left_and_cancel_right** **(** **)** |const| + +Returns ``true`` if the **OK** button should appear on the left and **Cancel** on the right. + +---- + +.. _class_OS_method_is_scancode_unicode: + +- :ref:`bool` **is_scancode_unicode** **(** :ref:`int` code **)** |const| + +Returns ``true`` if the input scancode corresponds to a Unicode character. + +---- + +.. _class_OS_method_is_stdout_verbose: + +- :ref:`bool` **is_stdout_verbose** **(** **)** |const| + +Returns ``true`` if the engine was executed with ``-v`` (verbose stdout). + +---- + +.. _class_OS_method_is_userfs_persistent: + +- :ref:`bool` **is_userfs_persistent** **(** **)** |const| + +If ``true``, the ``user://`` file system is persistent, so that its state is the same after a player quits and starts the game again. Relevant to the HTML5 platform, where this persistence may be unavailable. + +---- + +.. _class_OS_method_is_window_always_on_top: + +- :ref:`bool` **is_window_always_on_top** **(** **)** |const| + +Returns ``true`` if the window should always be on top of other windows. + +---- + +.. _class_OS_method_is_window_focused: + +- :ref:`bool` **is_window_focused** **(** **)** |const| + +Returns ``true`` if the window is currently focused. + +**Note:** Only implemented on desktop platforms. On other platforms, it will always return ``true``. + +---- + +.. _class_OS_method_keyboard_get_current_layout: + +- :ref:`int` **keyboard_get_current_layout** **(** **)** |const| + +Returns active keyboard layout index. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_count: + +- :ref:`int` **keyboard_get_layout_count** **(** **)** |const| + +Returns the number of keyboard layouts. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_language: + +- :ref:`String` **keyboard_get_layout_language** **(** :ref:`int` index **)** |const| + +Returns the ISO-639/BCP-47 language code of the keyboard layout at position ``index``. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_get_layout_name: + +- :ref:`String` **keyboard_get_layout_name** **(** :ref:`int` index **)** |const| + +Returns the localized name of the keyboard layout at position ``index``. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_keyboard_set_current_layout: + +- void **keyboard_set_current_layout** **(** :ref:`int` index **)** + +Sets active keyboard layout. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_kill: + +- :ref:`Error` **kill** **(** :ref:`int` pid **)** + +Kill (terminate) the process identified by the given process ID (``pid``), e.g. the one returned by :ref:`execute` in non-blocking mode. + +**Note:** This method can also be used to kill processes that were not spawned by the game. + +**Note:** This method is implemented on Android, iOS, Linux, macOS and Windows. + +---- + +.. _class_OS_method_move_window_to_foreground: + +- void **move_window_to_foreground** **(** **)** + +Moves the window to the front. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_native_video_is_playing: + +- :ref:`bool` **native_video_is_playing** **(** **)** + +Returns ``true`` if native video is playing. + +**Note:** This method is only implemented on iOS. + +---- + +.. _class_OS_method_native_video_pause: + +- void **native_video_pause** **(** **)** + +Pauses native video playback. + +**Note:** This method is only implemented on iOS. + +---- + +.. _class_OS_method_native_video_play: + +- :ref:`Error` **native_video_play** **(** :ref:`String` path, :ref:`float` volume, :ref:`String` audio_track, :ref:`String` subtitle_track **)** + +Plays native video from the specified path, at the given volume and with audio and subtitle tracks. + +**Note:** This method is only implemented on iOS. + +---- + +.. _class_OS_method_native_video_stop: + +- void **native_video_stop** **(** **)** + +Stops native video playback. + +**Note:** This method is implemented on iOS. + +---- + +.. _class_OS_method_native_video_unpause: + +- void **native_video_unpause** **(** **)** + +Resumes native video playback. + +**Note:** This method is implemented on iOS. + +---- + +.. _class_OS_method_open_midi_inputs: + +- void **open_midi_inputs** **(** **)** + +Initialises the singleton for the system MIDI driver. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_print_all_resources: + +- void **print_all_resources** **(** :ref:`String` tofile="" **)** + +Shows all resources in the game. Optionally, the list can be written to a file by specifying a file path in ``tofile``. + +---- + +.. _class_OS_method_print_all_textures_by_size: + +- void **print_all_textures_by_size** **(** **)** + +Shows the list of loaded textures sorted by size in memory. + +---- + +.. _class_OS_method_print_resources_by_type: + +- void **print_resources_by_type** **(** :ref:`PoolStringArray` types **)** + +Shows the number of resources loaded by the game of the given types. + +---- + +.. _class_OS_method_print_resources_in_use: + +- void **print_resources_in_use** **(** :ref:`bool` short=false **)** + +Shows all resources currently used by the game. + +---- + +.. _class_OS_method_request_attention: + +- void **request_attention** **(** **)** + +Request the user attention to the window. It'll flash the taskbar button on Windows or bounce the dock icon on OSX. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_request_permission: + +- :ref:`bool` **request_permission** **(** :ref:`String` name **)** + +At the moment this function is only used by ``AudioDriverOpenSL`` to request permission for ``RECORD_AUDIO`` on Android. + +---- + +.. _class_OS_method_request_permissions: + +- :ref:`bool` **request_permissions** **(** **)** + +With this function, you can request dangerous permissions since normal permissions are automatically granted at install time in Android applications. + +**Note:** This method is implemented on Android. + +---- + +.. _class_OS_method_set_environment: + +- :ref:`bool` **set_environment** **(** :ref:`String` variable, :ref:`String` value **)** |const| + +Sets the value of the environment variable ``variable`` to ``value``. The environment variable will be set for the Godot process and any process executed with :ref:`execute` after running :ref:`set_environment`. The environment variable will *not* persist to processes run after the Godot process was terminated. + +**Note:** Double-check the casing of ``variable``. Environment variable names are case-sensitive on all platforms except Windows. + +---- + +.. _class_OS_method_set_icon: + +- void **set_icon** **(** :ref:`Image` icon **)** + +Sets the game's icon using an :ref:`Image` resource. + +The same image is used for window caption, taskbar/dock and window selection dialog. Image is scaled as needed. + +**Note:** This method is implemented on HTML5, Linux, macOS and Windows. + +---- + +.. _class_OS_method_set_ime_active: + +- void **set_ime_active** **(** :ref:`bool` active **)** + +Sets whether IME input mode should be enabled. + +If active IME handles key events before the application and creates an composition string and suggestion list. + +Application can retrieve the composition status by using :ref:`get_ime_selection` and :ref:`get_ime_text` functions. + +Completed composition string is committed when input is finished. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_set_ime_position: + +- void **set_ime_position** **(** :ref:`Vector2` position **)** + +Sets position of IME suggestion list popup (in window coordinates). + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_set_native_icon: + +- void **set_native_icon** **(** :ref:`String` filename **)** + +Sets the game's icon using a multi-size platform-specific icon file (``*.ico`` on Windows and ``*.icns`` on macOS). + +Appropriate size sub-icons are used for window caption, taskbar/dock and window selection dialog. + +**Note:** This method is implemented on macOS and Windows. + +---- + +.. _class_OS_method_set_thread_name: + +- :ref:`Error` **set_thread_name** **(** :ref:`String` name **)** + +Sets the name of the current thread. + +---- + +.. _class_OS_method_set_use_file_access_save_and_swap: + +- void **set_use_file_access_save_and_swap** **(** :ref:`bool` enabled **)** + +Enables backup saves if ``enabled`` is ``true``. + +---- + +.. _class_OS_method_set_window_always_on_top: + +- void **set_window_always_on_top** **(** :ref:`bool` enabled **)** + +Sets whether the window should always be on top. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_set_window_mouse_passthrough: + +- void **set_window_mouse_passthrough** **(** :ref:`PoolVector2Array` region **)** + +Sets a polygonal region of the window which accepts mouse events. Mouse events outside the region will be passed through. + +Passing an empty array will disable passthrough support (all mouse events will be intercepted by the window, which is the default behavior). + +:: + + # Set region, using Path2D node. + OS.set_window_mouse_passthrough($Path2D.curve.get_baked_points()) + + # Set region, using Polygon2D node. + OS.set_window_mouse_passthrough($Polygon2D.polygon) + + # Reset region to default. + OS.set_window_mouse_passthrough([]) + +**Note:** On Windows, the portion of a window that lies outside the region is not drawn, while on Linux and macOS it is. + +**Note:** This method is implemented on Linux, macOS and Windows. + +---- + +.. _class_OS_method_set_window_title: + +- void **set_window_title** **(** :ref:`String` title **)** + +Sets the window title to the specified string. + +**Note:** This should be used sporadically. Don't set this every frame, as that will negatively affect performance on some window managers. + +**Note:** This method is implemented on HTML5, Linux, macOS and Windows. + +---- + +.. _class_OS_method_shell_open: + +- :ref:`Error` **shell_open** **(** :ref:`String` uri **)** + +Requests the OS to open a resource with the most appropriate program. For example: + +- ``OS.shell_open("C:\\Users\name\Downloads")`` on Windows opens the file explorer at the user's Downloads folder. + +- ``OS.shell_open("https://godotengine.org")`` opens the default web browser on the official Godot website. + +- ``OS.shell_open("mailto:example@example.com")`` opens the default email client with the "To" field set to ``example@example.com``. See `Customizing ``mailto:`` Links `__ for a list of fields that can be added. + +Use :ref:`ProjectSettings.globalize_path` to convert a ``res://`` or ``user://`` path into a system path for use with this method. + +**Note:** This method is implemented on Android, iOS, HTML5, Linux, macOS and Windows. + +---- + +.. _class_OS_method_show_virtual_keyboard: + +- void **show_virtual_keyboard** **(** :ref:`String` existing_text="", :ref:`bool` multiline=false **)** + +Shows the virtual keyboard if the platform has one. + +The ``existing_text`` parameter is useful for implementing your own :ref:`LineEdit` or :ref:`TextEdit`, as it tells the virtual keyboard what text has already been typed (the virtual keyboard uses it for auto-correct and predictions). + +The ``multiline`` parameter needs to be set to ``true`` to be able to enter multiple lines of text, as in :ref:`TextEdit`. + +**Note:** This method is implemented on Android, iOS and UWP. + +.. |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.)` diff --git a/classes/class_packeddatacontainer.rst b/classes/class_packeddatacontainer.rst new file mode 100644 index 0000000..1e80bfe --- /dev/null +++ b/classes/class_packeddatacontainer.rst @@ -0,0 +1,58 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PackedDataContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PackedDataContainer: + +PackedDataContainer +=================== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+--------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`__data__` | ``PoolByteArray( )`` | ++-------------------------------------------+--------------------------------------------------------------+-----------------------+ + +Methods +------- + ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`pack` **(** :ref:`Variant` value **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PackedDataContainer_property___data__: + +- :ref:`PoolByteArray` **__data__** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ + +Method Descriptions +------------------- + +.. _class_PackedDataContainer_method_pack: + +- :ref:`Error` **pack** **(** :ref:`Variant` value **)** + +---- + +.. _class_PackedDataContainer_method_size: + +- :ref:`int` **size** **(** **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_packeddatacontainerref.rst b/classes/class_packeddatacontainerref.rst new file mode 100644 index 0000000..428ae39 --- /dev/null +++ b/classes/class_packeddatacontainerref.rst @@ -0,0 +1,32 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PackedDataContainerRef.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PackedDataContainerRef: + +PackedDataContainerRef +====================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Reference version of :ref:`PackedDataContainer`. + +Methods +------- + ++-----------------------+---------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** |const| | ++-----------------------+---------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PackedDataContainerRef_method_size: + +- :ref:`int` **size** **(** **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_packedscene.rst b/classes/class_packedscene.rst new file mode 100644 index 0000000..100eb87 --- /dev/null +++ b/classes/class_packedscene.rst @@ -0,0 +1,158 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PackedScene.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PackedScene: + +PackedScene +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`PackedSceneGLTF` + +An abstraction of a serialized scene. + +Description +----------- + +A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. + +Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see ``owner`` property on :ref:`Node`). + +**Note:** The node doesn't need to own itself. + +**Example of loading a saved scene:** + +:: + + # Use `load()` instead of `preload()` if the path isn't known at compile-time. + var scene = preload("res://scene.tscn").instance() + # Add the node as a child of the node the script is attached to. + add_child(scene) + +**Example of saving a node with different owners:** The following example creates 3 objects: ``Node2D`` (``node``), ``RigidBody2D`` (``rigid``) and ``CollisionObject2D`` (``collision``). ``collision`` is a child of ``rigid`` which is a child of ``node``. Only ``rigid`` is owned by ``node`` and ``pack`` will therefore only save those two nodes, but not ``collision``. + +:: + + # Create the objects. + var node = Node2D.new() + var rigid = RigidBody2D.new() + var collision = CollisionShape2D.new() + + # Create the object hierarchy. + rigid.add_child(collision) + node.add_child(rigid) + + # Change owner of `rigid`, but not of `collision`. + rigid.owner = node + + var scene = PackedScene.new() + # Only `node` and `rigid` are now packed. + var result = scene.pack(node) + if result == OK: + var error = ResourceSaver.save("res://path/name.scn", scene) # Or "user://..." + if error != OK: + push_error("An error occurred while saving the scene to disk.") + +Tutorials +--------- + +- `2D Role Playing Game Demo `__ + +Properties +---------- + ++-------------------------------------+------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`_bundled` | ``{"conn_count": 0,"conns": PoolIntArray( ),"editable_instances": [ ],"names": PoolStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PoolIntArray( ),"variants": [ ],"version": 2}`` | ++-------------------------------------+------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_instance` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SceneState` | :ref:`get_state` **(** **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`instance` **(** :ref:`GenEditState` edit_state=0 **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`pack` **(** :ref:`Node` path **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PackedScene_GenEditState: + +.. _class_PackedScene_constant_GEN_EDIT_STATE_DISABLED: + +.. _class_PackedScene_constant_GEN_EDIT_STATE_INSTANCE: + +.. _class_PackedScene_constant_GEN_EDIT_STATE_MAIN: + +enum **GenEditState**: + +- **GEN_EDIT_STATE_DISABLED** = **0** --- If passed to :ref:`instance`, blocks edits to the scene state. + +- **GEN_EDIT_STATE_INSTANCE** = **1** --- If passed to :ref:`instance`, provides local scene resources to the local scene. + +**Note:** Only available in editor builds. + +- **GEN_EDIT_STATE_MAIN** = **2** --- If passed to :ref:`instance`, provides local scene resources to the local scene. Only the main scene should receive the main edit state. + +**Note:** Only available in editor builds. + +Property Descriptions +--------------------- + +.. _class_PackedScene_property__bundled: + +- :ref:`Dictionary` **_bundled** + ++-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| *Default* | ``{"conn_count": 0,"conns": PoolIntArray( ),"editable_instances": [ ],"names": PoolStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PoolIntArray( ),"variants": [ ],"version": 2}`` | ++-----------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +A dictionary representation of the scene contents. + +Available keys include "rnames" and "variants" for resources, "node_count", "nodes", "node_paths" for nodes, "editable_instances" for base scene children overrides, "conn_count" and "conns" for signal connections, and "version" for the format style of the PackedScene. + +Method Descriptions +------------------- + +.. _class_PackedScene_method_can_instance: + +- :ref:`bool` **can_instance** **(** **)** |const| + +Returns ``true`` if the scene file has nodes. + +---- + +.. _class_PackedScene_method_get_state: + +- :ref:`SceneState` **get_state** **(** **)** + +Returns the ``SceneState`` representing the scene file contents. + +---- + +.. _class_PackedScene_method_instance: + +- :ref:`Node` **instance** **(** :ref:`GenEditState` edit_state=0 **)** |const| + +Instantiates the scene's node hierarchy. Triggers child scene instantiation(s). Triggers a :ref:`Node.NOTIFICATION_INSTANCED` notification on the root node. + +---- + +.. _class_PackedScene_method_pack: + +- :ref:`Error` **pack** **(** :ref:`Node` path **)** + +Pack will ignore any sub-nodes not owned by given node. See :ref:`Node.owner`. + +.. |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.)` diff --git a/classes/class_packedscenegltf.rst b/classes/class_packedscenegltf.rst new file mode 100644 index 0000000..d45bfc4 --- /dev/null +++ b/classes/class_packedscenegltf.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PackedSceneGLTF.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PackedSceneGLTF: + +PackedSceneGLTF +=============== + +**Inherits:** :ref:`PackedScene` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | _bundled | ``{"conn_count": 0,"conns": PoolIntArray( ),"editable_instances": [ ],"names": PoolStringArray( ),"node_count": 0,"node_paths": [ ],"nodes": PoolIntArray( ),"variants": [ ],"version": 2}`` *(parent override)* | ++-------------------------------------+----------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`export_gltf` **(** :ref:`Node` node, :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0 **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`import_gltf_scene` **(** :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0, :ref:`int` compress_flags=2194432, :ref:`GLTFState` state=null **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`pack_gltf` **(** :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0, :ref:`int` compress_flags=2194432, :ref:`GLTFState` state=null **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PackedSceneGLTF_method_export_gltf: + +- :ref:`Error` **export_gltf** **(** :ref:`Node` node, :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0 **)** + +---- + +.. _class_PackedSceneGLTF_method_import_gltf_scene: + +- :ref:`Node` **import_gltf_scene** **(** :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0, :ref:`int` compress_flags=2194432, :ref:`GLTFState` state=null **)** + +---- + +.. _class_PackedSceneGLTF_method_pack_gltf: + +- void **pack_gltf** **(** :ref:`String` path, :ref:`int` flags=0, :ref:`float` bake_fps=1000.0, :ref:`int` compress_flags=2194432, :ref:`GLTFState` state=null **)** + +.. |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.)` diff --git a/classes/class_packetpeer.rst b/classes/class_packetpeer.rst new file mode 100644 index 0000000..54992d6 --- /dev/null +++ b/classes/class_packetpeer.rst @@ -0,0 +1,141 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PacketPeer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeer: + +PacketPeer +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`NetworkedMultiplayerPeer`, :ref:`PacketPeerDTLS`, :ref:`PacketPeerGDNative`, :ref:`PacketPeerStream`, :ref:`PacketPeerUDP`, :ref:`WebRTCDataChannel`, :ref:`WebSocketPeer` + +Abstraction and base class for packet-based protocols. + +Description +----------- + +PacketPeer is an abstraction and base class for packet-based protocols (such as UDP). It provides an API for sending and receiving packets both as raw data or variables. This makes it easy to transfer data over a protocol, without having to encode data as low-level bytes or having to worry about network ordering. + +Properties +---------- + ++-------------------------+---------------------------------------------------------------------------------+-------------+ +| :ref:`bool` | :ref:`allow_object_decoding` | ``false`` | ++-------------------------+---------------------------------------------------------------------------------+-------------+ +| :ref:`int` | :ref:`encode_buffer_max_size` | ``8388608`` | ++-------------------------+---------------------------------------------------------------------------------+-------------+ + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_packet_count` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`get_packet` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`get_packet_error` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_var` **(** :ref:`bool` allow_objects=false **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`put_packet` **(** :ref:`PoolByteArray` buffer **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`put_var` **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PacketPeer_property_allow_object_decoding: + +- :ref:`bool` **allow_object_decoding** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_allow_object_decoding(value) | ++-----------+----------------------------------+ +| *Getter* | is_object_decoding_allowed() | ++-----------+----------------------------------+ + +*Deprecated.* Use ``get_var`` and ``put_var`` parameters instead. + +If ``true``, the PacketPeer will allow encoding and decoding of object via :ref:`get_var` and :ref:`put_var`. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_PacketPeer_property_encode_buffer_max_size: + +- :ref:`int` **encode_buffer_max_size** + ++-----------+-----------------------------------+ +| *Default* | ``8388608`` | ++-----------+-----------------------------------+ +| *Setter* | set_encode_buffer_max_size(value) | ++-----------+-----------------------------------+ +| *Getter* | get_encode_buffer_max_size() | ++-----------+-----------------------------------+ + +Maximum buffer size allowed when encoding :ref:`Variant`\ s. Raise this value to support heavier memory allocations. + +The :ref:`put_var` method allocates memory on the stack, and the buffer used will grow automatically to the closest power of two to match the size of the :ref:`Variant`. If the :ref:`Variant` is bigger than ``encode_buffer_max_size``, the method will error out with :ref:`@GlobalScope.ERR_OUT_OF_MEMORY`. + +Method Descriptions +------------------- + +.. _class_PacketPeer_method_get_available_packet_count: + +- :ref:`int` **get_available_packet_count** **(** **)** |const| + +Returns the number of packets currently available in the ring-buffer. + +---- + +.. _class_PacketPeer_method_get_packet: + +- :ref:`PoolByteArray` **get_packet** **(** **)** + +Gets a raw packet. + +---- + +.. _class_PacketPeer_method_get_packet_error: + +- :ref:`Error` **get_packet_error** **(** **)** |const| + +Returns the error state of the last packet received (via :ref:`get_packet` and :ref:`get_var`). + +---- + +.. _class_PacketPeer_method_get_var: + +- :ref:`Variant` **get_var** **(** :ref:`bool` allow_objects=false **)** + +Gets a Variant. If ``allow_objects`` (or :ref:`allow_object_decoding`) is ``true``, decoding objects is allowed. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_PacketPeer_method_put_packet: + +- :ref:`Error` **put_packet** **(** :ref:`PoolByteArray` buffer **)** + +Sends a raw packet. + +---- + +.. _class_PacketPeer_method_put_var: + +- :ref:`Error` **put_var** **(** :ref:`Variant` var, :ref:`bool` full_objects=false **)** + +Sends a :ref:`Variant` as a packet. If ``full_objects`` (or :ref:`allow_object_decoding`) is ``true``, encoding objects is allowed (and can potentially include code). + +.. |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.)` diff --git a/classes/class_packetpeerdtls.rst b/classes/class_packetpeerdtls.rst new file mode 100644 index 0000000..6109e11 --- /dev/null +++ b/classes/class_packetpeerdtls.rst @@ -0,0 +1,98 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PacketPeerDTLS.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeerDTLS: + +PacketPeerDTLS +============== + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +DTLS packet peer. + +Description +----------- + +This class represents a DTLS peer connection. It can be used to connect to a DTLS server, and is returned by :ref:`DTLSServer.take_connection`. + +**Warning:** SSL/TLS certificate revocation and certificate pinning are currently not supported. Revoked certificates are accepted as long as they are otherwise valid. If this is a concern, you may want to use automatically managed certificates with a short validity period. + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_peer` **(** :ref:`PacketPeerUDP` packet_peer, :ref:`bool` validate_certs=true, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_from_peer` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_status` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PacketPeerDTLS_Status: + +.. _class_PacketPeerDTLS_constant_STATUS_DISCONNECTED: + +.. _class_PacketPeerDTLS_constant_STATUS_HANDSHAKING: + +.. _class_PacketPeerDTLS_constant_STATUS_CONNECTED: + +.. _class_PacketPeerDTLS_constant_STATUS_ERROR: + +.. _class_PacketPeerDTLS_constant_STATUS_ERROR_HOSTNAME_MISMATCH: + +enum **Status**: + +- **STATUS_DISCONNECTED** = **0** --- A status representing a ``PacketPeerDTLS`` that is disconnected. + +- **STATUS_HANDSHAKING** = **1** --- A status representing a ``PacketPeerDTLS`` that is currently performing the handshake with a remote peer. + +- **STATUS_CONNECTED** = **2** --- A status representing a ``PacketPeerDTLS`` that is connected to a remote peer. + +- **STATUS_ERROR** = **3** --- A status representing a ``PacketPeerDTLS`` in a generic error state. + +- **STATUS_ERROR_HOSTNAME_MISMATCH** = **4** --- An error status that shows a mismatch in the DTLS certificate domain presented by the host and the domain requested for validation. + +Method Descriptions +------------------- + +.. _class_PacketPeerDTLS_method_connect_to_peer: + +- :ref:`Error` **connect_to_peer** **(** :ref:`PacketPeerUDP` packet_peer, :ref:`bool` validate_certs=true, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** + +Connects a ``peer`` beginning the DTLS handshake using the underlying :ref:`PacketPeerUDP` which must be connected (see :ref:`PacketPeerUDP.connect_to_host`). If ``validate_certs`` is ``true``, ``PacketPeerDTLS`` will validate that the certificate presented by the remote peer and match it with the ``for_hostname`` argument. You can specify a custom :ref:`X509Certificate` to use for validation via the ``valid_certificate`` argument. + +---- + +.. _class_PacketPeerDTLS_method_disconnect_from_peer: + +- void **disconnect_from_peer** **(** **)** + +Disconnects this peer, terminating the DTLS session. + +---- + +.. _class_PacketPeerDTLS_method_get_status: + +- :ref:`Status` **get_status** **(** **)** |const| + +Returns the status of the connection. See :ref:`Status` for values. + +---- + +.. _class_PacketPeerDTLS_method_poll: + +- void **poll** **(** **)** + +Poll the connection to check for incoming packets. Call this frequently to update the status and keep the connection working. + +.. |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.)` diff --git a/classes/class_packetpeergdnative.rst b/classes/class_packetpeergdnative.rst new file mode 100644 index 0000000..404a998 --- /dev/null +++ b/classes/class_packetpeergdnative.rst @@ -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 PacketPeerGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeerGDNative: + +PacketPeerGDNative +================== + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_packetpeerstream.rst b/classes/class_packetpeerstream.rst new file mode 100644 index 0000000..28fe2bd --- /dev/null +++ b/classes/class_packetpeerstream.rst @@ -0,0 +1,77 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PacketPeerStream.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeerStream: + +PacketPeerStream +================ + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +Wrapper to use a PacketPeer over a StreamPeer. + +Description +----------- + +PacketStreamPeer provides a wrapper for working using packets over a stream. This allows for using packet based code with StreamPeers. PacketPeerStream implements a custom protocol over the StreamPeer, so the user should not read or write to the wrapped StreamPeer directly. + +Properties +---------- + ++-------------------------------------+---------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`input_buffer_max_size` | ``65532`` | ++-------------------------------------+---------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`output_buffer_max_size` | ``65532`` | ++-------------------------------------+---------------------------------------------------------------------------------------+-----------+ +| :ref:`StreamPeer` | :ref:`stream_peer` | | ++-------------------------------------+---------------------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_PacketPeerStream_property_input_buffer_max_size: + +- :ref:`int` **input_buffer_max_size** + ++-----------+----------------------------------+ +| *Default* | ``65532`` | ++-----------+----------------------------------+ +| *Setter* | set_input_buffer_max_size(value) | ++-----------+----------------------------------+ +| *Getter* | get_input_buffer_max_size() | ++-----------+----------------------------------+ + +---- + +.. _class_PacketPeerStream_property_output_buffer_max_size: + +- :ref:`int` **output_buffer_max_size** + ++-----------+-----------------------------------+ +| *Default* | ``65532`` | ++-----------+-----------------------------------+ +| *Setter* | set_output_buffer_max_size(value) | ++-----------+-----------------------------------+ +| *Getter* | get_output_buffer_max_size() | ++-----------+-----------------------------------+ + +---- + +.. _class_PacketPeerStream_property_stream_peer: + +- :ref:`StreamPeer` **stream_peer** + ++----------+------------------------+ +| *Setter* | set_stream_peer(value) | ++----------+------------------------+ +| *Getter* | get_stream_peer() | ++----------+------------------------+ + +The wrapped :ref:`StreamPeer` 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.)` diff --git a/classes/class_packetpeerudp.rst b/classes/class_packetpeerudp.rst new file mode 100644 index 0000000..3567720 --- /dev/null +++ b/classes/class_packetpeerudp.rst @@ -0,0 +1,179 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PacketPeerUDP.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PacketPeerUDP: + +PacketPeerUDP +============= + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +UDP packet peer. + +Description +----------- + +UDP packet peer. Can be used to send raw UDP packets as well as :ref:`Variant`\ s. + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_host` **(** :ref:`String` host, :ref:`int` port **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_packet_ip` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_packet_port` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connected_to_host` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_listening` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`join_multicast_group` **(** :ref:`String` multicast_address, :ref:`String` interface_name **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`leave_multicast_group` **(** :ref:`String` multicast_address, :ref:`String` interface_name **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`int` recv_buf_size=65536 **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_broadcast_enabled` **(** :ref:`bool` enabled **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`set_dest_address` **(** :ref:`String` host, :ref:`int` port **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`wait` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PacketPeerUDP_method_close: + +- void **close** **(** **)** + +Closes the UDP socket the ``PacketPeerUDP`` is currently listening on. + +---- + +.. _class_PacketPeerUDP_method_connect_to_host: + +- :ref:`Error` **connect_to_host** **(** :ref:`String` host, :ref:`int` port **)** + +Calling this method connects this UDP peer to the given ``host``/``port`` pair. UDP is in reality connectionless, so this option only means that incoming packets from different addresses are automatically discarded, and that outgoing packets are always sent to the connected address (future calls to :ref:`set_dest_address` are not allowed). This method does not send any data to the remote peer, to do that, use :ref:`PacketPeer.put_var` or :ref:`PacketPeer.put_packet` as usual. See also :ref:`UDPServer`. + +**Note:** Connecting to the remote peer does not help to protect from malicious attacks like IP spoofing, etc. Think about using an encryption technique like SSL or DTLS if you feel like your application is transferring sensitive information. + +---- + +.. _class_PacketPeerUDP_method_get_packet_ip: + +- :ref:`String` **get_packet_ip** **(** **)** |const| + +Returns the IP of the remote peer that sent the last packet(that was received with :ref:`PacketPeer.get_packet` or :ref:`PacketPeer.get_var`). + +---- + +.. _class_PacketPeerUDP_method_get_packet_port: + +- :ref:`int` **get_packet_port** **(** **)** |const| + +Returns the port of the remote peer that sent the last packet(that was received with :ref:`PacketPeer.get_packet` or :ref:`PacketPeer.get_var`). + +---- + +.. _class_PacketPeerUDP_method_is_connected_to_host: + +- :ref:`bool` **is_connected_to_host** **(** **)** |const| + +Returns ``true`` if the UDP socket is open and has been connected to a remote address. See :ref:`connect_to_host`. + +---- + +.. _class_PacketPeerUDP_method_is_listening: + +- :ref:`bool` **is_listening** **(** **)** |const| + +Returns whether this ``PacketPeerUDP`` is listening. + +---- + +.. _class_PacketPeerUDP_method_join_multicast_group: + +- :ref:`Error` **join_multicast_group** **(** :ref:`String` multicast_address, :ref:`String` interface_name **)** + +Joins the multicast group specified by ``multicast_address`` using the interface identified by ``interface_name``. + +You can join the same multicast group with multiple interfaces. Use :ref:`IP.get_local_interfaces` to know which are available. + +**Note:** Some Android devices might require the ``CHANGE_WIFI_MULTICAST_STATE`` permission for multicast to work. + +---- + +.. _class_PacketPeerUDP_method_leave_multicast_group: + +- :ref:`Error` **leave_multicast_group** **(** :ref:`String` multicast_address, :ref:`String` interface_name **)** + +Removes the interface identified by ``interface_name`` from the multicast group specified by ``multicast_address``. + +---- + +.. _class_PacketPeerUDP_method_listen: + +- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`String` bind_address="*", :ref:`int` recv_buf_size=65536 **)** + +Makes this ``PacketPeerUDP`` listen on the ``port`` binding to ``bind_address`` with a buffer size ``recv_buf_size``. + +If ``bind_address`` is set to ``"*"`` (default), the peer will listen on all available addresses (both IPv4 and IPv6). + +If ``bind_address`` is set to ``"0.0.0.0"`` (for IPv4) or ``"::"`` (for IPv6), the peer will listen on all available addresses matching that IP type. + +If ``bind_address`` is set to any valid address (e.g. ``"192.168.1.101"``, ``"::1"``, etc), the peer will only listen on the interface with that addresses (or fail if no interface with the given address exists). + +---- + +.. _class_PacketPeerUDP_method_set_broadcast_enabled: + +- void **set_broadcast_enabled** **(** :ref:`bool` enabled **)** + +Enable or disable sending of broadcast packets (e.g. ``set_dest_address("255.255.255.255", 4343)``. This option is disabled by default. + +**Note:** Some Android devices might require the ``CHANGE_WIFI_MULTICAST_STATE`` permission and this option to be enabled to receive broadcast packets too. + +---- + +.. _class_PacketPeerUDP_method_set_dest_address: + +- :ref:`Error` **set_dest_address** **(** :ref:`String` host, :ref:`int` port **)** + +Sets the destination address and port for sending packets and variables. A hostname will be resolved using DNS if needed. + +**Note:** :ref:`set_broadcast_enabled` must be enabled before sending packets to a broadcast address (e.g. ``255.255.255.255``). + +---- + +.. _class_PacketPeerUDP_method_wait: + +- :ref:`Error` **wait** **(** **)** + +Waits for a packet to arrive on the listening port. See :ref:`listen`. + +**Note:** :ref:`wait` can't be interrupted once it has been called. This can be worked around by allowing the other party to send a specific "death pill" packet like this: + +:: + + # Server + socket.set_dest_address("127.0.0.1", 789) + socket.put_packet("Time to stop".to_ascii()) + + # Client + while socket.wait() == OK: + var data = socket.get_packet().get_string_from_ascii() + if data == "Time to stop": + return + +.. |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.)` diff --git a/classes/class_panel.rst b/classes/class_panel.rst new file mode 100644 index 0000000..6f0ce87 --- /dev/null +++ b/classes/class_panel.rst @@ -0,0 +1,48 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Panel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Panel: + +Panel +===== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Provides an opaque background for :ref:`Control` children. + +Description +----------- + +Panel is a :ref:`Control` that displays an opaque background. It's commonly used as a parent and container for other types of :ref:`Control` nodes. + +Tutorials +--------- + +- `2D Role Playing Game Demo `__ + +- `2D Finite State Machine Demo `__ + +- `3D Inverse Kinematics Demo `__ + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | ++---------------------------------+---------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_Panel_theme_style_panel: + +- :ref:`StyleBox` **panel** + +The style of this ``Panel``. + +.. |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.)` diff --git a/classes/class_panelcontainer.rst b/classes/class_panelcontainer.rst new file mode 100644 index 0000000..c871f48 --- /dev/null +++ b/classes/class_panelcontainer.rst @@ -0,0 +1,46 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PanelContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PanelContainer: + +PanelContainer +============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ScriptEditor` + +Panel container type. + +Description +----------- + +Panel container type. This container fits controls inside of the delimited area of a stylebox. It's useful for giving controls an outline. + +Tutorials +--------- + +- `2D Role Playing Game Demo `__ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | ++---------------------------------+------------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_PanelContainer_theme_style_panel: + +- :ref:`StyleBox` **panel** + +The style of ``PanelContainer``'s background. + +.. |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.)` diff --git a/classes/class_panoramasky.rst b/classes/class_panoramasky.rst new file mode 100644 index 0000000..b85ca17 --- /dev/null +++ b/classes/class_panoramasky.rst @@ -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 PanoramaSky.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PanoramaSky: + +PanoramaSky +=========== + +**Inherits:** :ref:`Sky` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A type of :ref:`Sky` used to draw a background texture. + +Description +----------- + +A resource referenced in an :ref:`Environment` that is used to draw a background. The Panorama sky functions similar to skyboxes in other engines, except it uses an equirectangular sky map instead of a cube map. + +Using an HDR panorama is strongly recommended for accurate, high-quality reflections. Godot supports the Radiance HDR (``.hdr``) and OpenEXR (``.exr``) image formats for this purpose. + +You can use `this tool `__ to convert a cube map to an equirectangular sky map. + +Properties +---------- + ++-------------------------------+------------------------------------------------------+ +| :ref:`Texture` | :ref:`panorama` | ++-------------------------------+------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PanoramaSky_property_panorama: + +- :ref:`Texture` **panorama** + ++----------+---------------------+ +| *Setter* | set_panorama(value) | ++----------+---------------------+ +| *Getter* | get_panorama() | ++----------+---------------------+ + +:ref:`Texture` to be applied to the PanoramaSky. + +.. |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.)` diff --git a/classes/class_parallaxbackground.rst b/classes/class_parallaxbackground.rst new file mode 100644 index 0000000..7e62183 --- /dev/null +++ b/classes/class_parallaxbackground.rst @@ -0,0 +1,139 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ParallaxBackground.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ParallaxBackground: + +ParallaxBackground +================== + +**Inherits:** :ref:`CanvasLayer` **<** :ref:`Node` **<** :ref:`Object` + +A node used to create a parallax scrolling background. + +Description +----------- + +A ParallaxBackground uses one or more :ref:`ParallaxLayer` child nodes to create a parallax effect. Each :ref:`ParallaxLayer` can move at a different speed using :ref:`ParallaxLayer.motion_offset`. This creates an illusion of depth in a 2D game. If not used with a :ref:`Camera2D`, you must manually calculate the :ref:`scroll_offset`. + +Properties +---------- + ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | layer | ``-100`` *(parent override)* | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_base_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_base_scale` | ``Vector2( 1, 1 )`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`scroll_ignore_camera_zoom` | ``false`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_limit_begin` | ``Vector2( 0, 0 )`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_limit_end` | ``Vector2( 0, 0 )`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Vector2` | :ref:`scroll_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+-----------------------------------------------------------------------------------------------+------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ParallaxBackground_property_scroll_base_offset: + +- :ref:`Vector2` **scroll_base_offset** + ++-----------+-------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------------+ +| *Setter* | set_scroll_base_offset(value) | ++-----------+-------------------------------+ +| *Getter* | get_scroll_base_offset() | ++-----------+-------------------------------+ + +The base position offset for all :ref:`ParallaxLayer` children. + +---- + +.. _class_ParallaxBackground_property_scroll_base_scale: + +- :ref:`Vector2` **scroll_base_scale** + ++-----------+------------------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+------------------------------+ +| *Setter* | set_scroll_base_scale(value) | ++-----------+------------------------------+ +| *Getter* | get_scroll_base_scale() | ++-----------+------------------------------+ + +The base motion scale for all :ref:`ParallaxLayer` children. + +---- + +.. _class_ParallaxBackground_property_scroll_ignore_camera_zoom: + +- :ref:`bool` **scroll_ignore_camera_zoom** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_ignore_camera_zoom(value) | ++-----------+-------------------------------+ +| *Getter* | is_ignore_camera_zoom() | ++-----------+-------------------------------+ + +If ``true``, elements in :ref:`ParallaxLayer` child aren't affected by the zoom level of the camera. + +---- + +.. _class_ParallaxBackground_property_scroll_limit_begin: + +- :ref:`Vector2` **scroll_limit_begin** + ++-----------+------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_limit_begin(value) | ++-----------+------------------------+ +| *Getter* | get_limit_begin() | ++-----------+------------------------+ + +Top-left limits for scrolling to begin. If the camera is outside of this limit, the background will stop scrolling. Must be lower than :ref:`scroll_limit_end` to work. + +---- + +.. _class_ParallaxBackground_property_scroll_limit_end: + +- :ref:`Vector2` **scroll_limit_end** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------+ +| *Setter* | set_limit_end(value) | ++-----------+----------------------+ +| *Getter* | get_limit_end() | ++-----------+----------------------+ + +Bottom-right limits for scrolling to end. If the camera is outside of this limit, the background will stop scrolling. Must be higher than :ref:`scroll_limit_begin` to work. + +---- + +.. _class_ParallaxBackground_property_scroll_offset: + +- :ref:`Vector2` **scroll_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_scroll_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_scroll_offset() | ++-----------+--------------------------+ + +The ParallaxBackground's scroll value. Calculated automatically when using a :ref:`Camera2D`, but can be used to manually manage scrolling when no camera is present. + +.. |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.)` diff --git a/classes/class_parallaxlayer.rst b/classes/class_parallaxlayer.rst new file mode 100644 index 0000000..2b5f4b1 --- /dev/null +++ b/classes/class_parallaxlayer.rst @@ -0,0 +1,87 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ParallaxLayer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ParallaxLayer: + +ParallaxLayer +============= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A parallax scrolling layer to be used with :ref:`ParallaxBackground`. + +Description +----------- + +A ParallaxLayer must be the child of a :ref:`ParallaxBackground` node. Each ParallaxLayer can be set to move at different speeds relative to the camera movement or the :ref:`ParallaxBackground.scroll_offset` value. + +This node's children will be affected by its scroll offset. + +**Note:** Any changes to this node's position and scale made after it enters the scene will be ignored. + +Properties +---------- + ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`motion_mirroring` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`motion_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`motion_scale` | ``Vector2( 1, 1 )`` | ++-------------------------------+------------------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_ParallaxLayer_property_motion_mirroring: + +- :ref:`Vector2` **motion_mirroring** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------+ +| *Setter* | set_mirroring(value) | ++-----------+----------------------+ +| *Getter* | get_mirroring() | ++-----------+----------------------+ + +The ParallaxLayer's :ref:`Texture` mirroring. Useful for creating an infinite scrolling background. If an axis is set to ``0``, the :ref:`Texture` will not be mirrored. + +---- + +.. _class_ParallaxLayer_property_motion_offset: + +- :ref:`Vector2` **motion_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_motion_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_motion_offset() | ++-----------+--------------------------+ + +The ParallaxLayer's offset relative to the parent ParallaxBackground's :ref:`ParallaxBackground.scroll_offset`. + +---- + +.. _class_ParallaxLayer_property_motion_scale: + +- :ref:`Vector2` **motion_scale** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_motion_scale(value) | ++-----------+-------------------------+ +| *Getter* | get_motion_scale() | ++-----------+-------------------------+ + +Multiplies the ParallaxLayer's motion. If an axis is set to ``0``, it will not scroll. + +.. |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.)` diff --git a/classes/class_particles.rst b/classes/class_particles.rst new file mode 100644 index 0000000..d789238 --- /dev/null +++ b/classes/class_particles.rst @@ -0,0 +1,454 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Particles.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Particles: + +Particles +========= + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +GPU-based 3D particle emitter. + +Description +----------- + +3D particle node used to create a variety of particle systems and effects. ``Particles`` features an emitter that generates some number of particles at a given rate. + +Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. + +**Note:** ``Particles`` only work when using the GLES3 renderer. If using the GLES2 renderer, use :ref:`CPUParticles` instead. You can convert ``Particles`` to :ref:`CPUParticles` by selecting the node, clicking the **Particles** menu at the top of the 3D editor viewport then choosing **Convert to CPUParticles**. + +**Note:** On macOS, ``Particles`` rendering is much slower than :ref:`CPUParticles` due to transform feedback being implemented on the CPU instead of the GPU. Consider using :ref:`CPUParticles` instead when targeting macOS. + +**Note:** After working on a Particles node, remember to update its :ref:`visibility_aabb` by selecting it, clicking the **Particles** menu at the top of the 3D editor viewport then choose **Generate Visibility AABB**. Otherwise, particles may suddenly disappear depending on the camera position and angle. + +Tutorials +--------- + +- :doc:`../tutorials/performance/vertex_animation/controlling_thousands_of_fish` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`amount` | ``8`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`Mesh` | :ref:`draw_pass_1` | | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`Mesh` | :ref:`draw_pass_2` | | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`Mesh` | :ref:`draw_pass_3` | | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`Mesh` | :ref:`draw_pass_4` | | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`draw_passes` | ``1`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`bool` | :ref:`emitting` | ``true`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`float` | :ref:`explosiveness` | ``0.0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`int` | :ref:`fixed_fps` | ``0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`bool` | :ref:`fract_delta` | ``true`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`float` | :ref:`lifetime` | ``1.0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`bool` | :ref:`local_coords` | ``true`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`bool` | :ref:`one_shot` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`float` | :ref:`preprocess` | ``0.0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`Material` | :ref:`process_material` | | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`float` | :ref:`randomness` | ``0.0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ +| :ref:`AABB` | :ref:`visibility_aabb` | ``AABB( -4, -4, -4, 8, 8, 8 )`` | ++--------------------------------------------+--------------------------------------------------------------------+---------------------------------+ + +Methods +------- + ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`capture_aabb` **(** **)** |const| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mesh` | :ref:`get_draw_pass_mesh` **(** :ref:`int` pass **)** |const| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`restart` **(** **)** | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_draw_pass_mesh` **(** :ref:`int` pass, :ref:`Mesh` mesh **)** | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Particles_DrawOrder: + +.. _class_Particles_constant_DRAW_ORDER_INDEX: + +.. _class_Particles_constant_DRAW_ORDER_LIFETIME: + +.. _class_Particles_constant_DRAW_ORDER_VIEW_DEPTH: + +enum **DrawOrder**: + +- **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted. + +- **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. + +- **DRAW_ORDER_VIEW_DEPTH** = **2** --- Particles are drawn in order of depth. + +Constants +--------- + +.. _class_Particles_constant_MAX_DRAW_PASSES: + +- **MAX_DRAW_PASSES** = **4** --- Maximum number of draw passes supported. + +Property Descriptions +--------------------- + +.. _class_Particles_property_amount: + +- :ref:`int` **amount** + ++-----------+-------------------+ +| *Default* | ``8`` | ++-----------+-------------------+ +| *Setter* | set_amount(value) | ++-----------+-------------------+ +| *Getter* | get_amount() | ++-----------+-------------------+ + +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. + +---- + +.. _class_Particles_property_draw_order: + +- :ref:`DrawOrder` **draw_order** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_draw_order(value) | ++-----------+-----------------------+ +| *Getter* | get_draw_order() | ++-----------+-----------------------+ + +Particle draw order. Uses :ref:`DrawOrder` values. + +---- + +.. _class_Particles_property_draw_pass_1: + +- :ref:`Mesh` **draw_pass_1** + ++----------+---------------------------+ +| *Setter* | set_draw_pass_mesh(value) | ++----------+---------------------------+ +| *Getter* | get_draw_pass_mesh() | ++----------+---------------------------+ + +:ref:`Mesh` that is drawn for the first draw pass. + +---- + +.. _class_Particles_property_draw_pass_2: + +- :ref:`Mesh` **draw_pass_2** + ++----------+---------------------------+ +| *Setter* | set_draw_pass_mesh(value) | ++----------+---------------------------+ +| *Getter* | get_draw_pass_mesh() | ++----------+---------------------------+ + +:ref:`Mesh` that is drawn for the second draw pass. + +---- + +.. _class_Particles_property_draw_pass_3: + +- :ref:`Mesh` **draw_pass_3** + ++----------+---------------------------+ +| *Setter* | set_draw_pass_mesh(value) | ++----------+---------------------------+ +| *Getter* | get_draw_pass_mesh() | ++----------+---------------------------+ + +:ref:`Mesh` that is drawn for the third draw pass. + +---- + +.. _class_Particles_property_draw_pass_4: + +- :ref:`Mesh` **draw_pass_4** + ++----------+---------------------------+ +| *Setter* | set_draw_pass_mesh(value) | ++----------+---------------------------+ +| *Getter* | get_draw_pass_mesh() | ++----------+---------------------------+ + +:ref:`Mesh` that is drawn for the fourth draw pass. + +---- + +.. _class_Particles_property_draw_passes: + +- :ref:`int` **draw_passes** + ++-----------+------------------------+ +| *Default* | ``1`` | ++-----------+------------------------+ +| *Setter* | set_draw_passes(value) | ++-----------+------------------------+ +| *Getter* | get_draw_passes() | ++-----------+------------------------+ + +The number of draw passes when rendering particles. + +---- + +.. _class_Particles_property_emitting: + +- :ref:`bool` **emitting** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_emitting(value) | ++-----------+---------------------+ +| *Getter* | is_emitting() | ++-----------+---------------------+ + +If ``true``, particles are being emitted. + +---- + +.. _class_Particles_property_explosiveness: + +- :ref:`float` **explosiveness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_explosiveness_ratio(value) | ++-----------+--------------------------------+ +| *Getter* | get_explosiveness_ratio() | ++-----------+--------------------------------+ + +Time ratio between each emission. If ``0``, particles are emitted continuously. If ``1``, all particles are emitted simultaneously. + +---- + +.. _class_Particles_property_fixed_fps: + +- :ref:`int` **fixed_fps** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_fixed_fps(value) | ++-----------+----------------------+ +| *Getter* | get_fixed_fps() | ++-----------+----------------------+ + +The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + +---- + +.. _class_Particles_property_fract_delta: + +- :ref:`bool` **fract_delta** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_fractional_delta(value) | ++-----------+-----------------------------+ +| *Getter* | get_fractional_delta() | ++-----------+-----------------------------+ + +If ``true``, results in fractional delta calculation which has a smoother particles display effect. + +---- + +.. _class_Particles_property_lifetime: + +- :ref:`float` **lifetime** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_lifetime(value) | ++-----------+---------------------+ +| *Getter* | get_lifetime() | ++-----------+---------------------+ + +The amount of time each particle will exist (in seconds). + +---- + +.. _class_Particles_property_local_coords: + +- :ref:`bool` **local_coords** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_use_local_coordinates(value) | ++-----------+----------------------------------+ +| *Getter* | get_use_local_coordinates() | ++-----------+----------------------------------+ + +If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. + +---- + +.. _class_Particles_property_one_shot: + +- :ref:`bool` **one_shot** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_one_shot(value) | ++-----------+---------------------+ +| *Getter* | get_one_shot() | ++-----------+---------------------+ + +If ``true``, only ``amount`` particles will be emitted. + +---- + +.. _class_Particles_property_preprocess: + +- :ref:`float` **preprocess** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_pre_process_time(value) | ++-----------+-----------------------------+ +| *Getter* | get_pre_process_time() | ++-----------+-----------------------------+ + +Amount of time to preprocess the particles before animation starts. Lets you start the animation some time after particles have started emitting. + +---- + +.. _class_Particles_property_process_material: + +- :ref:`Material` **process_material** + ++----------+-----------------------------+ +| *Setter* | set_process_material(value) | ++----------+-----------------------------+ +| *Getter* | get_process_material() | ++----------+-----------------------------+ + +:ref:`Material` for processing particles. Can be a :ref:`ParticlesMaterial` or a :ref:`ShaderMaterial`. + +---- + +.. _class_Particles_property_randomness: + +- :ref:`float` **randomness** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_randomness_ratio(value) | ++-----------+-----------------------------+ +| *Getter* | get_randomness_ratio() | ++-----------+-----------------------------+ + +Emission randomness ratio. + +---- + +.. _class_Particles_property_speed_scale: + +- :ref:`float` **speed_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_speed_scale(value) | ++-----------+------------------------+ +| *Getter* | get_speed_scale() | ++-----------+------------------------+ + +Speed scaling ratio. A value of ``0`` can be used to pause the particles. + +---- + +.. _class_Particles_property_visibility_aabb: + +- :ref:`AABB` **visibility_aabb** + ++-----------+---------------------------------+ +| *Default* | ``AABB( -4, -4, -4, 8, 8, 8 )`` | ++-----------+---------------------------------+ +| *Setter* | set_visibility_aabb(value) | ++-----------+---------------------------------+ +| *Getter* | get_visibility_aabb() | ++-----------+---------------------------------+ + +The :ref:`AABB` that determines the node's region which needs to be visible on screen for the particle system to be active. + +Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The :ref:`AABB` can be grown via code or with the **Particles → Generate AABB** editor tool. + +**Note:** If the :ref:`ParticlesMaterial` in use is configured to cast shadows, you may want to enlarge this AABB to ensure the shadow is updated when particles are off-screen. + +Method Descriptions +------------------- + +.. _class_Particles_method_capture_aabb: + +- :ref:`AABB` **capture_aabb** **(** **)** |const| + +Returns the axis-aligned bounding box that contains all the particles that are active in the current frame. + +---- + +.. _class_Particles_method_get_draw_pass_mesh: + +- :ref:`Mesh` **get_draw_pass_mesh** **(** :ref:`int` pass **)** |const| + +Returns the :ref:`Mesh` that is drawn at index ``pass``. + +---- + +.. _class_Particles_method_restart: + +- void **restart** **(** **)** + +Restarts the particle emission, clearing existing particles. + +---- + +.. _class_Particles_method_set_draw_pass_mesh: + +- void **set_draw_pass_mesh** **(** :ref:`int` pass, :ref:`Mesh` mesh **)** + +Sets the :ref:`Mesh` that is drawn at index ``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.)` diff --git a/classes/class_particles2d.rst b/classes/class_particles2d.rst new file mode 100644 index 0000000..564ae45 --- /dev/null +++ b/classes/class_particles2d.rst @@ -0,0 +1,375 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Particles2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Particles2D: + +Particles2D +=========== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +GPU-based 2D particle emitter. + +Description +----------- + +2D particle node used to create a variety of particle systems and effects. ``Particles2D`` features an emitter that generates some number of particles at a given rate. + +Use the ``process_material`` property to add a :ref:`ParticlesMaterial` to configure particle appearance and behavior. Alternatively, you can add a :ref:`ShaderMaterial` which will be applied to all particles. + +**Note:** ``Particles2D`` only work when using the GLES3 renderer. If using the GLES2 renderer, use :ref:`CPUParticles2D` instead. You can convert ``Particles2D`` to :ref:`CPUParticles2D` by selecting the node, clicking the **Particles** menu at the top of the 2D editor viewport then choosing **Convert to CPUParticles2D**. + +**Note:** On macOS, ``Particles2D`` rendering is much slower than :ref:`CPUParticles2D` due to transform feedback being implemented on the CPU instead of the GPU. Consider using :ref:`CPUParticles2D` instead when targeting macOS. + +**Note:** After working on a Particles node, remember to update its :ref:`visibility_rect` by selecting it, clicking the **Particles** menu at the top of the 2D editor viewport then choose **Generate Visibility Rect**. Otherwise, particles may suddenly disappear depending on the camera position and angle. + +**Note:** Unlike :ref:`CPUParticles2D`, ``Particles2D`` currently ignore the texture region defined in :ref:`AtlasTexture`\ s. + +Tutorials +--------- + +- :doc:`../tutorials/2d/particle_systems_2d` + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`int` | :ref:`amount` | ``8`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`DrawOrder` | :ref:`draw_order` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`bool` | :ref:`emitting` | ``true`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`explosiveness` | ``0.0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`int` | :ref:`fixed_fps` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`bool` | :ref:`fract_delta` | ``true`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`lifetime` | ``1.0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`bool` | :ref:`local_coords` | ``true`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`Texture` | :ref:`normal_map` | | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`bool` | :ref:`one_shot` | ``false`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`preprocess` | ``0.0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`Material` | :ref:`process_material` | | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`randomness` | ``0.0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`float` | :ref:`speed_scale` | ``1.0`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ +| :ref:`Rect2` | :ref:`visibility_rect` | ``Rect2( -100, -100, 200, 200 )`` | ++----------------------------------------------+----------------------------------------------------------------------+-----------------------------------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`capture_rect` **(** **)** |const| | ++---------------------------+--------------------------------------------------------------------------------+ +| void | :ref:`restart` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Particles2D_DrawOrder: + +.. _class_Particles2D_constant_DRAW_ORDER_INDEX: + +.. _class_Particles2D_constant_DRAW_ORDER_LIFETIME: + +enum **DrawOrder**: + +- **DRAW_ORDER_INDEX** = **0** --- Particles are drawn in the order emitted. + +- **DRAW_ORDER_LIFETIME** = **1** --- Particles are drawn in order of remaining lifetime. + +Property Descriptions +--------------------- + +.. _class_Particles2D_property_amount: + +- :ref:`int` **amount** + ++-----------+-------------------+ +| *Default* | ``8`` | ++-----------+-------------------+ +| *Setter* | set_amount(value) | ++-----------+-------------------+ +| *Getter* | get_amount() | ++-----------+-------------------+ + +The number of particles emitted in one emission cycle (corresponding to the :ref:`lifetime`). + +**Note:** Changing :ref:`amount` will reset the particle emission, therefore removing all particles that were already emitted before changing :ref:`amount`. + +---- + +.. _class_Particles2D_property_draw_order: + +- :ref:`DrawOrder` **draw_order** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_draw_order(value) | ++-----------+-----------------------+ +| *Getter* | get_draw_order() | ++-----------+-----------------------+ + +Particle draw order. Uses :ref:`DrawOrder` values. + +---- + +.. _class_Particles2D_property_emitting: + +- :ref:`bool` **emitting** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_emitting(value) | ++-----------+---------------------+ +| *Getter* | is_emitting() | ++-----------+---------------------+ + +If ``true``, particles are being emitted. + +---- + +.. _class_Particles2D_property_explosiveness: + +- :ref:`float` **explosiveness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_explosiveness_ratio(value) | ++-----------+--------------------------------+ +| *Getter* | get_explosiveness_ratio() | ++-----------+--------------------------------+ + +How rapidly particles in an emission cycle are emitted. If greater than ``0``, there will be a gap in emissions before the next cycle begins. + +---- + +.. _class_Particles2D_property_fixed_fps: + +- :ref:`int` **fixed_fps** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_fixed_fps(value) | ++-----------+----------------------+ +| *Getter* | get_fixed_fps() | ++-----------+----------------------+ + +The particle system's frame rate is fixed to a value. For instance, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the simulation of the particle system itself. + +---- + +.. _class_Particles2D_property_fract_delta: + +- :ref:`bool` **fract_delta** + ++-----------+-----------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------+ +| *Setter* | set_fractional_delta(value) | ++-----------+-----------------------------+ +| *Getter* | get_fractional_delta() | ++-----------+-----------------------------+ + +If ``true``, results in fractional delta calculation which has a smoother particles display effect. + +---- + +.. _class_Particles2D_property_lifetime: + +- :ref:`float` **lifetime** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_lifetime(value) | ++-----------+---------------------+ +| *Getter* | get_lifetime() | ++-----------+---------------------+ + +The amount of time each particle will exist (in seconds). + +---- + +.. _class_Particles2D_property_local_coords: + +- :ref:`bool` **local_coords** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_use_local_coordinates(value) | ++-----------+----------------------------------+ +| *Getter* | get_use_local_coordinates() | ++-----------+----------------------------------+ + +If ``true``, particles use the parent node's coordinate space. If ``false``, they use global coordinates. + +---- + +.. _class_Particles2D_property_normal_map: + +- :ref:`Texture` **normal_map** + ++----------+-----------------------+ +| *Setter* | set_normal_map(value) | ++----------+-----------------------+ +| *Getter* | get_normal_map() | ++----------+-----------------------+ + +Normal map to be used for the :ref:`texture` property. + +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_Particles2D_property_one_shot: + +- :ref:`bool` **one_shot** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_one_shot(value) | ++-----------+---------------------+ +| *Getter* | get_one_shot() | ++-----------+---------------------+ + +If ``true``, only one emission cycle occurs. If set ``true`` during a cycle, emission will stop at the cycle's end. + +---- + +.. _class_Particles2D_property_preprocess: + +- :ref:`float` **preprocess** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_pre_process_time(value) | ++-----------+-----------------------------+ +| *Getter* | get_pre_process_time() | ++-----------+-----------------------------+ + +Particle system starts as if it had already run for this many seconds. + +---- + +.. _class_Particles2D_property_process_material: + +- :ref:`Material` **process_material** + ++----------+-----------------------------+ +| *Setter* | set_process_material(value) | ++----------+-----------------------------+ +| *Getter* | get_process_material() | ++----------+-----------------------------+ + +:ref:`Material` for processing particles. Can be a :ref:`ParticlesMaterial` or a :ref:`ShaderMaterial`. + +---- + +.. _class_Particles2D_property_randomness: + +- :ref:`float` **randomness** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_randomness_ratio(value) | ++-----------+-----------------------------+ +| *Getter* | get_randomness_ratio() | ++-----------+-----------------------------+ + +Emission lifetime randomness ratio. + +---- + +.. _class_Particles2D_property_speed_scale: + +- :ref:`float` **speed_scale** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_speed_scale(value) | ++-----------+------------------------+ +| *Getter* | get_speed_scale() | ++-----------+------------------------+ + +Particle system's running speed scaling ratio. A value of ``0`` can be used to pause the particles. + +---- + +.. _class_Particles2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Particle texture. If ``null``, particles will be squares. + +---- + +.. _class_Particles2D_property_visibility_rect: + +- :ref:`Rect2` **visibility_rect** + ++-----------+-----------------------------------+ +| *Default* | ``Rect2( -100, -100, 200, 200 )`` | ++-----------+-----------------------------------+ +| *Setter* | set_visibility_rect(value) | ++-----------+-----------------------------------+ +| *Getter* | get_visibility_rect() | ++-----------+-----------------------------------+ + +The :ref:`Rect2` that determines the node's region which needs to be visible on screen for the particle system to be active. + +Grow the rect if particles suddenly appear/disappear when the node enters/exits the screen. The :ref:`Rect2` can be grown via code or with the **Particles → Generate Visibility Rect** editor tool. + +Method Descriptions +------------------- + +.. _class_Particles2D_method_capture_rect: + +- :ref:`Rect2` **capture_rect** **(** **)** |const| + +Returns a rectangle containing the positions of all existing particles. + +---- + +.. _class_Particles2D_method_restart: + +- void **restart** **(** **)** + +Restarts all the existing particles. + +.. |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.)` diff --git a/classes/class_particlesmaterial.rst b/classes/class_particlesmaterial.rst new file mode 100644 index 0000000..5aa598c --- /dev/null +++ b/classes/class_particlesmaterial.rst @@ -0,0 +1,1250 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ParticlesMaterial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ParticlesMaterial: + +ParticlesMaterial +================= + +**Inherits:** :ref:`Material` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Particle properties for :ref:`Particles` and :ref:`Particles2D` nodes. + +Description +----------- + +ParticlesMaterial defines particle properties and behavior. It is used in the ``process_material`` of :ref:`Particles` and :ref:`Particles2D` emitter nodes. + +Some of this material's properties are applied to each particle when emitted, while others can have a :ref:`CurveTexture` applied to vary values over the lifetime of the particle. + +When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between ``1.0`` and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of ``0.4`` would scale the original property between ``0.4-1.0`` of its original value. + +Properties +---------- + ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angle` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`angle_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angle_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angular_velocity` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`angular_velocity_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`angular_velocity_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_offset` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`anim_offset_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_offset_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_speed` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`anim_speed_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`anim_speed_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`color_ramp` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`damping` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`damping_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`damping_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`direction` | ``Vector3( 1, 0, 0 )`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`emission_box_extents` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`emission_color_texture` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`emission_normal_texture` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`emission_point_count` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`emission_point_texture` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`emission_ring_axis` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_height` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_inner_radius` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_ring_radius` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`EmissionShape` | :ref:`emission_shape` | ``0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`emission_sphere_radius` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_align_y` | ``false`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_disable_z` | ``false`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flag_rotate_y` | ``false`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`flatness` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector3` | :ref:`gravity` | ``Vector3( 0, -9.8, 0 )`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`hue_variation` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`hue_variation_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`hue_variation_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`initial_velocity` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`initial_velocity_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`lifetime_randomness` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`linear_accel` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`linear_accel_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`linear_accel_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`orbit_velocity` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`orbit_velocity_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`orbit_velocity_random` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_accel` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`radial_accel_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_accel_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`scale` | ``1.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`scale_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`scale_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`spread` | ``45.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`tangential_accel` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`tangential_accel_curve` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`tangential_accel_random` | ``0.0`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`GradientTexture` | :ref:`trail_color_modifier` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`trail_divisor` | ``1`` | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`CurveTexture` | :ref:`trail_size_modifier` | | ++------------------------------------------------------------+------------------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag` **(** :ref:`Flags` flag **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Parameter` param **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param_randomness` **(** :ref:`Parameter` param **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_param_texture` **(** :ref:`Parameter` param **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag` **(** :ref:`Flags` flag, :ref:`bool` enable **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Parameter` param, :ref:`float` value **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_randomness` **(** :ref:`Parameter` param, :ref:`float` randomness **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param_texture` **(** :ref:`Parameter` param, :ref:`Texture` texture **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ParticlesMaterial_Parameter: + +.. _class_ParticlesMaterial_constant_PARAM_INITIAL_LINEAR_VELOCITY: + +.. _class_ParticlesMaterial_constant_PARAM_ANGULAR_VELOCITY: + +.. _class_ParticlesMaterial_constant_PARAM_ORBIT_VELOCITY: + +.. _class_ParticlesMaterial_constant_PARAM_LINEAR_ACCEL: + +.. _class_ParticlesMaterial_constant_PARAM_RADIAL_ACCEL: + +.. _class_ParticlesMaterial_constant_PARAM_TANGENTIAL_ACCEL: + +.. _class_ParticlesMaterial_constant_PARAM_DAMPING: + +.. _class_ParticlesMaterial_constant_PARAM_ANGLE: + +.. _class_ParticlesMaterial_constant_PARAM_SCALE: + +.. _class_ParticlesMaterial_constant_PARAM_HUE_VARIATION: + +.. _class_ParticlesMaterial_constant_PARAM_ANIM_SPEED: + +.. _class_ParticlesMaterial_constant_PARAM_ANIM_OFFSET: + +.. _class_ParticlesMaterial_constant_PARAM_MAX: + +enum **Parameter**: + +- **PARAM_INITIAL_LINEAR_VELOCITY** = **0** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set initial velocity properties. + +- **PARAM_ANGULAR_VELOCITY** = **1** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set angular velocity properties. + +- **PARAM_ORBIT_VELOCITY** = **2** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set orbital velocity properties. + +- **PARAM_LINEAR_ACCEL** = **3** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set linear acceleration properties. + +- **PARAM_RADIAL_ACCEL** = **4** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set radial acceleration properties. + +- **PARAM_TANGENTIAL_ACCEL** = **5** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set tangential acceleration properties. + +- **PARAM_DAMPING** = **6** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set damping properties. + +- **PARAM_ANGLE** = **7** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set angle properties. + +- **PARAM_SCALE** = **8** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set scale properties. + +- **PARAM_HUE_VARIATION** = **9** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set hue variation properties. + +- **PARAM_ANIM_SPEED** = **10** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set animation speed properties. + +- **PARAM_ANIM_OFFSET** = **11** --- Use with :ref:`set_param`, :ref:`set_param_randomness`, and :ref:`set_param_texture` to set animation offset properties. + +- **PARAM_MAX** = **12** --- Represents the size of the :ref:`Parameter` enum. + +---- + +.. _enum_ParticlesMaterial_Flags: + +.. _class_ParticlesMaterial_constant_FLAG_ALIGN_Y_TO_VELOCITY: + +.. _class_ParticlesMaterial_constant_FLAG_ROTATE_Y: + +.. _class_ParticlesMaterial_constant_FLAG_DISABLE_Z: + +.. _class_ParticlesMaterial_constant_FLAG_MAX: + +enum **Flags**: + +- **FLAG_ALIGN_Y_TO_VELOCITY** = **0** --- Use with :ref:`set_flag` to set :ref:`flag_align_y`. + +- **FLAG_ROTATE_Y** = **1** --- Use with :ref:`set_flag` to set :ref:`flag_rotate_y`. + +- **FLAG_DISABLE_Z** = **2** --- Use with :ref:`set_flag` to set :ref:`flag_disable_z`. + +- **FLAG_MAX** = **3** --- Represents the size of the :ref:`Flags` enum. + +---- + +.. _enum_ParticlesMaterial_EmissionShape: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_POINT: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_SPHERE: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_BOX: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_POINTS: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_DIRECTED_POINTS: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_RING: + +.. _class_ParticlesMaterial_constant_EMISSION_SHAPE_MAX: + +enum **EmissionShape**: + +- **EMISSION_SHAPE_POINT** = **0** --- All particles will be emitted from a single point. + +- **EMISSION_SHAPE_SPHERE** = **1** --- Particles will be emitted in the volume of a sphere. + +- **EMISSION_SHAPE_BOX** = **2** --- Particles will be emitted in the volume of a box. + +- **EMISSION_SHAPE_POINTS** = **3** --- Particles will be emitted at a position determined by sampling a random point on the :ref:`emission_point_texture`. Particle color will be modulated by :ref:`emission_color_texture`. + +- **EMISSION_SHAPE_DIRECTED_POINTS** = **4** --- Particles will be emitted at a position determined by sampling a random point on the :ref:`emission_point_texture`. Particle velocity and rotation will be set based on :ref:`emission_normal_texture`. Particle color will be modulated by :ref:`emission_color_texture`. + +- **EMISSION_SHAPE_RING** = **5** --- Particles will be emitted in a ring or cylinder. + +- **EMISSION_SHAPE_MAX** = **6** --- Represents the size of the :ref:`EmissionShape` enum. + +Property Descriptions +--------------------- + +.. _class_ParticlesMaterial_property_angle: + +- :ref:`float` **angle** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial rotation applied to each particle, in degrees. + +**Note:** Only applied when :ref:`flag_disable_z` or :ref:`flag_rotate_y` are ``true`` or the :ref:`SpatialMaterial` being used to draw the particle is using :ref:`SpatialMaterial.BILLBOARD_PARTICLES`. + +---- + +.. _class_ParticlesMaterial_property_angle_curve: + +- :ref:`Texture` **angle_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's rotation will be animated along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_angle_random: + +- :ref:`float` **angle_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Rotation randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_angular_velocity: + +- :ref:`float` **angular_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial angular velocity applied to each particle in *degrees* per second. Sets the speed of rotation of the particle. + +**Note:** Only applied when :ref:`flag_disable_z` or :ref:`flag_rotate_y` are ``true`` or the :ref:`SpatialMaterial` being used to draw the particle is using :ref:`SpatialMaterial.BILLBOARD_PARTICLES`. + +---- + +.. _class_ParticlesMaterial_property_angular_velocity_curve: + +- :ref:`Texture` **angular_velocity_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's angular velocity will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_angular_velocity_random: + +- :ref:`float` **angular_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Angular velocity randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_anim_offset: + +- :ref:`float` **anim_offset** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation offset. + +---- + +.. _class_ParticlesMaterial_property_anim_offset_curve: + +- :ref:`Texture` **anim_offset_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's animation offset will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_anim_offset_random: + +- :ref:`float` **anim_offset_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation offset randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_anim_speed: + +- :ref:`float` **anim_speed** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Particle animation speed. + +---- + +.. _class_ParticlesMaterial_property_anim_speed_curve: + +- :ref:`Texture` **anim_speed_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's animation speed will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_anim_speed_random: + +- :ref:`float` **anim_speed_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Animation speed randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +Each particle's initial color. If the :ref:`Particles2D`'s ``texture`` is defined, it will be multiplied by this color. To have particle display color in a :ref:`SpatialMaterial` make sure to set :ref:`SpatialMaterial.vertex_color_use_as_albedo` to ``true``. + +---- + +.. _class_ParticlesMaterial_property_color_ramp: + +- :ref:`Texture` **color_ramp** + ++----------+-----------------------+ +| *Setter* | set_color_ramp(value) | ++----------+-----------------------+ +| *Getter* | get_color_ramp() | ++----------+-----------------------+ + +Each particle's color will vary along this :ref:`GradientTexture` over its lifetime (multiplied with :ref:`color`). + +---- + +.. _class_ParticlesMaterial_property_damping: + +- :ref:`float` **damping** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The rate at which particles lose velocity. + +---- + +.. _class_ParticlesMaterial_property_damping_curve: + +- :ref:`Texture` **damping_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Damping will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_damping_random: + +- :ref:`float` **damping_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Damping randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_direction: + +- :ref:`Vector3` **direction** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_direction(value) | ++-----------+------------------------+ +| *Getter* | get_direction() | ++-----------+------------------------+ + +Unit vector specifying the particles' emission direction. + +---- + +.. _class_ParticlesMaterial_property_emission_box_extents: + +- :ref:`Vector3` **emission_box_extents** + ++----------+---------------------------------+ +| *Setter* | set_emission_box_extents(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_box_extents() | ++----------+---------------------------------+ + +The box's extents if ``emission_shape`` is set to :ref:`EMISSION_SHAPE_BOX`. + +---- + +.. _class_ParticlesMaterial_property_emission_color_texture: + +- :ref:`Texture` **emission_color_texture** + ++----------+-----------------------------------+ +| *Setter* | set_emission_color_texture(value) | ++----------+-----------------------------------+ +| *Getter* | get_emission_color_texture() | ++----------+-----------------------------------+ + +Particle color will be modulated by color determined by sampling this texture at the same point as the :ref:`emission_point_texture`. + +---- + +.. _class_ParticlesMaterial_property_emission_normal_texture: + +- :ref:`Texture` **emission_normal_texture** + ++----------+------------------------------------+ +| *Setter* | set_emission_normal_texture(value) | ++----------+------------------------------------+ +| *Getter* | get_emission_normal_texture() | ++----------+------------------------------------+ + +Particle velocity and rotation will be set by sampling this texture at the same point as the :ref:`emission_point_texture`. Used only in :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. + +---- + +.. _class_ParticlesMaterial_property_emission_point_count: + +- :ref:`int` **emission_point_count** + ++----------+---------------------------------+ +| *Setter* | set_emission_point_count(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_point_count() | ++----------+---------------------------------+ + +The number of emission points if ``emission_shape`` is set to :ref:`EMISSION_SHAPE_POINTS` or :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. + +---- + +.. _class_ParticlesMaterial_property_emission_point_texture: + +- :ref:`Texture` **emission_point_texture** + ++----------+-----------------------------------+ +| *Setter* | set_emission_point_texture(value) | ++----------+-----------------------------------+ +| *Getter* | get_emission_point_texture() | ++----------+-----------------------------------+ + +Particles will be emitted at positions determined by sampling this texture at a random position. Used with :ref:`EMISSION_SHAPE_POINTS` and :ref:`EMISSION_SHAPE_DIRECTED_POINTS`. Can be created automatically from mesh or node by selecting "Create Emission Points from Mesh/Node" under the "Particles" tool in the toolbar. + +---- + +.. _class_ParticlesMaterial_property_emission_ring_axis: + +- :ref:`Vector3` **emission_ring_axis** + ++----------+-------------------------------+ +| *Setter* | set_emission_ring_axis(value) | ++----------+-------------------------------+ +| *Getter* | get_emission_ring_axis() | ++----------+-------------------------------+ + +The axis of the ring when using the emitter :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_ParticlesMaterial_property_emission_ring_height: + +- :ref:`float` **emission_ring_height** + ++----------+---------------------------------+ +| *Setter* | set_emission_ring_height(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_ring_height() | ++----------+---------------------------------+ + +The height of the ring when using the emitter :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_ParticlesMaterial_property_emission_ring_inner_radius: + +- :ref:`float` **emission_ring_inner_radius** + ++----------+---------------------------------------+ +| *Setter* | set_emission_ring_inner_radius(value) | ++----------+---------------------------------------+ +| *Getter* | get_emission_ring_inner_radius() | ++----------+---------------------------------------+ + +The inner radius of the ring when using the emitter :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_ParticlesMaterial_property_emission_ring_radius: + +- :ref:`float` **emission_ring_radius** + ++----------+---------------------------------+ +| *Setter* | set_emission_ring_radius(value) | ++----------+---------------------------------+ +| *Getter* | get_emission_ring_radius() | ++----------+---------------------------------+ + +The radius of the ring when using the emitter :ref:`EMISSION_SHAPE_RING`. + +---- + +.. _class_ParticlesMaterial_property_emission_shape: + +- :ref:`EmissionShape` **emission_shape** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_emission_shape(value) | ++-----------+---------------------------+ +| *Getter* | get_emission_shape() | ++-----------+---------------------------+ + +Particles will be emitted inside this region. Use :ref:`EmissionShape` constants for values. + +---- + +.. _class_ParticlesMaterial_property_emission_sphere_radius: + +- :ref:`float` **emission_sphere_radius** + ++----------+-----------------------------------+ +| *Setter* | set_emission_sphere_radius(value) | ++----------+-----------------------------------+ +| *Getter* | get_emission_sphere_radius() | ++----------+-----------------------------------+ + +The sphere's radius if ``emission_shape`` is set to :ref:`EMISSION_SHAPE_SPHERE`. + +---- + +.. _class_ParticlesMaterial_property_flag_align_y: + +- :ref:`bool` **flag_align_y** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +Align Y axis of particle with the direction of its velocity. + +---- + +.. _class_ParticlesMaterial_property_flag_disable_z: + +- :ref:`bool` **flag_disable_z** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, particles will not move on the z axis. + +---- + +.. _class_ParticlesMaterial_property_flag_rotate_y: + +- :ref:`bool` **flag_rotate_y** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, particles rotate around Y axis by :ref:`angle`. + +---- + +.. _class_ParticlesMaterial_property_flatness: + +- :ref:`float` **flatness** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_flatness(value) | ++-----------+---------------------+ +| *Getter* | get_flatness() | ++-----------+---------------------+ + +Amount of :ref:`spread` along the Y axis. + +---- + +.. _class_ParticlesMaterial_property_gravity: + +- :ref:`Vector3` **gravity** + ++-----------+---------------------------+ +| *Default* | ``Vector3( 0, -9.8, 0 )`` | ++-----------+---------------------------+ +| *Setter* | set_gravity(value) | ++-----------+---------------------------+ +| *Getter* | get_gravity() | ++-----------+---------------------------+ + +Gravity applied to every particle. + +---- + +.. _class_ParticlesMaterial_property_hue_variation: + +- :ref:`float` **hue_variation** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial hue variation applied to each particle. + +---- + +.. _class_ParticlesMaterial_property_hue_variation_curve: + +- :ref:`Texture` **hue_variation_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's hue will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_hue_variation_random: + +- :ref:`float` **hue_variation_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Hue variation randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_initial_velocity: + +- :ref:`float` **initial_velocity** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial velocity magnitude for each particle. Direction comes from :ref:`spread` and the node's orientation. + +---- + +.. _class_ParticlesMaterial_property_initial_velocity_random: + +- :ref:`float` **initial_velocity_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Initial velocity randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_lifetime_randomness: + +- :ref:`float` **lifetime_randomness** + ++-----------+--------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------+ +| *Setter* | set_lifetime_randomness(value) | ++-----------+--------------------------------+ +| *Getter* | get_lifetime_randomness() | ++-----------+--------------------------------+ + +Particle lifetime randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_linear_accel: + +- :ref:`float` **linear_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Linear acceleration applied to each particle in the direction of motion. + +---- + +.. _class_ParticlesMaterial_property_linear_accel_curve: + +- :ref:`Texture` **linear_accel_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's linear acceleration will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_linear_accel_random: + +- :ref:`float` **linear_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Linear acceleration randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_orbit_velocity: + +- :ref:`float` **orbit_velocity** + ++----------+------------------+ +| *Setter* | set_param(value) | ++----------+------------------+ +| *Getter* | get_param() | ++----------+------------------+ + +Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second. + +**Note:** Only available when :ref:`flag_disable_z` is ``true``. + +---- + +.. _class_ParticlesMaterial_property_orbit_velocity_curve: + +- :ref:`Texture` **orbit_velocity_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's orbital velocity will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_orbit_velocity_random: + +- :ref:`float` **orbit_velocity_random** + ++----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++----------+-----------------------------+ + +Orbital velocity randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_radial_accel: + +- :ref:`float` **radial_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Radial acceleration applied to each particle. Makes particle accelerate away from origin. + +---- + +.. _class_ParticlesMaterial_property_radial_accel_curve: + +- :ref:`Texture` **radial_accel_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's radial acceleration will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_radial_accel_random: + +- :ref:`float` **radial_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Radial acceleration randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_scale: + +- :ref:`float` **scale** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Initial scale applied to each particle. + +---- + +.. _class_ParticlesMaterial_property_scale_curve: + +- :ref:`Texture` **scale_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's scale will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_scale_random: + +- :ref:`float` **scale_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Scale randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_spread: + +- :ref:`float` **spread** + ++-----------+-------------------+ +| *Default* | ``45.0`` | ++-----------+-------------------+ +| *Setter* | set_spread(value) | ++-----------+-------------------+ +| *Getter* | get_spread() | ++-----------+-------------------+ + +Each particle's initial direction range from ``+spread`` to ``-spread`` degrees. + +---- + +.. _class_ParticlesMaterial_property_tangential_accel: + +- :ref:`float` **tangential_accel** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle's velocity giving the particles a swirling motion. + +---- + +.. _class_ParticlesMaterial_property_tangential_accel_curve: + +- :ref:`Texture` **tangential_accel_curve** + ++----------+--------------------------+ +| *Setter* | set_param_texture(value) | ++----------+--------------------------+ +| *Getter* | get_param_texture() | ++----------+--------------------------+ + +Each particle's tangential acceleration will vary along this :ref:`CurveTexture`. + +---- + +.. _class_ParticlesMaterial_property_tangential_accel_random: + +- :ref:`float` **tangential_accel_random** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_param_randomness(value) | ++-----------+-----------------------------+ +| *Getter* | get_param_randomness() | ++-----------+-----------------------------+ + +Tangential acceleration randomness ratio. + +---- + +.. _class_ParticlesMaterial_property_trail_color_modifier: + +- :ref:`GradientTexture` **trail_color_modifier** + ++----------+---------------------------------+ +| *Setter* | set_trail_color_modifier(value) | ++----------+---------------------------------+ +| *Getter* | get_trail_color_modifier() | ++----------+---------------------------------+ + +Trail particles' color will vary along this :ref:`GradientTexture`. + +---- + +.. _class_ParticlesMaterial_property_trail_divisor: + +- :ref:`int` **trail_divisor** + ++-----------+--------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------+ +| *Setter* | set_trail_divisor(value) | ++-----------+--------------------------+ +| *Getter* | get_trail_divisor() | ++-----------+--------------------------+ + +Emitter will emit ``amount`` divided by ``trail_divisor`` particles. The remaining particles will be used as trail(s). + +---- + +.. _class_ParticlesMaterial_property_trail_size_modifier: + +- :ref:`CurveTexture` **trail_size_modifier** + ++----------+--------------------------------+ +| *Setter* | set_trail_size_modifier(value) | ++----------+--------------------------------+ +| *Getter* | get_trail_size_modifier() | ++----------+--------------------------------+ + +Trail particles' size will vary along this :ref:`CurveTexture`. + +Method Descriptions +------------------- + +.. _class_ParticlesMaterial_method_get_flag: + +- :ref:`bool` **get_flag** **(** :ref:`Flags` flag **)** |const| + +Returns ``true`` if the specified flag is enabled. + +---- + +.. _class_ParticlesMaterial_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Parameter` param **)** |const| + +Returns the value of the specified parameter. + +---- + +.. _class_ParticlesMaterial_method_get_param_randomness: + +- :ref:`float` **get_param_randomness** **(** :ref:`Parameter` param **)** |const| + +Returns the randomness ratio associated with the specified parameter. + +---- + +.. _class_ParticlesMaterial_method_get_param_texture: + +- :ref:`Texture` **get_param_texture** **(** :ref:`Parameter` param **)** |const| + +Returns the :ref:`Texture` used by the specified parameter. + +---- + +.. _class_ParticlesMaterial_method_set_flag: + +- void **set_flag** **(** :ref:`Flags` flag, :ref:`bool` enable **)** + +If ``true``, enables the specified flag. See :ref:`Flags` for options. + +---- + +.. _class_ParticlesMaterial_method_set_param: + +- void **set_param** **(** :ref:`Parameter` param, :ref:`float` value **)** + +Sets the specified :ref:`Parameter`. + +---- + +.. _class_ParticlesMaterial_method_set_param_randomness: + +- void **set_param_randomness** **(** :ref:`Parameter` param, :ref:`float` randomness **)** + +Sets the randomness ratio for the specified :ref:`Parameter`. + +---- + +.. _class_ParticlesMaterial_method_set_param_texture: + +- void **set_param_texture** **(** :ref:`Parameter` param, :ref:`Texture` texture **)** + +Sets the :ref:`Texture` for the specified :ref:`Parameter`. + +.. |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.)` diff --git a/classes/class_path.rst b/classes/class_path.rst new file mode 100644 index 0000000..f5529b7 --- /dev/null +++ b/classes/class_path.rst @@ -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 Path.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Path: + +Path +==== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Contains a :ref:`Curve3D` path for :ref:`PathFollow` nodes to follow. + +Description +----------- + +Can have :ref:`PathFollow` child nodes moving along the :ref:`Curve3D`. See :ref:`PathFollow` for more information on the usage. + +Note that the path is considered as relative to the moved nodes (children of :ref:`PathFollow`). As such, the curve should usually start with a zero vector ``(0, 0, 0)``. + +Properties +---------- + ++-------------------------------+-----------------------------------------+ +| :ref:`Curve3D` | :ref:`curve` | ++-------------------------------+-----------------------------------------+ + +Signals +------- + +.. _class_Path_signal_curve_changed: + +- **curve_changed** **(** **)** + +Emitted when the :ref:`curve` changes. + +Property Descriptions +--------------------- + +.. _class_Path_property_curve: + +- :ref:`Curve3D` **curve** + ++----------+------------------+ +| *Setter* | set_curve(value) | ++----------+------------------+ +| *Getter* | get_curve() | ++----------+------------------+ + +A :ref:`Curve3D` describing the 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.)` diff --git a/classes/class_path2d.rst b/classes/class_path2d.rst new file mode 100644 index 0000000..294efe2 --- /dev/null +++ b/classes/class_path2d.rst @@ -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 Path2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Path2D: + +Path2D +====== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Contains a :ref:`Curve2D` path for :ref:`PathFollow2D` nodes to follow. + +Description +----------- + +Can have :ref:`PathFollow2D` child nodes moving along the :ref:`Curve2D`. See :ref:`PathFollow2D` for more information on usage. + +**Note:** The path is considered as relative to the moved nodes (children of :ref:`PathFollow2D`). As such, the curve should usually start with a zero vector (``(0, 0)``). + +Properties +---------- + ++-------------------------------+-------------------------------------------+---------------------------------------------------+ +| :ref:`Curve2D` | :ref:`curve` | | ++-------------------------------+-------------------------------------------+---------------------------------------------------+ +| :ref:`Color` | self_modulate | ``Color( 0.5, 0.6, 1, 0.7 )`` *(parent override)* | ++-------------------------------+-------------------------------------------+---------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Path2D_property_curve: + +- :ref:`Curve2D` **curve** + ++----------+------------------+ +| *Setter* | set_curve(value) | ++----------+------------------+ +| *Getter* | get_curve() | ++----------+------------------+ + +A :ref:`Curve2D` describing the 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.)` diff --git a/classes/class_pathfollow.rst b/classes/class_pathfollow.rst new file mode 100644 index 0000000..316618f --- /dev/null +++ b/classes/class_pathfollow.rst @@ -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 PathFollow.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PathFollow: + +PathFollow +========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Point sampler for a :ref:`Path`. + +Description +----------- + +This node takes its parent :ref:`Path`, and returns the coordinates of a point within it, given a distance from the first vertex. + +It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting an offset in this node. + +Properties +---------- + ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`cubic_interp` | ``true`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`h_offset` | ``0.0`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`loop` | ``true`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`offset` | ``0.0`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`RotationMode` | :ref:`rotation_mode` | ``3`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`unit_offset` | ``0.0`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`v_offset` | ``0.0`` | ++---------------------------------------------------+---------------------------------------------------------------+----------+ + +Enumerations +------------ + +.. _enum_PathFollow_RotationMode: + +.. _class_PathFollow_constant_ROTATION_NONE: + +.. _class_PathFollow_constant_ROTATION_Y: + +.. _class_PathFollow_constant_ROTATION_XY: + +.. _class_PathFollow_constant_ROTATION_XYZ: + +.. _class_PathFollow_constant_ROTATION_ORIENTED: + +enum **RotationMode**: + +- **ROTATION_NONE** = **0** --- Forbids the PathFollow to rotate. + +- **ROTATION_Y** = **1** --- Allows the PathFollow to rotate in the Y axis only. + +- **ROTATION_XY** = **2** --- Allows the PathFollow to rotate in both the X, and Y axes. + +- **ROTATION_XYZ** = **3** --- Allows the PathFollow to rotate in any axis. + +- **ROTATION_ORIENTED** = **4** --- Uses the up vector information in a :ref:`Curve3D` to enforce orientation. This rotation mode requires the :ref:`Path`'s :ref:`Curve3D.up_vector_enabled` property to be set to ``true``. + +Property Descriptions +--------------------- + +.. _class_PathFollow_property_cubic_interp: + +- :ref:`bool` **cubic_interp** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_cubic_interpolation(value) | ++-----------+--------------------------------+ +| *Getter* | get_cubic_interpolation() | ++-----------+--------------------------------+ + +If ``true``, the position between two cached points is interpolated cubically, and linearly otherwise. + +The points along the :ref:`Curve3D` of the :ref:`Path` are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. + +There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + +---- + +.. _class_PathFollow_property_h_offset: + +- :ref:`float` **h_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_h_offset(value) | ++-----------+---------------------+ +| *Getter* | get_h_offset() | ++-----------+---------------------+ + +The node's offset along the curve. + +---- + +.. _class_PathFollow_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``true`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | has_loop() | ++-----------+-----------------+ + +If ``true``, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. + +---- + +.. _class_PathFollow_property_offset: + +- :ref:`float` **offset** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_offset(value) | ++-----------+-------------------+ +| *Getter* | get_offset() | ++-----------+-------------------+ + +The distance from the first vertex, measured in 3D units along the path. This sets this node's position to a point within the path. + +---- + +.. _class_PathFollow_property_rotation_mode: + +- :ref:`RotationMode` **rotation_mode** + ++-----------+--------------------------+ +| *Default* | ``3`` | ++-----------+--------------------------+ +| *Setter* | set_rotation_mode(value) | ++-----------+--------------------------+ +| *Getter* | get_rotation_mode() | ++-----------+--------------------------+ + +Allows or forbids rotation on one or more axes, depending on the :ref:`RotationMode` constants being used. + +---- + +.. _class_PathFollow_property_unit_offset: + +- :ref:`float` **unit_offset** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_unit_offset(value) | ++-----------+------------------------+ +| *Getter* | get_unit_offset() | ++-----------+------------------------+ + +The distance from the first vertex, considering 0.0 as the first vertex and 1.0 as the last. This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. + +---- + +.. _class_PathFollow_property_v_offset: + +- :ref:`float` **v_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_v_offset(value) | ++-----------+---------------------+ +| *Getter* | get_v_offset() | ++-----------+---------------------+ + +The node's offset perpendicular to the curve. + +.. |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.)` diff --git a/classes/class_pathfollow2d.rst b/classes/class_pathfollow2d.rst new file mode 100644 index 0000000..a7adbe4 --- /dev/null +++ b/classes/class_pathfollow2d.rst @@ -0,0 +1,179 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PathFollow2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PathFollow2D: + +PathFollow2D +============ + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Point sampler for a :ref:`Path2D`. + +Description +----------- + +This node takes its parent :ref:`Path2D`, and returns the coordinates of a point within it, given a distance from the first vertex. + +It is useful for making other nodes follow a path, without coding the movement pattern. For that, the nodes must be children of this node. The descendant nodes will then move accordingly when setting an offset in this node. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`cubic_interp` | ``true`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`h_offset` | ``0.0`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`lookahead` | ``4.0`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`loop` | ``true`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`offset` | ``0.0`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`rotate` | ``true`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`unit_offset` | ``0.0`` | ++---------------------------+---------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`v_offset` | ``0.0`` | ++---------------------------+---------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_PathFollow2D_property_cubic_interp: + +- :ref:`bool` **cubic_interp** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_cubic_interpolation(value) | ++-----------+--------------------------------+ +| *Getter* | get_cubic_interpolation() | ++-----------+--------------------------------+ + +If ``true``, the position between two cached points is interpolated cubically, and linearly otherwise. + +The points along the :ref:`Curve2D` of the :ref:`Path2D` are precomputed before use, for faster calculations. The point at the requested offset is then calculated interpolating between two adjacent cached points. This may present a problem if the curve makes sharp turns, as the cached points may not follow the curve closely enough. + +There are two answers to this problem: either increase the number of cached points and increase memory consumption, or make a cubic interpolation between two points at the cost of (slightly) slower calculations. + +---- + +.. _class_PathFollow2D_property_h_offset: + +- :ref:`float` **h_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_h_offset(value) | ++-----------+---------------------+ +| *Getter* | get_h_offset() | ++-----------+---------------------+ + +The node's offset along the curve. + +---- + +.. _class_PathFollow2D_property_lookahead: + +- :ref:`float` **lookahead** + ++-----------+----------------------+ +| *Default* | ``4.0`` | ++-----------+----------------------+ +| *Setter* | set_lookahead(value) | ++-----------+----------------------+ +| *Getter* | get_lookahead() | ++-----------+----------------------+ + +How far to look ahead of the curve to calculate the tangent if the node is rotating. E.g. shorter lookaheads will lead to faster rotations. + +---- + +.. _class_PathFollow2D_property_loop: + +- :ref:`bool` **loop** + ++-----------+-----------------+ +| *Default* | ``true`` | ++-----------+-----------------+ +| *Setter* | set_loop(value) | ++-----------+-----------------+ +| *Getter* | has_loop() | ++-----------+-----------------+ + +If ``true``, any offset outside the path's length will wrap around, instead of stopping at the ends. Use it for cyclic paths. + +---- + +.. _class_PathFollow2D_property_offset: + +- :ref:`float` **offset** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_offset(value) | ++-----------+-------------------+ +| *Getter* | get_offset() | ++-----------+-------------------+ + +The distance along the path in pixels. + +---- + +.. _class_PathFollow2D_property_rotate: + +- :ref:`bool` **rotate** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_rotate(value) | ++-----------+-------------------+ +| *Getter* | is_rotating() | ++-----------+-------------------+ + +If ``true``, this node rotates to follow the path, making its descendants rotate. + +---- + +.. _class_PathFollow2D_property_unit_offset: + +- :ref:`float` **unit_offset** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_unit_offset(value) | ++-----------+------------------------+ +| *Getter* | get_unit_offset() | ++-----------+------------------------+ + +The distance along the path as a number in the range 0.0 (for the first vertex) to 1.0 (for the last). This is just another way of expressing the offset within the path, as the offset supplied is multiplied internally by the path's length. + +---- + +.. _class_PathFollow2D_property_v_offset: + +- :ref:`float` **v_offset** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_v_offset(value) | ++-----------+---------------------+ +| *Getter* | get_v_offset() | ++-----------+---------------------+ + +The node's offset perpendicular to the curve. + +.. |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.)` diff --git a/classes/class_pckpacker.rst b/classes/class_pckpacker.rst new file mode 100644 index 0000000..3981554 --- /dev/null +++ b/classes/class_pckpacker.rst @@ -0,0 +1,68 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PCKPacker.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PCKPacker: + +PCKPacker +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Creates packages that can be loaded into a running project. + +Description +----------- + +The ``PCKPacker`` is used to create packages that can be loaded into a running project using :ref:`ProjectSettings.load_resource_pack`. + +:: + + var packer = PCKPacker.new() + packer.pck_start("test.pck") + packer.add_file("res://text.txt", "text.txt") + packer.flush() + +The above ``PCKPacker`` creates package ``test.pck``, then adds a file named ``text.txt`` at the root of the package. + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`add_file` **(** :ref:`String` pck_path, :ref:`String` source_path **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`flush` **(** :ref:`bool` verbose=false **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`pck_start` **(** :ref:`String` pck_name, :ref:`int` alignment=0 **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PCKPacker_method_add_file: + +- :ref:`Error` **add_file** **(** :ref:`String` pck_path, :ref:`String` source_path **)** + +Adds the ``source_path`` file to the current PCK package at the ``pck_path`` internal path (should start with ``res://``). + +---- + +.. _class_PCKPacker_method_flush: + +- :ref:`Error` **flush** **(** :ref:`bool` verbose=false **)** + +Writes the files specified using all :ref:`add_file` calls since the last flush. If ``verbose`` is ``true``, a list of files added will be printed to the console for easier debugging. + +---- + +.. _class_PCKPacker_method_pck_start: + +- :ref:`Error` **pck_start** **(** :ref:`String` pck_name, :ref:`int` alignment=0 **)** + +Creates a new PCK file with the name ``pck_name``. The ``.pck`` file extension isn't added automatically, so it should be part of ``pck_name`` (even though it's not required). + +.. |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.)` diff --git a/classes/class_performance.rst b/classes/class_performance.rst new file mode 100644 index 0000000..7e8edf7 --- /dev/null +++ b/classes/class_performance.rst @@ -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 Performance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Performance: + +Performance +=========== + +**Inherits:** :ref:`Object` + +Exposes performance-related data. + +Description +----------- + +This class provides access to a number of different monitors related to performance, such as memory usage, draw calls, and FPS. These are the same as the values displayed in the **Monitor** tab in the editor's **Debugger** panel. By using the :ref:`get_monitor` method of this class, you can access this data from your code. + +**Note:** A few of these monitors are only available in debug mode and will always return 0 when used in a release build. + +**Note:** Many of these monitors are not updated in real-time, so there may be a short delay between changes. + +Methods +------- + ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_monitor` **(** :ref:`Monitor` monitor **)** |const| | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Performance_Monitor: + +.. _class_Performance_constant_TIME_FPS: + +.. _class_Performance_constant_TIME_PROCESS: + +.. _class_Performance_constant_TIME_PHYSICS_PROCESS: + +.. _class_Performance_constant_MEMORY_STATIC: + +.. _class_Performance_constant_MEMORY_DYNAMIC: + +.. _class_Performance_constant_MEMORY_STATIC_MAX: + +.. _class_Performance_constant_MEMORY_DYNAMIC_MAX: + +.. _class_Performance_constant_MEMORY_MESSAGE_BUFFER_MAX: + +.. _class_Performance_constant_OBJECT_COUNT: + +.. _class_Performance_constant_OBJECT_RESOURCE_COUNT: + +.. _class_Performance_constant_OBJECT_NODE_COUNT: + +.. _class_Performance_constant_OBJECT_ORPHAN_NODE_COUNT: + +.. _class_Performance_constant_RENDER_OBJECTS_IN_FRAME: + +.. _class_Performance_constant_RENDER_VERTICES_IN_FRAME: + +.. _class_Performance_constant_RENDER_MATERIAL_CHANGES_IN_FRAME: + +.. _class_Performance_constant_RENDER_SHADER_CHANGES_IN_FRAME: + +.. _class_Performance_constant_RENDER_SURFACE_CHANGES_IN_FRAME: + +.. _class_Performance_constant_RENDER_DRAW_CALLS_IN_FRAME: + +.. _class_Performance_constant_RENDER_2D_ITEMS_IN_FRAME: + +.. _class_Performance_constant_RENDER_2D_DRAW_CALLS_IN_FRAME: + +.. _class_Performance_constant_RENDER_VIDEO_MEM_USED: + +.. _class_Performance_constant_RENDER_TEXTURE_MEM_USED: + +.. _class_Performance_constant_RENDER_VERTEX_MEM_USED: + +.. _class_Performance_constant_RENDER_USAGE_VIDEO_MEM_TOTAL: + +.. _class_Performance_constant_PHYSICS_2D_ACTIVE_OBJECTS: + +.. _class_Performance_constant_PHYSICS_2D_COLLISION_PAIRS: + +.. _class_Performance_constant_PHYSICS_2D_ISLAND_COUNT: + +.. _class_Performance_constant_PHYSICS_3D_ACTIVE_OBJECTS: + +.. _class_Performance_constant_PHYSICS_3D_COLLISION_PAIRS: + +.. _class_Performance_constant_PHYSICS_3D_ISLAND_COUNT: + +.. _class_Performance_constant_AUDIO_OUTPUT_LATENCY: + +.. _class_Performance_constant_MONITOR_MAX: + +enum **Monitor**: + +- **TIME_FPS** = **0** --- Number of frames per second. + +- **TIME_PROCESS** = **1** --- Time it took to complete one frame, in seconds. + +- **TIME_PHYSICS_PROCESS** = **2** --- Time it took to complete one physics frame, in seconds. + +- **MEMORY_STATIC** = **3** --- Static memory currently used, in bytes. Not available in release builds. + +- **MEMORY_DYNAMIC** = **4** --- Dynamic memory currently used, in bytes. Not available in release builds. + +- **MEMORY_STATIC_MAX** = **5** --- Available static memory. Not available in release builds. + +- **MEMORY_DYNAMIC_MAX** = **6** --- Available dynamic memory. Not available in release builds. + +- **MEMORY_MESSAGE_BUFFER_MAX** = **7** --- Largest amount of memory the message queue buffer has used, in bytes. The message queue is used for deferred functions calls and notifications. + +- **OBJECT_COUNT** = **8** --- Number of objects currently instanced (including nodes). + +- **OBJECT_RESOURCE_COUNT** = **9** --- Number of resources currently used. + +- **OBJECT_NODE_COUNT** = **10** --- Number of nodes currently instanced in the scene tree. This also includes the root node. + +- **OBJECT_ORPHAN_NODE_COUNT** = **11** --- Number of orphan nodes, i.e. nodes which are not parented to a node of the scene tree. + +- **RENDER_OBJECTS_IN_FRAME** = **12** --- 3D objects drawn per frame. + +- **RENDER_VERTICES_IN_FRAME** = **13** --- Vertices drawn per frame. 3D only. + +- **RENDER_MATERIAL_CHANGES_IN_FRAME** = **14** --- Material changes per frame. 3D only. + +- **RENDER_SHADER_CHANGES_IN_FRAME** = **15** --- Shader changes per frame. 3D only. + +- **RENDER_SURFACE_CHANGES_IN_FRAME** = **16** --- Render surface changes per frame. 3D only. + +- **RENDER_DRAW_CALLS_IN_FRAME** = **17** --- Draw calls per frame. 3D only. + +- **RENDER_2D_ITEMS_IN_FRAME** = **18** --- Items or joined items drawn per frame. + +- **RENDER_2D_DRAW_CALLS_IN_FRAME** = **19** --- Draw calls per frame. + +- **RENDER_VIDEO_MEM_USED** = **20** --- The amount of video memory used, i.e. texture and vertex memory combined. + +- **RENDER_TEXTURE_MEM_USED** = **21** --- The amount of texture memory used. + +- **RENDER_VERTEX_MEM_USED** = **22** --- The amount of vertex memory used. + +- **RENDER_USAGE_VIDEO_MEM_TOTAL** = **23** --- Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. + +- **PHYSICS_2D_ACTIVE_OBJECTS** = **24** --- Number of active :ref:`RigidBody2D` nodes in the game. + +- **PHYSICS_2D_COLLISION_PAIRS** = **25** --- Number of collision pairs in the 2D physics engine. + +- **PHYSICS_2D_ISLAND_COUNT** = **26** --- Number of islands in the 2D physics engine. + +- **PHYSICS_3D_ACTIVE_OBJECTS** = **27** --- Number of active :ref:`RigidBody` and :ref:`VehicleBody` nodes in the game. + +- **PHYSICS_3D_COLLISION_PAIRS** = **28** --- Number of collision pairs in the 3D physics engine. + +- **PHYSICS_3D_ISLAND_COUNT** = **29** --- Number of islands in the 3D physics engine. + +- **AUDIO_OUTPUT_LATENCY** = **30** --- Output latency of the :ref:`AudioServer`. + +- **MONITOR_MAX** = **31** --- Represents the size of the :ref:`Monitor` enum. + +Method Descriptions +------------------- + +.. _class_Performance_method_get_monitor: + +- :ref:`float` **get_monitor** **(** :ref:`Monitor` monitor **)** |const| + +Returns the value of one of the available monitors. You should provide one of the :ref:`Monitor` constants as the argument, like this: + +:: + + print(Performance.get_monitor(Performance.TIME_FPS)) # Prints the FPS to the console + +.. |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.)` diff --git a/classes/class_phashtranslation.rst b/classes/class_phashtranslation.rst new file mode 100644 index 0000000..7e12d6a --- /dev/null +++ b/classes/class_phashtranslation.rst @@ -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 PHashTranslation.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PHashTranslation: + +PHashTranslation +================ + +**Inherits:** :ref:`Translation` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Optimized translation. + +Description +----------- + +Optimized translation. Uses real-time compressed translations, which results in very small dictionaries. + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------+ +| void | :ref:`generate` **(** :ref:`Translation` from **)** | ++------+----------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PHashTranslation_method_generate: + +- void **generate** **(** :ref:`Translation` from **)** + +Generates and sets an optimized translation from the given :ref:`Translation` resource. + +.. |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.)` diff --git a/classes/class_physicalbone.rst b/classes/class_physicalbone.rst new file mode 100644 index 0000000..b063b83 --- /dev/null +++ b/classes/class_physicalbone.rst @@ -0,0 +1,237 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicalBone.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicalBone: + +PhysicalBone +============ + +**Inherits:** :ref:`PhysicsBody` **<** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`body_offset` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`bounce` | ``0.0`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`friction` | ``1.0`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`gravity_scale` | ``1.0`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`joint_offset` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`JointType` | :ref:`joint_type` | ``0`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`mass` | ``1.0`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`weight` | ``9.8`` | ++-----------------------------------------------+-----------------------------------------------------------------+-----------------------------------------------------+ + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_central_impulse` **(** :ref:`Vector3` impulse **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_impulse` **(** :ref:`Vector3` position, :ref:`Vector3` impulse **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_id` **(** **)** |const| | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_simulate_physics` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_simulating_physics` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_static_body` **(** **)** | ++-------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PhysicalBone_JointType: + +.. _class_PhysicalBone_constant_JOINT_TYPE_NONE: + +.. _class_PhysicalBone_constant_JOINT_TYPE_PIN: + +.. _class_PhysicalBone_constant_JOINT_TYPE_CONE: + +.. _class_PhysicalBone_constant_JOINT_TYPE_HINGE: + +.. _class_PhysicalBone_constant_JOINT_TYPE_SLIDER: + +.. _class_PhysicalBone_constant_JOINT_TYPE_6DOF: + +enum **JointType**: + +- **JOINT_TYPE_NONE** = **0** + +- **JOINT_TYPE_PIN** = **1** + +- **JOINT_TYPE_CONE** = **2** + +- **JOINT_TYPE_HINGE** = **3** + +- **JOINT_TYPE_SLIDER** = **4** + +- **JOINT_TYPE_6DOF** = **5** + +Property Descriptions +--------------------- + +.. _class_PhysicalBone_property_body_offset: + +- :ref:`Transform` **body_offset** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_body_offset(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_body_offset() | ++-----------+-----------------------------------------------------+ + +---- + +.. _class_PhysicalBone_property_bounce: + +- :ref:`float` **bounce** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_bounce(value) | ++-----------+-------------------+ +| *Getter* | get_bounce() | ++-----------+-------------------+ + +---- + +.. _class_PhysicalBone_property_friction: + +- :ref:`float` **friction** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_friction(value) | ++-----------+---------------------+ +| *Getter* | get_friction() | ++-----------+---------------------+ + +---- + +.. _class_PhysicalBone_property_gravity_scale: + +- :ref:`float` **gravity_scale** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_gravity_scale(value) | ++-----------+--------------------------+ +| *Getter* | get_gravity_scale() | ++-----------+--------------------------+ + +---- + +.. _class_PhysicalBone_property_joint_offset: + +- :ref:`Transform` **joint_offset** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_joint_offset(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_joint_offset() | ++-----------+-----------------------------------------------------+ + +---- + +.. _class_PhysicalBone_property_joint_type: + +- :ref:`JointType` **joint_type** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_joint_type(value) | ++-----------+-----------------------+ +| *Getter* | get_joint_type() | ++-----------+-----------------------+ + +---- + +.. _class_PhysicalBone_property_mass: + +- :ref:`float` **mass** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_mass(value) | ++-----------+-----------------+ +| *Getter* | get_mass() | ++-----------+-----------------+ + +---- + +.. _class_PhysicalBone_property_weight: + +- :ref:`float` **weight** + ++-----------+-------------------+ +| *Default* | ``9.8`` | ++-----------+-------------------+ +| *Setter* | set_weight(value) | ++-----------+-------------------+ +| *Getter* | get_weight() | ++-----------+-------------------+ + +Method Descriptions +------------------- + +.. _class_PhysicalBone_method_apply_central_impulse: + +- void **apply_central_impulse** **(** :ref:`Vector3` impulse **)** + +---- + +.. _class_PhysicalBone_method_apply_impulse: + +- void **apply_impulse** **(** :ref:`Vector3` position, :ref:`Vector3` impulse **)** + +---- + +.. _class_PhysicalBone_method_get_bone_id: + +- :ref:`int` **get_bone_id** **(** **)** |const| + +---- + +.. _class_PhysicalBone_method_get_simulate_physics: + +- :ref:`bool` **get_simulate_physics** **(** **)** + +---- + +.. _class_PhysicalBone_method_is_simulating_physics: + +- :ref:`bool` **is_simulating_physics** **(** **)** + +---- + +.. _class_PhysicalBone_method_is_static_body: + +- :ref:`bool` **is_static_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.)` diff --git a/classes/class_physics2ddirectbodystate.rst b/classes/class_physics2ddirectbodystate.rst new file mode 100644 index 0000000..62bc095 --- /dev/null +++ b/classes/class_physics2ddirectbodystate.rst @@ -0,0 +1,392 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Physics2DDirectBodyState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Physics2DDirectBodyState: + +Physics2DDirectBodyState +======================== + +**Inherits:** :ref:`Object` + +Direct access object to a physics body in the :ref:`Physics2DServer`. + +Description +----------- + +Provides direct access to a physics body in the :ref:`Physics2DServer`, allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See :ref:`RigidBody2D._integrate_forces`. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- :doc:`../tutorials/physics/ray-casting` + +Properties +---------- + ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angular_velocity` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`inverse_inertia` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`inverse_mass` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`linear_velocity` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`sleeping` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`step` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`total_angular_damp` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`total_gravity` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`total_linear_damp` | ++---------------------------------------+---------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`transform` | ++---------------------------------------+---------------------------------------------------------------------------------------+ + +Methods +------- + ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_central_force` **(** :ref:`Vector2` force **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_force` **(** :ref:`Vector2` offset, :ref:`Vector2` force **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_torque` **(** :ref:`float` torque **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_central_impulse` **(** :ref:`Vector2` impulse **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_impulse` **(** :ref:`Vector2` offset, :ref:`Vector2` impulse **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_torque_impulse` **(** :ref:`float` impulse **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_contact_collider` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_collider_id` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_contact_collider_object` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_contact_collider_position` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_collider_shape` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_contact_collider_shape_metadata` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_contact_collider_velocity_at_position` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_count` **(** **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_contact_local_normal` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_contact_local_position` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_local_shape` **(** :ref:`int` contact_idx **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Physics2DDirectSpaceState` | :ref:`get_space_state` **(** **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_velocity_at_local_position` **(** :ref:`Vector2` local_position **)** |const| | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`integrate_forces` **(** **)** | ++-------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Physics2DDirectBodyState_property_angular_velocity: + +- :ref:`float` **angular_velocity** + ++----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++----------+-----------------------------+ + +The body's rotational velocity in *radians* per second. + +---- + +.. _class_Physics2DDirectBodyState_property_inverse_inertia: + +- :ref:`float` **inverse_inertia** + ++----------+-----------------------+ +| *Getter* | get_inverse_inertia() | ++----------+-----------------------+ + +The inverse of the inertia of the body. + +---- + +.. _class_Physics2DDirectBodyState_property_inverse_mass: + +- :ref:`float` **inverse_mass** + ++----------+--------------------+ +| *Getter* | get_inverse_mass() | ++----------+--------------------+ + +The inverse of the mass of the body. + +---- + +.. _class_Physics2DDirectBodyState_property_linear_velocity: + +- :ref:`Vector2` **linear_velocity** + ++----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++----------+----------------------------+ + +The body's linear velocity in pixels per second. + +---- + +.. _class_Physics2DDirectBodyState_property_sleeping: + +- :ref:`bool` **sleeping** + ++----------+------------------------+ +| *Setter* | set_sleep_state(value) | ++----------+------------------------+ +| *Getter* | is_sleeping() | ++----------+------------------------+ + +If ``true``, this body is currently sleeping (not active). + +---- + +.. _class_Physics2DDirectBodyState_property_step: + +- :ref:`float` **step** + ++----------+------------+ +| *Getter* | get_step() | ++----------+------------+ + +The timestep (delta) used for the simulation. + +---- + +.. _class_Physics2DDirectBodyState_property_total_angular_damp: + +- :ref:`float` **total_angular_damp** + ++----------+--------------------------+ +| *Getter* | get_total_angular_damp() | ++----------+--------------------------+ + +The rate at which the body stops rotating, if there are not any other forces moving it. + +---- + +.. _class_Physics2DDirectBodyState_property_total_gravity: + +- :ref:`Vector2` **total_gravity** + ++----------+---------------------+ +| *Getter* | get_total_gravity() | ++----------+---------------------+ + +The total gravity vector being currently applied to this body. + +---- + +.. _class_Physics2DDirectBodyState_property_total_linear_damp: + +- :ref:`float` **total_linear_damp** + ++----------+-------------------------+ +| *Getter* | get_total_linear_damp() | ++----------+-------------------------+ + +The rate at which the body stops moving, if there are not any other forces moving it. + +---- + +.. _class_Physics2DDirectBodyState_property_transform: + +- :ref:`Transform2D` **transform** + ++----------+----------------------+ +| *Setter* | set_transform(value) | ++----------+----------------------+ +| *Getter* | get_transform() | ++----------+----------------------+ + +The body's transformation matrix. + +Method Descriptions +------------------- + +.. _class_Physics2DDirectBodyState_method_add_central_force: + +- void **add_central_force** **(** :ref:`Vector2` force **)** + +Adds a constant directional force without affecting rotation. + +---- + +.. _class_Physics2DDirectBodyState_method_add_force: + +- void **add_force** **(** :ref:`Vector2` offset, :ref:`Vector2` force **)** + +Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + +---- + +.. _class_Physics2DDirectBodyState_method_add_torque: + +- void **add_torque** **(** :ref:`float` torque **)** + +Adds a constant rotational force. + +---- + +.. _class_Physics2DDirectBodyState_method_apply_central_impulse: + +- void **apply_central_impulse** **(** :ref:`Vector2` impulse **)** + +Applies a directional impulse without affecting rotation. + +---- + +.. _class_Physics2DDirectBodyState_method_apply_impulse: + +- void **apply_impulse** **(** :ref:`Vector2` offset, :ref:`Vector2` impulse **)** + +Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason, it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The offset uses the rotation of the global coordinate system, but is centered at the object's origin. + +---- + +.. _class_Physics2DDirectBodyState_method_apply_torque_impulse: + +- void **apply_torque_impulse** **(** :ref:`float` impulse **)** + +Applies a rotational impulse to the body. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider: + +- :ref:`RID` **get_contact_collider** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's :ref:`RID`. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_id: + +- :ref:`int` **get_contact_collider_id** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's object id. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_object: + +- :ref:`Object` **get_contact_collider_object** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider object. This depends on how it was created (will return a scene node if such was used to create it). + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_position: + +- :ref:`Vector2` **get_contact_collider_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the contact position in the collider. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_shape: + +- :ref:`int` **get_contact_collider_shape** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's shape index. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_shape_metadata: + +- :ref:`Variant` **get_contact_collider_shape_metadata** **(** :ref:`int` contact_idx **)** |const| + +Returns the collided shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_collider_velocity_at_position: + +- :ref:`Vector2` **get_contact_collider_velocity_at_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the linear velocity vector at the collider's contact point. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_count: + +- :ref:`int` **get_contact_count** **(** **)** |const| + +Returns the number of contacts this body has with other bodies. + +**Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See :ref:`RigidBody2D.contact_monitor`. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_local_normal: + +- :ref:`Vector2` **get_contact_local_normal** **(** :ref:`int` contact_idx **)** |const| + +Returns the local normal at the contact point. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_local_position: + +- :ref:`Vector2` **get_contact_local_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the local position of the contact point. + +---- + +.. _class_Physics2DDirectBodyState_method_get_contact_local_shape: + +- :ref:`int` **get_contact_local_shape** **(** :ref:`int` contact_idx **)** |const| + +Returns the local shape index of the collision. + +---- + +.. _class_Physics2DDirectBodyState_method_get_space_state: + +- :ref:`Physics2DDirectSpaceState` **get_space_state** **(** **)** + +Returns the current state of the space, useful for queries. + +---- + +.. _class_Physics2DDirectBodyState_method_get_velocity_at_local_position: + +- :ref:`Vector2` **get_velocity_at_local_position** **(** :ref:`Vector2` local_position **)** |const| + +Returns the body's velocity at the given relative position, including both translation and rotation. + +---- + +.. _class_Physics2DDirectBodyState_method_integrate_forces: + +- void **integrate_forces** **(** **)** + +Calls the built-in force integration code. + +.. |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.)` diff --git a/classes/class_physics2ddirectspacestate.rst b/classes/class_physics2ddirectspacestate.rst new file mode 100644 index 0000000..d1277b4 --- /dev/null +++ b/classes/class_physics2ddirectspacestate.rst @@ -0,0 +1,190 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Physics2DDirectSpaceState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Physics2DDirectSpaceState: + +Physics2DDirectSpaceState +========================= + +**Inherits:** :ref:`Object` + +Direct access object to a space in the :ref:`Physics2DServer`. + +Description +----------- + +Direct access object to a space in the :ref:`Physics2DServer`. It's used mainly to do queries against objects and areas residing in a given space. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- :doc:`../tutorials/physics/ray-casting` + +Methods +------- + ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`cast_motion` **(** :ref:`Physics2DShapeQueryParameters` shape **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`collide_shape` **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_rest_info` **(** :ref:`Physics2DShapeQueryParameters` shape **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_point` **(** :ref:`Vector2` point, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_point_on_canvas` **(** :ref:`Vector2` point, :ref:`int` canvas_instance_id, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`intersect_ray` **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_shape` **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | ++-------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Physics2DDirectSpaceState_method_cast_motion: + +- :ref:`Array` **cast_motion** **(** :ref:`Physics2DShapeQueryParameters` shape **)** + +Checks how far a :ref:`Shape2D` can move without colliding. All the parameters for the query, including the shape and the motion, are supplied through a :ref:`Physics2DShapeQueryParameters` object. + +Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of ``[1.0, 1.0]`` will be returned. + +**Note:** Any :ref:`Shape2D`\ s that the shape is already colliding with e.g. inside of, will be ignored. Use :ref:`collide_shape` to determine the :ref:`Shape2D`\ s that the shape is already colliding with. + +---- + +.. _class_Physics2DDirectSpaceState_method_collide_shape: + +- :ref:`Array` **collide_shape** **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** + +Checks the intersections of a shape, given through a :ref:`Physics2DShapeQueryParameters` object, against the space. The resulting array contains a list of points where the shape intersects another. Like with :ref:`intersect_shape`, the number of returned results can be limited to save processing time. + +---- + +.. _class_Physics2DDirectSpaceState_method_get_rest_info: + +- :ref:`Dictionary` **get_rest_info** **(** :ref:`Physics2DShapeQueryParameters` shape **)** + +Checks the intersections of a shape, given through a :ref:`Physics2DShapeQueryParameters` object, against the space. If it collides with more than one shape, the nearest one is selected. If the shape did not intersect anything, then an empty dictionary is returned instead. + +**Note:** This method does not take into account the ``motion`` property of the object. The returned object is a dictionary containing the following fields: + +``collider_id``: The colliding object's ID. + +``linear_velocity``: The colliding object's velocity :ref:`Vector2`. If the object is an :ref:`Area2D`, the result is ``(0, 0)``. + +``metadata``: The intersecting shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +``normal``: The object's surface normal at the intersection point. + +``point``: The intersection point. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +---- + +.. _class_Physics2DDirectSpaceState_method_intersect_point: + +- :ref:`Array` **intersect_point** **(** :ref:`Vector2` point, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** + +Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``metadata``: The intersecting shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +The number of intersections can be limited with the ``max_results`` parameter, to reduce the processing time. + +Additionally, the method can take an ``exclude`` array of objects or :ref:`RID`\ s that are to be excluded from collisions, a ``collision_mask`` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with :ref:`PhysicsBody2D`\ s or :ref:`Area2D`\ s, respectively. + +**Note:** :ref:`ConcavePolygonShape2D`\ s and :ref:`CollisionPolygon2D`\ s in ``Segments`` build mode are not solid shapes. Therefore, they will not be detected. + +---- + +.. _class_Physics2DDirectSpaceState_method_intersect_point_on_canvas: + +- :ref:`Array` **intersect_point_on_canvas** **(** :ref:`Vector2` point, :ref:`int` canvas_instance_id, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** + +Checks whether a point is inside any solid shape, in a specific canvas layer given by ``canvas_instance_id``. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``metadata``: The intersecting shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +The number of intersections can be limited with the ``max_results`` parameter, to reduce the processing time. + +Additionally, the method can take an ``exclude`` array of objects or :ref:`RID`\ s that are to be excluded from collisions, a ``collision_mask`` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with :ref:`PhysicsBody2D`\ s or :ref:`Area2D`\ s, respectively. + +**Note:** :ref:`ConcavePolygonShape2D`\ s and :ref:`CollisionPolygon2D`\ s in ``Segments`` build mode are not solid shapes. Therefore, they will not be detected. + +---- + +.. _class_Physics2DDirectSpaceState_method_intersect_ray: + +- :ref:`Dictionary` **intersect_ray** **(** :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** + +Intersects a ray in a given space. The returned object is a dictionary with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``metadata``: The intersecting shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +``normal``: The object's surface normal at the intersection point. + +``position``: The intersection point. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +If the ray did not intersect anything, then an empty dictionary is returned instead. + +Additionally, the method can take an ``exclude`` array of objects or :ref:`RID`\ s that are to be excluded from collisions, a ``collision_mask`` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with :ref:`PhysicsBody2D`\ s or :ref:`Area2D`\ s, respectively. + +---- + +.. _class_Physics2DDirectSpaceState_method_intersect_shape: + +- :ref:`Array` **intersect_shape** **(** :ref:`Physics2DShapeQueryParameters` shape, :ref:`int` max_results=32 **)** + +Checks the intersections of a shape, given through a :ref:`Physics2DShapeQueryParameters` object, against the space. + +**Note:** This method does not take into account the ``motion`` property of the object. The intersected shapes are returned in an array containing dictionaries with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``metadata``: The intersecting shape's metadata. This metadata is different from :ref:`Object.get_meta`, and is set with :ref:`Physics2DServer.shape_set_data`. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +The number of intersections can be limited with the ``max_results`` parameter, to reduce the processing time. + +.. |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.)` diff --git a/classes/class_physics2dserver.rst b/classes/class_physics2dserver.rst new file mode 100644 index 0000000..bc3e97f --- /dev/null +++ b/classes/class_physics2dserver.rst @@ -0,0 +1,1368 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Physics2DServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Physics2DServer: + +Physics2DServer +=============== + +**Inherits:** :ref:`Object` + +Server interface for low-level 2D physics access. + +Description +----------- + +Physics2DServer is the server responsible for all 2D physics. It can create many kinds of physics objects, but does not insert them on the node tree. + +Methods +------- + ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_add_shape` **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`bool` disabled=false **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_attach_canvas_instance_id` **(** :ref:`RID` area, :ref:`int` id **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_attach_object_instance_id` **(** :ref:`RID` area, :ref:`int` id **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_clear_shapes` **(** :ref:`RID` area **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`area_get_canvas_instance_id` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`area_get_object_instance_id` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`area_get_param` **(** :ref:`RID` area, :ref:`AreaParameter` param **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_get_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`area_get_shape_count` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`area_get_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_get_space` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AreaSpaceOverrideMode` | :ref:`area_get_space_override_mode` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`area_get_transform` **(** :ref:`RID` area **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_remove_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_area_monitor_callback` **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_collision_layer` **(** :ref:`RID` area, :ref:`int` layer **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_collision_mask` **(** :ref:`RID` area, :ref:`int` mask **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_monitor_callback` **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_monitorable` **(** :ref:`RID` area, :ref:`bool` monitorable **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_param` **(** :ref:`RID` area, :ref:`AreaParameter` param, :ref:`Variant` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape_disabled` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`bool` disabled **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Transform2D` transform **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_space` **(** :ref:`RID` area, :ref:`RID` space **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_space_override_mode` **(** :ref:`RID` area, :ref:`AreaSpaceOverrideMode` mode **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_transform` **(** :ref:`RID` area, :ref:`Transform2D` transform **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_central_force` **(** :ref:`RID` body, :ref:`Vector2` force **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_force` **(** :ref:`RID` body, :ref:`Vector2` offset, :ref:`Vector2` force **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_shape` **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`bool` disabled=false **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_torque` **(** :ref:`RID` body, :ref:`float` torque **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_central_impulse` **(** :ref:`RID` body, :ref:`Vector2` impulse **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_impulse` **(** :ref:`RID` body, :ref:`Vector2` position, :ref:`Vector2` impulse **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_torque_impulse` **(** :ref:`RID` body, :ref:`float` impulse **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_attach_canvas_instance_id` **(** :ref:`RID` body, :ref:`int` id **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_attach_object_instance_id` **(** :ref:`RID` body, :ref:`int` id **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_clear_shapes` **(** :ref:`RID` body **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_canvas_instance_id` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_collision_layer` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_collision_mask` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`CCDMode` | :ref:`body_get_continuous_collision_detection_mode` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Physics2DDirectBodyState` | :ref:`body_get_direct_state` **(** :ref:`RID` body **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_max_contacts_reported` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BodyMode` | :ref:`body_get_mode` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_object_instance_id` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`body_get_param` **(** :ref:`RID` body, :ref:`BodyParameter` param **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_get_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_shape_count` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`body_get_shape_metadata` **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`body_get_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_get_space` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`body_get_state` **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_is_omitting_force_integration` **(** :ref:`RID` body **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_remove_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_remove_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_axis_velocity` **(** :ref:`RID` body, :ref:`Vector2` axis_velocity **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_collision_layer` **(** :ref:`RID` body, :ref:`int` layer **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_collision_mask` **(** :ref:`RID` body, :ref:`int` mask **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_continuous_collision_detection_mode` **(** :ref:`RID` body, :ref:`CCDMode` mode **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_force_integration_callback` **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_max_contacts_reported` **(** :ref:`RID` body, :ref:`int` amount **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_mode` **(** :ref:`RID` body, :ref:`BodyMode` mode **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_omit_force_integration` **(** :ref:`RID` body, :ref:`bool` enable **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_param` **(** :ref:`RID` body, :ref:`BodyParameter` param, :ref:`float` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_as_one_way_collision` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` enable, :ref:`float` margin **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_disabled` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` disabled **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_metadata` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Variant` metadata **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Transform2D` transform **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_space` **(** :ref:`RID` body, :ref:`RID` space **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_state` **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_test_motion` **(** :ref:`RID` body, :ref:`Transform2D` from, :ref:`Vector2` motion, :ref:`bool` infinite_inertia, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=null, :ref:`bool` exclude_raycast_shapes=true, :ref:`Array` exclude=[ ] **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`capsule_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`circle_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`concave_polygon_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`convex_polygon_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`damped_spring_joint_create` **(** :ref:`Vector2` anchor_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`damped_string_joint_get_param` **(** :ref:`RID` joint, :ref:`DampedStringParam` param **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`damped_string_joint_set_param` **(** :ref:`RID` joint, :ref:`DampedStringParam` param, :ref:`float` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`free_rid` **(** :ref:`RID` rid **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_process_info` **(** :ref:`ProcessInfo` process_info **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`groove_joint_create` **(** :ref:`Vector2` groove1_a, :ref:`Vector2` groove2_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`joint_get_param` **(** :ref:`RID` joint, :ref:`JointParam` param **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`JointType` | :ref:`joint_get_type` **(** :ref:`RID` joint **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`joint_set_param` **(** :ref:`RID` joint, :ref:`JointParam` param, :ref:`float` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`line_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`pin_joint_create` **(** :ref:`Vector2` anchor, :ref:`RID` body_a, :ref:`RID` body_b **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`ray_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`rectangle_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`segment_shape_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_active` **(** :ref:`bool` active **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_iterations` **(** :ref:`int` iterations **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`shape_get_data` **(** :ref:`RID` shape **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ShapeType` | :ref:`shape_get_type` **(** :ref:`RID` shape **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_set_data` **(** :ref:`RID` shape, :ref:`Variant` data **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`space_create` **(** **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Physics2DDirectSpaceState` | :ref:`space_get_direct_state` **(** :ref:`RID` space **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`space_get_param` **(** :ref:`RID` space, :ref:`SpaceParameter` param **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`space_is_active` **(** :ref:`RID` space **)** |const| | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`space_set_active` **(** :ref:`RID` space, :ref:`bool` active **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`space_set_param` **(** :ref:`RID` space, :ref:`SpaceParameter` param, :ref:`float` value **)** | ++--------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Physics2DServer_SpaceParameter: + +.. _class_Physics2DServer_constant_SPACE_PARAM_CONTACT_RECYCLE_RADIUS: + +.. _class_Physics2DServer_constant_SPACE_PARAM_CONTACT_MAX_SEPARATION: + +.. _class_Physics2DServer_constant_SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: + +.. _class_Physics2DServer_constant_SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: + +.. _class_Physics2DServer_constant_SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: + +.. _class_Physics2DServer_constant_SPACE_PARAM_BODY_TIME_TO_SLEEP: + +.. _class_Physics2DServer_constant_SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: + +enum **SpaceParameter**: + +- **SPACE_PARAM_CONTACT_RECYCLE_RADIUS** = **0** --- Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. + +- **SPACE_PARAM_CONTACT_MAX_SEPARATION** = **1** --- Constant to set/get the maximum distance a shape can be from another before they are considered separated. + +- **SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION** = **2** --- Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. + +- **SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD** = **3** --- Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + +- **SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD** = **4** --- Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + +- **SPACE_PARAM_BODY_TIME_TO_SLEEP** = **5** --- Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. + +- **SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS** = **6** --- Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. + +---- + +.. _enum_Physics2DServer_ShapeType: + +.. _class_Physics2DServer_constant_SHAPE_LINE: + +.. _class_Physics2DServer_constant_SHAPE_RAY: + +.. _class_Physics2DServer_constant_SHAPE_SEGMENT: + +.. _class_Physics2DServer_constant_SHAPE_CIRCLE: + +.. _class_Physics2DServer_constant_SHAPE_RECTANGLE: + +.. _class_Physics2DServer_constant_SHAPE_CAPSULE: + +.. _class_Physics2DServer_constant_SHAPE_CONVEX_POLYGON: + +.. _class_Physics2DServer_constant_SHAPE_CONCAVE_POLYGON: + +.. _class_Physics2DServer_constant_SHAPE_CUSTOM: + +enum **ShapeType**: + +- **SHAPE_LINE** = **0** --- This is the constant for creating line shapes. A line shape is an infinite line with an origin point, and a normal. Thus, it can be used for front/behind checks. + +- **SHAPE_RAY** = **1** + +- **SHAPE_SEGMENT** = **2** --- This is the constant for creating segment shapes. A segment shape is a line from a point A to a point B. It can be checked for intersections. + +- **SHAPE_CIRCLE** = **3** --- This is the constant for creating circle shapes. A circle shape only has a radius. It can be used for intersections and inside/outside checks. + +- **SHAPE_RECTANGLE** = **4** --- This is the constant for creating rectangle shapes. A rectangle shape is defined by a width and a height. It can be used for intersections and inside/outside checks. + +- **SHAPE_CAPSULE** = **5** --- This is the constant for creating capsule shapes. A capsule shape is defined by a radius and a length. It can be used for intersections and inside/outside checks. + +- **SHAPE_CONVEX_POLYGON** = **6** --- This is the constant for creating convex polygon shapes. A polygon is defined by a list of points. It can be used for intersections and inside/outside checks. Unlike the :ref:`CollisionPolygon2D.polygon` property, polygons modified with :ref:`shape_set_data` do not verify that the points supplied form is a convex polygon. + +- **SHAPE_CONCAVE_POLYGON** = **7** --- This is the constant for creating concave polygon shapes. A polygon is defined by a list of points. It can be used for intersections checks, but not for inside/outside checks. + +- **SHAPE_CUSTOM** = **8** --- This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. + +---- + +.. _enum_Physics2DServer_AreaParameter: + +.. _class_Physics2DServer_constant_AREA_PARAM_GRAVITY: + +.. _class_Physics2DServer_constant_AREA_PARAM_GRAVITY_VECTOR: + +.. _class_Physics2DServer_constant_AREA_PARAM_GRAVITY_IS_POINT: + +.. _class_Physics2DServer_constant_AREA_PARAM_GRAVITY_DISTANCE_SCALE: + +.. _class_Physics2DServer_constant_AREA_PARAM_GRAVITY_POINT_ATTENUATION: + +.. _class_Physics2DServer_constant_AREA_PARAM_LINEAR_DAMP: + +.. _class_Physics2DServer_constant_AREA_PARAM_ANGULAR_DAMP: + +.. _class_Physics2DServer_constant_AREA_PARAM_PRIORITY: + +enum **AreaParameter**: + +- **AREA_PARAM_GRAVITY** = **0** --- Constant to set/get gravity strength in an area. + +- **AREA_PARAM_GRAVITY_VECTOR** = **1** --- Constant to set/get gravity vector/center in an area. + +- **AREA_PARAM_GRAVITY_IS_POINT** = **2** --- Constant to set/get whether the gravity vector of an area is a direction, or a center point. + +- **AREA_PARAM_GRAVITY_DISTANCE_SCALE** = **3** --- Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. + +- **AREA_PARAM_GRAVITY_POINT_ATTENUATION** = **4** --- This constant was used to set/get the falloff factor for point gravity. It has been superseded by :ref:`AREA_PARAM_GRAVITY_DISTANCE_SCALE`. + +- **AREA_PARAM_LINEAR_DAMP** = **5** --- Constant to set/get the linear dampening factor of an area. + +- **AREA_PARAM_ANGULAR_DAMP** = **6** --- Constant to set/get the angular dampening factor of an area. + +- **AREA_PARAM_PRIORITY** = **7** --- Constant to set/get the priority (order of processing) of an area. + +---- + +.. _enum_Physics2DServer_AreaSpaceOverrideMode: + +.. _class_Physics2DServer_constant_AREA_SPACE_OVERRIDE_DISABLED: + +.. _class_Physics2DServer_constant_AREA_SPACE_OVERRIDE_COMBINE: + +.. _class_Physics2DServer_constant_AREA_SPACE_OVERRIDE_COMBINE_REPLACE: + +.. _class_Physics2DServer_constant_AREA_SPACE_OVERRIDE_REPLACE: + +.. _class_Physics2DServer_constant_AREA_SPACE_OVERRIDE_REPLACE_COMBINE: + +enum **AreaSpaceOverrideMode**: + +- **AREA_SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + +- **AREA_SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. + +- **AREA_SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. + +- **AREA_SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. + +- **AREA_SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. + +---- + +.. _enum_Physics2DServer_BodyMode: + +.. _class_Physics2DServer_constant_BODY_MODE_STATIC: + +.. _class_Physics2DServer_constant_BODY_MODE_KINEMATIC: + +.. _class_Physics2DServer_constant_BODY_MODE_RIGID: + +.. _class_Physics2DServer_constant_BODY_MODE_CHARACTER: + +enum **BodyMode**: + +- **BODY_MODE_STATIC** = **0** --- Constant for static bodies. + +- **BODY_MODE_KINEMATIC** = **1** --- Constant for kinematic bodies. + +- **BODY_MODE_RIGID** = **2** --- Constant for rigid bodies. + +- **BODY_MODE_CHARACTER** = **3** --- Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. + +---- + +.. _enum_Physics2DServer_BodyParameter: + +.. _class_Physics2DServer_constant_BODY_PARAM_BOUNCE: + +.. _class_Physics2DServer_constant_BODY_PARAM_FRICTION: + +.. _class_Physics2DServer_constant_BODY_PARAM_MASS: + +.. _class_Physics2DServer_constant_BODY_PARAM_INERTIA: + +.. _class_Physics2DServer_constant_BODY_PARAM_GRAVITY_SCALE: + +.. _class_Physics2DServer_constant_BODY_PARAM_LINEAR_DAMP: + +.. _class_Physics2DServer_constant_BODY_PARAM_ANGULAR_DAMP: + +.. _class_Physics2DServer_constant_BODY_PARAM_MAX: + +enum **BodyParameter**: + +- **BODY_PARAM_BOUNCE** = **0** --- Constant to set/get a body's bounce factor. + +- **BODY_PARAM_FRICTION** = **1** --- Constant to set/get a body's friction. + +- **BODY_PARAM_MASS** = **2** --- Constant to set/get a body's mass. + +- **BODY_PARAM_INERTIA** = **3** --- Constant to set/get a body's inertia. + +- **BODY_PARAM_GRAVITY_SCALE** = **4** --- Constant to set/get a body's gravity multiplier. + +- **BODY_PARAM_LINEAR_DAMP** = **5** --- Constant to set/get a body's linear dampening factor. + +- **BODY_PARAM_ANGULAR_DAMP** = **6** --- Constant to set/get a body's angular dampening factor. + +- **BODY_PARAM_MAX** = **7** --- Represents the size of the :ref:`BodyParameter` enum. + +---- + +.. _enum_Physics2DServer_BodyState: + +.. _class_Physics2DServer_constant_BODY_STATE_TRANSFORM: + +.. _class_Physics2DServer_constant_BODY_STATE_LINEAR_VELOCITY: + +.. _class_Physics2DServer_constant_BODY_STATE_ANGULAR_VELOCITY: + +.. _class_Physics2DServer_constant_BODY_STATE_SLEEPING: + +.. _class_Physics2DServer_constant_BODY_STATE_CAN_SLEEP: + +enum **BodyState**: + +- **BODY_STATE_TRANSFORM** = **0** --- Constant to set/get the current transform matrix of the body. + +- **BODY_STATE_LINEAR_VELOCITY** = **1** --- Constant to set/get the current linear velocity of the body. + +- **BODY_STATE_ANGULAR_VELOCITY** = **2** --- Constant to set/get the current angular velocity of the body. + +- **BODY_STATE_SLEEPING** = **3** --- Constant to sleep/wake up a body, or to get whether it is sleeping. + +- **BODY_STATE_CAN_SLEEP** = **4** --- Constant to set/get whether the body can sleep. + +---- + +.. _enum_Physics2DServer_JointType: + +.. _class_Physics2DServer_constant_JOINT_PIN: + +.. _class_Physics2DServer_constant_JOINT_GROOVE: + +.. _class_Physics2DServer_constant_JOINT_DAMPED_SPRING: + +enum **JointType**: + +- **JOINT_PIN** = **0** --- Constant to create pin joints. + +- **JOINT_GROOVE** = **1** --- Constant to create groove joints. + +- **JOINT_DAMPED_SPRING** = **2** --- Constant to create damped spring joints. + +---- + +.. _enum_Physics2DServer_JointParam: + +.. _class_Physics2DServer_constant_JOINT_PARAM_BIAS: + +.. _class_Physics2DServer_constant_JOINT_PARAM_MAX_BIAS: + +.. _class_Physics2DServer_constant_JOINT_PARAM_MAX_FORCE: + +enum **JointParam**: + +- **JOINT_PARAM_BIAS** = **0** + +- **JOINT_PARAM_MAX_BIAS** = **1** + +- **JOINT_PARAM_MAX_FORCE** = **2** + +---- + +.. _enum_Physics2DServer_DampedStringParam: + +.. _class_Physics2DServer_constant_DAMPED_STRING_REST_LENGTH: + +.. _class_Physics2DServer_constant_DAMPED_STRING_STIFFNESS: + +.. _class_Physics2DServer_constant_DAMPED_STRING_DAMPING: + +enum **DampedStringParam**: + +- **DAMPED_STRING_REST_LENGTH** = **0** --- Sets the resting length of the spring joint. The joint will always try to go to back this length when pulled apart. + +- **DAMPED_STRING_STIFFNESS** = **1** --- Sets the stiffness of the spring joint. The joint applies a force equal to the stiffness times the distance from its resting length. + +- **DAMPED_STRING_DAMPING** = **2** --- Sets the damping ratio of the spring joint. A value of 0 indicates an undamped spring, while 1 causes the system to reach equilibrium as fast as possible (critical damping). + +---- + +.. _enum_Physics2DServer_CCDMode: + +.. _class_Physics2DServer_constant_CCD_MODE_DISABLED: + +.. _class_Physics2DServer_constant_CCD_MODE_CAST_RAY: + +.. _class_Physics2DServer_constant_CCD_MODE_CAST_SHAPE: + +enum **CCDMode**: + +- **CCD_MODE_DISABLED** = **0** --- Disables continuous collision detection. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. + +- **CCD_MODE_CAST_RAY** = **1** --- Enables continuous collision detection by raycasting. It is faster than shapecasting, but less precise. + +- **CCD_MODE_CAST_SHAPE** = **2** --- Enables continuous collision detection by shapecasting. It is the slowest CCD method, and the most precise. + +---- + +.. _enum_Physics2DServer_AreaBodyStatus: + +.. _class_Physics2DServer_constant_AREA_BODY_ADDED: + +.. _class_Physics2DServer_constant_AREA_BODY_REMOVED: + +enum **AreaBodyStatus**: + +- **AREA_BODY_ADDED** = **0** --- The value of the first parameter and area callback function receives, when an object enters one of its shapes. + +- **AREA_BODY_REMOVED** = **1** --- The value of the first parameter and area callback function receives, when an object exits one of its shapes. + +---- + +.. _enum_Physics2DServer_ProcessInfo: + +.. _class_Physics2DServer_constant_INFO_ACTIVE_OBJECTS: + +.. _class_Physics2DServer_constant_INFO_COLLISION_PAIRS: + +.. _class_Physics2DServer_constant_INFO_ISLAND_COUNT: + +enum **ProcessInfo**: + +- **INFO_ACTIVE_OBJECTS** = **0** --- Constant to get the number of objects that are not sleeping. + +- **INFO_COLLISION_PAIRS** = **1** --- Constant to get the number of possible collisions. + +- **INFO_ISLAND_COUNT** = **2** --- Constant to get the number of space regions where a collision could occur. + +Method Descriptions +------------------- + +.. _class_Physics2DServer_method_area_add_shape: + +- void **area_add_shape** **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`bool` disabled=false **)** + +Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + +---- + +.. _class_Physics2DServer_method_area_attach_canvas_instance_id: + +- void **area_attach_canvas_instance_id** **(** :ref:`RID` area, :ref:`int` id **)** + +---- + +.. _class_Physics2DServer_method_area_attach_object_instance_id: + +- void **area_attach_object_instance_id** **(** :ref:`RID` area, :ref:`int` id **)** + +Assigns the area to a descendant of :ref:`Object`, so it can exist in the node tree. + +---- + +.. _class_Physics2DServer_method_area_clear_shapes: + +- void **area_clear_shapes** **(** :ref:`RID` area **)** + +Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. + +---- + +.. _class_Physics2DServer_method_area_create: + +- :ref:`RID` **area_create** **(** **)** + +Creates an :ref:`Area2D`. After creating an :ref:`Area2D` with this method, assign it to a space using :ref:`area_set_space` to use the created :ref:`Area2D` in the physics world. + +---- + +.. _class_Physics2DServer_method_area_get_canvas_instance_id: + +- :ref:`int` **area_get_canvas_instance_id** **(** :ref:`RID` area **)** |const| + +---- + +.. _class_Physics2DServer_method_area_get_object_instance_id: + +- :ref:`int` **area_get_object_instance_id** **(** :ref:`RID` area **)** |const| + +Gets the instance ID of the object the area is assigned to. + +---- + +.. _class_Physics2DServer_method_area_get_param: + +- :ref:`Variant` **area_get_param** **(** :ref:`RID` area, :ref:`AreaParameter` param **)** |const| + +Returns an area parameter value. See :ref:`AreaParameter` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_area_get_shape: + +- :ref:`RID` **area_get_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| + +Returns the :ref:`RID` of the nth shape of an area. + +---- + +.. _class_Physics2DServer_method_area_get_shape_count: + +- :ref:`int` **area_get_shape_count** **(** :ref:`RID` area **)** |const| + +Returns the number of shapes assigned to an area. + +---- + +.. _class_Physics2DServer_method_area_get_shape_transform: + +- :ref:`Transform2D` **area_get_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| + +Returns the transform matrix of a shape within an area. + +---- + +.. _class_Physics2DServer_method_area_get_space: + +- :ref:`RID` **area_get_space** **(** :ref:`RID` area **)** |const| + +Returns the space assigned to the area. + +---- + +.. _class_Physics2DServer_method_area_get_space_override_mode: + +- :ref:`AreaSpaceOverrideMode` **area_get_space_override_mode** **(** :ref:`RID` area **)** |const| + +Returns the space override mode for the area. + +---- + +.. _class_Physics2DServer_method_area_get_transform: + +- :ref:`Transform2D` **area_get_transform** **(** :ref:`RID` area **)** |const| + +Returns the transform matrix for an area. + +---- + +.. _class_Physics2DServer_method_area_remove_shape: + +- void **area_remove_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** + +Removes a shape from an area. It does not delete the shape, so it can be reassigned later. + +---- + +.. _class_Physics2DServer_method_area_set_area_monitor_callback: + +- void **area_set_area_monitor_callback** **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** + +---- + +.. _class_Physics2DServer_method_area_set_collision_layer: + +- void **area_set_collision_layer** **(** :ref:`RID` area, :ref:`int` layer **)** + +Assigns the area to one or many physics layers. + +---- + +.. _class_Physics2DServer_method_area_set_collision_mask: + +- void **area_set_collision_mask** **(** :ref:`RID` area, :ref:`int` mask **)** + +Sets which physics layers the area will monitor. + +---- + +.. _class_Physics2DServer_method_area_set_monitor_callback: + +- void **area_set_monitor_callback** **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** + +Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: + +1: :ref:`AREA_BODY_ADDED` or :ref:`AREA_BODY_REMOVED`, depending on whether the object entered or exited the area. + +2: :ref:`RID` of the object that entered/exited the area. + +3: Instance ID of the object that entered/exited the area. + +4: The shape index of the object that entered/exited the area. + +5: The shape index of the area where the object entered/exited. + +---- + +.. _class_Physics2DServer_method_area_set_monitorable: + +- void **area_set_monitorable** **(** :ref:`RID` area, :ref:`bool` monitorable **)** + +---- + +.. _class_Physics2DServer_method_area_set_param: + +- void **area_set_param** **(** :ref:`RID` area, :ref:`AreaParameter` param, :ref:`Variant` value **)** + +Sets the value for an area parameter. See :ref:`AreaParameter` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_area_set_shape: + +- void **area_set_shape** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** + +Substitutes a given area shape by another. The old shape is selected by its index, the new one by its :ref:`RID`. + +---- + +.. _class_Physics2DServer_method_area_set_shape_disabled: + +- void **area_set_shape_disabled** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`bool` disabled **)** + +Disables a given shape in an area. + +---- + +.. _class_Physics2DServer_method_area_set_shape_transform: + +- void **area_set_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Transform2D` transform **)** + +Sets the transform matrix for an area shape. + +---- + +.. _class_Physics2DServer_method_area_set_space: + +- void **area_set_space** **(** :ref:`RID` area, :ref:`RID` space **)** + +Assigns a space to the area. + +---- + +.. _class_Physics2DServer_method_area_set_space_override_mode: + +- void **area_set_space_override_mode** **(** :ref:`RID` area, :ref:`AreaSpaceOverrideMode` mode **)** + +Sets the space override mode for the area. See :ref:`AreaSpaceOverrideMode` for a list of available modes. + +---- + +.. _class_Physics2DServer_method_area_set_transform: + +- void **area_set_transform** **(** :ref:`RID` area, :ref:`Transform2D` transform **)** + +Sets the transform matrix for an area. + +---- + +.. _class_Physics2DServer_method_body_add_central_force: + +- void **body_add_central_force** **(** :ref:`RID` body, :ref:`Vector2` force **)** + +---- + +.. _class_Physics2DServer_method_body_add_collision_exception: + +- void **body_add_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** + +Adds a body to the list of bodies exempt from collisions. + +---- + +.. _class_Physics2DServer_method_body_add_force: + +- void **body_add_force** **(** :ref:`RID` body, :ref:`Vector2` offset, :ref:`Vector2` force **)** + +Adds a positioned force to the applied force and torque. As with :ref:`body_apply_impulse`, both the force and the offset from the body origin are in global coordinates. A force differs from an impulse in that, while the two are forces, the impulse clears itself after being applied. + +---- + +.. _class_Physics2DServer_method_body_add_shape: + +- void **body_add_shape** **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`bool` disabled=false **)** + +Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + +---- + +.. _class_Physics2DServer_method_body_add_torque: + +- void **body_add_torque** **(** :ref:`RID` body, :ref:`float` torque **)** + +---- + +.. _class_Physics2DServer_method_body_apply_central_impulse: + +- void **body_apply_central_impulse** **(** :ref:`RID` body, :ref:`Vector2` impulse **)** + +---- + +.. _class_Physics2DServer_method_body_apply_impulse: + +- void **body_apply_impulse** **(** :ref:`RID` body, :ref:`Vector2` position, :ref:`Vector2` impulse **)** + +Adds a positioned impulse to the applied force and torque. Both the force and the offset from the body origin are in global coordinates. + +---- + +.. _class_Physics2DServer_method_body_apply_torque_impulse: + +- void **body_apply_torque_impulse** **(** :ref:`RID` body, :ref:`float` impulse **)** + +---- + +.. _class_Physics2DServer_method_body_attach_canvas_instance_id: + +- void **body_attach_canvas_instance_id** **(** :ref:`RID` body, :ref:`int` id **)** + +---- + +.. _class_Physics2DServer_method_body_attach_object_instance_id: + +- void **body_attach_object_instance_id** **(** :ref:`RID` body, :ref:`int` id **)** + +Assigns the area to a descendant of :ref:`Object`, so it can exist in the node tree. + +---- + +.. _class_Physics2DServer_method_body_clear_shapes: + +- void **body_clear_shapes** **(** :ref:`RID` body **)** + +Removes all shapes from a body. + +---- + +.. _class_Physics2DServer_method_body_create: + +- :ref:`RID` **body_create** **(** **)** + +Creates a physics body. + +---- + +.. _class_Physics2DServer_method_body_get_canvas_instance_id: + +- :ref:`int` **body_get_canvas_instance_id** **(** :ref:`RID` body **)** |const| + +---- + +.. _class_Physics2DServer_method_body_get_collision_layer: + +- :ref:`int` **body_get_collision_layer** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers a body belongs to. + +---- + +.. _class_Physics2DServer_method_body_get_collision_mask: + +- :ref:`int` **body_get_collision_mask** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers a body can collide with. + +---- + +.. _class_Physics2DServer_method_body_get_continuous_collision_detection_mode: + +- :ref:`CCDMode` **body_get_continuous_collision_detection_mode** **(** :ref:`RID` body **)** |const| + +Returns the continuous collision detection mode. + +---- + +.. _class_Physics2DServer_method_body_get_direct_state: + +- :ref:`Physics2DDirectBodyState` **body_get_direct_state** **(** :ref:`RID` body **)** + +Returns the :ref:`Physics2DDirectBodyState` of the body. Returns ``null`` if the body is destroyed or removed from the physics space. + +---- + +.. _class_Physics2DServer_method_body_get_max_contacts_reported: + +- :ref:`int` **body_get_max_contacts_reported** **(** :ref:`RID` body **)** |const| + +Returns the maximum contacts that can be reported. See :ref:`body_set_max_contacts_reported`. + +---- + +.. _class_Physics2DServer_method_body_get_mode: + +- :ref:`BodyMode` **body_get_mode** **(** :ref:`RID` body **)** |const| + +Returns the body mode. + +---- + +.. _class_Physics2DServer_method_body_get_object_instance_id: + +- :ref:`int` **body_get_object_instance_id** **(** :ref:`RID` body **)** |const| + +Gets the instance ID of the object the area is assigned to. + +---- + +.. _class_Physics2DServer_method_body_get_param: + +- :ref:`float` **body_get_param** **(** :ref:`RID` body, :ref:`BodyParameter` param **)** |const| + +Returns the value of a body parameter. See :ref:`BodyParameter` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_body_get_shape: + +- :ref:`RID` **body_get_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| + +Returns the :ref:`RID` of the nth shape of a body. + +---- + +.. _class_Physics2DServer_method_body_get_shape_count: + +- :ref:`int` **body_get_shape_count** **(** :ref:`RID` body **)** |const| + +Returns the number of shapes assigned to a body. + +---- + +.. _class_Physics2DServer_method_body_get_shape_metadata: + +- :ref:`Variant` **body_get_shape_metadata** **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| + +Returns the metadata of a shape of a body. + +---- + +.. _class_Physics2DServer_method_body_get_shape_transform: + +- :ref:`Transform2D` **body_get_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| + +Returns the transform matrix of a body shape. + +---- + +.. _class_Physics2DServer_method_body_get_space: + +- :ref:`RID` **body_get_space** **(** :ref:`RID` body **)** |const| + +Returns the :ref:`RID` of the space assigned to a body. + +---- + +.. _class_Physics2DServer_method_body_get_state: + +- :ref:`Variant` **body_get_state** **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| + +Returns a body state. + +---- + +.. _class_Physics2DServer_method_body_is_omitting_force_integration: + +- :ref:`bool` **body_is_omitting_force_integration** **(** :ref:`RID` body **)** |const| + +Returns whether a body uses a callback function to calculate its own physics (see :ref:`body_set_force_integration_callback`). + +---- + +.. _class_Physics2DServer_method_body_remove_collision_exception: + +- void **body_remove_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** + +Removes a body from the list of bodies exempt from collisions. + +---- + +.. _class_Physics2DServer_method_body_remove_shape: + +- void **body_remove_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** + +Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. + +---- + +.. _class_Physics2DServer_method_body_set_axis_velocity: + +- void **body_set_axis_velocity** **(** :ref:`RID` body, :ref:`Vector2` axis_velocity **)** + +Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + +---- + +.. _class_Physics2DServer_method_body_set_collision_layer: + +- void **body_set_collision_layer** **(** :ref:`RID` body, :ref:`int` layer **)** + +Sets the physics layer or layers a body belongs to. + +---- + +.. _class_Physics2DServer_method_body_set_collision_mask: + +- void **body_set_collision_mask** **(** :ref:`RID` body, :ref:`int` mask **)** + +Sets the physics layer or layers a body can collide with. + +---- + +.. _class_Physics2DServer_method_body_set_continuous_collision_detection_mode: + +- void **body_set_continuous_collision_detection_mode** **(** :ref:`RID` body, :ref:`CCDMode` mode **)** + +Sets the continuous collision detection mode using one of the :ref:`CCDMode` constants. + +Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + +---- + +.. _class_Physics2DServer_method_body_set_force_integration_callback: + +- void **body_set_force_integration_callback** **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** + +Sets the function used to calculate physics for an object, if that object allows it (see :ref:`body_set_omit_force_integration`). + +---- + +.. _class_Physics2DServer_method_body_set_max_contacts_reported: + +- void **body_set_max_contacts_reported** **(** :ref:`RID` body, :ref:`int` amount **)** + +Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. + +---- + +.. _class_Physics2DServer_method_body_set_mode: + +- void **body_set_mode** **(** :ref:`RID` body, :ref:`BodyMode` mode **)** + +Sets the body mode using one of the :ref:`BodyMode` constants. + +---- + +.. _class_Physics2DServer_method_body_set_omit_force_integration: + +- void **body_set_omit_force_integration** **(** :ref:`RID` body, :ref:`bool` enable **)** + +Sets whether a body uses a callback function to calculate its own physics (see :ref:`body_set_force_integration_callback`). + +---- + +.. _class_Physics2DServer_method_body_set_param: + +- void **body_set_param** **(** :ref:`RID` body, :ref:`BodyParameter` param, :ref:`float` value **)** + +Sets a body parameter. See :ref:`BodyParameter` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_body_set_shape: + +- void **body_set_shape** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** + +Substitutes a given body shape by another. The old shape is selected by its index, the new one by its :ref:`RID`. + +---- + +.. _class_Physics2DServer_method_body_set_shape_as_one_way_collision: + +- void **body_set_shape_as_one_way_collision** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` enable, :ref:`float` margin **)** + +Enables one way collision on body if ``enable`` is ``true``. + +---- + +.. _class_Physics2DServer_method_body_set_shape_disabled: + +- void **body_set_shape_disabled** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` disabled **)** + +Disables shape in body if ``disable`` is ``true``. + +---- + +.. _class_Physics2DServer_method_body_set_shape_metadata: + +- void **body_set_shape_metadata** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Variant` metadata **)** + +Sets metadata of a shape within a body. This metadata is different from :ref:`Object.set_meta`, and can be retrieved on shape queries. + +---- + +.. _class_Physics2DServer_method_body_set_shape_transform: + +- void **body_set_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Transform2D` transform **)** + +Sets the transform matrix for a body shape. + +---- + +.. _class_Physics2DServer_method_body_set_space: + +- void **body_set_space** **(** :ref:`RID` body, :ref:`RID` space **)** + +Assigns a space to the body (see :ref:`space_create`). + +---- + +.. _class_Physics2DServer_method_body_set_state: + +- void **body_set_state** **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` value **)** + +Sets a body state using one of the :ref:`BodyState` constants. + +Note that the method doesn't take effect immediately. The state will change on the next physics frame. + +---- + +.. _class_Physics2DServer_method_body_test_motion: + +- :ref:`bool` **body_test_motion** **(** :ref:`RID` body, :ref:`Transform2D` from, :ref:`Vector2` motion, :ref:`bool` infinite_inertia, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=null, :ref:`bool` exclude_raycast_shapes=true, :ref:`Array` exclude=[ ] **)** + +Returns ``true`` if a collision would result from moving in the given direction from a given point in space. Margin increases the size of the shapes involved in the collision detection. :ref:`Physics2DTestMotionResult` can be passed to return additional information in. + +---- + +.. _class_Physics2DServer_method_capsule_shape_create: + +- :ref:`RID` **capsule_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_circle_shape_create: + +- :ref:`RID` **circle_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_concave_polygon_shape_create: + +- :ref:`RID` **concave_polygon_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_convex_polygon_shape_create: + +- :ref:`RID` **convex_polygon_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_damped_spring_joint_create: + +- :ref:`RID` **damped_spring_joint_create** **(** :ref:`Vector2` anchor_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b **)** + +Creates a damped spring joint between two bodies. If not specified, the second body is assumed to be the joint itself. + +---- + +.. _class_Physics2DServer_method_damped_string_joint_get_param: + +- :ref:`float` **damped_string_joint_get_param** **(** :ref:`RID` joint, :ref:`DampedStringParam` param **)** |const| + +Returns the value of a damped spring joint parameter. + +---- + +.. _class_Physics2DServer_method_damped_string_joint_set_param: + +- void **damped_string_joint_set_param** **(** :ref:`RID` joint, :ref:`DampedStringParam` param, :ref:`float` value **)** + +Sets a damped spring joint parameter. See :ref:`DampedStringParam` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_free_rid: + +- void **free_rid** **(** :ref:`RID` rid **)** + +Destroys any of the objects created by Physics2DServer. If the :ref:`RID` passed is not one of the objects that can be created by Physics2DServer, an error will be sent to the console. + +---- + +.. _class_Physics2DServer_method_get_process_info: + +- :ref:`int` **get_process_info** **(** :ref:`ProcessInfo` process_info **)** + +Returns information about the current state of the 2D physics engine. See :ref:`ProcessInfo` for a list of available states. + +---- + +.. _class_Physics2DServer_method_groove_joint_create: + +- :ref:`RID` **groove_joint_create** **(** :ref:`Vector2` groove1_a, :ref:`Vector2` groove2_a, :ref:`Vector2` anchor_b, :ref:`RID` body_a, :ref:`RID` body_b **)** + +Creates a groove joint between two bodies. If not specified, the bodies are assumed to be the joint itself. + +---- + +.. _class_Physics2DServer_method_joint_get_param: + +- :ref:`float` **joint_get_param** **(** :ref:`RID` joint, :ref:`JointParam` param **)** |const| + +Returns the value of a joint parameter. + +---- + +.. _class_Physics2DServer_method_joint_get_type: + +- :ref:`JointType` **joint_get_type** **(** :ref:`RID` joint **)** |const| + +Returns a joint's type (see :ref:`JointType`). + +---- + +.. _class_Physics2DServer_method_joint_set_param: + +- void **joint_set_param** **(** :ref:`RID` joint, :ref:`JointParam` param, :ref:`float` value **)** + +Sets a joint parameter. See :ref:`JointParam` for a list of available parameters. + +---- + +.. _class_Physics2DServer_method_line_shape_create: + +- :ref:`RID` **line_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_pin_joint_create: + +- :ref:`RID` **pin_joint_create** **(** :ref:`Vector2` anchor, :ref:`RID` body_a, :ref:`RID` body_b **)** + +Creates a pin joint between two bodies. If not specified, the second body is assumed to be the joint itself. + +---- + +.. _class_Physics2DServer_method_ray_shape_create: + +- :ref:`RID` **ray_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_rectangle_shape_create: + +- :ref:`RID` **rectangle_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_segment_shape_create: + +- :ref:`RID` **segment_shape_create** **(** **)** + +---- + +.. _class_Physics2DServer_method_set_active: + +- void **set_active** **(** :ref:`bool` active **)** + +Activates or deactivates the 2D physics engine. + +---- + +.. _class_Physics2DServer_method_set_collision_iterations: + +- void **set_collision_iterations** **(** :ref:`int` iterations **)** + +Sets the amount of iterations for calculating velocities of colliding bodies. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. The default value is ``8``. + +---- + +.. _class_Physics2DServer_method_shape_get_data: + +- :ref:`Variant` **shape_get_data** **(** :ref:`RID` shape **)** |const| + +Returns the shape data. + +---- + +.. _class_Physics2DServer_method_shape_get_type: + +- :ref:`ShapeType` **shape_get_type** **(** :ref:`RID` shape **)** |const| + +Returns a shape's type (see :ref:`ShapeType`). + +---- + +.. _class_Physics2DServer_method_shape_set_data: + +- void **shape_set_data** **(** :ref:`RID` shape, :ref:`Variant` data **)** + +Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created :ref:`shape_get_type`. + +---- + +.. _class_Physics2DServer_method_space_create: + +- :ref:`RID` **space_create** **(** **)** + +Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with :ref:`area_set_space`, or to a body with :ref:`body_set_space`. + +---- + +.. _class_Physics2DServer_method_space_get_direct_state: + +- :ref:`Physics2DDirectSpaceState` **space_get_direct_state** **(** :ref:`RID` space **)** + +Returns the state of a space, a :ref:`Physics2DDirectSpaceState`. This object can be used to make collision/intersection queries. + +---- + +.. _class_Physics2DServer_method_space_get_param: + +- :ref:`float` **space_get_param** **(** :ref:`RID` space, :ref:`SpaceParameter` param **)** |const| + +Returns the value of a space parameter. + +---- + +.. _class_Physics2DServer_method_space_is_active: + +- :ref:`bool` **space_is_active** **(** :ref:`RID` space **)** |const| + +Returns whether the space is active. + +---- + +.. _class_Physics2DServer_method_space_set_active: + +- void **space_set_active** **(** :ref:`RID` space, :ref:`bool` active **)** + +Marks a space as active. It will not have an effect, unless it is assigned to an area or body. + +---- + +.. _class_Physics2DServer_method_space_set_param: + +- void **space_set_param** **(** :ref:`RID` space, :ref:`SpaceParameter` param, :ref:`float` value **)** + +Sets the value for a space parameter. See :ref:`SpaceParameter` for a list of available parameters. + +.. |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.)` diff --git a/classes/class_physics2dshapequeryparameters.rst b/classes/class_physics2dshapequeryparameters.rst new file mode 100644 index 0000000..a1babdc --- /dev/null +++ b/classes/class_physics2dshapequeryparameters.rst @@ -0,0 +1,187 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Physics2DShapeQueryParameters.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Physics2DShapeQueryParameters: + +Physics2DShapeQueryParameters +============================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Parameters to be sent to a 2D shape physics query. + +Description +----------- + +This class contains the shape and other parameters for 2D intersection/collision queries. + +Properties +---------- + ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`bool` | :ref:`collide_with_areas` | ``false`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`bool` | :ref:`collide_with_bodies` | ``true`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`collision_layer` | ``2147483647`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Array` | :ref:`exclude` | ``[ ]`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`float` | :ref:`margin` | ``0.0`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Vector2` | :ref:`motion` | ``Vector2( 0, 0 )`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`RID` | :ref:`shape_rid` | | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Transform2D` | :ref:`transform` | ``Transform2D( 1, 0, 0, 1, 0, 0 )`` | ++---------------------------------------+----------------------------------------------------------------------------------------------+-------------------------------------+ + +Methods +------- + ++------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shape` **(** :ref:`Resource` shape **)** | ++------+--------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Physics2DShapeQueryParameters_property_collide_with_areas: + +- :ref:`bool` **collide_with_areas** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_collide_with_areas(value) | ++-----------+---------------------------------+ +| *Getter* | is_collide_with_areas_enabled() | ++-----------+---------------------------------+ + +If ``true``, the query will take :ref:`Area2D`\ s into account. + +---- + +.. _class_Physics2DShapeQueryParameters_property_collide_with_bodies: + +- :ref:`bool` **collide_with_bodies** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_collide_with_bodies(value) | ++-----------+----------------------------------+ +| *Getter* | is_collide_with_bodies_enabled() | ++-----------+----------------------------------+ + +If ``true``, the query will take :ref:`PhysicsBody2D`\ s into account. + +---- + +.. _class_Physics2DShapeQueryParameters_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``2147483647`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_Physics2DShapeQueryParameters_property_exclude: + +- :ref:`Array` **exclude** + ++-----------+--------------------+ +| *Default* | ``[ ]`` | ++-----------+--------------------+ +| *Setter* | set_exclude(value) | ++-----------+--------------------+ +| *Getter* | get_exclude() | ++-----------+--------------------+ + +The list of objects or object :ref:`RID`\ s that will be excluded from collisions. + +---- + +.. _class_Physics2DShapeQueryParameters_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +The collision margin for the shape. + +---- + +.. _class_Physics2DShapeQueryParameters_property_motion: + +- :ref:`Vector2` **motion** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_motion(value) | ++-----------+---------------------+ +| *Getter* | get_motion() | ++-----------+---------------------+ + +The motion of the shape being queried for. + +---- + +.. _class_Physics2DShapeQueryParameters_property_shape_rid: + +- :ref:`RID` **shape_rid** + ++----------+----------------------+ +| *Setter* | set_shape_rid(value) | ++----------+----------------------+ +| *Getter* | get_shape_rid() | ++----------+----------------------+ + +The queried shape's :ref:`RID`. See also :ref:`set_shape`. + +---- + +.. _class_Physics2DShapeQueryParameters_property_transform: + +- :ref:`Transform2D` **transform** + ++-----------+-------------------------------------+ +| *Default* | ``Transform2D( 1, 0, 0, 1, 0, 0 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-------------------------------------+ +| *Getter* | get_transform() | ++-----------+-------------------------------------+ + +The queried shape's transform matrix. + +Method Descriptions +------------------- + +.. _class_Physics2DShapeQueryParameters_method_set_shape: + +- void **set_shape** **(** :ref:`Resource` shape **)** + +Sets the :ref:`Shape2D` that will be used for collision/intersection queries. + +.. |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.)` diff --git a/classes/class_physics2dtestmotionresult.rst b/classes/class_physics2dtestmotionresult.rst new file mode 100644 index 0000000..dc1ef77 --- /dev/null +++ b/classes/class_physics2dtestmotionresult.rst @@ -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 Physics2DTestMotionResult.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Physics2DTestMotionResult: + +Physics2DTestMotionResult +========================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Object` | :ref:`collider` | | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`collider_id` | ``0`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`RID` | :ref:`collider_rid` | | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`collider_shape` | ``0`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`collider_velocity` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`collision_depth` | ``0.0`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`collision_normal` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`collision_point` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`collision_safe_fraction` | ``0.0`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`collision_unsafe_fraction` | ``0.0`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`motion` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`motion_remainder` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_Physics2DTestMotionResult_property_collider: + +- :ref:`Object` **collider** + ++----------+----------------+ +| *Getter* | get_collider() | ++----------+----------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collider_id: + +- :ref:`int` **collider_id** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Getter* | get_collider_id() | ++-----------+-------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collider_rid: + +- :ref:`RID` **collider_rid** + ++----------+--------------------+ +| *Getter* | get_collider_rid() | ++----------+--------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collider_shape: + +- :ref:`int` **collider_shape** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Getter* | get_collider_shape() | ++-----------+----------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collider_velocity: + +- :ref:`Vector2` **collider_velocity** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Getter* | get_collider_velocity() | ++-----------+-------------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collision_depth: + +- :ref:`float` **collision_depth** + ++-----------+-----------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------+ +| *Getter* | get_collision_depth() | ++-----------+-----------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collision_normal: + +- :ref:`Vector2` **collision_normal** + ++-----------+------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_collision_normal() | ++-----------+------------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collision_point: + +- :ref:`Vector2` **collision_point** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-----------------------+ +| *Getter* | get_collision_point() | ++-----------+-----------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collision_safe_fraction: + +- :ref:`float` **collision_safe_fraction** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Getter* | get_collision_safe_fraction() | ++-----------+-------------------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_collision_unsafe_fraction: + +- :ref:`float` **collision_unsafe_fraction** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Getter* | get_collision_unsafe_fraction() | ++-----------+---------------------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_motion: + +- :ref:`Vector2` **motion** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Getter* | get_motion() | ++-----------+---------------------+ + +---- + +.. _class_Physics2DTestMotionResult_property_motion_remainder: + +- :ref:`Vector2` **motion_remainder** + ++-----------+------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_motion_remainder() | ++-----------+------------------------+ + +.. |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.)` diff --git a/classes/class_physicsbody.rst b/classes/class_physicsbody.rst new file mode 100644 index 0000000..6e690be --- /dev/null +++ b/classes/class_physicsbody.rst @@ -0,0 +1,66 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsBody: + +PhysicsBody +=========== + +**Inherits:** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`KinematicBody`, :ref:`PhysicalBone`, :ref:`RigidBody`, :ref:`StaticBody` + +Base class for all objects affected by physics in 3D space. + +Description +----------- + +PhysicsBody is an abstract base class for implementing a physics body. All \*Body types inherit from it. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +Methods +------- + ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_collision_exception_with` **(** :ref:`Node` body **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_collision_exceptions` **(** **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_collision_exception_with` **(** :ref:`Node` body **)** | ++---------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PhysicsBody_method_add_collision_exception_with: + +- void **add_collision_exception_with** **(** :ref:`Node` body **)** + +Adds a body to the list of bodies that this body can't collide with. + +---- + +.. _class_PhysicsBody_method_get_collision_exceptions: + +- :ref:`Array` **get_collision_exceptions** **(** **)** + +Returns an array of nodes that were added as collision exceptions for this body. + +---- + +.. _class_PhysicsBody_method_remove_collision_exception_with: + +- void **remove_collision_exception_with** **(** :ref:`Node` body **)** + +Removes a body from the list of bodies that this body can't collide 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.)` diff --git a/classes/class_physicsbody2d.rst b/classes/class_physicsbody2d.rst new file mode 100644 index 0000000..0e38f64 --- /dev/null +++ b/classes/class_physicsbody2d.rst @@ -0,0 +1,84 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsBody2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsBody2D: + +PhysicsBody2D +============= + +**Inherits:** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`KinematicBody2D`, :ref:`RigidBody2D`, :ref:`StaticBody2D` + +Base class for all objects affected by physics in 2D space. + +Description +----------- + +PhysicsBody2D is an abstract base class for implementing a physics body. All \*Body2D types inherit from it. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +Properties +---------- + ++-------------------------+----------------------------------------------------+-------------------------------+ +| :ref:`bool` | input_pickable | ``false`` *(parent override)* | ++-------------------------+----------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`layers` | | ++-------------------------+----------------------------------------------------+-------------------------------+ + +Methods +------- + ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_collision_exception_with` **(** :ref:`Node` body **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_collision_exceptions` **(** **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_collision_exception_with` **(** :ref:`Node` body **)** | ++---------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PhysicsBody2D_property_layers: + +- :ref:`int` **layers** + +Both collision_layer and collision_mask. Returns collision_layer when accessed. Updates collision_layer and collision_mask when modified. + +Method Descriptions +------------------- + +.. _class_PhysicsBody2D_method_add_collision_exception_with: + +- void **add_collision_exception_with** **(** :ref:`Node` body **)** + +Adds a body to the list of bodies that this body can't collide with. + +---- + +.. _class_PhysicsBody2D_method_get_collision_exceptions: + +- :ref:`Array` **get_collision_exceptions** **(** **)** + +Returns an array of nodes that were added as collision exceptions for this body. + +---- + +.. _class_PhysicsBody2D_method_remove_collision_exception_with: + +- void **remove_collision_exception_with** **(** :ref:`Node` body **)** + +Removes a body from the list of bodies that this body can't collide 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.)` diff --git a/classes/class_physicsdirectbodystate.rst b/classes/class_physicsdirectbodystate.rst new file mode 100644 index 0000000..565b8e7 --- /dev/null +++ b/classes/class_physicsdirectbodystate.rst @@ -0,0 +1,420 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsDirectBodyState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsDirectBodyState: + +PhysicsDirectBodyState +====================== + +**Inherits:** :ref:`Object` + +Direct access object to a physics body in the :ref:`PhysicsServer`. + +Description +----------- + +Provides direct access to a physics body in the :ref:`PhysicsServer`, allowing safe changes to physics properties. This object is passed via the direct state callback of rigid/character bodies, and is intended for changing the direct state of that body. See :ref:`RigidBody._integrate_forces`. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- :doc:`../tutorials/physics/ray-casting` + +Properties +---------- + ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`angular_velocity` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`center_of_mass` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`inverse_inertia` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`inverse_mass` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`linear_velocity` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`principal_inertia_axes` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`sleeping` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`step` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`total_angular_damp` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`total_gravity` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`total_linear_damp` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`transform` | ++-----------------------------------+---------------------------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_central_force` **(** :ref:`Vector3` force **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_force` **(** :ref:`Vector3` force, :ref:`Vector3` position **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_torque` **(** :ref:`Vector3` torque **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_central_impulse` **(** :ref:`Vector3` j **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_impulse` **(** :ref:`Vector3` position, :ref:`Vector3` j **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_torque_impulse` **(** :ref:`Vector3` j **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_contact_collider` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_collider_id` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_contact_collider_object` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_contact_collider_position` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_collider_shape` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_contact_collider_velocity_at_position` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_count` **(** **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_contact_impulse` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_contact_local_normal` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_contact_local_position` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_contact_local_shape` **(** :ref:`int` contact_idx **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PhysicsDirectSpaceState` | :ref:`get_space_state` **(** **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_velocity_at_local_position` **(** :ref:`Vector3` local_position **)** |const| | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`integrate_forces` **(** **)** | ++---------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PhysicsDirectBodyState_property_angular_velocity: + +- :ref:`Vector3` **angular_velocity** + ++----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++----------+-----------------------------+ + +The body's rotational velocity in axis-angle format. The magnitude of the vector is the rotation rate in *radians* per second. + +---- + +.. _class_PhysicsDirectBodyState_property_center_of_mass: + +- :ref:`Vector3` **center_of_mass** + ++----------+----------------------+ +| *Getter* | get_center_of_mass() | ++----------+----------------------+ + +---- + +.. _class_PhysicsDirectBodyState_property_inverse_inertia: + +- :ref:`Vector3` **inverse_inertia** + ++----------+-----------------------+ +| *Getter* | get_inverse_inertia() | ++----------+-----------------------+ + +The inverse of the inertia of the body. + +---- + +.. _class_PhysicsDirectBodyState_property_inverse_mass: + +- :ref:`float` **inverse_mass** + ++----------+--------------------+ +| *Getter* | get_inverse_mass() | ++----------+--------------------+ + +The inverse of the mass of the body. + +---- + +.. _class_PhysicsDirectBodyState_property_linear_velocity: + +- :ref:`Vector3` **linear_velocity** + ++----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++----------+----------------------------+ + +The body's linear velocity in units per second. + +---- + +.. _class_PhysicsDirectBodyState_property_principal_inertia_axes: + +- :ref:`Basis` **principal_inertia_axes** + ++----------+------------------------------+ +| *Getter* | get_principal_inertia_axes() | ++----------+------------------------------+ + +---- + +.. _class_PhysicsDirectBodyState_property_sleeping: + +- :ref:`bool` **sleeping** + ++----------+------------------------+ +| *Setter* | set_sleep_state(value) | ++----------+------------------------+ +| *Getter* | is_sleeping() | ++----------+------------------------+ + +If ``true``, this body is currently sleeping (not active). + +---- + +.. _class_PhysicsDirectBodyState_property_step: + +- :ref:`float` **step** + ++----------+------------+ +| *Getter* | get_step() | ++----------+------------+ + +The timestep (delta) used for the simulation. + +---- + +.. _class_PhysicsDirectBodyState_property_total_angular_damp: + +- :ref:`float` **total_angular_damp** + ++----------+--------------------------+ +| *Getter* | get_total_angular_damp() | ++----------+--------------------------+ + +The rate at which the body stops rotating, if there are not any other forces moving it. + +---- + +.. _class_PhysicsDirectBodyState_property_total_gravity: + +- :ref:`Vector3` **total_gravity** + ++----------+---------------------+ +| *Getter* | get_total_gravity() | ++----------+---------------------+ + +The total gravity vector being currently applied to this body. + +---- + +.. _class_PhysicsDirectBodyState_property_total_linear_damp: + +- :ref:`float` **total_linear_damp** + ++----------+-------------------------+ +| *Getter* | get_total_linear_damp() | ++----------+-------------------------+ + +The rate at which the body stops moving, if there are not any other forces moving it. + +---- + +.. _class_PhysicsDirectBodyState_property_transform: + +- :ref:`Transform` **transform** + ++----------+----------------------+ +| *Setter* | set_transform(value) | ++----------+----------------------+ +| *Getter* | get_transform() | ++----------+----------------------+ + +The body's transformation matrix. + +Method Descriptions +------------------- + +.. _class_PhysicsDirectBodyState_method_add_central_force: + +- void **add_central_force** **(** :ref:`Vector3` force **)** + +Adds a constant directional force without affecting rotation. + +This is equivalent to ``add_force(force, Vector3(0,0,0))``. + +---- + +.. _class_PhysicsDirectBodyState_method_add_force: + +- void **add_force** **(** :ref:`Vector3` force, :ref:`Vector3` position **)** + +Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + +---- + +.. _class_PhysicsDirectBodyState_method_add_torque: + +- void **add_torque** **(** :ref:`Vector3` torque **)** + +Adds a constant rotational force without affecting position. + +---- + +.. _class_PhysicsDirectBodyState_method_apply_central_impulse: + +- void **apply_central_impulse** **(** :ref:`Vector3` j **)** + +Applies a single directional impulse without affecting rotation. + +This is equivalent to ``apply_impulse(Vector3(0, 0, 0), impulse)``. + +---- + +.. _class_PhysicsDirectBodyState_method_apply_impulse: + +- void **apply_impulse** **(** :ref:`Vector3` position, :ref:`Vector3` j **)** + +Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. + +---- + +.. _class_PhysicsDirectBodyState_method_apply_torque_impulse: + +- void **apply_torque_impulse** **(** :ref:`Vector3` j **)** + +Apply a torque impulse (which will be affected by the body mass and shape). This will rotate the body around the vector ``j`` passed as parameter. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider: + +- :ref:`RID` **get_contact_collider** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's :ref:`RID`. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider_id: + +- :ref:`int` **get_contact_collider_id** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's object id. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider_object: + +- :ref:`Object` **get_contact_collider_object** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider object. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider_position: + +- :ref:`Vector3` **get_contact_collider_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the contact position in the collider. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider_shape: + +- :ref:`int` **get_contact_collider_shape** **(** :ref:`int` contact_idx **)** |const| + +Returns the collider's shape index. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_collider_velocity_at_position: + +- :ref:`Vector3` **get_contact_collider_velocity_at_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the linear velocity vector at the collider's contact point. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_count: + +- :ref:`int` **get_contact_count** **(** **)** |const| + +Returns the number of contacts this body has with other bodies. + +**Note:** By default, this returns 0 unless bodies are configured to monitor contacts. See :ref:`RigidBody.contact_monitor`. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_impulse: + +- :ref:`float` **get_contact_impulse** **(** :ref:`int` contact_idx **)** |const| + +Impulse created by the contact. Only implemented for Bullet physics. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_local_normal: + +- :ref:`Vector3` **get_contact_local_normal** **(** :ref:`int` contact_idx **)** |const| + +Returns the local normal at the contact point. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_local_position: + +- :ref:`Vector3` **get_contact_local_position** **(** :ref:`int` contact_idx **)** |const| + +Returns the local position of the contact point. + +---- + +.. _class_PhysicsDirectBodyState_method_get_contact_local_shape: + +- :ref:`int` **get_contact_local_shape** **(** :ref:`int` contact_idx **)** |const| + +Returns the local shape index of the collision. + +---- + +.. _class_PhysicsDirectBodyState_method_get_space_state: + +- :ref:`PhysicsDirectSpaceState` **get_space_state** **(** **)** + +Returns the current state of the space, useful for queries. + +---- + +.. _class_PhysicsDirectBodyState_method_get_velocity_at_local_position: + +- :ref:`Vector3` **get_velocity_at_local_position** **(** :ref:`Vector3` local_position **)** |const| + +Returns the body's velocity at the given relative position, including both translation and rotation. + +---- + +.. _class_PhysicsDirectBodyState_method_integrate_forces: + +- void **integrate_forces** **(** **)** + +Calls the built-in force integration code. + +.. |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.)` diff --git a/classes/class_physicsdirectspacestate.rst b/classes/class_physicsdirectspacestate.rst new file mode 100644 index 0000000..c6eeb9e --- /dev/null +++ b/classes/class_physicsdirectspacestate.rst @@ -0,0 +1,152 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsDirectSpaceState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsDirectSpaceState: + +PhysicsDirectSpaceState +======================= + +**Inherits:** :ref:`Object` + +Direct access object to a space in the :ref:`PhysicsServer`. + +Description +----------- + +Direct access object to a space in the :ref:`PhysicsServer`. It's used mainly to do queries against objects and areas residing in a given space. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- :doc:`../tutorials/physics/ray-casting` + +Methods +------- + ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`cast_motion` **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`Vector3` motion **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`collide_shape` **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_rest_info` **(** :ref:`PhysicsShapeQueryParameters` shape **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_point` **(** :ref:`Vector3` point, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`intersect_ray` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Array` exclude=[ ], :ref:`int` collision_mask=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`intersect_shape` **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`int` max_results=32 **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PhysicsDirectSpaceState_method_cast_motion: + +- :ref:`Array` **cast_motion** **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`Vector3` motion **)** + +Checks how far a :ref:`Shape` can move without colliding. All the parameters for the query, including the shape, are supplied through a :ref:`PhysicsShapeQueryParameters` object. + +Returns an array with the safe and unsafe proportions (between 0 and 1) of the motion. The safe proportion is the maximum fraction of the motion that can be made without a collision. The unsafe proportion is the minimum fraction of the distance that must be moved for a collision. If no collision is detected a result of ``[1.0, 1.0]`` will be returned. + +**Note:** Any :ref:`Shape`\ s that the shape is already colliding with e.g. inside of, will be ignored. Use :ref:`collide_shape` to determine the :ref:`Shape`\ s that the shape is already colliding with. + +---- + +.. _class_PhysicsDirectSpaceState_method_collide_shape: + +- :ref:`Array` **collide_shape** **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`int` max_results=32 **)** + +Checks the intersections of a shape, given through a :ref:`PhysicsShapeQueryParameters` object, against the space. The resulting array contains a list of points where the shape intersects another. Like with :ref:`intersect_shape`, the number of returned results can be limited to save processing time. + +---- + +.. _class_PhysicsDirectSpaceState_method_get_rest_info: + +- :ref:`Dictionary` **get_rest_info** **(** :ref:`PhysicsShapeQueryParameters` shape **)** + +Checks the intersections of a shape, given through a :ref:`PhysicsShapeQueryParameters` object, against the space. If it collides with more than one shape, the nearest one is selected. The returned object is a dictionary containing the following fields: + +``collider_id``: The colliding object's ID. + +``linear_velocity``: The colliding object's velocity :ref:`Vector3`. If the object is an :ref:`Area`, the result is ``(0, 0, 0)``. + +``normal``: The object's surface normal at the intersection point. + +``point``: The intersection point. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +If the shape did not intersect anything, then an empty dictionary is returned instead. + +---- + +.. _class_PhysicsDirectSpaceState_method_intersect_point: + +- :ref:`Array` **intersect_point** **(** :ref:`Vector3` point, :ref:`int` max_results=32, :ref:`Array` exclude=[ ], :ref:`int` collision_layer=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** + +Checks whether a point is inside any solid shape. The shapes the point is inside of are returned in an array containing dictionaries with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +The number of intersections can be limited with the ``max_results`` parameter, to reduce the processing time. + +Additionally, the method can take an ``exclude`` array of objects or :ref:`RID`\ s that are to be excluded from collisions, a ``collision_mask`` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with :ref:`PhysicsBody`\ s or :ref:`Area`\ s, respectively. + +---- + +.. _class_PhysicsDirectSpaceState_method_intersect_ray: + +- :ref:`Dictionary` **intersect_ray** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`Array` exclude=[ ], :ref:`int` collision_mask=2147483647, :ref:`bool` collide_with_bodies=true, :ref:`bool` collide_with_areas=false **)** + +Intersects a ray in a given space. The returned object is a dictionary with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``normal``: The object's surface normal at the intersection point. + +``position``: The intersection point. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +If the ray did not intersect anything, then an empty dictionary is returned instead. + +Additionally, the method can take an ``exclude`` array of objects or :ref:`RID`\ s that are to be excluded from collisions, a ``collision_mask`` bitmask representing the physics layers to check in, or booleans to determine if the ray should collide with :ref:`PhysicsBody`\ s or :ref:`Area`\ s, respectively. + +---- + +.. _class_PhysicsDirectSpaceState_method_intersect_shape: + +- :ref:`Array` **intersect_shape** **(** :ref:`PhysicsShapeQueryParameters` shape, :ref:`int` max_results=32 **)** + +Checks the intersections of a shape, given through a :ref:`PhysicsShapeQueryParameters` object, against the space. The intersected shapes are returned in an array containing dictionaries with the following fields: + +``collider``: The colliding object. + +``collider_id``: The colliding object's ID. + +``rid``: The intersecting object's :ref:`RID`. + +``shape``: The shape index of the colliding shape. + +The number of intersections can be limited with the ``max_results`` parameter, to reduce the processing time. + +.. |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.)` diff --git a/classes/class_physicsmaterial.rst b/classes/class_physicsmaterial.rst new file mode 100644 index 0000000..64bff98 --- /dev/null +++ b/classes/class_physicsmaterial.rst @@ -0,0 +1,101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsMaterial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsMaterial: + +PhysicsMaterial +=============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A material for physics properties. + +Description +----------- + +Provides a means of modifying the collision properties of a :ref:`PhysicsBody`. + +Properties +---------- + ++---------------------------+------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`absorbent` | ``false`` | ++---------------------------+------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`bounce` | ``0.0`` | ++---------------------------+------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`friction` | ``1.0`` | ++---------------------------+------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`rough` | ``false`` | ++---------------------------+------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_PhysicsMaterial_property_absorbent: + +- :ref:`bool` **absorbent** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_absorbent(value) | ++-----------+----------------------+ +| *Getter* | is_absorbent() | ++-----------+----------------------+ + +If ``true``, subtracts the bounciness from the colliding object's bounciness instead of adding it. + +---- + +.. _class_PhysicsMaterial_property_bounce: + +- :ref:`float` **bounce** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_bounce(value) | ++-----------+-------------------+ +| *Getter* | get_bounce() | ++-----------+-------------------+ + +The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness). + +---- + +.. _class_PhysicsMaterial_property_friction: + +- :ref:`float` **friction** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_friction(value) | ++-----------+---------------------+ +| *Getter* | get_friction() | ++-----------+---------------------+ + +The body's friction. Values range from ``0`` (frictionless) to ``1`` (maximum friction). + +---- + +.. _class_PhysicsMaterial_property_rough: + +- :ref:`bool` **rough** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_rough(value) | ++-----------+------------------+ +| *Getter* | is_rough() | ++-----------+------------------+ + +If ``true``, the physics engine will use the friction of the object marked as "rough" when two objects collide. If ``false``, the physics engine will use the lowest friction of all colliding objects instead. If ``true`` for both colliding objects, the physics engine will use the highest friction. + +.. |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.)` diff --git a/classes/class_physicsserver.rst b/classes/class_physicsserver.rst new file mode 100644 index 0000000..19427c4 --- /dev/null +++ b/classes/class_physicsserver.rst @@ -0,0 +1,1790 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PhysicsServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsServer: + +PhysicsServer +============= + +**Inherits:** :ref:`Object` + +Server interface for low-level physics access. + +Description +----------- + +PhysicsServer is the server responsible for all 3D physics. It can create many kinds of physics objects, but does not insert them on the node tree. + +Methods +------- + ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_add_shape` **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Transform` transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), :ref:`bool` disabled=false **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_attach_object_instance_id` **(** :ref:`RID` area, :ref:`int` id **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_clear_shapes` **(** :ref:`RID` area **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_create` **(** **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`area_get_object_instance_id` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`area_get_param` **(** :ref:`RID` area, :ref:`AreaParameter` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_get_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`area_get_shape_count` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`area_get_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`area_get_space` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AreaSpaceOverrideMode` | :ref:`area_get_space_override_mode` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`area_get_transform` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`area_is_ray_pickable` **(** :ref:`RID` area **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_remove_shape` **(** :ref:`RID` area, :ref:`int` shape_idx **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_area_monitor_callback` **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_collision_layer` **(** :ref:`RID` area, :ref:`int` layer **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_collision_mask` **(** :ref:`RID` area, :ref:`int` mask **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_monitor_callback` **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_monitorable` **(** :ref:`RID` area, :ref:`bool` monitorable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_param` **(** :ref:`RID` area, :ref:`AreaParameter` param, :ref:`Variant` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_ray_pickable` **(** :ref:`RID` area, :ref:`bool` enable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape_disabled` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`bool` disabled **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_shape_transform` **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Transform` transform **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_space` **(** :ref:`RID` area, :ref:`RID` space **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_space_override_mode` **(** :ref:`RID` area, :ref:`AreaSpaceOverrideMode` mode **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`area_set_transform` **(** :ref:`RID` area, :ref:`Transform` transform **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_central_force` **(** :ref:`RID` body, :ref:`Vector3` force **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_force` **(** :ref:`RID` body, :ref:`Vector3` force, :ref:`Vector3` position **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_shape` **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Transform` transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), :ref:`bool` disabled=false **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_add_torque` **(** :ref:`RID` body, :ref:`Vector3` torque **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_central_impulse` **(** :ref:`RID` body, :ref:`Vector3` impulse **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_impulse` **(** :ref:`RID` body, :ref:`Vector3` position, :ref:`Vector3` impulse **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_apply_torque_impulse` **(** :ref:`RID` body, :ref:`Vector3` impulse **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_attach_object_instance_id` **(** :ref:`RID` body, :ref:`int` id **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_clear_shapes` **(** :ref:`RID` body **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_create` **(** :ref:`BodyMode` mode=2, :ref:`bool` init_sleeping=false **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_collision_layer` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_collision_mask` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PhysicsDirectBodyState` | :ref:`body_get_direct_state` **(** :ref:`RID` body **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`body_get_kinematic_safe_margin` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_max_contacts_reported` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BodyMode` | :ref:`body_get_mode` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_object_instance_id` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`body_get_param` **(** :ref:`RID` body, :ref:`BodyParameter` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_get_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`body_get_shape_count` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`body_get_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`body_get_space` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`body_get_state` **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_is_axis_locked` **(** :ref:`RID` body, :ref:`BodyAxis` axis **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_is_continuous_collision_detection_enabled` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_is_omitting_force_integration` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_is_ray_pickable` **(** :ref:`RID` body **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_remove_collision_exception` **(** :ref:`RID` body, :ref:`RID` excepted_body **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_remove_shape` **(** :ref:`RID` body, :ref:`int` shape_idx **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_axis_lock` **(** :ref:`RID` body, :ref:`BodyAxis` axis, :ref:`bool` lock **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_axis_velocity` **(** :ref:`RID` body, :ref:`Vector3` axis_velocity **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_collision_layer` **(** :ref:`RID` body, :ref:`int` layer **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_collision_mask` **(** :ref:`RID` body, :ref:`int` mask **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_enable_continuous_collision_detection` **(** :ref:`RID` body, :ref:`bool` enable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_force_integration_callback` **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_kinematic_safe_margin` **(** :ref:`RID` body, :ref:`float` margin **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_max_contacts_reported` **(** :ref:`RID` body, :ref:`int` amount **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_mode` **(** :ref:`RID` body, :ref:`BodyMode` mode **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_omit_force_integration` **(** :ref:`RID` body, :ref:`bool` enable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_param` **(** :ref:`RID` body, :ref:`BodyParameter` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_ray_pickable` **(** :ref:`RID` body, :ref:`bool` enable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_disabled` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` disabled **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_shape_transform` **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Transform` transform **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_space` **(** :ref:`RID` body, :ref:`RID` space **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`body_set_state` **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`body_test_motion` **(** :ref:`RID` body, :ref:`Transform` from, :ref:`Vector3` motion, :ref:`bool` infinite_inertia, :ref:`PhysicsTestMotionResult` result=null, :ref:`bool` exclude_raycast_shapes=true, :ref:`Array` exclude=[ ] **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cone_twist_joint_get_param` **(** :ref:`RID` joint, :ref:`ConeTwistJointParam` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`cone_twist_joint_set_param` **(** :ref:`RID` joint, :ref:`ConeTwistJointParam` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`free_rid` **(** :ref:`RID` rid **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`generic_6dof_joint_get_flag` **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisFlag` flag **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`generic_6dof_joint_get_param` **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisParam` param **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`generic_6dof_joint_set_flag` **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisFlag` flag, :ref:`bool` enable **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`generic_6dof_joint_set_param` **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisParam` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_process_info` **(** :ref:`ProcessInfo` process_info **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`hinge_joint_get_flag` **(** :ref:`RID` joint, :ref:`HingeJointFlag` flag **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`hinge_joint_get_param` **(** :ref:`RID` joint, :ref:`HingeJointParam` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hinge_joint_set_flag` **(** :ref:`RID` joint, :ref:`HingeJointFlag` flag, :ref:`bool` enabled **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hinge_joint_set_param` **(** :ref:`RID` joint, :ref:`HingeJointParam` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`joint_create_cone_twist` **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`joint_create_generic_6dof` **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`joint_create_hinge` **(** :ref:`RID` body_A, :ref:`Transform` hinge_A, :ref:`RID` body_B, :ref:`Transform` hinge_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`joint_create_pin` **(** :ref:`RID` body_A, :ref:`Vector3` local_A, :ref:`RID` body_B, :ref:`Vector3` local_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`joint_create_slider` **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`joint_get_solver_priority` **(** :ref:`RID` joint **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`JointType` | :ref:`joint_get_type` **(** :ref:`RID` joint **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`joint_set_solver_priority` **(** :ref:`RID` joint, :ref:`int` priority **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`pin_joint_get_local_a` **(** :ref:`RID` joint **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`pin_joint_get_local_b` **(** :ref:`RID` joint **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`pin_joint_get_param` **(** :ref:`RID` joint, :ref:`PinJointParam` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`pin_joint_set_local_a` **(** :ref:`RID` joint, :ref:`Vector3` local_A **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`pin_joint_set_local_b` **(** :ref:`RID` joint, :ref:`Vector3` local_B **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`pin_joint_set_param` **(** :ref:`RID` joint, :ref:`PinJointParam` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_active` **(** :ref:`bool` active **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_iterations` **(** :ref:`int` iterations **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`shape_create` **(** :ref:`ShapeType` type **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`shape_get_data` **(** :ref:`RID` shape **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ShapeType` | :ref:`shape_get_type` **(** :ref:`RID` shape **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shape_set_data` **(** :ref:`RID` shape, :ref:`Variant` data **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`slider_joint_get_param` **(** :ref:`RID` joint, :ref:`SliderJointParam` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`slider_joint_set_param` **(** :ref:`RID` joint, :ref:`SliderJointParam` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`space_create` **(** **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PhysicsDirectSpaceState` | :ref:`space_get_direct_state` **(** :ref:`RID` space **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`space_get_param` **(** :ref:`RID` space, :ref:`SpaceParameter` param **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`space_is_active` **(** :ref:`RID` space **)** |const| | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`space_set_active` **(** :ref:`RID` space, :ref:`bool` active **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`space_set_param` **(** :ref:`RID` space, :ref:`SpaceParameter` param, :ref:`float` value **)** | ++------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PhysicsServer_JointType: + +.. _class_PhysicsServer_constant_JOINT_PIN: + +.. _class_PhysicsServer_constant_JOINT_HINGE: + +.. _class_PhysicsServer_constant_JOINT_SLIDER: + +.. _class_PhysicsServer_constant_JOINT_CONE_TWIST: + +.. _class_PhysicsServer_constant_JOINT_6DOF: + +enum **JointType**: + +- **JOINT_PIN** = **0** --- The :ref:`Joint` is a :ref:`PinJoint`. + +- **JOINT_HINGE** = **1** --- The :ref:`Joint` is a :ref:`HingeJoint`. + +- **JOINT_SLIDER** = **2** --- The :ref:`Joint` is a :ref:`SliderJoint`. + +- **JOINT_CONE_TWIST** = **3** --- The :ref:`Joint` is a :ref:`ConeTwistJoint`. + +- **JOINT_6DOF** = **4** --- The :ref:`Joint` is a :ref:`Generic6DOFJoint`. + +---- + +.. _enum_PhysicsServer_PinJointParam: + +.. _class_PhysicsServer_constant_PIN_JOINT_BIAS: + +.. _class_PhysicsServer_constant_PIN_JOINT_DAMPING: + +.. _class_PhysicsServer_constant_PIN_JOINT_IMPULSE_CLAMP: + +enum **PinJointParam**: + +- **PIN_JOINT_BIAS** = **0** --- The strength with which the pinned objects try to stay in positional relation to each other. + +The higher, the stronger. + +- **PIN_JOINT_DAMPING** = **1** --- The strength with which the pinned objects try to stay in velocity relation to each other. + +The higher, the stronger. + +- **PIN_JOINT_IMPULSE_CLAMP** = **2** --- If above 0, this value is the maximum value for an impulse that this Joint puts on its ends. + +---- + +.. _enum_PhysicsServer_HingeJointParam: + +.. _class_PhysicsServer_constant_HINGE_JOINT_BIAS: + +.. _class_PhysicsServer_constant_HINGE_JOINT_LIMIT_UPPER: + +.. _class_PhysicsServer_constant_HINGE_JOINT_LIMIT_LOWER: + +.. _class_PhysicsServer_constant_HINGE_JOINT_LIMIT_BIAS: + +.. _class_PhysicsServer_constant_HINGE_JOINT_LIMIT_SOFTNESS: + +.. _class_PhysicsServer_constant_HINGE_JOINT_LIMIT_RELAXATION: + +.. _class_PhysicsServer_constant_HINGE_JOINT_MOTOR_TARGET_VELOCITY: + +.. _class_PhysicsServer_constant_HINGE_JOINT_MOTOR_MAX_IMPULSE: + +enum **HingeJointParam**: + +- **HINGE_JOINT_BIAS** = **0** --- The speed with which the two bodies get pulled together when they move in different directions. + +- **HINGE_JOINT_LIMIT_UPPER** = **1** --- The maximum rotation across the Hinge. + +- **HINGE_JOINT_LIMIT_LOWER** = **2** --- The minimum rotation across the Hinge. + +- **HINGE_JOINT_LIMIT_BIAS** = **3** --- The speed with which the rotation across the axis perpendicular to the hinge gets corrected. + +- **HINGE_JOINT_LIMIT_SOFTNESS** = **4** + +- **HINGE_JOINT_LIMIT_RELAXATION** = **5** --- The lower this value, the more the rotation gets slowed down. + +- **HINGE_JOINT_MOTOR_TARGET_VELOCITY** = **6** --- Target speed for the motor. + +- **HINGE_JOINT_MOTOR_MAX_IMPULSE** = **7** --- Maximum acceleration for the motor. + +---- + +.. _enum_PhysicsServer_HingeJointFlag: + +.. _class_PhysicsServer_constant_HINGE_JOINT_FLAG_USE_LIMIT: + +.. _class_PhysicsServer_constant_HINGE_JOINT_FLAG_ENABLE_MOTOR: + +enum **HingeJointFlag**: + +- **HINGE_JOINT_FLAG_USE_LIMIT** = **0** --- If ``true``, the Hinge has a maximum and a minimum rotation. + +- **HINGE_JOINT_FLAG_ENABLE_MOTOR** = **1** --- If ``true``, a motor turns the Hinge. + +---- + +.. _enum_PhysicsServer_SliderJointParam: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_LIMIT_UPPER: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_LIMIT_LOWER: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_LIMIT_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_MOTION_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_MOTION_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_MOTION_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_LIMIT_UPPER: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_LIMIT_LOWER: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_LIMIT_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_MOTION_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING: + +.. _class_PhysicsServer_constant_SLIDER_JOINT_MAX: + +enum **SliderJointParam**: + +- **SLIDER_JOINT_LINEAR_LIMIT_UPPER** = **0** --- The maximum difference between the pivot points on their X axis before damping happens. + +- **SLIDER_JOINT_LINEAR_LIMIT_LOWER** = **1** --- The minimum difference between the pivot points on their X axis before damping happens. + +- **SLIDER_JOINT_LINEAR_LIMIT_SOFTNESS** = **2** --- A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + +- **SLIDER_JOINT_LINEAR_LIMIT_RESTITUTION** = **3** --- The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. + +- **SLIDER_JOINT_LINEAR_LIMIT_DAMPING** = **4** --- The amount of damping once the slider limits are surpassed. + +- **SLIDER_JOINT_LINEAR_MOTION_SOFTNESS** = **5** --- A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + +- **SLIDER_JOINT_LINEAR_MOTION_RESTITUTION** = **6** --- The amount of restitution inside the slider limits. + +- **SLIDER_JOINT_LINEAR_MOTION_DAMPING** = **7** --- The amount of damping inside the slider limits. + +- **SLIDER_JOINT_LINEAR_ORTHOGONAL_SOFTNESS** = **8** --- A factor applied to the movement across axes orthogonal to the slider. + +- **SLIDER_JOINT_LINEAR_ORTHOGONAL_RESTITUTION** = **9** --- The amount of restitution when movement is across axes orthogonal to the slider. + +- **SLIDER_JOINT_LINEAR_ORTHOGONAL_DAMPING** = **10** --- The amount of damping when movement is across axes orthogonal to the slider. + +- **SLIDER_JOINT_ANGULAR_LIMIT_UPPER** = **11** --- The upper limit of rotation in the slider. + +- **SLIDER_JOINT_ANGULAR_LIMIT_LOWER** = **12** --- The lower limit of rotation in the slider. + +- **SLIDER_JOINT_ANGULAR_LIMIT_SOFTNESS** = **13** --- A factor applied to the all rotation once the limit is surpassed. + +- **SLIDER_JOINT_ANGULAR_LIMIT_RESTITUTION** = **14** --- The amount of restitution of the rotation when the limit is surpassed. + +- **SLIDER_JOINT_ANGULAR_LIMIT_DAMPING** = **15** --- The amount of damping of the rotation when the limit is surpassed. + +- **SLIDER_JOINT_ANGULAR_MOTION_SOFTNESS** = **16** --- A factor that gets applied to the all rotation in the limits. + +- **SLIDER_JOINT_ANGULAR_MOTION_RESTITUTION** = **17** --- The amount of restitution of the rotation in the limits. + +- **SLIDER_JOINT_ANGULAR_MOTION_DAMPING** = **18** --- The amount of damping of the rotation in the limits. + +- **SLIDER_JOINT_ANGULAR_ORTHOGONAL_SOFTNESS** = **19** --- A factor that gets applied to the all rotation across axes orthogonal to the slider. + +- **SLIDER_JOINT_ANGULAR_ORTHOGONAL_RESTITUTION** = **20** --- The amount of restitution of the rotation across axes orthogonal to the slider. + +- **SLIDER_JOINT_ANGULAR_ORTHOGONAL_DAMPING** = **21** --- The amount of damping of the rotation across axes orthogonal to the slider. + +- **SLIDER_JOINT_MAX** = **22** --- Represents the size of the :ref:`SliderJointParam` enum. + +---- + +.. _enum_PhysicsServer_ConeTwistJointParam: + +.. _class_PhysicsServer_constant_CONE_TWIST_JOINT_SWING_SPAN: + +.. _class_PhysicsServer_constant_CONE_TWIST_JOINT_TWIST_SPAN: + +.. _class_PhysicsServer_constant_CONE_TWIST_JOINT_BIAS: + +.. _class_PhysicsServer_constant_CONE_TWIST_JOINT_SOFTNESS: + +.. _class_PhysicsServer_constant_CONE_TWIST_JOINT_RELAXATION: + +enum **ConeTwistJointParam**: + +- **CONE_TWIST_JOINT_SWING_SPAN** = **0** --- Swing is rotation from side to side, around the axis perpendicular to the twist axis. + +The swing span defines, how much rotation will not get corrected along the swing axis. + +Could be defined as looseness in the :ref:`ConeTwistJoint`. + +If below 0.05, this behavior is locked. + +- **CONE_TWIST_JOINT_TWIST_SPAN** = **1** --- Twist is the rotation around the twist axis, this value defined how far the joint can twist. + +Twist is locked if below 0.05. + +- **CONE_TWIST_JOINT_BIAS** = **2** --- The speed with which the swing or twist will take place. + +The higher, the faster. + +- **CONE_TWIST_JOINT_SOFTNESS** = **3** --- The ease with which the Joint twists, if it's too low, it takes more force to twist the joint. + +- **CONE_TWIST_JOINT_RELAXATION** = **4** --- Defines, how fast the swing- and twist-speed-difference on both sides gets synced. + +---- + +.. _enum_PhysicsServer_G6DOFJointAxisParam: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_LOWER_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_UPPER_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_RESTITUTION: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_DAMPING: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_LOWER_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_UPPER_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_DAMPING: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_RESTITUTION: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_FORCE_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_ERP: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT: + +enum **G6DOFJointAxisParam**: + +- **G6DOF_JOINT_LINEAR_LOWER_LIMIT** = **0** --- The minimum difference between the pivot points' axes. + +- **G6DOF_JOINT_LINEAR_UPPER_LIMIT** = **1** --- The maximum difference between the pivot points' axes. + +- **G6DOF_JOINT_LINEAR_LIMIT_SOFTNESS** = **2** --- A factor that gets applied to the movement across the axes. The lower, the slower the movement. + +- **G6DOF_JOINT_LINEAR_RESTITUTION** = **3** --- The amount of restitution on the axes movement. The lower, the more velocity-energy gets lost. + +- **G6DOF_JOINT_LINEAR_DAMPING** = **4** --- The amount of damping that happens at the linear motion across the axes. + +- **G6DOF_JOINT_LINEAR_MOTOR_TARGET_VELOCITY** = **5** --- The velocity that the joint's linear motor will attempt to reach. + +- **G6DOF_JOINT_LINEAR_MOTOR_FORCE_LIMIT** = **6** --- The maximum force that the linear motor can apply while trying to reach the target velocity. + +- **G6DOF_JOINT_ANGULAR_LOWER_LIMIT** = **10** --- The minimum rotation in negative direction to break loose and rotate around the axes. + +- **G6DOF_JOINT_ANGULAR_UPPER_LIMIT** = **11** --- The minimum rotation in positive direction to break loose and rotate around the axes. + +- **G6DOF_JOINT_ANGULAR_LIMIT_SOFTNESS** = **12** --- A factor that gets multiplied onto all rotations across the axes. + +- **G6DOF_JOINT_ANGULAR_DAMPING** = **13** --- The amount of rotational damping across the axes. The lower, the more dampening occurs. + +- **G6DOF_JOINT_ANGULAR_RESTITUTION** = **14** --- The amount of rotational restitution across the axes. The lower, the more restitution occurs. + +- **G6DOF_JOINT_ANGULAR_FORCE_LIMIT** = **15** --- The maximum amount of force that can occur, when rotating around the axes. + +- **G6DOF_JOINT_ANGULAR_ERP** = **16** --- When correcting the crossing of limits in rotation across the axes, this error tolerance factor defines how much the correction gets slowed down. The lower, the slower. + +- **G6DOF_JOINT_ANGULAR_MOTOR_TARGET_VELOCITY** = **17** --- Target speed for the motor at the axes. + +- **G6DOF_JOINT_ANGULAR_MOTOR_FORCE_LIMIT** = **18** --- Maximum acceleration for the motor at the axes. + +---- + +.. _enum_PhysicsServer_G6DOFJointAxisFlag: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_FLAG_ENABLE_MOTOR: + +.. _class_PhysicsServer_constant_G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR: + +enum **G6DOFJointAxisFlag**: + +- **G6DOF_JOINT_FLAG_ENABLE_LINEAR_LIMIT** = **0** --- If ``set`` there is linear motion possible within the given limits. + +- **G6DOF_JOINT_FLAG_ENABLE_ANGULAR_LIMIT** = **1** --- If ``set`` there is rotational motion possible. + +- **G6DOF_JOINT_FLAG_ENABLE_MOTOR** = **4** --- If ``set`` there is a rotational motor across these axes. + +- **G6DOF_JOINT_FLAG_ENABLE_LINEAR_MOTOR** = **5** --- If ``set`` there is a linear motor on this axis that targets a specific velocity. + +---- + +.. _enum_PhysicsServer_ShapeType: + +.. _class_PhysicsServer_constant_SHAPE_PLANE: + +.. _class_PhysicsServer_constant_SHAPE_RAY: + +.. _class_PhysicsServer_constant_SHAPE_SPHERE: + +.. _class_PhysicsServer_constant_SHAPE_BOX: + +.. _class_PhysicsServer_constant_SHAPE_CAPSULE: + +.. _class_PhysicsServer_constant_SHAPE_CYLINDER: + +.. _class_PhysicsServer_constant_SHAPE_CONVEX_POLYGON: + +.. _class_PhysicsServer_constant_SHAPE_CONCAVE_POLYGON: + +.. _class_PhysicsServer_constant_SHAPE_HEIGHTMAP: + +.. _class_PhysicsServer_constant_SHAPE_CUSTOM: + +enum **ShapeType**: + +- **SHAPE_PLANE** = **0** --- The :ref:`Shape` is a :ref:`PlaneShape`. + +- **SHAPE_RAY** = **1** --- The :ref:`Shape` is a :ref:`RayShape`. + +- **SHAPE_SPHERE** = **2** --- The :ref:`Shape` is a :ref:`SphereShape`. + +- **SHAPE_BOX** = **3** --- The :ref:`Shape` is a :ref:`BoxShape`. + +- **SHAPE_CAPSULE** = **4** --- The :ref:`Shape` is a :ref:`CapsuleShape`. + +- **SHAPE_CYLINDER** = **5** --- The :ref:`Shape` is a :ref:`CylinderShape`. + +- **SHAPE_CONVEX_POLYGON** = **6** --- The :ref:`Shape` is a :ref:`ConvexPolygonShape`. + +- **SHAPE_CONCAVE_POLYGON** = **7** --- The :ref:`Shape` is a :ref:`ConcavePolygonShape`. + +- **SHAPE_HEIGHTMAP** = **8** --- The :ref:`Shape` is a :ref:`HeightMapShape`. + +- **SHAPE_CUSTOM** = **9** --- This constant is used internally by the engine. Any attempt to create this kind of shape results in an error. + +---- + +.. _enum_PhysicsServer_AreaParameter: + +.. _class_PhysicsServer_constant_AREA_PARAM_GRAVITY: + +.. _class_PhysicsServer_constant_AREA_PARAM_GRAVITY_VECTOR: + +.. _class_PhysicsServer_constant_AREA_PARAM_GRAVITY_IS_POINT: + +.. _class_PhysicsServer_constant_AREA_PARAM_GRAVITY_DISTANCE_SCALE: + +.. _class_PhysicsServer_constant_AREA_PARAM_GRAVITY_POINT_ATTENUATION: + +.. _class_PhysicsServer_constant_AREA_PARAM_LINEAR_DAMP: + +.. _class_PhysicsServer_constant_AREA_PARAM_ANGULAR_DAMP: + +.. _class_PhysicsServer_constant_AREA_PARAM_PRIORITY: + +enum **AreaParameter**: + +- **AREA_PARAM_GRAVITY** = **0** --- Constant to set/get gravity strength in an area. + +- **AREA_PARAM_GRAVITY_VECTOR** = **1** --- Constant to set/get gravity vector/center in an area. + +- **AREA_PARAM_GRAVITY_IS_POINT** = **2** --- Constant to set/get whether the gravity vector of an area is a direction, or a center point. + +- **AREA_PARAM_GRAVITY_DISTANCE_SCALE** = **3** --- Constant to set/get the falloff factor for point gravity of an area. The greater this value is, the faster the strength of gravity decreases with the square of distance. + +- **AREA_PARAM_GRAVITY_POINT_ATTENUATION** = **4** --- This constant was used to set/get the falloff factor for point gravity. It has been superseded by :ref:`AREA_PARAM_GRAVITY_DISTANCE_SCALE`. + +- **AREA_PARAM_LINEAR_DAMP** = **5** --- Constant to set/get the linear dampening factor of an area. + +- **AREA_PARAM_ANGULAR_DAMP** = **6** --- Constant to set/get the angular dampening factor of an area. + +- **AREA_PARAM_PRIORITY** = **7** --- Constant to set/get the priority (order of processing) of an area. + +---- + +.. _enum_PhysicsServer_AreaSpaceOverrideMode: + +.. _class_PhysicsServer_constant_AREA_SPACE_OVERRIDE_DISABLED: + +.. _class_PhysicsServer_constant_AREA_SPACE_OVERRIDE_COMBINE: + +.. _class_PhysicsServer_constant_AREA_SPACE_OVERRIDE_COMBINE_REPLACE: + +.. _class_PhysicsServer_constant_AREA_SPACE_OVERRIDE_REPLACE: + +.. _class_PhysicsServer_constant_AREA_SPACE_OVERRIDE_REPLACE_COMBINE: + +enum **AreaSpaceOverrideMode**: + +- **AREA_SPACE_OVERRIDE_DISABLED** = **0** --- This area does not affect gravity/damp. These are generally areas that exist only to detect collisions, and objects entering or exiting them. + +- **AREA_SPACE_OVERRIDE_COMBINE** = **1** --- This area adds its gravity/damp values to whatever has been calculated so far. This way, many overlapping areas can combine their physics to make interesting effects. + +- **AREA_SPACE_OVERRIDE_COMBINE_REPLACE** = **2** --- This area adds its gravity/damp values to whatever has been calculated so far. Then stops taking into account the rest of the areas, even the default one. + +- **AREA_SPACE_OVERRIDE_REPLACE** = **3** --- This area replaces any gravity/damp, even the default one, and stops taking into account the rest of the areas. + +- **AREA_SPACE_OVERRIDE_REPLACE_COMBINE** = **4** --- This area replaces any gravity/damp calculated so far, but keeps calculating the rest of the areas, down to the default one. + +---- + +.. _enum_PhysicsServer_BodyMode: + +.. _class_PhysicsServer_constant_BODY_MODE_STATIC: + +.. _class_PhysicsServer_constant_BODY_MODE_KINEMATIC: + +.. _class_PhysicsServer_constant_BODY_MODE_RIGID: + +.. _class_PhysicsServer_constant_BODY_MODE_CHARACTER: + +enum **BodyMode**: + +- **BODY_MODE_STATIC** = **0** --- Constant for static bodies. + +- **BODY_MODE_KINEMATIC** = **1** --- Constant for kinematic bodies. + +- **BODY_MODE_RIGID** = **2** --- Constant for rigid bodies. + +- **BODY_MODE_CHARACTER** = **3** --- Constant for rigid bodies in character mode. In this mode, a body can not rotate, and only its linear velocity is affected by physics. + +---- + +.. _enum_PhysicsServer_BodyParameter: + +.. _class_PhysicsServer_constant_BODY_PARAM_BOUNCE: + +.. _class_PhysicsServer_constant_BODY_PARAM_FRICTION: + +.. _class_PhysicsServer_constant_BODY_PARAM_MASS: + +.. _class_PhysicsServer_constant_BODY_PARAM_GRAVITY_SCALE: + +.. _class_PhysicsServer_constant_BODY_PARAM_LINEAR_DAMP: + +.. _class_PhysicsServer_constant_BODY_PARAM_ANGULAR_DAMP: + +.. _class_PhysicsServer_constant_BODY_PARAM_MAX: + +enum **BodyParameter**: + +- **BODY_PARAM_BOUNCE** = **0** --- Constant to set/get a body's bounce factor. + +- **BODY_PARAM_FRICTION** = **1** --- Constant to set/get a body's friction. + +- **BODY_PARAM_MASS** = **2** --- Constant to set/get a body's mass. + +- **BODY_PARAM_GRAVITY_SCALE** = **3** --- Constant to set/get a body's gravity multiplier. + +- **BODY_PARAM_LINEAR_DAMP** = **4** --- Constant to set/get a body's linear dampening factor. + +- **BODY_PARAM_ANGULAR_DAMP** = **5** --- Constant to set/get a body's angular dampening factor. + +- **BODY_PARAM_MAX** = **6** --- Represents the size of the :ref:`BodyParameter` enum. + +---- + +.. _enum_PhysicsServer_BodyState: + +.. _class_PhysicsServer_constant_BODY_STATE_TRANSFORM: + +.. _class_PhysicsServer_constant_BODY_STATE_LINEAR_VELOCITY: + +.. _class_PhysicsServer_constant_BODY_STATE_ANGULAR_VELOCITY: + +.. _class_PhysicsServer_constant_BODY_STATE_SLEEPING: + +.. _class_PhysicsServer_constant_BODY_STATE_CAN_SLEEP: + +enum **BodyState**: + +- **BODY_STATE_TRANSFORM** = **0** --- Constant to set/get the current transform matrix of the body. + +- **BODY_STATE_LINEAR_VELOCITY** = **1** --- Constant to set/get the current linear velocity of the body. + +- **BODY_STATE_ANGULAR_VELOCITY** = **2** --- Constant to set/get the current angular velocity of the body. + +- **BODY_STATE_SLEEPING** = **3** --- Constant to sleep/wake up a body, or to get whether it is sleeping. + +- **BODY_STATE_CAN_SLEEP** = **4** --- Constant to set/get whether the body can sleep. + +---- + +.. _enum_PhysicsServer_AreaBodyStatus: + +.. _class_PhysicsServer_constant_AREA_BODY_ADDED: + +.. _class_PhysicsServer_constant_AREA_BODY_REMOVED: + +enum **AreaBodyStatus**: + +- **AREA_BODY_ADDED** = **0** --- The value of the first parameter and area callback function receives, when an object enters one of its shapes. + +- **AREA_BODY_REMOVED** = **1** --- The value of the first parameter and area callback function receives, when an object exits one of its shapes. + +---- + +.. _enum_PhysicsServer_ProcessInfo: + +.. _class_PhysicsServer_constant_INFO_ACTIVE_OBJECTS: + +.. _class_PhysicsServer_constant_INFO_COLLISION_PAIRS: + +.. _class_PhysicsServer_constant_INFO_ISLAND_COUNT: + +enum **ProcessInfo**: + +- **INFO_ACTIVE_OBJECTS** = **0** --- Constant to get the number of objects that are not sleeping. + +- **INFO_COLLISION_PAIRS** = **1** --- Constant to get the number of possible collisions. + +- **INFO_ISLAND_COUNT** = **2** --- Constant to get the number of space regions where a collision could occur. + +---- + +.. _enum_PhysicsServer_SpaceParameter: + +.. _class_PhysicsServer_constant_SPACE_PARAM_CONTACT_RECYCLE_RADIUS: + +.. _class_PhysicsServer_constant_SPACE_PARAM_CONTACT_MAX_SEPARATION: + +.. _class_PhysicsServer_constant_SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION: + +.. _class_PhysicsServer_constant_SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD: + +.. _class_PhysicsServer_constant_SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD: + +.. _class_PhysicsServer_constant_SPACE_PARAM_BODY_TIME_TO_SLEEP: + +.. _class_PhysicsServer_constant_SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO: + +.. _class_PhysicsServer_constant_SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS: + +enum **SpaceParameter**: + +- **SPACE_PARAM_CONTACT_RECYCLE_RADIUS** = **0** --- Constant to set/get the maximum distance a pair of bodies has to move before their collision status has to be recalculated. + +- **SPACE_PARAM_CONTACT_MAX_SEPARATION** = **1** --- Constant to set/get the maximum distance a shape can be from another before they are considered separated. + +- **SPACE_PARAM_BODY_MAX_ALLOWED_PENETRATION** = **2** --- Constant to set/get the maximum distance a shape can penetrate another shape before it is considered a collision. + +- **SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD** = **3** --- Constant to set/get the threshold linear velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + +- **SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD** = **4** --- Constant to set/get the threshold angular velocity of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after the time given. + +- **SPACE_PARAM_BODY_TIME_TO_SLEEP** = **5** --- Constant to set/get the maximum time of activity. A body marked as potentially inactive for both linear and angular velocity will be put to sleep after this time. + +- **SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO** = **6** + +- **SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS** = **7** --- Constant to set/get the default solver bias for all physics constraints. A solver bias is a factor controlling how much two objects "rebound", after violating a constraint, to avoid leaving them in that state because of numerical imprecision. + +---- + +.. _enum_PhysicsServer_BodyAxis: + +.. _class_PhysicsServer_constant_BODY_AXIS_LINEAR_X: + +.. _class_PhysicsServer_constant_BODY_AXIS_LINEAR_Y: + +.. _class_PhysicsServer_constant_BODY_AXIS_LINEAR_Z: + +.. _class_PhysicsServer_constant_BODY_AXIS_ANGULAR_X: + +.. _class_PhysicsServer_constant_BODY_AXIS_ANGULAR_Y: + +.. _class_PhysicsServer_constant_BODY_AXIS_ANGULAR_Z: + +enum **BodyAxis**: + +- **BODY_AXIS_LINEAR_X** = **1** + +- **BODY_AXIS_LINEAR_Y** = **2** + +- **BODY_AXIS_LINEAR_Z** = **4** + +- **BODY_AXIS_ANGULAR_X** = **8** + +- **BODY_AXIS_ANGULAR_Y** = **16** + +- **BODY_AXIS_ANGULAR_Z** = **32** + +Method Descriptions +------------------- + +.. _class_PhysicsServer_method_area_add_shape: + +- void **area_add_shape** **(** :ref:`RID` area, :ref:`RID` shape, :ref:`Transform` transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), :ref:`bool` disabled=false **)** + +Adds a shape to the area, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + +---- + +.. _class_PhysicsServer_method_area_attach_object_instance_id: + +- void **area_attach_object_instance_id** **(** :ref:`RID` area, :ref:`int` id **)** + +Assigns the area to a descendant of :ref:`Object`, so it can exist in the node tree. + +---- + +.. _class_PhysicsServer_method_area_clear_shapes: + +- void **area_clear_shapes** **(** :ref:`RID` area **)** + +Removes all shapes from an area. It does not delete the shapes, so they can be reassigned later. + +---- + +.. _class_PhysicsServer_method_area_create: + +- :ref:`RID` **area_create** **(** **)** + +Creates an :ref:`Area`. + +---- + +.. _class_PhysicsServer_method_area_get_object_instance_id: + +- :ref:`int` **area_get_object_instance_id** **(** :ref:`RID` area **)** |const| + +Gets the instance ID of the object the area is assigned to. + +---- + +.. _class_PhysicsServer_method_area_get_param: + +- :ref:`Variant` **area_get_param** **(** :ref:`RID` area, :ref:`AreaParameter` param **)** |const| + +Returns an area parameter value. A list of available parameters is on the :ref:`AreaParameter` constants. + +---- + +.. _class_PhysicsServer_method_area_get_shape: + +- :ref:`RID` **area_get_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| + +Returns the :ref:`RID` of the nth shape of an area. + +---- + +.. _class_PhysicsServer_method_area_get_shape_count: + +- :ref:`int` **area_get_shape_count** **(** :ref:`RID` area **)** |const| + +Returns the number of shapes assigned to an area. + +---- + +.. _class_PhysicsServer_method_area_get_shape_transform: + +- :ref:`Transform` **area_get_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx **)** |const| + +Returns the transform matrix of a shape within an area. + +---- + +.. _class_PhysicsServer_method_area_get_space: + +- :ref:`RID` **area_get_space** **(** :ref:`RID` area **)** |const| + +Returns the space assigned to the area. + +---- + +.. _class_PhysicsServer_method_area_get_space_override_mode: + +- :ref:`AreaSpaceOverrideMode` **area_get_space_override_mode** **(** :ref:`RID` area **)** |const| + +Returns the space override mode for the area. + +---- + +.. _class_PhysicsServer_method_area_get_transform: + +- :ref:`Transform` **area_get_transform** **(** :ref:`RID` area **)** |const| + +Returns the transform matrix for an area. + +---- + +.. _class_PhysicsServer_method_area_is_ray_pickable: + +- :ref:`bool` **area_is_ray_pickable** **(** :ref:`RID` area **)** |const| + +If ``true``, area collides with rays. + +---- + +.. _class_PhysicsServer_method_area_remove_shape: + +- void **area_remove_shape** **(** :ref:`RID` area, :ref:`int` shape_idx **)** + +Removes a shape from an area. It does not delete the shape, so it can be reassigned later. + +---- + +.. _class_PhysicsServer_method_area_set_area_monitor_callback: + +- void **area_set_area_monitor_callback** **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** + +---- + +.. _class_PhysicsServer_method_area_set_collision_layer: + +- void **area_set_collision_layer** **(** :ref:`RID` area, :ref:`int` layer **)** + +Assigns the area to one or many physics layers. + +---- + +.. _class_PhysicsServer_method_area_set_collision_mask: + +- void **area_set_collision_mask** **(** :ref:`RID` area, :ref:`int` mask **)** + +Sets which physics layers the area will monitor. + +---- + +.. _class_PhysicsServer_method_area_set_monitor_callback: + +- void **area_set_monitor_callback** **(** :ref:`RID` area, :ref:`Object` receiver, :ref:`String` method **)** + +Sets the function to call when any body/area enters or exits the area. This callback will be called for any object interacting with the area, and takes five parameters: + +1: :ref:`AREA_BODY_ADDED` or :ref:`AREA_BODY_REMOVED`, depending on whether the object entered or exited the area. + +2: :ref:`RID` of the object that entered/exited the area. + +3: Instance ID of the object that entered/exited the area. + +4: The shape index of the object that entered/exited the area. + +5: The shape index of the area where the object entered/exited. + +---- + +.. _class_PhysicsServer_method_area_set_monitorable: + +- void **area_set_monitorable** **(** :ref:`RID` area, :ref:`bool` monitorable **)** + +---- + +.. _class_PhysicsServer_method_area_set_param: + +- void **area_set_param** **(** :ref:`RID` area, :ref:`AreaParameter` param, :ref:`Variant` value **)** + +Sets the value for an area parameter. A list of available parameters is on the :ref:`AreaParameter` constants. + +---- + +.. _class_PhysicsServer_method_area_set_ray_pickable: + +- void **area_set_ray_pickable** **(** :ref:`RID` area, :ref:`bool` enable **)** + +Sets object pickable with rays. + +---- + +.. _class_PhysicsServer_method_area_set_shape: + +- void **area_set_shape** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`RID` shape **)** + +Substitutes a given area shape by another. The old shape is selected by its index, the new one by its :ref:`RID`. + +---- + +.. _class_PhysicsServer_method_area_set_shape_disabled: + +- void **area_set_shape_disabled** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`bool` disabled **)** + +---- + +.. _class_PhysicsServer_method_area_set_shape_transform: + +- void **area_set_shape_transform** **(** :ref:`RID` area, :ref:`int` shape_idx, :ref:`Transform` transform **)** + +Sets the transform matrix for an area shape. + +---- + +.. _class_PhysicsServer_method_area_set_space: + +- void **area_set_space** **(** :ref:`RID` area, :ref:`RID` space **)** + +Assigns a space to the area. + +---- + +.. _class_PhysicsServer_method_area_set_space_override_mode: + +- void **area_set_space_override_mode** **(** :ref:`RID` area, :ref:`AreaSpaceOverrideMode` mode **)** + +Sets the space override mode for the area. The modes are described in the :ref:`AreaSpaceOverrideMode` constants. + +---- + +.. _class_PhysicsServer_method_area_set_transform: + +- void **area_set_transform** **(** :ref:`RID` area, :ref:`Transform` transform **)** + +Sets the transform matrix for an area. + +---- + +.. _class_PhysicsServer_method_body_add_central_force: + +- void **body_add_central_force** **(** :ref:`RID` body, :ref:`Vector3` force **)** + +---- + +.. _class_PhysicsServer_method_body_add_collision_exception: + +- void **body_add_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** + +Adds a body to the list of bodies exempt from collisions. + +---- + +.. _class_PhysicsServer_method_body_add_force: + +- void **body_add_force** **(** :ref:`RID` body, :ref:`Vector3` force, :ref:`Vector3` position **)** + +---- + +.. _class_PhysicsServer_method_body_add_shape: + +- void **body_add_shape** **(** :ref:`RID` body, :ref:`RID` shape, :ref:`Transform` transform=Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 ), :ref:`bool` disabled=false **)** + +Adds a shape to the body, along with a transform matrix. Shapes are usually referenced by their index, so you should track which shape has a given index. + +---- + +.. _class_PhysicsServer_method_body_add_torque: + +- void **body_add_torque** **(** :ref:`RID` body, :ref:`Vector3` torque **)** + +---- + +.. _class_PhysicsServer_method_body_apply_central_impulse: + +- void **body_apply_central_impulse** **(** :ref:`RID` body, :ref:`Vector3` impulse **)** + +---- + +.. _class_PhysicsServer_method_body_apply_impulse: + +- void **body_apply_impulse** **(** :ref:`RID` body, :ref:`Vector3` position, :ref:`Vector3` impulse **)** + +Gives the body a push at a ``position`` in the direction of the ``impulse``. + +---- + +.. _class_PhysicsServer_method_body_apply_torque_impulse: + +- void **body_apply_torque_impulse** **(** :ref:`RID` body, :ref:`Vector3` impulse **)** + +Gives the body a push to rotate it. + +---- + +.. _class_PhysicsServer_method_body_attach_object_instance_id: + +- void **body_attach_object_instance_id** **(** :ref:`RID` body, :ref:`int` id **)** + +Assigns the area to a descendant of :ref:`Object`, so it can exist in the node tree. + +---- + +.. _class_PhysicsServer_method_body_clear_shapes: + +- void **body_clear_shapes** **(** :ref:`RID` body **)** + +Removes all shapes from a body. + +---- + +.. _class_PhysicsServer_method_body_create: + +- :ref:`RID` **body_create** **(** :ref:`BodyMode` mode=2, :ref:`bool` init_sleeping=false **)** + +Creates a physics body. The first parameter can be any value from :ref:`BodyMode` constants, for the type of body created. Additionally, the body can be created in sleeping state to save processing time. + +---- + +.. _class_PhysicsServer_method_body_get_collision_layer: + +- :ref:`int` **body_get_collision_layer** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers a body belongs to. + +---- + +.. _class_PhysicsServer_method_body_get_collision_mask: + +- :ref:`int` **body_get_collision_mask** **(** :ref:`RID` body **)** |const| + +Returns the physics layer or layers a body can collide with. + +---- + +.. _class_PhysicsServer_method_body_get_direct_state: + +- :ref:`PhysicsDirectBodyState` **body_get_direct_state** **(** :ref:`RID` body **)** + +Returns the :ref:`PhysicsDirectBodyState` of the body. Returns ``null`` if the body is destroyed or removed from the physics space. + +---- + +.. _class_PhysicsServer_method_body_get_kinematic_safe_margin: + +- :ref:`float` **body_get_kinematic_safe_margin** **(** :ref:`RID` body **)** |const| + +---- + +.. _class_PhysicsServer_method_body_get_max_contacts_reported: + +- :ref:`int` **body_get_max_contacts_reported** **(** :ref:`RID` body **)** |const| + +Returns the maximum contacts that can be reported. See :ref:`body_set_max_contacts_reported`. + +---- + +.. _class_PhysicsServer_method_body_get_mode: + +- :ref:`BodyMode` **body_get_mode** **(** :ref:`RID` body **)** |const| + +Returns the body mode. + +---- + +.. _class_PhysicsServer_method_body_get_object_instance_id: + +- :ref:`int` **body_get_object_instance_id** **(** :ref:`RID` body **)** |const| + +Gets the instance ID of the object the area is assigned to. + +---- + +.. _class_PhysicsServer_method_body_get_param: + +- :ref:`float` **body_get_param** **(** :ref:`RID` body, :ref:`BodyParameter` param **)** |const| + +Returns the value of a body parameter. A list of available parameters is on the :ref:`BodyParameter` constants. + +---- + +.. _class_PhysicsServer_method_body_get_shape: + +- :ref:`RID` **body_get_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| + +Returns the :ref:`RID` of the nth shape of a body. + +---- + +.. _class_PhysicsServer_method_body_get_shape_count: + +- :ref:`int` **body_get_shape_count** **(** :ref:`RID` body **)** |const| + +Returns the number of shapes assigned to a body. + +---- + +.. _class_PhysicsServer_method_body_get_shape_transform: + +- :ref:`Transform` **body_get_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx **)** |const| + +Returns the transform matrix of a body shape. + +---- + +.. _class_PhysicsServer_method_body_get_space: + +- :ref:`RID` **body_get_space** **(** :ref:`RID` body **)** |const| + +Returns the :ref:`RID` of the space assigned to a body. + +---- + +.. _class_PhysicsServer_method_body_get_state: + +- :ref:`Variant` **body_get_state** **(** :ref:`RID` body, :ref:`BodyState` state **)** |const| + +Returns a body state. + +---- + +.. _class_PhysicsServer_method_body_is_axis_locked: + +- :ref:`bool` **body_is_axis_locked** **(** :ref:`RID` body, :ref:`BodyAxis` axis **)** |const| + +---- + +.. _class_PhysicsServer_method_body_is_continuous_collision_detection_enabled: + +- :ref:`bool` **body_is_continuous_collision_detection_enabled** **(** :ref:`RID` body **)** |const| + +If ``true``, the continuous collision detection mode is enabled. + +---- + +.. _class_PhysicsServer_method_body_is_omitting_force_integration: + +- :ref:`bool` **body_is_omitting_force_integration** **(** :ref:`RID` body **)** |const| + +Returns whether a body uses a callback function to calculate its own physics (see :ref:`body_set_force_integration_callback`). + +---- + +.. _class_PhysicsServer_method_body_is_ray_pickable: + +- :ref:`bool` **body_is_ray_pickable** **(** :ref:`RID` body **)** |const| + +If ``true``, the body can be detected by rays. + +---- + +.. _class_PhysicsServer_method_body_remove_collision_exception: + +- void **body_remove_collision_exception** **(** :ref:`RID` body, :ref:`RID` excepted_body **)** + +Removes a body from the list of bodies exempt from collisions. + +Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + +---- + +.. _class_PhysicsServer_method_body_remove_shape: + +- void **body_remove_shape** **(** :ref:`RID` body, :ref:`int` shape_idx **)** + +Removes a shape from a body. The shape is not deleted, so it can be reused afterwards. + +---- + +.. _class_PhysicsServer_method_body_set_axis_lock: + +- void **body_set_axis_lock** **(** :ref:`RID` body, :ref:`BodyAxis` axis, :ref:`bool` lock **)** + +---- + +.. _class_PhysicsServer_method_body_set_axis_velocity: + +- void **body_set_axis_velocity** **(** :ref:`RID` body, :ref:`Vector3` axis_velocity **)** + +Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + +---- + +.. _class_PhysicsServer_method_body_set_collision_layer: + +- void **body_set_collision_layer** **(** :ref:`RID` body, :ref:`int` layer **)** + +Sets the physics layer or layers a body belongs to. + +---- + +.. _class_PhysicsServer_method_body_set_collision_mask: + +- void **body_set_collision_mask** **(** :ref:`RID` body, :ref:`int` mask **)** + +Sets the physics layer or layers a body can collide with. + +---- + +.. _class_PhysicsServer_method_body_set_enable_continuous_collision_detection: + +- void **body_set_enable_continuous_collision_detection** **(** :ref:`RID` body, :ref:`bool` enable **)** + +If ``true``, the continuous collision detection mode is enabled. + +Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. + +---- + +.. _class_PhysicsServer_method_body_set_force_integration_callback: + +- void **body_set_force_integration_callback** **(** :ref:`RID` body, :ref:`Object` receiver, :ref:`String` method, :ref:`Variant` userdata=null **)** + +Sets the function used to calculate physics for an object, if that object allows it (see :ref:`body_set_omit_force_integration`). + +---- + +.. _class_PhysicsServer_method_body_set_kinematic_safe_margin: + +- void **body_set_kinematic_safe_margin** **(** :ref:`RID` body, :ref:`float` margin **)** + +---- + +.. _class_PhysicsServer_method_body_set_max_contacts_reported: + +- void **body_set_max_contacts_reported** **(** :ref:`RID` body, :ref:`int` amount **)** + +Sets the maximum contacts to report. Bodies can keep a log of the contacts with other bodies, this is enabled by setting the maximum amount of contacts reported to a number greater than 0. + +---- + +.. _class_PhysicsServer_method_body_set_mode: + +- void **body_set_mode** **(** :ref:`RID` body, :ref:`BodyMode` mode **)** + +Sets the body mode, from one of the :ref:`BodyMode` constants. + +---- + +.. _class_PhysicsServer_method_body_set_omit_force_integration: + +- void **body_set_omit_force_integration** **(** :ref:`RID` body, :ref:`bool` enable **)** + +Sets whether a body uses a callback function to calculate its own physics (see :ref:`body_set_force_integration_callback`). + +---- + +.. _class_PhysicsServer_method_body_set_param: + +- void **body_set_param** **(** :ref:`RID` body, :ref:`BodyParameter` param, :ref:`float` value **)** + +Sets a body parameter. A list of available parameters is on the :ref:`BodyParameter` constants. + +---- + +.. _class_PhysicsServer_method_body_set_ray_pickable: + +- void **body_set_ray_pickable** **(** :ref:`RID` body, :ref:`bool` enable **)** + +Sets the body pickable with rays if ``enabled`` is set. + +---- + +.. _class_PhysicsServer_method_body_set_shape: + +- void **body_set_shape** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`RID` shape **)** + +Substitutes a given body shape by another. The old shape is selected by its index, the new one by its :ref:`RID`. + +---- + +.. _class_PhysicsServer_method_body_set_shape_disabled: + +- void **body_set_shape_disabled** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`bool` disabled **)** + +---- + +.. _class_PhysicsServer_method_body_set_shape_transform: + +- void **body_set_shape_transform** **(** :ref:`RID` body, :ref:`int` shape_idx, :ref:`Transform` transform **)** + +Sets the transform matrix for a body shape. + +---- + +.. _class_PhysicsServer_method_body_set_space: + +- void **body_set_space** **(** :ref:`RID` body, :ref:`RID` space **)** + +Assigns a space to the body (see :ref:`space_create`). + +---- + +.. _class_PhysicsServer_method_body_set_state: + +- void **body_set_state** **(** :ref:`RID` body, :ref:`BodyState` state, :ref:`Variant` value **)** + +Sets a body state (see :ref:`BodyState` constants). + +---- + +.. _class_PhysicsServer_method_body_test_motion: + +- :ref:`bool` **body_test_motion** **(** :ref:`RID` body, :ref:`Transform` from, :ref:`Vector3` motion, :ref:`bool` infinite_inertia, :ref:`PhysicsTestMotionResult` result=null, :ref:`bool` exclude_raycast_shapes=true, :ref:`Array` exclude=[ ] **)** + +Returns ``true`` if a collision would result from moving in the given direction from a given point in space. :ref:`PhysicsTestMotionResult` can be passed to return additional information in. + +---- + +.. _class_PhysicsServer_method_cone_twist_joint_get_param: + +- :ref:`float` **cone_twist_joint_get_param** **(** :ref:`RID` joint, :ref:`ConeTwistJointParam` param **)** |const| + +Gets a cone_twist_joint parameter (see :ref:`ConeTwistJointParam` constants). + +---- + +.. _class_PhysicsServer_method_cone_twist_joint_set_param: + +- void **cone_twist_joint_set_param** **(** :ref:`RID` joint, :ref:`ConeTwistJointParam` param, :ref:`float` value **)** + +Sets a cone_twist_joint parameter (see :ref:`ConeTwistJointParam` constants). + +---- + +.. _class_PhysicsServer_method_free_rid: + +- void **free_rid** **(** :ref:`RID` rid **)** + +Destroys any of the objects created by PhysicsServer. If the :ref:`RID` passed is not one of the objects that can be created by PhysicsServer, an error will be sent to the console. + +---- + +.. _class_PhysicsServer_method_generic_6dof_joint_get_flag: + +- :ref:`bool` **generic_6dof_joint_get_flag** **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisFlag` flag **)** + +Gets a generic_6_DOF_joint flag (see :ref:`G6DOFJointAxisFlag` constants). + +---- + +.. _class_PhysicsServer_method_generic_6dof_joint_get_param: + +- :ref:`float` **generic_6dof_joint_get_param** **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisParam` param **)** + +Gets a generic_6_DOF_joint parameter (see :ref:`G6DOFJointAxisParam` constants). + +---- + +.. _class_PhysicsServer_method_generic_6dof_joint_set_flag: + +- void **generic_6dof_joint_set_flag** **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisFlag` flag, :ref:`bool` enable **)** + +Sets a generic_6_DOF_joint flag (see :ref:`G6DOFJointAxisFlag` constants). + +---- + +.. _class_PhysicsServer_method_generic_6dof_joint_set_param: + +- void **generic_6dof_joint_set_param** **(** :ref:`RID` joint, Vector3.Axis axis, :ref:`G6DOFJointAxisParam` param, :ref:`float` value **)** + +Sets a generic_6_DOF_joint parameter (see :ref:`G6DOFJointAxisParam` constants). + +---- + +.. _class_PhysicsServer_method_get_process_info: + +- :ref:`int` **get_process_info** **(** :ref:`ProcessInfo` process_info **)** + +Returns an Info defined by the :ref:`ProcessInfo` input given. + +---- + +.. _class_PhysicsServer_method_hinge_joint_get_flag: + +- :ref:`bool` **hinge_joint_get_flag** **(** :ref:`RID` joint, :ref:`HingeJointFlag` flag **)** |const| + +Gets a hinge_joint flag (see :ref:`HingeJointFlag` constants). + +---- + +.. _class_PhysicsServer_method_hinge_joint_get_param: + +- :ref:`float` **hinge_joint_get_param** **(** :ref:`RID` joint, :ref:`HingeJointParam` param **)** |const| + +Gets a hinge_joint parameter (see :ref:`HingeJointParam`). + +---- + +.. _class_PhysicsServer_method_hinge_joint_set_flag: + +- void **hinge_joint_set_flag** **(** :ref:`RID` joint, :ref:`HingeJointFlag` flag, :ref:`bool` enabled **)** + +Sets a hinge_joint flag (see :ref:`HingeJointFlag` constants). + +---- + +.. _class_PhysicsServer_method_hinge_joint_set_param: + +- void **hinge_joint_set_param** **(** :ref:`RID` joint, :ref:`HingeJointParam` param, :ref:`float` value **)** + +Sets a hinge_joint parameter (see :ref:`HingeJointParam` constants). + +---- + +.. _class_PhysicsServer_method_joint_create_cone_twist: + +- :ref:`RID` **joint_create_cone_twist** **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** + +Creates a :ref:`ConeTwistJoint`. + +---- + +.. _class_PhysicsServer_method_joint_create_generic_6dof: + +- :ref:`RID` **joint_create_generic_6dof** **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** + +Creates a :ref:`Generic6DOFJoint`. + +---- + +.. _class_PhysicsServer_method_joint_create_hinge: + +- :ref:`RID` **joint_create_hinge** **(** :ref:`RID` body_A, :ref:`Transform` hinge_A, :ref:`RID` body_B, :ref:`Transform` hinge_B **)** + +Creates a :ref:`HingeJoint`. + +---- + +.. _class_PhysicsServer_method_joint_create_pin: + +- :ref:`RID` **joint_create_pin** **(** :ref:`RID` body_A, :ref:`Vector3` local_A, :ref:`RID` body_B, :ref:`Vector3` local_B **)** + +Creates a :ref:`PinJoint`. + +---- + +.. _class_PhysicsServer_method_joint_create_slider: + +- :ref:`RID` **joint_create_slider** **(** :ref:`RID` body_A, :ref:`Transform` local_ref_A, :ref:`RID` body_B, :ref:`Transform` local_ref_B **)** + +Creates a :ref:`SliderJoint`. + +---- + +.. _class_PhysicsServer_method_joint_get_solver_priority: + +- :ref:`int` **joint_get_solver_priority** **(** :ref:`RID` joint **)** |const| + +Gets the priority value of the Joint. + +---- + +.. _class_PhysicsServer_method_joint_get_type: + +- :ref:`JointType` **joint_get_type** **(** :ref:`RID` joint **)** |const| + +Returns the type of the Joint. + +---- + +.. _class_PhysicsServer_method_joint_set_solver_priority: + +- void **joint_set_solver_priority** **(** :ref:`RID` joint, :ref:`int` priority **)** + +Sets the priority value of the Joint. + +---- + +.. _class_PhysicsServer_method_pin_joint_get_local_a: + +- :ref:`Vector3` **pin_joint_get_local_a** **(** :ref:`RID` joint **)** |const| + +Returns position of the joint in the local space of body a of the joint. + +---- + +.. _class_PhysicsServer_method_pin_joint_get_local_b: + +- :ref:`Vector3` **pin_joint_get_local_b** **(** :ref:`RID` joint **)** |const| + +Returns position of the joint in the local space of body b of the joint. + +---- + +.. _class_PhysicsServer_method_pin_joint_get_param: + +- :ref:`float` **pin_joint_get_param** **(** :ref:`RID` joint, :ref:`PinJointParam` param **)** |const| + +Gets a pin_joint parameter (see :ref:`PinJointParam` constants). + +---- + +.. _class_PhysicsServer_method_pin_joint_set_local_a: + +- void **pin_joint_set_local_a** **(** :ref:`RID` joint, :ref:`Vector3` local_A **)** + +Sets position of the joint in the local space of body a of the joint. + +---- + +.. _class_PhysicsServer_method_pin_joint_set_local_b: + +- void **pin_joint_set_local_b** **(** :ref:`RID` joint, :ref:`Vector3` local_B **)** + +Sets position of the joint in the local space of body b of the joint. + +---- + +.. _class_PhysicsServer_method_pin_joint_set_param: + +- void **pin_joint_set_param** **(** :ref:`RID` joint, :ref:`PinJointParam` param, :ref:`float` value **)** + +Sets a pin_joint parameter (see :ref:`PinJointParam` constants). + +---- + +.. _class_PhysicsServer_method_set_active: + +- void **set_active** **(** :ref:`bool` active **)** + +Activates or deactivates the 3D physics engine. + +---- + +.. _class_PhysicsServer_method_set_collision_iterations: + +- void **set_collision_iterations** **(** :ref:`int` iterations **)** + +Sets the amount of iterations for calculating velocities of colliding bodies. The greater the amount of iterations, the more accurate the collisions will be. However, a greater amount of iterations requires more CPU power, which can decrease performance. The default value is ``8``. + +**Note:** Only has an effect when using the GodotPhysics engine, not the default Bullet physics engine. + +---- + +.. _class_PhysicsServer_method_shape_create: + +- :ref:`RID` **shape_create** **(** :ref:`ShapeType` type **)** + +Creates a shape of a type from :ref:`ShapeType`. Does not assign it to a body or an area. To do so, you must use :ref:`area_set_shape` or :ref:`body_set_shape`. + +---- + +.. _class_PhysicsServer_method_shape_get_data: + +- :ref:`Variant` **shape_get_data** **(** :ref:`RID` shape **)** |const| + +Returns the shape data. + +---- + +.. _class_PhysicsServer_method_shape_get_type: + +- :ref:`ShapeType` **shape_get_type** **(** :ref:`RID` shape **)** |const| + +Returns the type of shape (see :ref:`ShapeType` constants). + +---- + +.. _class_PhysicsServer_method_shape_set_data: + +- void **shape_set_data** **(** :ref:`RID` shape, :ref:`Variant` data **)** + +Sets the shape data that defines its shape and size. The data to be passed depends on the kind of shape created :ref:`shape_get_type`. + +---- + +.. _class_PhysicsServer_method_slider_joint_get_param: + +- :ref:`float` **slider_joint_get_param** **(** :ref:`RID` joint, :ref:`SliderJointParam` param **)** |const| + +Gets a slider_joint parameter (see :ref:`SliderJointParam` constants). + +---- + +.. _class_PhysicsServer_method_slider_joint_set_param: + +- void **slider_joint_set_param** **(** :ref:`RID` joint, :ref:`SliderJointParam` param, :ref:`float` value **)** + +Gets a slider_joint parameter (see :ref:`SliderJointParam` constants). + +---- + +.. _class_PhysicsServer_method_space_create: + +- :ref:`RID` **space_create** **(** **)** + +Creates a space. A space is a collection of parameters for the physics engine that can be assigned to an area or a body. It can be assigned to an area with :ref:`area_set_space`, or to a body with :ref:`body_set_space`. + +---- + +.. _class_PhysicsServer_method_space_get_direct_state: + +- :ref:`PhysicsDirectSpaceState` **space_get_direct_state** **(** :ref:`RID` space **)** + +Returns the state of a space, a :ref:`PhysicsDirectSpaceState`. This object can be used to make collision/intersection queries. + +---- + +.. _class_PhysicsServer_method_space_get_param: + +- :ref:`float` **space_get_param** **(** :ref:`RID` space, :ref:`SpaceParameter` param **)** |const| + +Returns the value of a space parameter. + +---- + +.. _class_PhysicsServer_method_space_is_active: + +- :ref:`bool` **space_is_active** **(** :ref:`RID` space **)** |const| + +Returns whether the space is active. + +---- + +.. _class_PhysicsServer_method_space_set_active: + +- void **space_set_active** **(** :ref:`RID` space, :ref:`bool` active **)** + +Marks a space as active. It will not have an effect, unless it is assigned to an area or body. + +---- + +.. _class_PhysicsServer_method_space_set_param: + +- void **space_set_param** **(** :ref:`RID` space, :ref:`SpaceParameter` param, :ref:`float` value **)** + +Sets the value for a space parameter. A list of available parameters is on the :ref:`SpaceParameter` 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.)` diff --git a/classes/class_physicsshapequeryparameters.rst b/classes/class_physicsshapequeryparameters.rst new file mode 100644 index 0000000..8b161cc --- /dev/null +++ b/classes/class_physicsshapequeryparameters.rst @@ -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 PhysicsShapeQueryParameters.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsShapeQueryParameters: + +PhysicsShapeQueryParameters +=========================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Parameters to be sent to a 3D shape physics query. + +Description +----------- + +This class contains the shape and other parameters for 3D intersection/collision queries. + +Properties +---------- + ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`collide_with_areas` | ``false`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`collide_with_bodies` | ``true`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`collision_mask` | ``2147483647`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Array` | :ref:`exclude` | ``[ ]`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`margin` | ``0.0`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`RID` | :ref:`shape_rid` | | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`transform` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------+--------------------------------------------------------------------------------------------+-----------------------------------------------------+ + +Methods +------- + ++------+------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shape` **(** :ref:`Resource` shape **)** | ++------+------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PhysicsShapeQueryParameters_property_collide_with_areas: + +- :ref:`bool` **collide_with_areas** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_collide_with_areas(value) | ++-----------+---------------------------------+ +| *Getter* | is_collide_with_areas_enabled() | ++-----------+---------------------------------+ + +If ``true``, the query will take :ref:`Area`\ s into account. + +---- + +.. _class_PhysicsShapeQueryParameters_property_collide_with_bodies: + +- :ref:`bool` **collide_with_bodies** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_collide_with_bodies(value) | ++-----------+----------------------------------+ +| *Getter* | is_collide_with_bodies_enabled() | ++-----------+----------------------------------+ + +If ``true``, the query will take :ref:`PhysicsBody`\ s into account. + +---- + +.. _class_PhysicsShapeQueryParameters_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``2147483647`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layer(s) the query will take into account (as a bitmask). See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_PhysicsShapeQueryParameters_property_exclude: + +- :ref:`Array` **exclude** + ++-----------+--------------------+ +| *Default* | ``[ ]`` | ++-----------+--------------------+ +| *Setter* | set_exclude(value) | ++-----------+--------------------+ +| *Getter* | get_exclude() | ++-----------+--------------------+ + +The list of objects or object :ref:`RID`\ s that will be excluded from collisions. + +---- + +.. _class_PhysicsShapeQueryParameters_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +The collision margin for the shape. + +---- + +.. _class_PhysicsShapeQueryParameters_property_shape_rid: + +- :ref:`RID` **shape_rid** + ++----------+----------------------+ +| *Setter* | set_shape_rid(value) | ++----------+----------------------+ +| *Getter* | get_shape_rid() | ++----------+----------------------+ + +The queried shape's :ref:`RID`. See also :ref:`set_shape`. + +---- + +.. _class_PhysicsShapeQueryParameters_property_transform: + +- :ref:`Transform` **transform** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_transform() | ++-----------+-----------------------------------------------------+ + +The queried shape's transform matrix. + +Method Descriptions +------------------- + +.. _class_PhysicsShapeQueryParameters_method_set_shape: + +- void **set_shape** **(** :ref:`Resource` shape **)** + +Sets the :ref:`Shape` that will be used for collision/intersection queries. + +.. |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.)` diff --git a/classes/class_physicstestmotionresult.rst b/classes/class_physicstestmotionresult.rst new file mode 100644 index 0000000..a9b88dd --- /dev/null +++ b/classes/class_physicstestmotionresult.rst @@ -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 PhysicsTestMotionResult.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PhysicsTestMotionResult: + +PhysicsTestMotionResult +======================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Object` | :ref:`collider` | | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collider_id` | ``0`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`RID` | :ref:`collider_rid` | | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`collider_shape` | ``0`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`collider_velocity` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`collision_depth` | ``0.0`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`collision_normal` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`collision_point` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`collision_safe_fraction` | ``0.0`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`collision_unsafe_fraction` | ``0.0`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`motion` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`motion_remainder` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_PhysicsTestMotionResult_property_collider: + +- :ref:`Object` **collider** + ++----------+----------------+ +| *Getter* | get_collider() | ++----------+----------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collider_id: + +- :ref:`int` **collider_id** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Getter* | get_collider_id() | ++-----------+-------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collider_rid: + +- :ref:`RID` **collider_rid** + ++----------+--------------------+ +| *Getter* | get_collider_rid() | ++----------+--------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collider_shape: + +- :ref:`int` **collider_shape** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Getter* | get_collider_shape() | ++-----------+----------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collider_velocity: + +- :ref:`Vector3` **collider_velocity** + ++-----------+-------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Getter* | get_collider_velocity() | ++-----------+-------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collision_depth: + +- :ref:`float` **collision_depth** + ++-----------+-----------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------+ +| *Getter* | get_collision_depth() | ++-----------+-----------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collision_normal: + +- :ref:`Vector3` **collision_normal** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_collision_normal() | ++-----------+------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collision_point: + +- :ref:`Vector3` **collision_point** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_collision_point() | ++-----------+------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collision_safe_fraction: + +- :ref:`float` **collision_safe_fraction** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Getter* | get_collision_safe_fraction() | ++-----------+-------------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_collision_unsafe_fraction: + +- :ref:`float` **collision_unsafe_fraction** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Getter* | get_collision_unsafe_fraction() | ++-----------+---------------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_motion: + +- :ref:`Vector3` **motion** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_motion() | ++-----------+------------------------+ + +---- + +.. _class_PhysicsTestMotionResult_property_motion_remainder: + +- :ref:`Vector3` **motion_remainder** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Getter* | get_motion_remainder() | ++-----------+------------------------+ + +.. |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.)` diff --git a/classes/class_pinjoint.rst b/classes/class_pinjoint.rst new file mode 100644 index 0000000..79c90f5 --- /dev/null +++ b/classes/class_pinjoint.rst @@ -0,0 +1,128 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PinJoint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PinJoint: + +PinJoint +======== + +**Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Pin joint for 3D PhysicsBodies. + +Description +----------- + +Pin joint for 3D rigid bodies. It pins 2 bodies (rigid or static) together. See also :ref:`Generic6DOFJoint`. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`params/bias` | ``0.3`` | ++---------------------------+---------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`params/damping` | ``1.0`` | ++---------------------------+---------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`params/impulse_clamp` | ``0.0`` | ++---------------------------+---------------------------------------------------------------------------+---------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_PinJoint_Param: + +.. _class_PinJoint_constant_PARAM_BIAS: + +.. _class_PinJoint_constant_PARAM_DAMPING: + +.. _class_PinJoint_constant_PARAM_IMPULSE_CLAMP: + +enum **Param**: + +- **PARAM_BIAS** = **0** --- The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. + +- **PARAM_DAMPING** = **1** --- The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. + +- **PARAM_IMPULSE_CLAMP** = **2** --- If above 0, this value is the maximum value for an impulse that this Joint produces. + +Property Descriptions +--------------------- + +.. _class_PinJoint_property_params/bias: + +- :ref:`float` **params/bias** + ++-----------+------------------+ +| *Default* | ``0.3`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The force with which the pinned objects stay in positional relation to each other. The higher, the stronger. + +---- + +.. _class_PinJoint_property_params/damping: + +- :ref:`float` **params/damping** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The force with which the pinned objects stay in velocity relation to each other. The higher, the stronger. + +---- + +.. _class_PinJoint_property_params/impulse_clamp: + +- :ref:`float` **params/impulse_clamp** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +If above 0, this value is the maximum value for an impulse that this Joint produces. + +Method Descriptions +------------------- + +.. _class_PinJoint_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| + +Returns the value of the specified parameter. + +---- + +.. _class_PinJoint_method_set_param: + +- void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** + +Sets the value of the specified parameter. + +.. |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.)` diff --git a/classes/class_pinjoint2d.rst b/classes/class_pinjoint2d.rst new file mode 100644 index 0000000..da68cf5 --- /dev/null +++ b/classes/class_pinjoint2d.rst @@ -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 PinJoint2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PinJoint2D: + +PinJoint2D +========== + +**Inherits:** :ref:`Joint2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Pin Joint for 2D shapes. + +Description +----------- + +Pin Joint for 2D rigid bodies. It pins two bodies (rigid or static) together. + +Properties +---------- + ++---------------------------+-----------------------------------------------------+---------+ +| :ref:`float` | :ref:`softness` | ``0.0`` | ++---------------------------+-----------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_PinJoint2D_property_softness: + +- :ref:`float` **softness** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_softness(value) | ++-----------+---------------------+ +| *Getter* | get_softness() | ++-----------+---------------------+ + +The higher this value, the more the bond to the pinned partner can flex. + +.. |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.)` diff --git a/classes/class_plane.rst b/classes/class_plane.rst new file mode 100644 index 0000000..aaec656 --- /dev/null +++ b/classes/class_plane.rst @@ -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 Plane.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Plane: + +Plane +===== + +Plane in hessian form. + +Description +----------- + +Plane represents a normalized plane equation. Basically, "normal" is the normal of the plane (a,b,c normalized), and "d" is the distance from the origin to the plane (in the direction of "normal"). "Over" or "Above" the plane is considered the side of the plane towards where the normal is pointing. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +Properties +---------- + ++-------------------------------+--------------------------------------------+------------------------+ +| :ref:`float` | :ref:`d` | ``0.0`` | ++-------------------------------+--------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`normal` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+--------------------------------------------+------------------------+ +| :ref:`float` | :ref:`x` | ``0.0`` | ++-------------------------------+--------------------------------------------+------------------------+ +| :ref:`float` | :ref:`y` | ``0.0`` | ++-------------------------------+--------------------------------------------+------------------------+ +| :ref:`float` | :ref:`z` | ``0.0`` | ++-------------------------------+--------------------------------------------+------------------------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`Plane` **(** :ref:`float` a, :ref:`float` b, :ref:`float` c, :ref:`float` d **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`Plane` **(** :ref:`Vector3` v1, :ref:`Vector3` v2, :ref:`Vector3` v3 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`Plane` **(** :ref:`Vector3` normal, :ref:`float` d **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`center` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3` point **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_any_point` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`intersect_3` **(** :ref:`Plane` b, :ref:`Plane` c **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`intersects_ray` **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`intersects_segment` **(** :ref:`Vector3` begin, :ref:`Vector3` end **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Plane` plane **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_over` **(** :ref:`Vector3` point **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Plane` | :ref:`normalized` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project` **(** :ref:`Vector3` point **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Plane_constant_PLANE_YZ: + +.. _class_Plane_constant_PLANE_XZ: + +.. _class_Plane_constant_PLANE_XY: + +- **PLANE_YZ** = **Plane( 1, 0, 0, 0 )** --- A plane that extends in the Y and Z axes (normal vector points +X). + +- **PLANE_XZ** = **Plane( 0, 1, 0, 0 )** --- A plane that extends in the X and Z axes (normal vector points +Y). + +- **PLANE_XY** = **Plane( 0, 0, 1, 0 )** --- A plane that extends in the X and Y axes (normal vector points +Z). + +Property Descriptions +--------------------- + +.. _class_Plane_property_d: + +- :ref:`float` **d** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The distance from the origin to the plane, in the direction of :ref:`normal`. This value is typically non-negative. + +In the scalar equation of the plane ``ax + by + cz = d``, this is ``d``, while the ``(a, b, c)`` coordinates are represented by the :ref:`normal` property. + +---- + +.. _class_Plane_property_normal: + +- :ref:`Vector3` **normal** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ + +The normal of the plane, which must be normalized. + +In the scalar equation of the plane ``ax + by + cz = d``, this is the vector ``(a, b, c)``, where ``d`` is the :ref:`d` property. + +---- + +.. _class_Plane_property_x: + +- :ref:`float` **x** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The X component of the plane's :ref:`normal` vector. + +---- + +.. _class_Plane_property_y: + +- :ref:`float` **y** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The Y component of the plane's :ref:`normal` vector. + +---- + +.. _class_Plane_property_z: + +- :ref:`float` **z** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The Z component of the plane's :ref:`normal` vector. + +Method Descriptions +------------------- + +.. _class_Plane_method_Plane: + +- :ref:`Plane` **Plane** **(** :ref:`float` a, :ref:`float` b, :ref:`float` c, :ref:`float` d **)** + +Creates a plane from the four parameters. The three components of the resulting plane's :ref:`normal` are ``a``, ``b`` and ``c``, and the plane has a distance of ``d`` from the origin. + +---- + +- :ref:`Plane` **Plane** **(** :ref:`Vector3` v1, :ref:`Vector3` v2, :ref:`Vector3` v3 **)** + +Creates a plane from the three points, given in clockwise order. + +---- + +- :ref:`Plane` **Plane** **(** :ref:`Vector3` normal, :ref:`float` d **)** + +Creates a plane from the normal and the plane's distance to the origin. + +---- + +.. _class_Plane_method_center: + +- :ref:`Vector3` **center** **(** **)** + +Returns the center of the plane. + +---- + +.. _class_Plane_method_distance_to: + +- :ref:`float` **distance_to** **(** :ref:`Vector3` point **)** + +Returns the shortest distance from the plane to the position ``point``. + +---- + +.. _class_Plane_method_get_any_point: + +- :ref:`Vector3` **get_any_point** **(** **)** + +Returns the center of the plane. + +This method is deprecated, please use :ref:`center` instead. + +---- + +.. _class_Plane_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`Vector3` point, :ref:`float` epsilon=1e-05 **)** + +Returns ``true`` if ``point`` is inside the plane. Comparison uses a custom minimum ``epsilon`` threshold. + +---- + +.. _class_Plane_method_intersect_3: + +- :ref:`Vector3` **intersect_3** **(** :ref:`Plane` b, :ref:`Plane` c **)** + +Returns the intersection point of the three planes ``b``, ``c`` and this plane. If no intersection is found, ``null`` is returned. + +---- + +.. _class_Plane_method_intersects_ray: + +- :ref:`Vector3` **intersects_ray** **(** :ref:`Vector3` from, :ref:`Vector3` dir **)** + +Returns the intersection point of a ray consisting of the position ``from`` and the direction normal ``dir`` with this plane. If no intersection is found, ``null`` is returned. + +---- + +.. _class_Plane_method_intersects_segment: + +- :ref:`Vector3` **intersects_segment** **(** :ref:`Vector3` begin, :ref:`Vector3` end **)** + +Returns the intersection point of a segment from position ``begin`` to position ``end`` with this plane. If no intersection is found, ``null`` is returned. + +---- + +.. _class_Plane_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Plane` plane **)** + +Returns ``true`` if this plane and ``plane`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_Plane_method_is_point_over: + +- :ref:`bool` **is_point_over** **(** :ref:`Vector3` point **)** + +Returns ``true`` if ``point`` is located above the plane. + +---- + +.. _class_Plane_method_normalized: + +- :ref:`Plane` **normalized** **(** **)** + +Returns a copy of the plane, normalized. + +---- + +.. _class_Plane_method_project: + +- :ref:`Vector3` **project** **(** :ref:`Vector3` point **)** + +Returns the orthogonal projection of ``point`` into a point in the plane. + +.. |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.)` diff --git a/classes/class_planemesh.rst b/classes/class_planemesh.rst new file mode 100644 index 0000000..ab84dce --- /dev/null +++ b/classes/class_planemesh.rst @@ -0,0 +1,103 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PlaneMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PlaneMesh: + +PlaneMesh +========= + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a planar :ref:`PrimitiveMesh`. + +Description +----------- + +Class representing a planar :ref:`PrimitiveMesh`. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Z axes; this default rotation isn't suited for use with billboarded materials. For billboarded materials, use :ref:`QuadMesh` instead. + +**Note:** When using a large textured ``PlaneMesh`` (e.g. as a floor), you may stumble upon UV jittering issues depending on the camera angle. To solve this, increase :ref:`subdivide_depth` and :ref:`subdivide_width` until you no longer notice UV jittering. + +Properties +---------- + ++-------------------------------+------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`center_offset` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+------------------------------------------------------------------+------------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 2, 2 )`` | ++-------------------------------+------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_depth` | ``0`` | ++-------------------------------+------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_width` | ``0`` | ++-------------------------------+------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_PlaneMesh_property_center_offset: + +- :ref:`Vector3` **center_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_center_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_center_offset() | ++-----------+--------------------------+ + +Offset from the origin of the generated plane. Useful for particles. + +---- + +.. _class_PlaneMesh_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 2, 2 )`` | ++-----------+---------------------+ +| *Setter* | set_size(value) | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +Size of the generated plane. + +---- + +.. _class_PlaneMesh_property_subdivide_depth: + +- :ref:`int` **subdivide_depth** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_depth(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_depth() | ++-----------+----------------------------+ + +Number of subdivision along the Z axis. + +---- + +.. _class_PlaneMesh_property_subdivide_width: + +- :ref:`int` **subdivide_width** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_width(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_width() | ++-----------+----------------------------+ + +Number of subdivision along the X 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.)` diff --git a/classes/class_planeshape.rst b/classes/class_planeshape.rst new file mode 100644 index 0000000..6c28bdc --- /dev/null +++ b/classes/class_planeshape.rst @@ -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 PlaneShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PlaneShape: + +PlaneShape +========== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Infinite plane shape for 3D collisions. + +Description +----------- + +An infinite plane shape for 3D collisions. Note that the :ref:`Plane`'s normal matters; anything "below" the plane will collide with it. If the ``PlaneShape`` is used in a :ref:`PhysicsBody`, it will cause colliding objects placed "below" it to teleport "above" the plane. + +Properties +---------- + ++---------------------------+-----------------------------------------------+-------------------------+ +| :ref:`Plane` | :ref:`plane` | ``Plane( 0, 1, 0, 0 )`` | ++---------------------------+-----------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_PlaneShape_property_plane: + +- :ref:`Plane` **plane** + ++-----------+-------------------------+ +| *Default* | ``Plane( 0, 1, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_plane(value) | ++-----------+-------------------------+ +| *Getter* | get_plane() | ++-----------+-------------------------+ + +The :ref:`Plane` used by the ``PlaneShape`` for collision. + +.. |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.)` diff --git a/classes/class_pluginscript.rst b/classes/class_pluginscript.rst new file mode 100644 index 0000000..d7f97b8 --- /dev/null +++ b/classes/class_pluginscript.rst @@ -0,0 +1,34 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PluginScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PluginScript: + +PluginScript +============ + +**Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`new` **(** ... **)** |vararg| | ++-------------------------------+--------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PluginScript_method_new: + +- :ref:`Variant` **new** **(** ... **)** |vararg| + +Returns a new instance of the script. + +.. |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.)` diff --git a/classes/class_pointmesh.rst b/classes/class_pointmesh.rst new file mode 100644 index 0000000..e079cd5 --- /dev/null +++ b/classes/class_pointmesh.rst @@ -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 PointMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PointMesh: + +PointMesh +========= + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Mesh with a single Point primitive. + +Description +----------- + +The PointMesh is made from a single point. Instead of relying on triangles, points are rendered as a single rectangle on the screen with a constant size. They are intended to be used with Particle systems, but can be used as a cheap way to render constant size billboarded sprites (for example in a point cloud). + +PointMeshes, must be used with a material that has a point size. Point size can be accessed in a shader with ``POINT_SIZE``, or in a :ref:`SpatialMaterial` by setting :ref:`SpatialMaterial.flags_use_point_size` and the variable :ref:`SpatialMaterial.params_point_size`. + +When using PointMeshes, properties that normally alter vertices will be ignored, including billboard mode, grow, and cull face. + +.. |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.)` diff --git a/classes/class_polygon2d.rst b/classes/class_polygon2d.rst new file mode 100644 index 0000000..7084527 --- /dev/null +++ b/classes/class_polygon2d.rst @@ -0,0 +1,409 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Polygon2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Polygon2D: + +Polygon2D +========= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A 2D polygon. + +Description +----------- + +A Polygon2D is defined by a set of points. Each point is connected to the next, with the final point being connected to the first, resulting in a closed polygon. Polygon2Ds can be filled with color (solid or gradient) or filled with a given texture. + +**Note:** By default, Godot can only draw up to 4,096 polygon points at a time. To increase this limit, open the Project Settings and increase :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_buffer_size_kb` and :ref:`ProjectSettings.rendering/limits/buffers/canvas_polygon_index_buffer_size_kb`. + +Properties +---------- + ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`antialiased` | ``false`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Array` | :ref:`bones` | ``[ ]`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 1, 1, 1, 1 )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`int` | :ref:`internal_vertex_count` | ``0`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`invert_border` | ``100.0`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`invert_enable` | ``false`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`polygon` | ``PoolVector2Array( )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Array` | :ref:`polygons` | ``[ ]`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`NodePath` | :ref:`skeleton` | ``NodePath("")`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Vector2` | :ref:`texture_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`texture_rotation` | | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`texture_rotation_degrees` | ``0.0`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`Vector2` | :ref:`texture_scale` | ``Vector2( 1, 1 )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector2Array` | :ref:`uv` | ``PoolVector2Array( )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ +| :ref:`PoolColorArray` | :ref:`vertex_colors` | ``PoolColorArray( )`` | ++-------------------------------------------------+------------------------------------------------------------------------------------+--------------------------+ + +Methods +------- + ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bone` **(** :ref:`NodePath` path, :ref:`PoolRealArray` weights **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_bones` **(** **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_bone` **(** :ref:`int` index **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_count` **(** **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_bone_path` **(** :ref:`int` index **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`get_bone_weights` **(** :ref:`int` index **)** |const| | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_path` **(** :ref:`int` index, :ref:`NodePath` path **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_weights` **(** :ref:`int` index, :ref:`PoolRealArray` weights **)** | ++-------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Polygon2D_property_antialiased: + +- :ref:`bool` **antialiased** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_antialiased(value) | ++-----------+------------------------+ +| *Getter* | get_antialiased() | ++-----------+------------------------+ + +If ``true``, polygon edges will be anti-aliased. + +---- + +.. _class_Polygon2D_property_bones: + +- :ref:`Array` **bones** + ++-----------+----------+ +| *Default* | ``[ ]`` | ++-----------+----------+ + +---- + +.. _class_Polygon2D_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The polygon's fill color. If ``texture`` is defined, it will be multiplied by this color. It will also be the default color for vertices not set in ``vertex_colors``. + +---- + +.. _class_Polygon2D_property_internal_vertex_count: + +- :ref:`int` **internal_vertex_count** + ++-----------+----------------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------------+ +| *Setter* | set_internal_vertex_count(value) | ++-----------+----------------------------------+ +| *Getter* | get_internal_vertex_count() | ++-----------+----------------------------------+ + +---- + +.. _class_Polygon2D_property_invert_border: + +- :ref:`float` **invert_border** + ++-----------+--------------------------+ +| *Default* | ``100.0`` | ++-----------+--------------------------+ +| *Setter* | set_invert_border(value) | ++-----------+--------------------------+ +| *Getter* | get_invert_border() | ++-----------+--------------------------+ + +Added padding applied to the bounding box when using ``invert``. Setting this value too small may result in a "Bad Polygon" error. + +---- + +.. _class_Polygon2D_property_invert_enable: + +- :ref:`bool` **invert_enable** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_invert(value) | ++-----------+-------------------+ +| *Getter* | get_invert() | ++-----------+-------------------+ + +If ``true``, polygon will be inverted, containing the area outside the defined points and extending to the ``invert_border``. + +---- + +.. _class_Polygon2D_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The offset applied to each vertex. + +---- + +.. _class_Polygon2D_property_polygon: + +- :ref:`PoolVector2Array` **polygon** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_polygon(value) | ++-----------+--------------------------+ +| *Getter* | get_polygon() | ++-----------+--------------------------+ + +The polygon's list of vertices. The final point will be connected to the first. + +**Note:** This returns a copy of the :ref:`PoolVector2Array` rather than a reference. + +---- + +.. _class_Polygon2D_property_polygons: + +- :ref:`Array` **polygons** + ++-----------+---------------------+ +| *Default* | ``[ ]`` | ++-----------+---------------------+ +| *Setter* | set_polygons(value) | ++-----------+---------------------+ +| *Getter* | get_polygons() | ++-----------+---------------------+ + +---- + +.. _class_Polygon2D_property_skeleton: + +- :ref:`NodePath` **skeleton** + ++-----------+---------------------+ +| *Default* | ``NodePath("")`` | ++-----------+---------------------+ +| *Setter* | set_skeleton(value) | ++-----------+---------------------+ +| *Getter* | get_skeleton() | ++-----------+---------------------+ + +---- + +.. _class_Polygon2D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The polygon's fill texture. Use ``uv`` to set texture coordinates. + +---- + +.. _class_Polygon2D_property_texture_offset: + +- :ref:`Vector2` **texture_offset** + ++-----------+---------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------------+ +| *Setter* | set_texture_offset(value) | ++-----------+---------------------------+ +| *Getter* | get_texture_offset() | ++-----------+---------------------------+ + +Amount to offset the polygon's ``texture``. If ``(0, 0)`` the texture's origin (its top-left corner) will be placed at the polygon's ``position``. + +---- + +.. _class_Polygon2D_property_texture_rotation: + +- :ref:`float` **texture_rotation** + ++----------+-----------------------------+ +| *Setter* | set_texture_rotation(value) | ++----------+-----------------------------+ +| *Getter* | get_texture_rotation() | ++----------+-----------------------------+ + +The texture's rotation in radians. + +---- + +.. _class_Polygon2D_property_texture_rotation_degrees: + +- :ref:`float` **texture_rotation_degrees** + ++-----------+-------------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_texture_rotation_degrees(value) | ++-----------+-------------------------------------+ +| *Getter* | get_texture_rotation_degrees() | ++-----------+-------------------------------------+ + +The texture's rotation in degrees. + +---- + +.. _class_Polygon2D_property_texture_scale: + +- :ref:`Vector2` **texture_scale** + ++-----------+--------------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+--------------------------+ +| *Setter* | set_texture_scale(value) | ++-----------+--------------------------+ +| *Getter* | get_texture_scale() | ++-----------+--------------------------+ + +Amount to multiply the ``uv`` coordinates when using a ``texture``. Larger values make the texture smaller, and vice versa. + +---- + +.. _class_Polygon2D_property_uv: + +- :ref:`PoolVector2Array` **uv** + ++-----------+--------------------------+ +| *Default* | ``PoolVector2Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_uv(value) | ++-----------+--------------------------+ +| *Getter* | get_uv() | ++-----------+--------------------------+ + +Texture coordinates for each vertex of the polygon. There should be one ``uv`` per polygon vertex. If there are fewer, undefined vertices will use ``(0, 0)``. + +---- + +.. _class_Polygon2D_property_vertex_colors: + +- :ref:`PoolColorArray` **vertex_colors** + ++-----------+--------------------------+ +| *Default* | ``PoolColorArray( )`` | ++-----------+--------------------------+ +| *Setter* | set_vertex_colors(value) | ++-----------+--------------------------+ +| *Getter* | get_vertex_colors() | ++-----------+--------------------------+ + +Color for each vertex. Colors are interpolated between vertices, resulting in smooth gradients. There should be one per polygon vertex. If there are fewer, undefined vertices will use ``color``. + +Method Descriptions +------------------- + +.. _class_Polygon2D_method_add_bone: + +- void **add_bone** **(** :ref:`NodePath` path, :ref:`PoolRealArray` weights **)** + +Adds a bone with the specified ``path`` and ``weights``. + +---- + +.. _class_Polygon2D_method_clear_bones: + +- void **clear_bones** **(** **)** + +Removes all bones from this ``Polygon2D``. + +---- + +.. _class_Polygon2D_method_erase_bone: + +- void **erase_bone** **(** :ref:`int` index **)** + +Removes the specified bone from this ``Polygon2D``. + +---- + +.. _class_Polygon2D_method_get_bone_count: + +- :ref:`int` **get_bone_count** **(** **)** |const| + +Returns the number of bones in this ``Polygon2D``. + +---- + +.. _class_Polygon2D_method_get_bone_path: + +- :ref:`NodePath` **get_bone_path** **(** :ref:`int` index **)** |const| + +Returns the path to the node associated with the specified bone. + +---- + +.. _class_Polygon2D_method_get_bone_weights: + +- :ref:`PoolRealArray` **get_bone_weights** **(** :ref:`int` index **)** |const| + +Returns the height values of the specified bone. + +---- + +.. _class_Polygon2D_method_set_bone_path: + +- void **set_bone_path** **(** :ref:`int` index, :ref:`NodePath` path **)** + +Sets the path to the node associated with the specified bone. + +---- + +.. _class_Polygon2D_method_set_bone_weights: + +- void **set_bone_weights** **(** :ref:`int` index, :ref:`PoolRealArray` weights **)** + +Sets the weight values for the specified bone. + +.. |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.)` diff --git a/classes/class_polygonpathfinder.rst b/classes/class_polygonpathfinder.rst new file mode 100644 index 0000000..27e7322 --- /dev/null +++ b/classes/class_polygonpathfinder.rst @@ -0,0 +1,88 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PolygonPathFinder.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PolygonPathFinder: + +PolygonPathFinder +================= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`find_path` **(** :ref:`Vector2` from, :ref:`Vector2` to **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_bounds` **(** **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_closest_point` **(** :ref:`Vector2` point **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`get_intersections` **(** :ref:`Vector2` from, :ref:`Vector2` to **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_point_penalty` **(** :ref:`int` idx **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_inside` **(** :ref:`Vector2` point **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_penalty` **(** :ref:`int` idx, :ref:`float` penalty **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`setup` **(** :ref:`PoolVector2Array` points, :ref:`PoolIntArray` connections **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PolygonPathFinder_method_find_path: + +- :ref:`PoolVector2Array` **find_path** **(** :ref:`Vector2` from, :ref:`Vector2` to **)** + +---- + +.. _class_PolygonPathFinder_method_get_bounds: + +- :ref:`Rect2` **get_bounds** **(** **)** |const| + +---- + +.. _class_PolygonPathFinder_method_get_closest_point: + +- :ref:`Vector2` **get_closest_point** **(** :ref:`Vector2` point **)** |const| + +---- + +.. _class_PolygonPathFinder_method_get_intersections: + +- :ref:`PoolVector2Array` **get_intersections** **(** :ref:`Vector2` from, :ref:`Vector2` to **)** |const| + +---- + +.. _class_PolygonPathFinder_method_get_point_penalty: + +- :ref:`float` **get_point_penalty** **(** :ref:`int` idx **)** |const| + +---- + +.. _class_PolygonPathFinder_method_is_point_inside: + +- :ref:`bool` **is_point_inside** **(** :ref:`Vector2` point **)** |const| + +---- + +.. _class_PolygonPathFinder_method_set_point_penalty: + +- void **set_point_penalty** **(** :ref:`int` idx, :ref:`float` penalty **)** + +---- + +.. _class_PolygonPathFinder_method_setup: + +- void **setup** **(** :ref:`PoolVector2Array` points, :ref:`PoolIntArray` connections **)** + +.. |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.)` diff --git a/classes/class_poolbytearray.rst b/classes/class_poolbytearray.rst new file mode 100644 index 0000000..b90cbf2 --- /dev/null +++ b/classes/class_poolbytearray.rst @@ -0,0 +1,222 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolByteArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolByteArray: + +PoolByteArray +============= + +A pooled :ref:`Array` of bytes. + +Description +----------- + +An :ref:`Array` specifically designed to hold bytes. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +Methods +------- + ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`PoolByteArray` **(** :ref:`Array` from **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`int` byte **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolByteArray` array **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`compress` **(** :ref:`int` compression_mode=0 **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`decompress` **(** :ref:`int` buffer_size, :ref:`int` compression_mode=0 **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`decompress_dynamic` **(** :ref:`int` max_output_size, :ref:`int` compression_mode=0 **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_string_from_ascii` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_string_from_utf8` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`hex_encode` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`int` byte **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`int` byte **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`int` byte **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`subarray` **(** :ref:`int` from, :ref:`int` to **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolByteArray_method_PoolByteArray: + +- :ref:`PoolByteArray` **PoolByteArray** **(** :ref:`Array` from **)** + +Constructs a new ``PoolByteArray``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolByteArray_method_append: + +- void **append** **(** :ref:`int` byte **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolByteArray_method_append_array: + +- void **append_array** **(** :ref:`PoolByteArray` array **)** + +Appends a ``PoolByteArray`` at the end of this array. + +---- + +.. _class_PoolByteArray_method_compress: + +- :ref:`PoolByteArray` **compress** **(** :ref:`int` compression_mode=0 **)** + +Returns a new ``PoolByteArray`` with the data compressed. Set the compression mode using one of :ref:`CompressionMode`'s constants. + +---- + +.. _class_PoolByteArray_method_decompress: + +- :ref:`PoolByteArray` **decompress** **(** :ref:`int` buffer_size, :ref:`int` compression_mode=0 **)** + +Returns a new ``PoolByteArray`` with the data decompressed. Set ``buffer_size`` to the size of the uncompressed data. Set the compression mode using one of :ref:`CompressionMode`'s constants. + +---- + +.. _class_PoolByteArray_method_decompress_dynamic: + +- :ref:`PoolByteArray` **decompress_dynamic** **(** :ref:`int` max_output_size, :ref:`int` compression_mode=0 **)** + +Returns a new ``PoolByteArray`` with the data decompressed. Set the compression mode using one of :ref:`CompressionMode`'s constants. **This method only accepts gzip and deflate compression modes.** + +This method is potentially slower than ``decompress``, as it may have to re-allocate its output buffer multiple times while decompressing, where as ``decompress`` knows its output buffer size from the beginning. + + + +GZIP has a maximal compression ratio of 1032:1, meaning it's very possible for a small compressed payload to decompress to a potentially very large output. To guard against this, you may provide a maximum size this function is allowed to allocate in bytes via ``max_output_size``. Passing -1 will allow for unbounded output. If any positive value is passed, and the decompression exceeds that amount in bytes, then an error will be returned. + +---- + +.. _class_PoolByteArray_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolByteArray_method_get_string_from_ascii: + +- :ref:`String` **get_string_from_ascii** **(** **)** + +Returns a copy of the array's contents as :ref:`String`. Fast alternative to :ref:`get_string_from_utf8` if the content is ASCII-only. Unlike the UTF-8 function this function maps every byte to a character in the array. Multibyte sequences will not be interpreted correctly. For parsing user input always use :ref:`get_string_from_utf8`. + +---- + +.. _class_PoolByteArray_method_get_string_from_utf8: + +- :ref:`String` **get_string_from_utf8** **(** **)** + +Returns a copy of the array's contents as :ref:`String`. Slower than :ref:`get_string_from_ascii` but supports UTF-8 encoded data. Use this function if you are unsure about the source of the data. For user input this function should always be preferred. + +---- + +.. _class_PoolByteArray_method_hex_encode: + +- :ref:`String` **hex_encode** **(** **)** + +Returns a hexadecimal representation of this array as a :ref:`String`. + +:: + + var array = PoolByteArray([11, 46, 255]) + print(array.hex_encode()) # Prints: 0b2eff + +---- + +.. _class_PoolByteArray_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`int` byte **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolByteArray_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolByteArray_method_push_back: + +- void **push_back** **(** :ref:`int` byte **)** + +Appends an element at the end of the array. + +---- + +.. _class_PoolByteArray_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolByteArray_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +**Note:** Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. + +---- + +.. _class_PoolByteArray_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`int` byte **)** + +Changes the byte at the given index. + +---- + +.. _class_PoolByteArray_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +---- + +.. _class_PoolByteArray_method_subarray: + +- :ref:`PoolByteArray` **subarray** **(** :ref:`int` from, :ref:`int` to **)** + +Returns the slice of the ``PoolByteArray`` between indices (inclusive) as a new ``PoolByteArray``. Any negative index is considered to be from the end of the array. + +.. |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.)` diff --git a/classes/class_poolcolorarray.rst b/classes/class_poolcolorarray.rst new file mode 100644 index 0000000..c09bb4a --- /dev/null +++ b/classes/class_poolcolorarray.rst @@ -0,0 +1,139 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolColorArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolColorArray: + +PoolColorArray +============== + +A pooled :ref:`Array` of :ref:`Color`. + +Description +----------- + +An :ref:`Array` specifically designed to hold :ref:`Color`. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +Methods +------- + ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolColorArray` | :ref:`PoolColorArray` **(** :ref:`Array` from **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`Color` color **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolColorArray` array **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Color` color **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`Color` color **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`Color` color **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++---------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolColorArray_method_PoolColorArray: + +- :ref:`PoolColorArray` **PoolColorArray** **(** :ref:`Array` from **)** + +Constructs a new ``PoolColorArray``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolColorArray_method_append: + +- void **append** **(** :ref:`Color` color **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolColorArray_method_append_array: + +- void **append_array** **(** :ref:`PoolColorArray` array **)** + +Appends a ``PoolColorArray`` at the end of this array. + +---- + +.. _class_PoolColorArray_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolColorArray_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Color` color **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolColorArray_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolColorArray_method_push_back: + +- void **push_back** **(** :ref:`Color` color **)** + +Appends a value to the array. + +---- + +.. _class_PoolColorArray_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolColorArray_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +---- + +.. _class_PoolColorArray_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`Color` color **)** + +Changes the :ref:`Color` at the given index. + +---- + +.. _class_PoolColorArray_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +.. |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.)` diff --git a/classes/class_poolintarray.rst b/classes/class_poolintarray.rst new file mode 100644 index 0000000..d4fcd9d --- /dev/null +++ b/classes/class_poolintarray.rst @@ -0,0 +1,143 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolIntArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolIntArray: + +PoolIntArray +============ + +A pooled :ref:`Array` of integers (:ref:`int`). + +Description +----------- + +An :ref:`Array` specifically designed to hold integer values (:ref:`int`). Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +**Note:** This type is limited to signed 32-bit integers, which means it can only take values in the interval ``[-2^31, 2^31 - 1]``, i.e. ``[-2147483648, 2147483647]``. Exceeding those bounds will wrap around. In comparison, :ref:`int` uses signed 64-bit integers which can hold much larger values. + +Methods +------- + ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`PoolIntArray` **(** :ref:`Array` from **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`int` integer **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolIntArray` array **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`int` integer **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`int` integer **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`int` integer **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolIntArray_method_PoolIntArray: + +- :ref:`PoolIntArray` **PoolIntArray** **(** :ref:`Array` from **)** + +Constructs a new ``PoolIntArray``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolIntArray_method_append: + +- void **append** **(** :ref:`int` integer **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolIntArray_method_append_array: + +- void **append_array** **(** :ref:`PoolIntArray` array **)** + +Appends a ``PoolIntArray`` at the end of this array. + +---- + +.. _class_PoolIntArray_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolIntArray_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`int` integer **)** + +Inserts a new int at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolIntArray_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolIntArray_method_push_back: + +- void **push_back** **(** :ref:`int` integer **)** + +Appends a value to the array. + +---- + +.. _class_PoolIntArray_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolIntArray_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +**Note:** Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. + +---- + +.. _class_PoolIntArray_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`int` integer **)** + +Changes the int at the given index. + +---- + +.. _class_PoolIntArray_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the array size. + +.. |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.)` diff --git a/classes/class_poolrealarray.rst b/classes/class_poolrealarray.rst new file mode 100644 index 0000000..52d93bb --- /dev/null +++ b/classes/class_poolrealarray.rst @@ -0,0 +1,143 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolRealArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolRealArray: + +PoolRealArray +============= + +A pooled :ref:`Array` of reals (:ref:`float`). + +Description +----------- + +An :ref:`Array` specifically designed to hold floating-point values. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +**Note:** Unlike primitive :ref:`float`\ s which are 64-bit, numbers stored in ``PoolRealArray`` are 32-bit floats. This means values stored in ``PoolRealArray`` have lower precision compared to primitive :ref:`float`\ s. If you need to store 64-bit floats in an array, use a generic :ref:`Array` with :ref:`float` elements as these will still be 64-bit. However, using a generic :ref:`Array` to store :ref:`float`\ s will use roughly 6 times more memory compared to a ``PoolRealArray``. + +Methods +------- + ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`PoolRealArray` **(** :ref:`Array` from **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`float` value **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolRealArray` array **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`float` value **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`float` value **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`float` value **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolRealArray_method_PoolRealArray: + +- :ref:`PoolRealArray` **PoolRealArray** **(** :ref:`Array` from **)** + +Constructs a new ``PoolRealArray``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolRealArray_method_append: + +- void **append** **(** :ref:`float` value **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolRealArray_method_append_array: + +- void **append_array** **(** :ref:`PoolRealArray` array **)** + +Appends a ``PoolRealArray`` at the end of this array. + +---- + +.. _class_PoolRealArray_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolRealArray_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`float` value **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolRealArray_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolRealArray_method_push_back: + +- void **push_back** **(** :ref:`float` value **)** + +Appends an element at the end of the array. + +---- + +.. _class_PoolRealArray_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolRealArray_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +**Note:** Added elements are not automatically initialized to 0 and will contain garbage, i.e. indeterminate values. + +---- + +.. _class_PoolRealArray_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`float` value **)** + +Changes the float at the given index. + +---- + +.. _class_PoolRealArray_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +.. |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.)` diff --git a/classes/class_poolstringarray.rst b/classes/class_poolstringarray.rst new file mode 100644 index 0000000..181144f --- /dev/null +++ b/classes/class_poolstringarray.rst @@ -0,0 +1,154 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolStringArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolStringArray: + +PoolStringArray +=============== + +A pooled :ref:`Array` of :ref:`String`. + +Description +----------- + +An :ref:`Array` specifically designed to hold :ref:`String`\ s. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +Tutorials +--------- + +- `OS Test Demo `__ + +Methods +------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`PoolStringArray` **(** :ref:`Array` from **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolStringArray` array **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`join` **(** :ref:`String` delimiter **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`String` string **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-----------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolStringArray_method_PoolStringArray: + +- :ref:`PoolStringArray` **PoolStringArray** **(** :ref:`Array` from **)** + +Constructs a new ``PoolStringArray``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolStringArray_method_append: + +- void **append** **(** :ref:`String` string **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolStringArray_method_append_array: + +- void **append_array** **(** :ref:`PoolStringArray` array **)** + +Appends a ``PoolStringArray`` at the end of this array. + +---- + +.. _class_PoolStringArray_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolStringArray_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`String` string **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolStringArray_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolStringArray_method_join: + +- :ref:`String` **join** **(** :ref:`String` delimiter **)** + +Returns a :ref:`String` with each element of the array joined with the given ``delimiter``. + +---- + +.. _class_PoolStringArray_method_push_back: + +- void **push_back** **(** :ref:`String` string **)** + +Appends a string element at end of the array. + +---- + +.. _class_PoolStringArray_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolStringArray_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +---- + +.. _class_PoolStringArray_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`String` string **)** + +Changes the :ref:`String` at the given index. + +---- + +.. _class_PoolStringArray_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +.. |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.)` diff --git a/classes/class_poolvector2array.rst b/classes/class_poolvector2array.rst new file mode 100644 index 0000000..29c1e3e --- /dev/null +++ b/classes/class_poolvector2array.rst @@ -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 PoolVector2Array.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolVector2Array: + +PoolVector2Array +================ + +A pooled :ref:`Array` of :ref:`Vector2`. + +Description +----------- + +An :ref:`Array` specifically designed to hold :ref:`Vector2`. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +Tutorials +--------- + +- `2D Navigation Astar Demo `__ + +Methods +------- + ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`PoolVector2Array` **(** :ref:`Array` from **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`Vector2` vector2 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolVector2Array` array **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`Vector2` vector2 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolVector2Array_method_PoolVector2Array: + +- :ref:`PoolVector2Array` **PoolVector2Array** **(** :ref:`Array` from **)** + +Constructs a new ``PoolVector2Array``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolVector2Array_method_append: + +- void **append** **(** :ref:`Vector2` vector2 **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolVector2Array_method_append_array: + +- void **append_array** **(** :ref:`PoolVector2Array` array **)** + +Appends a ``PoolVector2Array`` at the end of this array. + +---- + +.. _class_PoolVector2Array_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolVector2Array_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolVector2Array_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolVector2Array_method_push_back: + +- void **push_back** **(** :ref:`Vector2` vector2 **)** + +Inserts a :ref:`Vector2` at the end. + +---- + +.. _class_PoolVector2Array_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolVector2Array_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +---- + +.. _class_PoolVector2Array_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`Vector2` vector2 **)** + +Changes the :ref:`Vector2` at the given index. + +---- + +.. _class_PoolVector2Array_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +.. |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.)` diff --git a/classes/class_poolvector3array.rst b/classes/class_poolvector3array.rst new file mode 100644 index 0000000..5cc647f --- /dev/null +++ b/classes/class_poolvector3array.rst @@ -0,0 +1,139 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PoolVector3Array.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PoolVector3Array: + +PoolVector3Array +================ + +A pooled :ref:`Array` of :ref:`Vector3`. + +Description +----------- + +An :ref:`Array` specifically designed to hold :ref:`Vector3`. Optimized for memory usage, does not fragment the memory. + +**Note:** This type is passed by value and not by reference. + +Methods +------- + ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`PoolVector3Array` **(** :ref:`Array` from **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append` **(** :ref:`Vector3` vector3 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_array` **(** :ref:`PoolVector3Array` array **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`insert` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`invert` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_back` **(** :ref:`Vector3` vector3 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` idx **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set` **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`size` **(** **)** | ++-------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_PoolVector3Array_method_PoolVector3Array: + +- :ref:`PoolVector3Array` **PoolVector3Array** **(** :ref:`Array` from **)** + +Constructs a new ``PoolVector3Array``. Optionally, you can pass in a generic :ref:`Array` that will be converted. + +---- + +.. _class_PoolVector3Array_method_append: + +- void **append** **(** :ref:`Vector3` vector3 **)** + +Appends an element at the end of the array (alias of :ref:`push_back`). + +---- + +.. _class_PoolVector3Array_method_append_array: + +- void **append_array** **(** :ref:`PoolVector3Array` array **)** + +Appends a ``PoolVector3Array`` at the end of this array. + +---- + +.. _class_PoolVector3Array_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the array is empty. + +---- + +.. _class_PoolVector3Array_method_insert: + +- :ref:`int` **insert** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** + +Inserts a new element at a given position in the array. The position must be valid, or at the end of the array (``idx == size()``). + +---- + +.. _class_PoolVector3Array_method_invert: + +- void **invert** **(** **)** + +Reverses the order of the elements in the array. + +---- + +.. _class_PoolVector3Array_method_push_back: + +- void **push_back** **(** :ref:`Vector3` vector3 **)** + +Inserts a :ref:`Vector3` at the end. + +---- + +.. _class_PoolVector3Array_method_remove: + +- void **remove** **(** :ref:`int` idx **)** + +Removes an element from the array by index. + +---- + +.. _class_PoolVector3Array_method_resize: + +- void **resize** **(** :ref:`int` idx **)** + +Sets the size of the array. If the array is grown, reserves elements at the end of the array. If the array is shrunk, truncates the array to the new size. + +---- + +.. _class_PoolVector3Array_method_set: + +- void **set** **(** :ref:`int` idx, :ref:`Vector3` vector3 **)** + +Changes the :ref:`Vector3` at the given index. + +---- + +.. _class_PoolVector3Array_method_size: + +- :ref:`int` **size** **(** **)** + +Returns the size of the array. + +.. |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.)` diff --git a/classes/class_popup.rst b/classes/class_popup.rst new file mode 100644 index 0000000..e9e39c3 --- /dev/null +++ b/classes/class_popup.rst @@ -0,0 +1,147 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Popup.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Popup: + +Popup +===== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`PopupDialog`, :ref:`PopupMenu`, :ref:`PopupPanel`, :ref:`WindowDialog` + +Base container control for popups and dialogs. + +Description +----------- + +Popup is a base :ref:`Control` used to show dialogs and popups. It's a subwindow and modal by default (see :ref:`Control`) and has helpers for custom popup behavior. All popup methods ensure correct placement within the viewport. + +Properties +---------- + ++-------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`popup_exclusive` | ``false`` | ++-------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | visible | ``false`` *(parent override)* | ++-------------------------+--------------------------------------------------------------+-------------------------------+ + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`popup` **(** :ref:`Rect2` bounds=Rect2( 0, 0, 0, 0 ) **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`popup_centered` **(** :ref:`Vector2` size=Vector2( 0, 0 ) **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`popup_centered_clamped` **(** :ref:`Vector2` size=Vector2( 0, 0 ), :ref:`float` fallback_ratio=0.75 **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`popup_centered_minsize` **(** :ref:`Vector2` minsize=Vector2( 0, 0 ) **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`popup_centered_ratio` **(** :ref:`float` ratio=0.75 **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_as_minsize` **(** **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Popup_signal_about_to_show: + +- **about_to_show** **(** **)** + +Emitted when a popup is about to be shown. This is often used in :ref:`PopupMenu` to clear the list of options then create a new one according to the current context. + +---- + +.. _class_Popup_signal_popup_hide: + +- **popup_hide** **(** **)** + +Emitted when a popup is hidden. + +Constants +--------- + +.. _class_Popup_constant_NOTIFICATION_POST_POPUP: + +.. _class_Popup_constant_NOTIFICATION_POPUP_HIDE: + +- **NOTIFICATION_POST_POPUP** = **80** --- Notification sent right after the popup is shown. + +- **NOTIFICATION_POPUP_HIDE** = **81** --- Notification sent right after the popup is hidden. + +Property Descriptions +--------------------- + +.. _class_Popup_property_popup_exclusive: + +- :ref:`bool` **popup_exclusive** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_exclusive(value) | ++-----------+----------------------+ +| *Getter* | is_exclusive() | ++-----------+----------------------+ + +If ``true``, the popup will not be hidden when a click event occurs outside of it, or when it receives the ``ui_cancel`` action event. + +**Note:** Enabling this property doesn't affect the Close or Cancel buttons' behavior in dialogs that inherit from this class. As a workaround, you can use :ref:`WindowDialog.get_close_button` or :ref:`ConfirmationDialog.get_cancel` and hide the buttons in question by setting their :ref:`CanvasItem.visible` property to ``false``. + +Method Descriptions +------------------- + +.. _class_Popup_method_popup: + +- void **popup** **(** :ref:`Rect2` bounds=Rect2( 0, 0, 0, 0 ) **)** + +Popup (show the control in modal form). + +---- + +.. _class_Popup_method_popup_centered: + +- void **popup_centered** **(** :ref:`Vector2` size=Vector2( 0, 0 ) **)** + +Popup (show the control in modal form) in the center of the screen relative to its current canvas transform, at the current size, or at a size determined by ``size``. + +---- + +.. _class_Popup_method_popup_centered_clamped: + +- void **popup_centered_clamped** **(** :ref:`Vector2` size=Vector2( 0, 0 ), :ref:`float` fallback_ratio=0.75 **)** + +Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, clamping the size to ``size``, then ensuring the popup is no larger than the viewport size multiplied by ``fallback_ratio``. + +---- + +.. _class_Popup_method_popup_centered_minsize: + +- void **popup_centered_minsize** **(** :ref:`Vector2` minsize=Vector2( 0, 0 ) **)** + +Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, ensuring the size is never smaller than ``minsize``. + +---- + +.. _class_Popup_method_popup_centered_ratio: + +- void **popup_centered_ratio** **(** :ref:`float` ratio=0.75 **)** + +Popup (show the control in modal form) in the center of the screen relative to the current canvas transform, scaled at a ratio of size of the screen. + +---- + +.. _class_Popup_method_set_as_minsize: + +- void **set_as_minsize** **(** **)** + +Shrink popup to keep to the minimum size of content. + +.. |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.)` diff --git a/classes/class_popupdialog.rst b/classes/class_popupdialog.rst new file mode 100644 index 0000000..6cfa531 --- /dev/null +++ b/classes/class_popupdialog.rst @@ -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 PopupDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PopupDialog: + +PopupDialog +=========== + +**Inherits:** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Base class for popup dialogs. + +Description +----------- + +PopupDialog is a base class for popup dialogs, along with :ref:`WindowDialog`. + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | ++---------------------------------+---------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_PopupDialog_theme_style_panel: + +- :ref:`StyleBox` **panel** + +Sets a custom :ref:`StyleBox` for the panel of the ``PopupDialog``. + +.. |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.)` diff --git a/classes/class_popupmenu.rst b/classes/class_popupmenu.rst new file mode 100644 index 0000000..fee7cc1 --- /dev/null +++ b/classes/class_popupmenu.rst @@ -0,0 +1,956 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PopupMenu.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PopupMenu: + +PopupMenu +========= + +**Inherits:** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +PopupMenu displays a list of options. + +Description +----------- + +``PopupMenu`` is a :ref:`Control` that displays a list of options. They are popular in toolbars or context menus. + +Properties +---------- + ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`allow_search` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`hide_on_checkable_item_selection` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`hide_on_item_selection` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`hide_on_state_item_selection` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`submenu_popup_delay` | ``0.3`` | ++------------------------------------------+----------------------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_check_item` **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_check_shortcut` **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_check_item` **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_check_shortcut` **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_item` **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_radio_check_item` **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_radio_check_shortcut` **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_icon_shortcut` **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_item` **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_multistate_item` **(** :ref:`String` label, :ref:`int` max_states, :ref:`int` default_state=0, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_radio_check_item` **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_radio_check_shortcut` **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_separator` **(** :ref:`String` label="", :ref:`int` id=-1 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_shortcut` **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_submenu_item` **(** :ref:`String` label, :ref:`String` submenu, :ref:`int` id=-1 **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_index` **(** **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_accelerator` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_count` **(** **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_item_icon` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_id` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_item_index` **(** :ref:`int` id **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_item_metadata` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ShortCut` | :ref:`get_item_shortcut` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_submenu` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_text` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_item_tooltip` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_hide_on_window_lose_focus` **(** **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_checkable` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_checked` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_disabled` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_radio_checkable` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_separator` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_item_shortcut_disabled` **(** :ref:`int` idx **)** |const| | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_item` **(** :ref:`int` idx **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_hide_on_window_lose_focus` **(** :ref:`bool` enable **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_accelerator` **(** :ref:`int` idx, :ref:`int` accel **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_as_checkable` **(** :ref:`int` idx, :ref:`bool` enable **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_as_radio_checkable` **(** :ref:`int` idx, :ref:`bool` enable **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_as_separator` **(** :ref:`int` idx, :ref:`bool` enable **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_checked` **(** :ref:`int` idx, :ref:`bool` checked **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_icon` **(** :ref:`int` idx, :ref:`Texture` icon **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_id` **(** :ref:`int` idx, :ref:`int` id **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_metadata` **(** :ref:`int` idx, :ref:`Variant` metadata **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_multistate` **(** :ref:`int` idx, :ref:`int` state **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_shortcut` **(** :ref:`int` idx, :ref:`ShortCut` shortcut, :ref:`bool` global=false **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_shortcut_disabled` **(** :ref:`int` idx, :ref:`bool` disabled **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_submenu` **(** :ref:`int` idx, :ref:`String` submenu **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_text` **(** :ref:`int` idx, :ref:`String` text **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_item_tooltip` **(** :ref:`int` idx, :ref:`String` tooltip **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`toggle_item_checked` **(** :ref:`int` idx **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`toggle_item_multistate` **(** :ref:`int` idx **)** | ++---------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_accel` | ``Color( 0.7, 0.7, 0.7, 0.8 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.4, 0.4, 0.4, 0.8 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_separator` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`vseparation` | ``4`` | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`checked` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_checked` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`radio_unchecked` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`submenu` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`unchecked` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`labeled_separator_left` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`labeled_separator_right` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`panel_disabled` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`separator` | | ++---------------------------------+-------------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_PopupMenu_signal_id_focused: + +- **id_focused** **(** :ref:`int` id **)** + +Emitted when user navigated to an item of some ``id`` using ``ui_up`` or ``ui_down`` action. + +---- + +.. _class_PopupMenu_signal_id_pressed: + +- **id_pressed** **(** :ref:`int` id **)** + +Emitted when an item of some ``id`` is pressed or its accelerator is activated. + +---- + +.. _class_PopupMenu_signal_index_pressed: + +- **index_pressed** **(** :ref:`int` index **)** + +Emitted when an item of some ``index`` is pressed or its accelerator is activated. + +Property Descriptions +--------------------- + +.. _class_PopupMenu_property_allow_search: + +- :ref:`bool` **allow_search** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_allow_search(value) | ++-----------+-------------------------+ +| *Getter* | get_allow_search() | ++-----------+-------------------------+ + +If ``true``, allows navigating ``PopupMenu`` with letter keys. + +---- + +.. _class_PopupMenu_property_hide_on_checkable_item_selection: + +- :ref:`bool` **hide_on_checkable_item_selection** + ++-----------+---------------------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------------------+ +| *Setter* | set_hide_on_checkable_item_selection(value) | ++-----------+---------------------------------------------+ +| *Getter* | is_hide_on_checkable_item_selection() | ++-----------+---------------------------------------------+ + +If ``true``, hides the ``PopupMenu`` when a checkbox or radio button is selected. + +---- + +.. _class_PopupMenu_property_hide_on_item_selection: + +- :ref:`bool` **hide_on_item_selection** + ++-----------+-----------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------+ +| *Setter* | set_hide_on_item_selection(value) | ++-----------+-----------------------------------+ +| *Getter* | is_hide_on_item_selection() | ++-----------+-----------------------------------+ + +If ``true``, hides the ``PopupMenu`` when an item is selected. + +---- + +.. _class_PopupMenu_property_hide_on_state_item_selection: + +- :ref:`bool` **hide_on_state_item_selection** + ++-----------+-----------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------+ +| *Setter* | set_hide_on_state_item_selection(value) | ++-----------+-----------------------------------------+ +| *Getter* | is_hide_on_state_item_selection() | ++-----------+-----------------------------------------+ + +If ``true``, hides the ``PopupMenu`` when a state item is selected. + +---- + +.. _class_PopupMenu_property_submenu_popup_delay: + +- :ref:`float` **submenu_popup_delay** + ++-----------+--------------------------------+ +| *Default* | ``0.3`` | ++-----------+--------------------------------+ +| *Setter* | set_submenu_popup_delay(value) | ++-----------+--------------------------------+ +| *Getter* | get_submenu_popup_delay() | ++-----------+--------------------------------+ + +Sets the delay time in seconds for the submenu item to popup on mouse hovering. If the popup menu is added as a child of another (acting as a submenu), it will inherit the delay time of the parent menu item. + +Method Descriptions +------------------- + +.. _class_PopupMenu_method_add_check_item: + +- void **add_check_item** **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new checkable item with text ``label``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_check_shortcut: + +- void **add_check_shortcut** **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Adds a new checkable item and assigns the specified :ref:`ShortCut` to it. Sets the label of the checkbox to the :ref:`ShortCut`'s name. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_icon_check_item: + +- void **add_icon_check_item** **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new checkable item with text ``label`` and icon ``texture``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_icon_check_shortcut: + +- void **add_icon_check_shortcut** **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Adds a new checkable item and assigns the specified :ref:`ShortCut` and icon ``texture`` to it. Sets the label of the checkbox to the :ref:`ShortCut`'s name. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_icon_item: + +- void **add_icon_item** **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new item with text ``label`` and icon ``texture``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +---- + +.. _class_PopupMenu_method_add_icon_radio_check_item: + +- void **add_icon_radio_check_item** **(** :ref:`Texture` texture, :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Same as :ref:`add_icon_check_item`, but uses a radio check button. + +---- + +.. _class_PopupMenu_method_add_icon_radio_check_shortcut: + +- void **add_icon_radio_check_shortcut** **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Same as :ref:`add_icon_check_shortcut`, but uses a radio check button. + +---- + +.. _class_PopupMenu_method_add_icon_shortcut: + +- void **add_icon_shortcut** **(** :ref:`Texture` texture, :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Adds a new item and assigns the specified :ref:`ShortCut` and icon ``texture`` to it. Sets the label of the checkbox to the :ref:`ShortCut`'s name. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +---- + +.. _class_PopupMenu_method_add_item: + +- void **add_item** **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new item with text ``label``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +---- + +.. _class_PopupMenu_method_add_multistate_item: + +- void **add_multistate_item** **(** :ref:`String` label, :ref:`int` max_states, :ref:`int` default_state=0, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new multistate item with text ``label``. + +Contrarily to normal binary items, multistate items can have more than two states, as defined by ``max_states``. Each press or activate of the item will increase the state by one. The default value is defined by ``default_state``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +---- + +.. _class_PopupMenu_method_add_radio_check_item: + +- void **add_radio_check_item** **(** :ref:`String` label, :ref:`int` id=-1, :ref:`int` accel=0 **)** + +Adds a new radio check button with text ``label``. + +An ``id`` can optionally be provided, as well as an accelerator (``accel``). If no ``id`` is provided, one will be created from the index. If no ``accel`` is provided then the default ``0`` will be assigned to it. See :ref:`get_item_accelerator` for more info on accelerators. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_radio_check_shortcut: + +- void **add_radio_check_shortcut** **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Adds a new radio check button and assigns a :ref:`ShortCut` to it. Sets the label of the checkbox to the :ref:`ShortCut`'s name. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. See :ref:`set_item_checked` for more info on how to control it. + +---- + +.. _class_PopupMenu_method_add_separator: + +- void **add_separator** **(** :ref:`String` label="", :ref:`int` id=-1 **)** + +Adds a separator between items. Separators also occupy an index, which you can set by using the ``id`` parameter. + +A ``label`` can optionally be provided, which will appear at the center of the separator. + +---- + +.. _class_PopupMenu_method_add_shortcut: + +- void **add_shortcut** **(** :ref:`ShortCut` shortcut, :ref:`int` id=-1, :ref:`bool` global=false **)** + +Adds a :ref:`ShortCut`. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +---- + +.. _class_PopupMenu_method_add_submenu_item: + +- void **add_submenu_item** **(** :ref:`String` label, :ref:`String` submenu, :ref:`int` id=-1 **)** + +Adds an item that will act as a submenu of the parent ``PopupMenu`` node when clicked. The ``submenu`` argument is the name of the child ``PopupMenu`` node that will be shown when the item is clicked. + +An ``id`` can optionally be provided. If no ``id`` is provided, one will be created from the index. + +---- + +.. _class_PopupMenu_method_clear: + +- void **clear** **(** **)** + +Removes all items from the ``PopupMenu``. + +---- + +.. _class_PopupMenu_method_get_current_index: + +- :ref:`int` **get_current_index** **(** **)** |const| + +Returns the index of the currently focused item. Returns ``-1`` if no item is focused. + +---- + +.. _class_PopupMenu_method_get_item_accelerator: + +- :ref:`int` **get_item_accelerator** **(** :ref:`int` idx **)** |const| + +Returns the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + +---- + +.. _class_PopupMenu_method_get_item_count: + +- :ref:`int` **get_item_count** **(** **)** |const| + +Returns the number of items in the ``PopupMenu``. + +---- + +.. _class_PopupMenu_method_get_item_icon: + +- :ref:`Texture` **get_item_icon** **(** :ref:`int` idx **)** |const| + +Returns the icon of the item at index ``idx``. + +---- + +.. _class_PopupMenu_method_get_item_id: + +- :ref:`int` **get_item_id** **(** :ref:`int` idx **)** |const| + +Returns the id of the item at index ``idx``. ``id`` can be manually assigned, while index can not. + +---- + +.. _class_PopupMenu_method_get_item_index: + +- :ref:`int` **get_item_index** **(** :ref:`int` id **)** |const| + +Returns the index of the item containing the specified ``id``. Index is automatically assigned to each item by the engine. Index can not be set manually. + +---- + +.. _class_PopupMenu_method_get_item_metadata: + +- :ref:`Variant` **get_item_metadata** **(** :ref:`int` idx **)** |const| + +Returns the metadata of the specified item, which might be of any type. You can set it with :ref:`set_item_metadata`, which provides a simple way of assigning context data to items. + +---- + +.. _class_PopupMenu_method_get_item_shortcut: + +- :ref:`ShortCut` **get_item_shortcut** **(** :ref:`int` idx **)** |const| + +Returns the :ref:`ShortCut` associated with the specified ``idx`` item. + +---- + +.. _class_PopupMenu_method_get_item_submenu: + +- :ref:`String` **get_item_submenu** **(** :ref:`int` idx **)** |const| + +Returns the submenu name of the item at index ``idx``. See :ref:`add_submenu_item` for more info on how to add a submenu. + +---- + +.. _class_PopupMenu_method_get_item_text: + +- :ref:`String` **get_item_text** **(** :ref:`int` idx **)** |const| + +Returns the text of the item at index ``idx``. + +---- + +.. _class_PopupMenu_method_get_item_tooltip: + +- :ref:`String` **get_item_tooltip** **(** :ref:`int` idx **)** |const| + +Returns the tooltip associated with the specified index index ``idx``. + +---- + +.. _class_PopupMenu_method_is_hide_on_window_lose_focus: + +- :ref:`bool` **is_hide_on_window_lose_focus** **(** **)** |const| + +Returns ``true`` if the popup will be hidden when the window loses focus or not. + +---- + +.. _class_PopupMenu_method_is_item_checkable: + +- :ref:`bool` **is_item_checkable** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at index ``idx`` is checkable in some way, i.e. if it has a checkbox or radio button. + +**Note:** Checkable items just display a checkmark or radio button, but don't have any built-in checking behavior and must be checked/unchecked manually. + +---- + +.. _class_PopupMenu_method_is_item_checked: + +- :ref:`bool` **is_item_checked** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at index ``idx`` is checked. + +---- + +.. _class_PopupMenu_method_is_item_disabled: + +- :ref:`bool` **is_item_disabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at index ``idx`` is disabled. When it is disabled it can't be selected, or its action invoked. + +See :ref:`set_item_disabled` for more info on how to disable an item. + +---- + +.. _class_PopupMenu_method_is_item_radio_checkable: + +- :ref:`bool` **is_item_radio_checkable** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item at index ``idx`` has radio button-style checkability. + +**Note:** This is purely cosmetic; you must add the logic for checking/unchecking items in radio groups. + +---- + +.. _class_PopupMenu_method_is_item_separator: + +- :ref:`bool` **is_item_separator** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the item is a separator. If it is, it will be displayed as a line. See :ref:`add_separator` for more info on how to add a separator. + +---- + +.. _class_PopupMenu_method_is_item_shortcut_disabled: + +- :ref:`bool` **is_item_shortcut_disabled** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the specified item's shortcut is disabled. + +---- + +.. _class_PopupMenu_method_remove_item: + +- void **remove_item** **(** :ref:`int` idx **)** + +Removes the item at index ``idx`` from the menu. + +**Note:** The indices of items after the removed item will be shifted by one. + +---- + +.. _class_PopupMenu_method_set_hide_on_window_lose_focus: + +- void **set_hide_on_window_lose_focus** **(** :ref:`bool` enable **)** + +Hides the ``PopupMenu`` when the window loses focus. + +---- + +.. _class_PopupMenu_method_set_item_accelerator: + +- void **set_item_accelerator** **(** :ref:`int` idx, :ref:`int` accel **)** + +Sets the accelerator of the item at index ``idx``. Accelerators are special combinations of keys that activate the item, no matter which control is focused. + +---- + +.. _class_PopupMenu_method_set_item_as_checkable: + +- void **set_item_as_checkable** **(** :ref:`int` idx, :ref:`bool` enable **)** + +Sets whether the item at index ``idx`` has a checkbox. If ``false``, sets the type of the item to plain text. + +**Note:** Checkable items just display a checkmark, but don't have any built-in checking behavior and must be checked/unchecked manually. + +---- + +.. _class_PopupMenu_method_set_item_as_radio_checkable: + +- void **set_item_as_radio_checkable** **(** :ref:`int` idx, :ref:`bool` enable **)** + +Sets the type of the item at the specified index ``idx`` to radio button. If ``false``, sets the type of the item to plain text. + +---- + +.. _class_PopupMenu_method_set_item_as_separator: + +- void **set_item_as_separator** **(** :ref:`int` idx, :ref:`bool` enable **)** + +Mark the item at index ``idx`` as a separator, which means that it would be displayed as a line. If ``false``, sets the type of the item to plain text. + +---- + +.. _class_PopupMenu_method_set_item_checked: + +- void **set_item_checked** **(** :ref:`int` idx, :ref:`bool` checked **)** + +Sets the checkstate status of the item at index ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_disabled: + +- void **set_item_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** + +Enables/disables the item at index ``idx``. When it is disabled, it can't be selected and its action can't be invoked. + +---- + +.. _class_PopupMenu_method_set_item_icon: + +- void **set_item_icon** **(** :ref:`int` idx, :ref:`Texture` icon **)** + +Replaces the :ref:`Texture` icon of the specified ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_id: + +- void **set_item_id** **(** :ref:`int` idx, :ref:`int` id **)** + +Sets the ``id`` of the item at index ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_metadata: + +- void **set_item_metadata** **(** :ref:`int` idx, :ref:`Variant` metadata **)** + +Sets the metadata of an item, which may be of any type. You can later get it with :ref:`get_item_metadata`, which provides a simple way of assigning context data to items. + +---- + +.. _class_PopupMenu_method_set_item_multistate: + +- void **set_item_multistate** **(** :ref:`int` idx, :ref:`int` state **)** + +Sets the state of a multistate item. See :ref:`add_multistate_item` for details. + +---- + +.. _class_PopupMenu_method_set_item_shortcut: + +- void **set_item_shortcut** **(** :ref:`int` idx, :ref:`ShortCut` shortcut, :ref:`bool` global=false **)** + +Sets a :ref:`ShortCut` for the specified item ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_shortcut_disabled: + +- void **set_item_shortcut_disabled** **(** :ref:`int` idx, :ref:`bool` disabled **)** + +Disables the :ref:`ShortCut` of the specified index ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_submenu: + +- void **set_item_submenu** **(** :ref:`int` idx, :ref:`String` submenu **)** + +Sets the submenu of the item at index ``idx``. The submenu is the name of a child ``PopupMenu`` node that would be shown when the item is clicked. + +---- + +.. _class_PopupMenu_method_set_item_text: + +- void **set_item_text** **(** :ref:`int` idx, :ref:`String` text **)** + +Sets the text of the item at index ``idx``. + +---- + +.. _class_PopupMenu_method_set_item_tooltip: + +- void **set_item_tooltip** **(** :ref:`int` idx, :ref:`String` tooltip **)** + +Sets the :ref:`String` tooltip of the item at the specified index ``idx``. + +---- + +.. _class_PopupMenu_method_toggle_item_checked: + +- void **toggle_item_checked** **(** :ref:`int` idx **)** + +Toggles the check state of the item of the specified index ``idx``. + +---- + +.. _class_PopupMenu_method_toggle_item_multistate: + +- void **toggle_item_multistate** **(** :ref:`int` idx **)** + +Cycle to the next state of a multistate item. See :ref:`add_multistate_item` for details. + +Theme Property Descriptions +--------------------------- + +.. _class_PopupMenu_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +The default text :ref:`Color` for menu items' names. + +---- + +.. _class_PopupMenu_theme_color_font_color_accel: + +- :ref:`Color` **font_color_accel** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.7, 0.7, 0.7, 0.8 )`` | ++-----------+---------------------------------+ + +The text :ref:`Color` used for shortcuts and accelerators that show next to the menu item name when defined. See :ref:`get_item_accelerator` for more info on accelerators. + +---- + +.. _class_PopupMenu_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.4, 0.4, 0.4, 0.8 )`` | ++-----------+---------------------------------+ + +:ref:`Color` used for disabled menu items' text. + +---- + +.. _class_PopupMenu_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +:ref:`Color` used for the hovered text. + +---- + +.. _class_PopupMenu_theme_color_font_color_separator: + +- :ref:`Color` **font_color_separator** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +:ref:`Color` used for labeled separators' text. See :ref:`add_separator`. + +---- + +.. _class_PopupMenu_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal space between the item's name and the shortcut text/submenu arrow. + +---- + +.. _class_PopupMenu_theme_constant_vseparation: + +- :ref:`int` **vseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The vertical space between each menu item. + +---- + +.. _class_PopupMenu_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` used for the menu items. + +---- + +.. _class_PopupMenu_theme_icon_checked: + +- :ref:`Texture` **checked** + +:ref:`Texture` icon for the checked checkbox items. + +---- + +.. _class_PopupMenu_theme_icon_radio_checked: + +- :ref:`Texture` **radio_checked** + +:ref:`Texture` icon for the checked radio button items. + +---- + +.. _class_PopupMenu_theme_icon_radio_unchecked: + +- :ref:`Texture` **radio_unchecked** + +:ref:`Texture` icon for the unchecked radio button items. + +---- + +.. _class_PopupMenu_theme_icon_submenu: + +- :ref:`Texture` **submenu** + +:ref:`Texture` icon for the submenu arrow. + +---- + +.. _class_PopupMenu_theme_icon_unchecked: + +- :ref:`Texture` **unchecked** + +:ref:`Texture` icon for the unchecked checkbox items. + +---- + +.. _class_PopupMenu_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` displayed when the ``PopupMenu`` item is hovered. + +---- + +.. _class_PopupMenu_theme_style_labeled_separator_left: + +- :ref:`StyleBox` **labeled_separator_left** + +:ref:`StyleBox` for the left side of labeled separator. See :ref:`add_separator`. + +---- + +.. _class_PopupMenu_theme_style_labeled_separator_right: + +- :ref:`StyleBox` **labeled_separator_right** + +:ref:`StyleBox` for the right side of labeled separator. See :ref:`add_separator`. + +---- + +.. _class_PopupMenu_theme_style_panel: + +- :ref:`StyleBox` **panel** + +Default :ref:`StyleBox` of the ``PopupMenu`` items. + +---- + +.. _class_PopupMenu_theme_style_panel_disabled: + +- :ref:`StyleBox` **panel_disabled** + +:ref:`StyleBox` used when the ``PopupMenu`` item is disabled. + +---- + +.. _class_PopupMenu_theme_style_separator: + +- :ref:`StyleBox` **separator** + +:ref:`StyleBox` used for the separators. See :ref:`add_separator`. + +.. |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.)` diff --git a/classes/class_popuppanel.rst b/classes/class_popuppanel.rst new file mode 100644 index 0000000..1560c80 --- /dev/null +++ b/classes/class_popuppanel.rst @@ -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 PopupPanel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PopupPanel: + +PopupPanel +========== + +**Inherits:** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Class for displaying popups with a panel background. + +Description +----------- + +Class for displaying popups with a panel background. In some cases it might be simpler to use than :ref:`Popup`, since it provides a configurable background. If you are making windows, better check :ref:`WindowDialog`. + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | ++---------------------------------+--------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_PopupPanel_theme_style_panel: + +- :ref:`StyleBox` **panel** + +The background panel style of this ``PopupPanel``. + +.. |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.)` diff --git a/classes/class_portal.rst b/classes/class_portal.rst new file mode 100644 index 0000000..95fb202 --- /dev/null +++ b/classes/class_portal.rst @@ -0,0 +1,165 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Portal.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Portal: + +Portal +====== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Portal nodes are used to enable visibility between :ref:`Room`\ s. + +Description +----------- + +``Portal``\ s are a special type of :ref:`MeshInstance` that allow the portal culling system to 'see' from one room to the next. They often correspond to doors and windows in level geometry. By only allowing :ref:`Camera`\ s to see through portals, this allows the system to cull out all the objects in rooms that cannot be seen through portals. This is a form of **occlusion culling**, and can greatly increase performance. + +There are some limitations to the form of portals: + +They must be single sided convex polygons, and usually you would orientate their front faces **outward** from the :ref:`Room` they are placed in. The vertices should be positioned on a single plane (although their positioning does not have to be perfect). + +There is no need to place an opposite portal in an adjacent room, links are made two-way automatically. + +Properties +---------- + ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`NodePath` | :ref:`linked_room` | ``NodePath("")`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`PoolVector2Array` | :ref:`points` | ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`bool` | :ref:`portal_active` | ``true`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`float` | :ref:`portal_margin` | ``1.0`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`bool` | :ref:`two_way` | ``true`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ +| :ref:`bool` | :ref:`use_default_margin` | ``true`` | ++-------------------------------------------------+---------------------------------------------------------------------+----------------------------------------------------+ + +Methods +------- + ++------+---------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point` **(** :ref:`int` index, :ref:`Vector2` position **)** | ++------+---------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Portal_property_linked_room: + +- :ref:`NodePath` **linked_room** + ++-----------+------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------+ +| *Setter* | set_linked_room(value) | ++-----------+------------------------+ +| *Getter* | get_linked_room() | ++-----------+------------------------+ + +This is a shortcut for setting the linked :ref:`Room` in the name of the ``Portal`` (the name is used during conversion). + +---- + +.. _class_Portal_property_points: + +- :ref:`PoolVector2Array` **points** + ++-----------+----------------------------------------------------+ +| *Default* | ``PoolVector2Array( 1, -1, 1, 1, -1, 1, -1, -1 )`` | ++-----------+----------------------------------------------------+ +| *Setter* | set_points(value) | ++-----------+----------------------------------------------------+ +| *Getter* | get_points() | ++-----------+----------------------------------------------------+ + +The points defining the shape of the ``Portal`` polygon (which should be convex). + +These are defined in 2D, with ``0,0`` being the origin of the ``Portal`` node's :ref:`Spatial.global_transform`. + +**Note:** These raw points are sanitized for winding order internally. + +---- + +.. _class_Portal_property_portal_active: + +- :ref:`bool` **portal_active** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_portal_active(value) | ++-----------+--------------------------+ +| *Getter* | get_portal_active() | ++-----------+--------------------------+ + +Visibility through ``Portal``\ s can be turned on and off at runtime - this is useful for having closable doors. + +---- + +.. _class_Portal_property_portal_margin: + +- :ref:`float` **portal_margin** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_portal_margin(value) | ++-----------+--------------------------+ +| *Getter* | get_portal_margin() | ++-----------+--------------------------+ + +Some objects are so big that they may be present in more than one :ref:`Room` ('sprawling'). As we often don't want objects that \*just\* breach the edges to be assigned to neighbouring rooms, you can assign an extra margin through the ``Portal`` to allow objects to breach without sprawling. + +---- + +.. _class_Portal_property_two_way: + +- :ref:`bool` **two_way** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_two_way(value) | ++-----------+--------------------+ +| *Getter* | is_two_way() | ++-----------+--------------------+ + +Portals default to being two way - see through in both directions, however you can make them one way, visible from the source room only. + +---- + +.. _class_Portal_property_use_default_margin: + +- :ref:`bool` **use_default_margin** + ++-----------+-------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------+ +| *Setter* | set_use_default_margin(value) | ++-----------+-------------------------------+ +| *Getter* | get_use_default_margin() | ++-----------+-------------------------------+ + +In most cases you will want to use the default ``Portal`` margin in your portals (this is set in the :ref:`RoomManager`). + +If you want to override this default, set this value to ``false``, and the local :ref:`portal_margin` will take effect. + +Method Descriptions +------------------- + +.. _class_Portal_method_set_point: + +- void **set_point** **(** :ref:`int` index, :ref:`Vector2` position **)** + +Sets individual points. Primarily for use by the editor. + +.. |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.)` diff --git a/classes/class_position2d.rst b/classes/class_position2d.rst new file mode 100644 index 0000000..f567bb5 --- /dev/null +++ b/classes/class_position2d.rst @@ -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 Position2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Position2D: + +Position2D +========== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Generic 2D position hint for editing. + +Description +----------- + +Generic 2D position hint for editing. It's just like a plain :ref:`Node2D`, but it displays as a cross in the 2D editor at all times. You can set cross' visual size by using the gizmo in the 2D editor while the node is selected. + +.. |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.)` diff --git a/classes/class_position3d.rst b/classes/class_position3d.rst new file mode 100644 index 0000000..c5891d0 --- /dev/null +++ b/classes/class_position3d.rst @@ -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 Position3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Position3D: + +Position3D +========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Generic 3D position hint for editing. + +Description +----------- + +Generic 3D position hint for editing. It's just like a plain :ref:`Spatial`, but it displays as a cross in the 3D editor at all times. + +.. |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.)` diff --git a/classes/class_primitivemesh.rst b/classes/class_primitivemesh.rst new file mode 100644 index 0000000..1c8ea62 --- /dev/null +++ b/classes/class_primitivemesh.rst @@ -0,0 +1,107 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PrimitiveMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PrimitiveMesh: + +PrimitiveMesh +============= + +**Inherits:** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PointMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, :ref:`SphereMesh` + +Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. + +Description +----------- + +Base class for all primitive meshes. Handles applying a :ref:`Material` to a primitive mesh. Examples include :ref:`CapsuleMesh`, :ref:`CubeMesh`, :ref:`CylinderMesh`, :ref:`PlaneMesh`, :ref:`PrismMesh`, :ref:`QuadMesh`, and :ref:`SphereMesh`. + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------+------------------------------+ +| :ref:`AABB` | :ref:`custom_aabb` | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++---------------------------------+--------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`flip_faces` | ``false`` | ++---------------------------------+--------------------------------------------------------------+------------------------------+ +| :ref:`Material` | :ref:`material` | | ++---------------------------------+--------------------------------------------------------------+------------------------------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_mesh_arrays` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_PrimitiveMesh_property_custom_aabb: + +- :ref:`AABB` **custom_aabb** + ++-----------+------------------------------+ +| *Default* | ``AABB( 0, 0, 0, 0, 0, 0 )`` | ++-----------+------------------------------+ +| *Setter* | set_custom_aabb(value) | ++-----------+------------------------------+ +| *Getter* | get_custom_aabb() | ++-----------+------------------------------+ + +Overrides the :ref:`AABB` with one defined by user for use with frustum culling. Especially useful to avoid unexpected culling when using a shader to offset vertices. + +---- + +.. _class_PrimitiveMesh_property_flip_faces: + +- :ref:`bool` **flip_faces** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_flip_faces(value) | ++-----------+-----------------------+ +| *Getter* | get_flip_faces() | ++-----------+-----------------------+ + +If set, the order of the vertices in each triangle are reversed resulting in the backside of the mesh being drawn. + +This gives the same result as using :ref:`SpatialMaterial.CULL_BACK` in :ref:`SpatialMaterial.params_cull_mode`. + +---- + +.. _class_PrimitiveMesh_property_material: + +- :ref:`Material` **material** + ++----------+---------------------+ +| *Setter* | set_material(value) | ++----------+---------------------+ +| *Getter* | get_material() | ++----------+---------------------+ + +The current :ref:`Material` of the primitive mesh. + +Method Descriptions +------------------- + +.. _class_PrimitiveMesh_method_get_mesh_arrays: + +- :ref:`Array` **get_mesh_arrays** **(** **)** |const| + +Returns mesh arrays used to constitute surface of :ref:`Mesh`. The result can be passed to :ref:`ArrayMesh.add_surface_from_arrays` to create a new surface. For example: + +:: + + var c := CylinderMesh.new() + var arr_mesh := ArrayMesh.new() + arr_mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, c.get_mesh_arrays()) + +.. |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.)` diff --git a/classes/class_prismmesh.rst b/classes/class_prismmesh.rst new file mode 100644 index 0000000..cbb12aa --- /dev/null +++ b/classes/class_prismmesh.rst @@ -0,0 +1,119 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the PrismMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_PrismMesh: + +PrismMesh +========= + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a prism-shaped :ref:`PrimitiveMesh`. + +Description +----------- + +Class representing a prism-shaped :ref:`PrimitiveMesh`. + +Properties +---------- + ++-------------------------------+--------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`left_to_right` | ``0.5`` | ++-------------------------------+--------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`size` | ``Vector3( 2, 2, 2 )`` | ++-------------------------------+--------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_depth` | ``0`` | ++-------------------------------+--------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_height` | ``0`` | ++-------------------------------+--------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`subdivide_width` | ``0`` | ++-------------------------------+--------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_PrismMesh_property_left_to_right: + +- :ref:`float` **left_to_right** + ++-----------+--------------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------------+ +| *Setter* | set_left_to_right(value) | ++-----------+--------------------------+ +| *Getter* | get_left_to_right() | ++-----------+--------------------------+ + +Displacement of the upper edge along the X axis. 0.0 positions edge straight above the bottom-left edge. + +---- + +.. _class_PrismMesh_property_size: + +- :ref:`Vector3` **size** + ++-----------+------------------------+ +| *Default* | ``Vector3( 2, 2, 2 )`` | ++-----------+------------------------+ +| *Setter* | set_size(value) | ++-----------+------------------------+ +| *Getter* | get_size() | ++-----------+------------------------+ + +Size of the prism. + +---- + +.. _class_PrismMesh_property_subdivide_depth: + +- :ref:`int` **subdivide_depth** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_depth(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_depth() | ++-----------+----------------------------+ + +Number of added edge loops along the Z axis. + +---- + +.. _class_PrismMesh_property_subdivide_height: + +- :ref:`int` **subdivide_height** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_subdivide_height(value) | ++-----------+-----------------------------+ +| *Getter* | get_subdivide_height() | ++-----------+-----------------------------+ + +Number of added edge loops along the Y axis. + +---- + +.. _class_PrismMesh_property_subdivide_width: + +- :ref:`int` **subdivide_width** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_subdivide_width(value) | ++-----------+----------------------------+ +| *Getter* | get_subdivide_width() | ++-----------+----------------------------+ + +Number of added edge loops along the X 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.)` diff --git a/classes/class_proceduralsky.rst b/classes/class_proceduralsky.rst new file mode 100644 index 0000000..0b51154 --- /dev/null +++ b/classes/class_proceduralsky.rst @@ -0,0 +1,350 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ProceduralSky.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ProceduralSky: + +ProceduralSky +============= + +**Inherits:** :ref:`Sky` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Type of :ref:`Sky` that is generated procedurally based on user input parameters. + +Description +----------- + +ProceduralSky provides a way to create an effective background quickly by defining procedural parameters for the sun, the sky and the ground. The sky and ground are very similar, they are defined by a color at the horizon, another color, and finally an easing curve to interpolate between these two colors. Similarly, the sun is described by a position in the sky, a color, and an easing curve. However, the sun also defines a minimum and maximum angle, these two values define at what distance the easing curve begins and ends from the sun, and thus end up defining the size of the sun in the sky. + +The ProceduralSky is updated on the CPU after the parameters change. It is stored in a texture and then displayed as a background in the scene. This makes it relatively unsuitable for real-time updates during gameplay. However, with a small enough texture size, it can still be updated relatively frequently, as it is updated on a background thread when multi-threading is available. + +Properties +---------- + ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`Color` | :ref:`ground_bottom_color` | ``Color( 0.156863, 0.184314, 0.211765, 1 )`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`ground_curve` | ``0.02`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`ground_energy` | ``1.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`Color` | :ref:`ground_horizon_color` | ``Color( 0.423529, 0.396078, 0.372549, 1 )`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sky_curve` | ``0.09`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sky_energy` | ``1.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`Color` | :ref:`sky_horizon_color` | ``Color( 0.839216, 0.917647, 0.980392, 1 )`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`Color` | :ref:`sky_top_color` | ``Color( 0.647059, 0.839216, 0.945098, 1 )`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_angle_max` | ``100.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_angle_min` | ``1.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`Color` | :ref:`sun_color` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_curve` | ``0.05`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_energy` | ``1.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_latitude` | ``35.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`float` | :ref:`sun_longitude` | ``0.0`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ +| :ref:`TextureSize` | :ref:`texture_size` | ``2`` | ++----------------------------------------------------+--------------------------------------------------------------------------------+----------------------------------------------+ + +Enumerations +------------ + +.. _enum_ProceduralSky_TextureSize: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_256: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_512: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_1024: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_2048: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_4096: + +.. _class_ProceduralSky_constant_TEXTURE_SIZE_MAX: + +enum **TextureSize**: + +- **TEXTURE_SIZE_256** = **0** --- Sky texture will be 256x128. + +- **TEXTURE_SIZE_512** = **1** --- Sky texture will be 512x256. + +- **TEXTURE_SIZE_1024** = **2** --- Sky texture will be 1024x512. This is the default size. + +- **TEXTURE_SIZE_2048** = **3** --- Sky texture will be 2048x1024. + +- **TEXTURE_SIZE_4096** = **4** --- Sky texture will be 4096x2048. + +- **TEXTURE_SIZE_MAX** = **5** --- Represents the size of the :ref:`TextureSize` enum. + +Property Descriptions +--------------------- + +.. _class_ProceduralSky_property_ground_bottom_color: + +- :ref:`Color` **ground_bottom_color** + ++-----------+----------------------------------------------+ +| *Default* | ``Color( 0.156863, 0.184314, 0.211765, 1 )`` | ++-----------+----------------------------------------------+ +| *Setter* | set_ground_bottom_color(value) | ++-----------+----------------------------------------------+ +| *Getter* | get_ground_bottom_color() | ++-----------+----------------------------------------------+ + +Color of the ground at the bottom. + +---- + +.. _class_ProceduralSky_property_ground_curve: + +- :ref:`float` **ground_curve** + ++-----------+-------------------------+ +| *Default* | ``0.02`` | ++-----------+-------------------------+ +| *Setter* | set_ground_curve(value) | ++-----------+-------------------------+ +| *Getter* | get_ground_curve() | ++-----------+-------------------------+ + +How quickly the :ref:`ground_horizon_color` fades into the :ref:`ground_bottom_color`. + +---- + +.. _class_ProceduralSky_property_ground_energy: + +- :ref:`float` **ground_energy** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_ground_energy(value) | ++-----------+--------------------------+ +| *Getter* | get_ground_energy() | ++-----------+--------------------------+ + +Amount of energy contribution from the ground. + +---- + +.. _class_ProceduralSky_property_ground_horizon_color: + +- :ref:`Color` **ground_horizon_color** + ++-----------+----------------------------------------------+ +| *Default* | ``Color( 0.423529, 0.396078, 0.372549, 1 )`` | ++-----------+----------------------------------------------+ +| *Setter* | set_ground_horizon_color(value) | ++-----------+----------------------------------------------+ +| *Getter* | get_ground_horizon_color() | ++-----------+----------------------------------------------+ + +Color of the ground at the horizon. + +---- + +.. _class_ProceduralSky_property_sky_curve: + +- :ref:`float` **sky_curve** + ++-----------+----------------------+ +| *Default* | ``0.09`` | ++-----------+----------------------+ +| *Setter* | set_sky_curve(value) | ++-----------+----------------------+ +| *Getter* | get_sky_curve() | ++-----------+----------------------+ + +How quickly the :ref:`sky_horizon_color` fades into the :ref:`sky_top_color`. + +---- + +.. _class_ProceduralSky_property_sky_energy: + +- :ref:`float` **sky_energy** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_sky_energy(value) | ++-----------+-----------------------+ +| *Getter* | get_sky_energy() | ++-----------+-----------------------+ + +Amount of energy contribution from the sky. + +---- + +.. _class_ProceduralSky_property_sky_horizon_color: + +- :ref:`Color` **sky_horizon_color** + ++-----------+----------------------------------------------+ +| *Default* | ``Color( 0.839216, 0.917647, 0.980392, 1 )`` | ++-----------+----------------------------------------------+ +| *Setter* | set_sky_horizon_color(value) | ++-----------+----------------------------------------------+ +| *Getter* | get_sky_horizon_color() | ++-----------+----------------------------------------------+ + +Color of the sky at the horizon. + +---- + +.. _class_ProceduralSky_property_sky_top_color: + +- :ref:`Color` **sky_top_color** + ++-----------+----------------------------------------------+ +| *Default* | ``Color( 0.647059, 0.839216, 0.945098, 1 )`` | ++-----------+----------------------------------------------+ +| *Setter* | set_sky_top_color(value) | ++-----------+----------------------------------------------+ +| *Getter* | get_sky_top_color() | ++-----------+----------------------------------------------+ + +Color of the sky at the top. + +---- + +.. _class_ProceduralSky_property_sun_angle_max: + +- :ref:`float` **sun_angle_max** + ++-----------+--------------------------+ +| *Default* | ``100.0`` | ++-----------+--------------------------+ +| *Setter* | set_sun_angle_max(value) | ++-----------+--------------------------+ +| *Getter* | get_sun_angle_max() | ++-----------+--------------------------+ + +Distance from center of sun where it fades out completely. + +---- + +.. _class_ProceduralSky_property_sun_angle_min: + +- :ref:`float` **sun_angle_min** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_sun_angle_min(value) | ++-----------+--------------------------+ +| *Getter* | get_sun_angle_min() | ++-----------+--------------------------+ + +Distance from sun where it goes from solid to starting to fade. + +---- + +.. _class_ProceduralSky_property_sun_color: + +- :ref:`Color` **sun_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_sun_color(value) | ++-----------+-------------------------+ +| *Getter* | get_sun_color() | ++-----------+-------------------------+ + +The sun's color. + +---- + +.. _class_ProceduralSky_property_sun_curve: + +- :ref:`float` **sun_curve** + ++-----------+----------------------+ +| *Default* | ``0.05`` | ++-----------+----------------------+ +| *Setter* | set_sun_curve(value) | ++-----------+----------------------+ +| *Getter* | get_sun_curve() | ++-----------+----------------------+ + +How quickly the sun fades away between :ref:`sun_angle_min` and :ref:`sun_angle_max`. + +---- + +.. _class_ProceduralSky_property_sun_energy: + +- :ref:`float` **sun_energy** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_sun_energy(value) | ++-----------+-----------------------+ +| *Getter* | get_sun_energy() | ++-----------+-----------------------+ + +Amount of energy contribution from the sun. + +---- + +.. _class_ProceduralSky_property_sun_latitude: + +- :ref:`float` **sun_latitude** + ++-----------+-------------------------+ +| *Default* | ``35.0`` | ++-----------+-------------------------+ +| *Setter* | set_sun_latitude(value) | ++-----------+-------------------------+ +| *Getter* | get_sun_latitude() | ++-----------+-------------------------+ + +The sun's height using polar coordinates. + +---- + +.. _class_ProceduralSky_property_sun_longitude: + +- :ref:`float` **sun_longitude** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_sun_longitude(value) | ++-----------+--------------------------+ +| *Getter* | get_sun_longitude() | ++-----------+--------------------------+ + +The direction of the sun using polar coordinates. + +---- + +.. _class_ProceduralSky_property_texture_size: + +- :ref:`TextureSize` **texture_size** + ++-----------+-------------------------+ +| *Default* | ``2`` | ++-----------+-------------------------+ +| *Setter* | set_texture_size(value) | ++-----------+-------------------------+ +| *Getter* | get_texture_size() | ++-----------+-------------------------+ + +Size of :ref:`Texture` that the ProceduralSky will generate. The size is set using :ref:`TextureSize`. + +.. |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.)` diff --git a/classes/class_progressbar.rst b/classes/class_progressbar.rst new file mode 100644 index 0000000..015f0ad --- /dev/null +++ b/classes/class_progressbar.rst @@ -0,0 +1,115 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ProgressBar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ProgressBar: + +ProgressBar +=========== + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +General-purpose progress bar. + +Description +----------- + +General-purpose progress bar. Shows fill percentage from right to left. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`percent_visible` | ``true`` | ++---------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` *(parent override)* | ++---------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`float` | step | ``0.01`` *(parent override)* | ++---------------------------+--------------------------------------------------------------------+------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_shadow` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`fg` | | ++---------------------------------+---------------------------------------------------------------------------+----------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ProgressBar_property_percent_visible: + +- :ref:`bool` **percent_visible** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_percent_visible(value) | ++-----------+----------------------------+ +| *Getter* | is_percent_visible() | ++-----------+----------------------------+ + +If ``true``, the fill percentage is displayed on the bar. + +Theme Property Descriptions +--------------------------- + +.. _class_ProgressBar_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +The color of the text. + +---- + +.. _class_ProgressBar_theme_color_font_color_shadow: + +- :ref:`Color` **font_color_shadow** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +The color of the text's shadow. + +---- + +.. _class_ProgressBar_theme_font_font: + +- :ref:`Font` **font** + +Font used to draw the fill percentage if :ref:`percent_visible` is ``true``. + +---- + +.. _class_ProgressBar_theme_style_bg: + +- :ref:`StyleBox` **bg** + +The style of the background. + +---- + +.. _class_ProgressBar_theme_style_fg: + +- :ref:`StyleBox` **fg** + +The style of the progress (i.e. the part that fills the bar). + +.. |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.)` diff --git a/classes/class_projectsettings.rst b/classes/class_projectsettings.rst new file mode 100644 index 0000000..9a58522 --- /dev/null +++ b/classes/class_projectsettings.rst @@ -0,0 +1,6037 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ProjectSettings.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ProjectSettings: + +ProjectSettings +=============== + +**Inherits:** :ref:`Object` + +Contains global variables accessible from everywhere. + +Description +----------- + +Contains global variables accessible from everywhere. Use :ref:`get_setting`, :ref:`set_setting` or :ref:`has_setting` to access them. Variables stored in ``project.godot`` are also loaded into ProjectSettings, making this object very useful for reading custom game configuration options. + +When naming a Project Settings property, use the full path to the setting including the category. For example, ``"application/config/name"`` for the project name. Category and property names can be viewed in the Project Settings dialog. + +**Feature tags:** Project settings can be overridden for specific platforms and configurations (debug, release, ...) using `feature tags `__. + +**Overriding:** Any project setting can be overridden by creating a file named ``override.cfg`` in the project's root directory. This can also be used in exported projects by placing this file in the same directory as the project binary. Overriding will still take the base project settings' `feature tags `__ in account. Therefore, make sure to *also* override the setting with the desired feature tags if you want them to override base project settings on all platforms and configurations. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +- `3D Platformer Demo `__ + +- `OS Test Demo `__ + +Properties +---------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`android/modules` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`application/boot_splash/bg_color` | ``Color( 0.14, 0.14, 0.14, 1 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/boot_splash/fullsize` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/boot_splash/image` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/boot_splash/use_filter` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/custom_user_dir_name` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/description` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/icon` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/macos_native_icon` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/name` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/project_settings_override` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/config/use_custom_user_dir` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/config/use_hidden_project_data_directory` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/config/windows_native_icon` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/delta_smoothing` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/delta_sync_after_draw` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/disable_stderr` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/disable_stdout` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/flush_stdout_on_print` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/flush_stdout_on_print.debug` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`application/run/frame_delay_msec` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`application/run/low_processor_mode` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`application/run/low_processor_mode_sleep_usec` | ``6900`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`application/run/main_scene` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio/channel_disable_threshold_db` | ``-60.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`audio/channel_disable_time` | ``2.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`audio/default_bus_layout` | ``"res://default_bus_layout.tres"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`audio/driver` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`audio/enable_audio_input` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio/mix_rate` | ``44100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio/mix_rate.web` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio/output_latency` | ``15`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio/output_latency.web` | ``50`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`audio/video_delay_compensation_ms` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`compression/formats/gzip/compression_level` | ``-1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`compression/formats/zlib/compression_level` | ``-1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`compression/formats/zstd/compression_level` | ``3`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`compression/formats/zstd/long_distance_matching` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`compression/formats/zstd/window_log_size` | ``27`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/completion/autocomplete_setters_and_getters` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/constant_used_as_function` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/deprecated_keyword` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/enable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/exclude_addons` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/function_conflicts_constant` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/function_conflicts_variable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/function_may_yield` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/function_used_as_property` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/incompatible_ternary` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/integer_division` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/narrowing_conversion` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/property_used_as_function` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/return_value_discarded` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/shadowed_variable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/standalone_expression` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/standalone_ternary` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/treat_warnings_as_errors` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unassigned_variable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unassigned_variable_op_assign` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unreachable_code` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unsafe_call_argument` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unsafe_cast` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unsafe_method_access` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unsafe_property_access` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unused_argument` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unused_class_variable` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unused_signal` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/unused_variable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/variable_conflicts_function` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/gdscript/warnings/void_assignment` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`debug/settings/crash_handler/message` | ``"Please include this when reporting the bug on https://github.com/godotengine/godot/issues"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/settings/fps/force_fps` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/settings/gdscript/max_call_stack` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/settings/profiler/max_functions` | ``16384`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/settings/stdout/print_fps` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/settings/stdout/verbose_stdout` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/settings/visual_script/max_call_stack` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`debug/shapes/collision/contact_color` | ``Color( 1, 0.2, 0.1, 0.8 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`debug/shapes/collision/draw_2d_outlines` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`debug/shapes/collision/max_contacts_displayed` | ``10000`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`debug/shapes/collision/shape_color` | ``Color( 0, 0.6, 0.7, 0.42 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`debug/shapes/navigation/disabled_geometry_color` | ``Color( 1, 0.7, 0.1, 0.4 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`debug/shapes/navigation/geometry_color` | ``Color( 0.1, 1, 0.7, 0.4 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`display/mouse_cursor/custom_image` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`display/mouse_cursor/custom_image_hotspot` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`display/mouse_cursor/tooltip_position_offset` | ``Vector2( 10, 10 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/dpi/allow_hidpi` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/energy_saving/keep_screen_on` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`display/window/handheld/orientation` | ``"landscape"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/ios/hide_home_indicator` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/per_pixel_transparency/allowed` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/per_pixel_transparency/enabled` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/size/always_on_top` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/size/borderless` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/size/fullscreen` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`display/window/size/height` | ``600`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/size/resizable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`display/window/size/test_height` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`display/window/size/test_width` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`display/window/size/width` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`display/window/tablet_driver` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/vsync/use_vsync` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`display/window/vsync/vsync_via_compositor` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`editor/main_run_args` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`editor/script_templates_search_path` | ``"res://script_templates"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`editor/search_in_file_extensions` | ``PoolStringArray( "gd", "gdshader", "shader" )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`gui/common/default_scroll_deadzone` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gui/common/swap_ok_cancel` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`gui/common/text_edit_undo_stack_max_size` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`gui/theme/custom` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`gui/theme/custom_font` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gui/theme/use_hidpi` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`gui/timers/incremental_search_max_interval_msec` | ``2000`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gui/timers/text_edit_idle_detect_sec` | ``3`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gui/timers/tooltip_delay_sec` | ``0.5`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_accept` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_cancel` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_down` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_end` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_focus_next` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_focus_prev` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_home` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_left` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_page_down` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_page_up` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_right` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_select` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`input/ui_up` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`input_devices/buffering/agile_event_flushing` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`input_devices/pointing/emulate_mouse_from_touch` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`input_devices/pointing/emulate_touch_from_mouse` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`input_devices/pointing/ios/touch_delay` | ``0.15`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_1` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_10` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_11` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_12` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_13` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_14` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_15` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_16` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_17` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_18` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_19` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_2` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_20` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_21` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_22` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_23` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_24` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_25` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_26` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_27` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_28` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_29` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_3` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_30` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_31` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_32` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_4` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_5` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_6` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_7` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_8` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_physics/layer_9` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_1` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_10` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_11` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_12` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_13` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_14` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_15` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_16` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_17` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_18` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_19` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_2` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_20` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_3` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_4` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_5` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_6` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_7` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_8` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/2d_render/layer_9` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_1` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_10` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_11` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_12` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_13` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_14` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_15` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_16` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_17` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_18` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_19` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_2` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_20` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_21` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_22` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_23` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_24` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_25` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_26` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_27` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_28` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_29` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_3` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_30` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_31` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_32` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_4` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_5` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_6` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_7` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_8` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_physics/layer_9` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_1` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_10` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_11` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_12` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_13` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_14` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_15` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_16` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_17` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_18` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_19` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_2` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_20` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_3` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_4` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_5` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_6` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_7` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_8` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`layer_names/3d_render/layer_9` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`locale/fallback` | ``"en"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`locale/test` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`logging/file_logging/enable_file_logging` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`logging/file_logging/enable_file_logging.pc` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`logging/file_logging/log_path` | ``"user://logs/godot.log"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`logging/file_logging/max_log_files` | ``5`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`memory/limits/command_queue/multithreading_queue_size_kb` | ``256`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`memory/limits/message_queue/max_size_kb` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`memory/limits/multithreaded_server/rid_pool_prealloc` | ``60`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/debugger_stdout/max_chars_per_second` | ``2048`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/debugger_stdout/max_errors_per_second` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/debugger_stdout/max_messages_per_frame` | ``10`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/debugger_stdout/max_warnings_per_second` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/packet_peer_stream/max_buffer_po2` | ``16`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/tcp/connect_timeout_seconds` | ``30`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/webrtc/max_channel_in_buffer_kb` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_client/max_in_buffer_kb` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_client/max_in_packets` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_client/max_out_buffer_kb` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_client/max_out_packets` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_server/max_in_buffer_kb` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_server/max_in_packets` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_server/max_out_buffer_kb` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/limits/websocket_server/max_out_packets` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/remote_fs/page_read_ahead` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`network/remote_fs/page_size` | ``65536`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`network/ssl/certificates` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`node/name_casing` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`node/name_num_separator` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/2d/bp_hash_table_size` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/bvh_collision_margin` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/2d/cell_size` | ``128`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/default_angular_damp` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/2d/default_gravity` | ``98`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`physics/2d/default_gravity_vector` | ``Vector2( 0, 1 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/default_linear_damp` | ``0.1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/2d/large_object_surface_threshold_in_cells` | ``512`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`physics/2d/physics_engine` | ``"DEFAULT"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/sleep_threshold_angular` | ``0.139626`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/sleep_threshold_linear` | ``2.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/2d/thread_model` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/2d/time_before_sleep` | ``0.5`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`physics/2d/use_bvh` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`physics/3d/active_soft_world` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/3d/default_angular_damp` | ``0.1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/3d/default_gravity` | ``9.8`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`physics/3d/default_gravity_vector` | ``Vector3( 0, -1, 0 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/3d/default_linear_damp` | ``0.1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/3d/godot_physics/bvh_collision_margin` | ``0.1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`physics/3d/godot_physics/use_bvh` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`physics/3d/physics_engine` | ``"DEFAULT"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`physics/common/enable_object_picking` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`physics/common/enable_pause_aware_picking` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`physics/common/physics_fps` | ``60`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`physics/common/physics_jitter_fix` | ``0.5`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/2d/opengl/batching_send_null` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/2d/opengl/batching_stream` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/2d/opengl/legacy_orphan_buffers` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/2d/opengl/legacy_stream` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/2d/options/ninepatch_mode` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/2d/options/use_nvidia_rect_flicker_workaround` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/2d/options/use_software_skinning` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/2d/snapping/use_gpu_pixel_snap` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/debug/diagnose_frame` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/debug/flash_batching` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/lights/max_join_items` | ``32`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/batching/lights/scissor_area_threshold` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/single_rect_fallback` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/use_batching` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/options/use_batching_in_editor` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/batch_buffer_size` | ``16384`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/batching/parameters/colored_vertex_format_threshold` | ``0.25`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/item_reordering_lookahead` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/parameters/max_join_item_commands` | ``16`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/batching/precision/uv_contract` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/batching/precision/uv_contract_amount` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/cpu_lightmapper/quality/high_quality_ray_count` | ``512`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/cpu_lightmapper/quality/low_quality_ray_count` | ``64`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/cpu_lightmapper/quality/medium_quality_ray_count` | ``256`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/cpu_lightmapper/quality/ultra_quality_ray_count` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`rendering/environment/default_clear_color` | ``Color( 0.3, 0.3, 0.3, 1 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rendering/environment/default_environment` | ``""`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/gles2/compatibility/disable_half_float` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/gles2/compatibility/disable_half_float.iOS` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/gles2/compatibility/enable_high_float.Android` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/buffers/blend_shape_max_buffer_size_kb` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/buffers/canvas_polygon_buffer_size_kb` | ``128`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/buffers/canvas_polygon_index_buffer_size_kb` | ``128`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/buffers/immediate_buffer_size_kb` | ``2048`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/rendering/max_lights_per_object` | ``32`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/rendering/max_renderable_elements` | ``65536`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/rendering/max_renderable_lights` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/limits/rendering/max_renderable_reflections` | ``1024`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/limits/time/time_rollover_secs` | ``3600`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/misc/lossless_compression/force_png` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/misc/lossless_compression/webp_compression_level` | ``2`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/misc/mesh_storage/split_stream` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/misc/occlusion_culling/max_active_spheres` | ``8`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/advanced/flip_imported_portals` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/debug/logging` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/gameplay/use_signals` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/optimize/remove_danglers` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/pvs/pvs_logging` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/portals/pvs/use_simple_pvs` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/depth/hdr` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/depth/hdr.mobile` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rendering/quality/depth_prepass/disable_for_vendors` | ``"PowerVR,Mali,Adreno,Apple"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/depth_prepass/enable` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/directional_shadow/size` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/directional_shadow/size.mobile` | ``2048`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rendering/quality/driver/driver_name` | ``"GLES3"`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/driver/fallback_to_gles2` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/filters/anisotropic_filter_level` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/filters/msaa` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/quality/filters/sharpen_intensity` | ``0.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/filters/use_debanding` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/filters/use_fxaa` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/filters/use_nearest_mipmap_filter` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/intended_usage/framebuffer_allocation` | ``2`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/intended_usage/framebuffer_allocation.mobile` | ``3`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/lightmapping/use_bicubic_sampling` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/lightmapping/use_bicubic_sampling.mobile` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/reflections/atlas_size` | ``2048`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/reflections/atlas_subdiv` | ``8`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/reflections/high_quality_ggx` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/reflections/high_quality_ggx.mobile` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/reflections/irradiance_max_size` | ``128`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/reflections/texture_array_reflections` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/reflections/texture_array_reflections.mobile` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_blinn_over_ggx` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_blinn_over_ggx.mobile` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_lambert_over_burley` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_lambert_over_burley.mobile` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_vertex_shading` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/force_vertex_shading.mobile` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/shading/use_physical_light_attenuation` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/cubemap_size` | ``512`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/quadrant_0_subdiv` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/quadrant_1_subdiv` | ``2`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/quadrant_2_subdiv` | ``3`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/quadrant_3_subdiv` | ``4`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/size` | ``4096`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadow_atlas/size.mobile` | ``2048`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadows/filter_mode` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/shadows/filter_mode.mobile` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/skinning/force_software_skinning` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/skinning/software_skinning_fallback` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/quality/spatial_partitioning/bvh_collision_margin` | ``0.1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`rendering/quality/spatial_partitioning/render_tree_balance` | ``0.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/spatial_partitioning/use_bvh` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/subsurface_scattering/follow_surface` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/subsurface_scattering/quality` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/quality/subsurface_scattering/scale` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/subsurface_scattering/weight_samples` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/quality/voxel_cone_tracing/high_quality` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rendering/threads/thread_model` | ``1`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/threads/thread_safe_bvh` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/vram_compression/import_bptc` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/vram_compression/import_etc` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/vram_compression/import_etc2` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/vram_compression/import_pvrtc` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`rendering/vram_compression/import_s3tc` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`world/2d/cell_size` | ``100`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+-------------------------------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_property_info` **(** :ref:`Dictionary` hint **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_order` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_setting` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`globalize_path` **(** :ref:`String` path **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_setting` **(** :ref:`String` name **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`load_resource_pack` **(** :ref:`String` pack, :ref:`bool` replace_files=true, :ref:`int` offset=0 **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`localize_path` **(** :ref:`String` path **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save_custom` **(** :ref:`String` file **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_initial_value` **(** :ref:`String` name, :ref:`Variant` value **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_order` **(** :ref:`String` name, :ref:`int` position **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_setting` **(** :ref:`String` name, :ref:`Variant` value **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ProjectSettings_property_android/modules: + +- :ref:`String` **android/modules** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. ``"org/godotengine/godot/MyCustomSingleton,com/example/foo/FrenchFriesFactory"``. + +**Note:** Since Godot 3.2.2, the ``org/godotengine/godot/GodotPaymentV3`` module was deprecated and replaced by the ``GodotPayment`` plugin which should be enabled in the Android export preset under ``Plugins`` section. The singleton to access in code was also renamed to ``GodotPayment``. + +---- + +.. _class_ProjectSettings_property_application/boot_splash/bg_color: + +- :ref:`Color` **application/boot_splash/bg_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.14, 0.14, 0.14, 1 )`` | ++-----------+----------------------------------+ + +Background color for the boot splash. + +---- + +.. _class_ProjectSettings_property_application/boot_splash/fullsize: + +- :ref:`bool` **application/boot_splash/fullsize** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, scale the boot splash image to the full window length when engine starts. If ``false``, the engine will leave it at the default pixel size. + +---- + +.. _class_ProjectSettings_property_application/boot_splash/image: + +- :ref:`String` **application/boot_splash/image** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Path to an image used as the boot splash. + +---- + +.. _class_ProjectSettings_property_application/boot_splash/use_filter: + +- :ref:`bool` **application/boot_splash/use_filter** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, applies linear filtering when scaling the image (recommended for high resolution artwork). If ``false``, uses nearest-neighbor interpolation (recommended for pixel art). + +---- + +.. _class_ProjectSettings_property_application/config/custom_user_dir_name: + +- :ref:`String` **application/config/custom_user_dir_name** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +This user directory is used for storing persistent data (``user://`` filesystem). If left empty, ``user://`` resolves to a project-specific folder in Godot's own configuration folder (see :ref:`OS.get_user_data_dir`). If a custom directory name is defined, this name will be used instead and appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in :ref:`OS.get_user_data_dir`). + +The :ref:`application/config/use_custom_user_dir` setting must be enabled for this to take effect. + +---- + +.. _class_ProjectSettings_property_application/config/description: + +- :ref:`String` **application/config/description** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +The project's description, displayed as a tooltip in the Project Manager when hovering the project. + +---- + +.. _class_ProjectSettings_property_application/config/icon: + +- :ref:`String` **application/config/icon** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Icon used for the project, set when project loads. Exporters will also use this icon when possible. + +---- + +.. _class_ProjectSettings_property_application/config/macos_native_icon: + +- :ref:`String` **application/config/macos_native_icon** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Icon set in ``.icns`` format used on macOS to set the game's icon. This is done automatically on start by calling :ref:`OS.set_native_icon`. + +---- + +.. _class_ProjectSettings_property_application/config/name: + +- :ref:`String` **application/config/name** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +The project's name. It is used both by the Project Manager and by exporters. The project name can be translated by translating its value in localization files. The window title will be set to match the project name automatically on startup. + +**Note:** Changing this value will also change the user data folder's path if :ref:`application/config/use_custom_user_dir` is ``false``. After renaming the project, you will no longer be able to access existing data in ``user://`` unless you rename the old folder to match the new project name. See `Data paths `__ in the documentation for more information. + +---- + +.. _class_ProjectSettings_property_application/config/project_settings_override: + +- :ref:`String` **application/config/project_settings_override** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Specifies a file to override project settings. For example: ``user://custom_settings.cfg``. See "Overriding" in the ``ProjectSettings`` class description at the top for more information. + +**Note:** Regardless of this setting's value, ``res://override.cfg`` will still be read to override the project settings. + +---- + +.. _class_ProjectSettings_property_application/config/use_custom_user_dir: + +- :ref:`bool` **application/config/use_custom_user_dir** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the project will save user data to its own user directory (see :ref:`application/config/custom_user_dir_name`). This setting is only effective on desktop platforms. A name must be set in the :ref:`application/config/custom_user_dir_name` setting for this to take effect. If ``false``, the project will save user data to ``(OS user data directory)/Godot/app_userdata/(project name)``. + +---- + +.. _class_ProjectSettings_property_application/config/use_hidden_project_data_directory: + +- :ref:`bool` **application/config/use_hidden_project_data_directory** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, the project will use a hidden directory (``.import``) for storing project-specific data (metadata, shader cache, etc.). + +If ``false``, a non-hidden directory (``import``) will be used instead. + +**Note:** Restart the application after changing this setting. + +**Note:** Changing this value can help on platforms or with third-party tools where hidden directory patterns are disallowed. Only modify this setting if you know that your environment requires it, as changing the default can impact compatibility with some external tools or plugins which expect the default ``.import`` folder. + +---- + +.. _class_ProjectSettings_property_application/config/windows_native_icon: + +- :ref:`String` **application/config/windows_native_icon** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Icon set in ``.ico`` format used on Windows to set the game's icon. This is done automatically on start by calling :ref:`OS.set_native_icon`. + +---- + +.. _class_ProjectSettings_property_application/run/delta_smoothing: + +- :ref:`bool` **application/run/delta_smoothing** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Time samples for frame deltas are subject to random variation introduced by the platform, even when frames are displayed at regular intervals thanks to V-Sync. This can lead to jitter. Delta smoothing can often give a better result by filtering the input deltas to correct for minor fluctuations from the refresh rate. + +**Note:** Delta smoothing is only attempted when :ref:`display/window/vsync/use_vsync` is switched on, as it does not work well without V-Sync. + +It may take several seconds at a stable frame rate before the smoothing is initially activated. It will only be active on machines where performance is adequate to render frames at the refresh rate. + +---- + +.. _class_ProjectSettings_property_application/run/delta_sync_after_draw: + +- :ref:`bool` **application/run/delta_sync_after_draw** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +**Experimental.** Shifts the measurement of delta time for each frame to just after the drawing has taken place. This may lead to more consistent deltas and a reduction in frame stutters. + +---- + +.. _class_ProjectSettings_property_application/run/disable_stderr: + +- :ref:`bool` **application/run/disable_stderr** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, disables printing to standard error. If ``true``, this also hides error and warning messages printed by :ref:`@GDScript.push_error` and :ref:`@GDScript.push_warning`. See also :ref:`application/run/disable_stdout`. + +Changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_application/run/disable_stdout: + +- :ref:`bool` **application/run/disable_stdout** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, disables printing to standard output. This is equivalent to starting the editor or project with the ``--quiet`` command line argument. See also :ref:`application/run/disable_stderr`. + +Changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_application/run/flush_stdout_on_print: + +- :ref:`bool` **application/run/flush_stdout_on_print** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, flushes the standard output stream every time a line is printed. This affects both terminal logging and file logging. + +When running a project, this setting must be enabled if you want logs to be collected by service managers such as systemd/journalctl. This setting is disabled by default on release builds, since flushing on every printed line will negatively affect performance if lots of lines are printed in a rapid succession. Also, if this setting is enabled, logged files will still be written successfully if the application crashes or is otherwise killed by the user (without being closed "normally"). + +**Note:** Regardless of this setting, the standard error stream (``stderr``) is always flushed when a line is printed to it. + +Changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_application/run/flush_stdout_on_print.debug: + +- :ref:`bool` **application/run/flush_stdout_on_print.debug** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Debug build override for :ref:`application/run/flush_stdout_on_print`, as performance is less important during debugging. + +Changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_application/run/frame_delay_msec: + +- :ref:`int` **application/run/frame_delay_msec** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Forces a delay between frames in the main loop (in milliseconds). This may be useful if you plan to disable vertical synchronization. + +---- + +.. _class_ProjectSettings_property_application/run/low_processor_mode: + +- :ref:`bool` **application/run/low_processor_mode** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables low-processor usage mode. This setting only works on desktop platforms. The screen is not redrawn if nothing changes visually. This is meant for writing applications and editors, but is pretty useless (and can hurt performance) in most games. + +---- + +.. _class_ProjectSettings_property_application/run/low_processor_mode_sleep_usec: + +- :ref:`int` **application/run/low_processor_mode_sleep_usec** + ++-----------+----------+ +| *Default* | ``6900`` | ++-----------+----------+ + +Amount of sleeping between frames when the low-processor usage mode is enabled (in microseconds). Higher values will result in lower CPU usage. + +---- + +.. _class_ProjectSettings_property_application/run/main_scene: + +- :ref:`String` **application/run/main_scene** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Path to the main scene file that will be loaded when the project runs. + +---- + +.. _class_ProjectSettings_property_audio/channel_disable_threshold_db: + +- :ref:`float` **audio/channel_disable_threshold_db** + ++-----------+-----------+ +| *Default* | ``-60.0`` | ++-----------+-----------+ + +Audio buses will disable automatically when sound goes below a given dB threshold for a given time. This saves CPU as effects assigned to that bus will no longer do any processing. + +---- + +.. _class_ProjectSettings_property_audio/channel_disable_time: + +- :ref:`float` **audio/channel_disable_time** + ++-----------+---------+ +| *Default* | ``2.0`` | ++-----------+---------+ + +Audio buses will disable automatically when sound goes below a given dB threshold for a given time. This saves CPU as effects assigned to that bus will no longer do any processing. + +---- + +.. _class_ProjectSettings_property_audio/default_bus_layout: + +- :ref:`String` **audio/default_bus_layout** + ++-----------+-------------------------------------+ +| *Default* | ``"res://default_bus_layout.tres"`` | ++-----------+-------------------------------------+ + +Default :ref:`AudioBusLayout` resource file to use in the project, unless overridden by the scene. + +---- + +.. _class_ProjectSettings_property_audio/driver: + +- :ref:`String` **audio/driver** + +Specifies the audio driver to use. This setting is platform-dependent as each platform supports different audio drivers. If left empty, the default audio driver will be used. + +---- + +.. _class_ProjectSettings_property_audio/enable_audio_input: + +- :ref:`bool` **audio/enable_audio_input** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, microphone input will be allowed. This requires appropriate permissions to be set when exporting to Android or iOS. + +---- + +.. _class_ProjectSettings_property_audio/mix_rate: + +- :ref:`int` **audio/mix_rate** + ++-----------+-----------+ +| *Default* | ``44100`` | ++-----------+-----------+ + +The mixing rate used for audio (in Hz). In general, it's better to not touch this and leave it to the host operating system. + +---- + +.. _class_ProjectSettings_property_audio/mix_rate.web: + +- :ref:`int` **audio/mix_rate.web** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Safer override for :ref:`audio/mix_rate` in the Web platform. Here ``0`` means "let the browser choose" (since some browsers do not like forcing the mix rate). + +---- + +.. _class_ProjectSettings_property_audio/output_latency: + +- :ref:`int` **audio/output_latency** + ++-----------+--------+ +| *Default* | ``15`` | ++-----------+--------+ + +Specifies the preferred output latency in milliseconds for audio. Lower values will result in lower audio latency at the cost of increased CPU usage. Low values may result in audible cracking on slower hardware. + +Audio output latency may be constrained by the host operating system and audio hardware drivers. If the host can not provide the specified audio output latency then Godot will attempt to use the nearest latency allowed by the host. As such you should always use :ref:`AudioServer.get_output_latency` to determine the actual audio output latency. + +**Note:** This setting is ignored on Windows. + +---- + +.. _class_ProjectSettings_property_audio/output_latency.web: + +- :ref:`int` **audio/output_latency.web** + ++-----------+--------+ +| *Default* | ``50`` | ++-----------+--------+ + +Safer override for :ref:`audio/output_latency` in the Web platform, to avoid audio issues especially on mobile devices. + +---- + +.. _class_ProjectSettings_property_audio/video_delay_compensation_ms: + +- :ref:`int` **audio/video_delay_compensation_ms** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Setting to hardcode audio delay when playing video. Best to leave this untouched unless you know what you are doing. + +---- + +.. _class_ProjectSettings_property_compression/formats/gzip/compression_level: + +- :ref:`int` **compression/formats/gzip/compression_level** + ++-----------+--------+ +| *Default* | ``-1`` | ++-----------+--------+ + +The default compression level for gzip. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. ``-1`` uses the default gzip compression level, which is identical to ``6`` but could change in the future due to underlying zlib updates. + +---- + +.. _class_ProjectSettings_property_compression/formats/zlib/compression_level: + +- :ref:`int` **compression/formats/zlib/compression_level** + ++-----------+--------+ +| *Default* | ``-1`` | ++-----------+--------+ + +The default compression level for Zlib. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. ``-1`` uses the default gzip compression level, which is identical to ``6`` but could change in the future due to underlying zlib updates. + +---- + +.. _class_ProjectSettings_property_compression/formats/zstd/compression_level: + +- :ref:`int` **compression/formats/zstd/compression_level** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The default compression level for Zstandard. Affects compressed scenes and resources. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. + +---- + +.. _class_ProjectSettings_property_compression/formats/zstd/long_distance_matching: + +- :ref:`bool` **compression/formats/zstd/long_distance_matching** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enables `long-distance matching `__ in Zstandard. + +---- + +.. _class_ProjectSettings_property_compression/formats/zstd/window_log_size: + +- :ref:`int` **compression/formats/zstd/window_log_size** + ++-----------+--------+ +| *Default* | ``27`` | ++-----------+--------+ + +Largest size limit (in power of 2) allowed when compressing using long-distance matching with Zstandard. Higher values can result in better compression, but will require more memory when compressing and decompressing. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/completion/autocomplete_setters_and_getters: + +- :ref:`bool` **debug/gdscript/completion/autocomplete_setters_and_getters** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, displays getters and setters in autocompletion results in the script editor. This setting is meant to be used when porting old projects (Godot 2), as using member variables is the preferred style from Godot 3 onwards. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/constant_used_as_function: + +- :ref:`bool` **debug/gdscript/warnings/constant_used_as_function** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a constant is used as a function. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/deprecated_keyword: + +- :ref:`bool` **debug/gdscript/warnings/deprecated_keyword** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when deprecated keywords such as ``slave`` are used. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/enable: + +- :ref:`bool` **debug/gdscript/warnings/enable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables specific GDScript warnings (see ``debug/gdscript/warnings/*`` settings). If ``false``, disables all GDScript warnings. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/exclude_addons: + +- :ref:`bool` **debug/gdscript/warnings/exclude_addons** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, scripts in the ``res://addons`` folder will not generate warnings. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/function_conflicts_constant: + +- :ref:`bool` **debug/gdscript/warnings/function_conflicts_constant** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a function is declared with the same name as a constant. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/function_conflicts_variable: + +- :ref:`bool` **debug/gdscript/warnings/function_conflicts_variable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a function is declared with the same name as a variable. This will turn into an error in a future version when first-class functions become supported in GDScript. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/function_may_yield: + +- :ref:`bool` **debug/gdscript/warnings/function_may_yield** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a function assigned to a variable may yield and return a function state instead of a value. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/function_used_as_property: + +- :ref:`bool` **debug/gdscript/warnings/function_used_as_property** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when using a function as if it was a property. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/incompatible_ternary: + +- :ref:`bool` **debug/gdscript/warnings/incompatible_ternary** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a ternary operator may emit values with incompatible types. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/integer_division: + +- :ref:`bool` **debug/gdscript/warnings/integer_division** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when dividing an integer by another integer (the decimal part will be discarded). + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/narrowing_conversion: + +- :ref:`bool` **debug/gdscript/warnings/narrowing_conversion** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when passing a floating-point value to a function that expects an integer (it will be converted and lose precision). + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/property_used_as_function: + +- :ref:`bool` **debug/gdscript/warnings/property_used_as_function** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when using a property as if it was a function. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/return_value_discarded: + +- :ref:`bool` **debug/gdscript/warnings/return_value_discarded** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the :ref:`Error` enum. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/shadowed_variable: + +- :ref:`bool` **debug/gdscript/warnings/shadowed_variable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable). + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/standalone_expression: + +- :ref:`bool` **debug/gdscript/warnings/standalone_expression** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when calling an expression that has no effect on the surrounding code, such as writing ``2 + 2`` as a statement. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/standalone_ternary: + +- :ref:`bool` **debug/gdscript/warnings/standalone_ternary** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when calling a ternary expression that has no effect on the surrounding code, such as writing ``42 if active else 0`` as a statement. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/treat_warnings_as_errors: + +- :ref:`bool` **debug/gdscript/warnings/treat_warnings_as_errors** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, all warnings will be reported as if they were errors. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unassigned_variable: + +- :ref:`bool` **debug/gdscript/warnings/unassigned_variable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when using a variable that wasn't previously assigned. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unassigned_variable_op_assign: + +- :ref:`bool` **debug/gdscript/warnings/unassigned_variable_op_assign** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when assigning a variable using an assignment operator like ``+=`` if the variable wasn't previously assigned. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unreachable_code: + +- :ref:`bool` **debug/gdscript/warnings/unreachable_code** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when unreachable code is detected (such as after a ``return`` statement that will always be executed). + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unsafe_call_argument: + +- :ref:`bool` **debug/gdscript/warnings/unsafe_call_argument** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables warnings when using an expression whose type may not be compatible with the function parameter expected. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unsafe_cast: + +- :ref:`bool` **debug/gdscript/warnings/unsafe_cast** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables warnings when performing an unsafe cast. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unsafe_method_access: + +- :ref:`bool` **debug/gdscript/warnings/unsafe_method_access** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables warnings when calling a method whose presence is not guaranteed at compile-time in the class. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unsafe_property_access: + +- :ref:`bool` **debug/gdscript/warnings/unsafe_property_access** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables warnings when accessing a property whose presence is not guaranteed at compile-time in the class. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unused_argument: + +- :ref:`bool` **debug/gdscript/warnings/unused_argument** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a function parameter is unused. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unused_class_variable: + +- :ref:`bool` **debug/gdscript/warnings/unused_class_variable** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables warnings when a member variable is unused. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unused_signal: + +- :ref:`bool` **debug/gdscript/warnings/unused_signal** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a signal is unused. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/unused_variable: + +- :ref:`bool` **debug/gdscript/warnings/unused_variable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a local variable is unused. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/variable_conflicts_function: + +- :ref:`bool` **debug/gdscript/warnings/variable_conflicts_function** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when a variable is declared with the same name as a function. This will turn into an error in a future version when first-class functions become supported in GDScript. + +---- + +.. _class_ProjectSettings_property_debug/gdscript/warnings/void_assignment: + +- :ref:`bool` **debug/gdscript/warnings/void_assignment** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables warnings when assigning the result of a function that returns ``void`` to a variable. + +---- + +.. _class_ProjectSettings_property_debug/settings/crash_handler/message: + +- :ref:`String` **debug/settings/crash_handler/message** + ++-----------+-------------------------------------------------------------------------------------------------+ +| *Default* | ``"Please include this when reporting the bug on https://github.com/godotengine/godot/issues"`` | ++-----------+-------------------------------------------------------------------------------------------------+ + +Message to be displayed before the backtrace when the engine crashes. + +---- + +.. _class_ProjectSettings_property_debug/settings/fps/force_fps: + +- :ref:`int` **debug/settings/fps/force_fps** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Maximum number of frames per second allowed. The actual number of frames per second may still be below this value if the game is lagging. See also :ref:`physics/common/physics_fps`. + +If :ref:`display/window/vsync/use_vsync` is enabled, it takes precedence and the forced FPS number cannot exceed the monitor's refresh rate. + +This setting is therefore mostly relevant for lowering the maximum FPS below VSync, e.g. to perform non-real-time rendering of static frames, or test the project under lag conditions. + +**Note:** This property is only read when the project starts. To change the rendering FPS cap at runtime, set :ref:`Engine.target_fps` instead. + +---- + +.. _class_ProjectSettings_property_debug/settings/gdscript/max_call_stack: + +- :ref:`int` **debug/settings/gdscript/max_call_stack** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum call stack allowed for debugging GDScript. + +---- + +.. _class_ProjectSettings_property_debug/settings/profiler/max_functions: + +- :ref:`int` **debug/settings/profiler/max_functions** + ++-----------+-----------+ +| *Default* | ``16384`` | ++-----------+-----------+ + +Maximum amount of functions per frame allowed when profiling. + +---- + +.. _class_ProjectSettings_property_debug/settings/stdout/print_fps: + +- :ref:`bool` **debug/settings/stdout/print_fps** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Print frames per second to standard output every second. + +---- + +.. _class_ProjectSettings_property_debug/settings/stdout/verbose_stdout: + +- :ref:`bool` **debug/settings/stdout/verbose_stdout** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Print more information to standard output when running. It displays information such as memory leaks, which scenes and resources are being loaded, etc. + +---- + +.. _class_ProjectSettings_property_debug/settings/visual_script/max_call_stack: + +- :ref:`int` **debug/settings/visual_script/max_call_stack** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum call stack in visual scripting, to avoid infinite recursion. + +---- + +.. _class_ProjectSettings_property_debug/shapes/collision/contact_color: + +- :ref:`Color` **debug/shapes/collision/contact_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 1, 0.2, 0.1, 0.8 )`` | ++-----------+-------------------------------+ + +Color of the contact points between collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_debug/shapes/collision/draw_2d_outlines: + +- :ref:`bool` **debug/shapes/collision/draw_2d_outlines** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Sets whether 2D physics will display collision outlines in game when "Visible Collision Shapes" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_debug/shapes/collision/max_contacts_displayed: + +- :ref:`int` **debug/shapes/collision/max_contacts_displayed** + ++-----------+-----------+ +| *Default* | ``10000`` | ++-----------+-----------+ + +Maximum number of contact points between collision shapes to display when "Visible Collision Shapes" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_debug/shapes/collision/shape_color: + +- :ref:`Color` **debug/shapes/collision/shape_color** + ++-----------+--------------------------------+ +| *Default* | ``Color( 0, 0.6, 0.7, 0.42 )`` | ++-----------+--------------------------------+ + +Color of the collision shapes, visible when "Visible Collision Shapes" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_debug/shapes/navigation/disabled_geometry_color: + +- :ref:`Color` **debug/shapes/navigation/disabled_geometry_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 1, 0.7, 0.1, 0.4 )`` | ++-----------+-------------------------------+ + +Color of the disabled navigation geometry, visible when "Visible Navigation" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_debug/shapes/navigation/geometry_color: + +- :ref:`Color` **debug/shapes/navigation/geometry_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.1, 1, 0.7, 0.4 )`` | ++-----------+-------------------------------+ + +Color of the navigation geometry, visible when "Visible Navigation" is enabled in the Debug menu. + +---- + +.. _class_ProjectSettings_property_display/mouse_cursor/custom_image: + +- :ref:`String` **display/mouse_cursor/custom_image** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Custom image for the mouse cursor (limited to 256×256). + +---- + +.. _class_ProjectSettings_property_display/mouse_cursor/custom_image_hotspot: + +- :ref:`Vector2` **display/mouse_cursor/custom_image_hotspot** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ + +Hotspot for the custom mouse cursor image. + +---- + +.. _class_ProjectSettings_property_display/mouse_cursor/tooltip_position_offset: + +- :ref:`Vector2` **display/mouse_cursor/tooltip_position_offset** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 10, 10 )`` | ++-----------+-----------------------+ + +Position offset for tooltips, relative to the mouse cursor's hotspot. + +---- + +.. _class_ProjectSettings_property_display/window/dpi/allow_hidpi: + +- :ref:`bool` **display/window/dpi/allow_hidpi** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, allows HiDPI display on Windows, macOS, and the HTML5 platform. This setting has no effect on desktop Linux, as DPI-awareness fallbacks are not supported there. + +---- + +.. _class_ProjectSettings_property_display/window/energy_saving/keep_screen_on: + +- :ref:`bool` **display/window/energy_saving/keep_screen_on** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, keeps the screen on (even in case of inactivity), so the screensaver does not take over. Works on desktop and mobile platforms. + +---- + +.. _class_ProjectSettings_property_display/window/handheld/orientation: + +- :ref:`String` **display/window/handheld/orientation** + ++-----------+-----------------+ +| *Default* | ``"landscape"`` | ++-----------+-----------------+ + +The default screen orientation to use on mobile devices. + +**Note:** When set to a portrait orientation, this project setting does not flip the project resolution's width and height automatically. Instead, you have to set :ref:`display/window/size/width` and :ref:`display/window/size/height` accordingly. + +---- + +.. _class_ProjectSettings_property_display/window/ios/hide_home_indicator: + +- :ref:`bool` **display/window/ios/hide_home_indicator** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, the home indicator is hidden automatically. This only affects iOS devices without a physical home button. + +---- + +.. _class_ProjectSettings_property_display/window/per_pixel_transparency/allowed: + +- :ref:`bool` **display/window/per_pixel_transparency/allowed** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, allows per-pixel transparency for the window background. This affects performance, so leave it on ``false`` unless you need it. + +See :ref:`OS.window_per_pixel_transparency_enabled` for more details. + +**Note:** This feature is implemented on HTML5, Linux, macOS, Windows, and Android. + +---- + +.. _class_ProjectSettings_property_display/window/per_pixel_transparency/enabled: + +- :ref:`bool` **display/window/per_pixel_transparency/enabled** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Sets the window background to transparent when it starts. + +See :ref:`OS.window_per_pixel_transparency_enabled` for more details. + +**Note:** This feature is implemented on HTML5, Linux, macOS, Windows, and Android. + +---- + +.. _class_ProjectSettings_property_display/window/size/always_on_top: + +- :ref:`bool` **display/window/size/always_on_top** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Forces the main window to be always on top. + +**Note:** This setting is ignored on iOS, Android, and HTML5. + +---- + +.. _class_ProjectSettings_property_display/window/size/borderless: + +- :ref:`bool` **display/window/size/borderless** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Forces the main window to be borderless. + +**Note:** This setting is ignored on iOS, Android, and HTML5. + +---- + +.. _class_ProjectSettings_property_display/window/size/fullscreen: + +- :ref:`bool` **display/window/size/fullscreen** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Sets the main window to full screen when the project starts. Note that this is not *exclusive* fullscreen. On Windows and Linux, a borderless window is used to emulate fullscreen. On macOS, a new desktop is used to display the running project. + +Regardless of the platform, enabling fullscreen will change the window size to match the monitor's size. Therefore, make sure your project supports `multiple resolutions `__ when enabling fullscreen mode. + +**Note:** This setting is ignored on iOS, Android, and HTML5. + +---- + +.. _class_ProjectSettings_property_display/window/size/height: + +- :ref:`int` **display/window/size/height** + ++-----------+---------+ +| *Default* | ``600`` | ++-----------+---------+ + +Sets the game's main viewport height. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled. + +---- + +.. _class_ProjectSettings_property_display/window/size/resizable: + +- :ref:`bool` **display/window/size/resizable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Allows the window to be resizable by default. + +**Note:** This setting is ignored on iOS and Android. + +---- + +.. _class_ProjectSettings_property_display/window/size/test_height: + +- :ref:`int` **display/window/size/test_height** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +If greater than zero, overrides the window height when running the game. Useful for testing stretch modes. + +---- + +.. _class_ProjectSettings_property_display/window/size/test_width: + +- :ref:`int` **display/window/size/test_width** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +If greater than zero, overrides the window width when running the game. Useful for testing stretch modes. + +---- + +.. _class_ProjectSettings_property_display/window/size/width: + +- :ref:`int` **display/window/size/width** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Sets the game's main viewport width. On desktop platforms, this is the default window size. Stretch mode settings also use this as a reference when enabled. + +---- + +.. _class_ProjectSettings_property_display/window/tablet_driver: + +- :ref:`String` **display/window/tablet_driver** + +Specifies the tablet driver to use. If left empty, the default driver will be used. + +---- + +.. _class_ProjectSettings_property_display/window/vsync/use_vsync: + +- :ref:`bool` **display/window/vsync/use_vsync** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, enables vertical synchronization. This eliminates tearing that may appear in moving scenes, at the cost of higher input latency and stuttering at lower framerates. If ``false``, vertical synchronization will be disabled, however, many platforms will enforce it regardless (such as mobile platforms and HTML5). + +---- + +.. _class_ProjectSettings_property_display/window/vsync/vsync_via_compositor: + +- :ref:`bool` **display/window/vsync/vsync_via_compositor** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``Use Vsync`` is enabled and this setting is ``true``, enables vertical synchronization via the operating system's window compositor when in windowed mode and the compositor is enabled. This will prevent stutter in certain situations. (Windows only.) + +**Note:** This option is experimental and meant to alleviate stutter experienced by some users. However, some users have experienced a Vsync framerate halving (e.g. from 60 FPS to 30 FPS) when using it. + +---- + +.. _class_ProjectSettings_property_editor/main_run_args: + +- :ref:`String` **editor/main_run_args** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +The command-line arguments to append to Godot's own command line when running the project. This doesn't affect the editor itself. + +It is possible to make another executable run Godot by using the ``%command%`` placeholder. The placeholder will be replaced with Godot's own command line. Program-specific arguments should be placed *before* the placeholder, whereas Godot-specific arguments should be placed *after* the placeholder. + +For example, this can be used to force the project to run on the dedicated GPU in a NVIDIA Optimus system on Linux: + +:: + + prime-run %command% + +---- + +.. _class_ProjectSettings_property_editor/script_templates_search_path: + +- :ref:`String` **editor/script_templates_search_path** + ++-----------+------------------------------+ +| *Default* | ``"res://script_templates"`` | ++-----------+------------------------------+ + +Search path for project-specific script templates. Godot will search for script templates both in the editor-specific path and in this project-specific path. + +---- + +.. _class_ProjectSettings_property_editor/search_in_file_extensions: + +- :ref:`PoolStringArray` **editor/search_in_file_extensions** + ++-----------+---------------------------------------------------+ +| *Default* | ``PoolStringArray( "gd", "gdshader", "shader" )`` | ++-----------+---------------------------------------------------+ + +Text-based file extensions to include in the script editor's "Find in Files" feature. You can add e.g. ``tscn`` if you wish to also parse your scene files, especially if you use built-in scripts which are serialized in the scene files. + +---- + +.. _class_ProjectSettings_property_gui/common/default_scroll_deadzone: + +- :ref:`int` **gui/common/default_scroll_deadzone** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Default value for :ref:`ScrollContainer.scroll_deadzone`, which will be used for all :ref:`ScrollContainer`\ s unless overridden. + +---- + +.. _class_ProjectSettings_property_gui/common/swap_ok_cancel: + +- :ref:`bool` **gui/common/swap_ok_cancel** + +If ``true``, swaps OK and Cancel buttons in dialogs on Windows and UWP to follow interface conventions. + +---- + +.. _class_ProjectSettings_property_gui/common/text_edit_undo_stack_max_size: + +- :ref:`int` **gui/common/text_edit_undo_stack_max_size** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +---- + +.. _class_ProjectSettings_property_gui/theme/custom: + +- :ref:`String` **gui/theme/custom** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Path to a custom :ref:`Theme` resource file to use for the project (``theme`` or generic ``tres``/``res`` extension). + +---- + +.. _class_ProjectSettings_property_gui/theme/custom_font: + +- :ref:`String` **gui/theme/custom_font** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Path to a custom :ref:`Font` resource to use as default for all GUI elements of the project. + +---- + +.. _class_ProjectSettings_property_gui/theme/use_hidpi: + +- :ref:`bool` **gui/theme/use_hidpi** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, makes sure the theme used works with HiDPI. + +---- + +.. _class_ProjectSettings_property_gui/timers/incremental_search_max_interval_msec: + +- :ref:`int` **gui/timers/incremental_search_max_interval_msec** + ++-----------+----------+ +| *Default* | ``2000`` | ++-----------+----------+ + +Timer setting for incremental search in :ref:`Tree`, :ref:`ItemList`, etc. controls (in milliseconds). + +---- + +.. _class_ProjectSettings_property_gui/timers/text_edit_idle_detect_sec: + +- :ref:`float` **gui/timers/text_edit_idle_detect_sec** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +Timer for detecting idle in :ref:`TextEdit` (in seconds). + +---- + +.. _class_ProjectSettings_property_gui/timers/tooltip_delay_sec: + +- :ref:`float` **gui/timers/tooltip_delay_sec** + ++-----------+---------+ +| *Default* | ``0.5`` | ++-----------+---------+ + +Default delay for tooltips (in seconds). + +---- + +.. _class_ProjectSettings_property_input/ui_accept: + +- :ref:`Dictionary` **input/ui_accept** + +Default :ref:`InputEventAction` to confirm a focused button, menu or list item, or validate input. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_cancel: + +- :ref:`Dictionary` **input/ui_cancel** + +Default :ref:`InputEventAction` to discard a modal or pending input. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_down: + +- :ref:`Dictionary` **input/ui_down** + +Default :ref:`InputEventAction` to move down in the UI. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_end: + +- :ref:`Dictionary` **input/ui_end** + +Default :ref:`InputEventAction` to go to the end position of a :ref:`Control` (e.g. last item in an :ref:`ItemList` or a :ref:`Tree`), matching the behavior of :ref:`@GlobalScope.KEY_END` on typical desktop UI systems. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_focus_next: + +- :ref:`Dictionary` **input/ui_focus_next** + +Default :ref:`InputEventAction` to focus the next :ref:`Control` in the scene. The focus behavior can be configured via :ref:`Control.focus_next`. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_focus_prev: + +- :ref:`Dictionary` **input/ui_focus_prev** + +Default :ref:`InputEventAction` to focus the previous :ref:`Control` in the scene. The focus behavior can be configured via :ref:`Control.focus_previous`. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_home: + +- :ref:`Dictionary` **input/ui_home** + +Default :ref:`InputEventAction` to go to the start position of a :ref:`Control` (e.g. first item in an :ref:`ItemList` or a :ref:`Tree`), matching the behavior of :ref:`@GlobalScope.KEY_HOME` on typical desktop UI systems. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_left: + +- :ref:`Dictionary` **input/ui_left** + +Default :ref:`InputEventAction` to move left in the UI. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_page_down: + +- :ref:`Dictionary` **input/ui_page_down** + +Default :ref:`InputEventAction` to go down a page in a :ref:`Control` (e.g. in an :ref:`ItemList` or a :ref:`Tree`), matching the behavior of :ref:`@GlobalScope.KEY_PAGEDOWN` on typical desktop UI systems. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_page_up: + +- :ref:`Dictionary` **input/ui_page_up** + +Default :ref:`InputEventAction` to go up a page in a :ref:`Control` (e.g. in an :ref:`ItemList` or a :ref:`Tree`), matching the behavior of :ref:`@GlobalScope.KEY_PAGEUP` on typical desktop UI systems. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_right: + +- :ref:`Dictionary` **input/ui_right** + +Default :ref:`InputEventAction` to move right in the UI. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_select: + +- :ref:`Dictionary` **input/ui_select** + +Default :ref:`InputEventAction` to select an item in a :ref:`Control` (e.g. in an :ref:`ItemList` or a :ref:`Tree`). + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input/ui_up: + +- :ref:`Dictionary` **input/ui_up** + +Default :ref:`InputEventAction` to move up in the UI. + +**Note:** Default ``ui_*`` actions cannot be removed as they are necessary for the internal logic of several :ref:`Control`\ s. The events assigned to the action can however be modified. + +---- + +.. _class_ProjectSettings_property_input_devices/buffering/agile_event_flushing: + +- :ref:`bool` **input_devices/buffering/agile_event_flushing** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, key/touch/joystick events will be flushed just before every idle and physics frame. + +If ``false``, such events will be flushed only once per idle frame, between iterations of the engine. + +Enabling this can greatly improve the responsiveness to input, specially in devices that need to run multiple physics frames per visible (idle) frame, because they can't run at the target frame rate. + +**Note:** Currently implemented only in Android. + +---- + +.. _class_ProjectSettings_property_input_devices/pointing/emulate_mouse_from_touch: + +- :ref:`bool` **input_devices/pointing/emulate_mouse_from_touch** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, sends mouse input events when tapping or swiping on the touchscreen. + +---- + +.. _class_ProjectSettings_property_input_devices/pointing/emulate_touch_from_mouse: + +- :ref:`bool` **input_devices/pointing/emulate_touch_from_mouse** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, sends touch input events when clicking or dragging the mouse. + +---- + +.. _class_ProjectSettings_property_input_devices/pointing/ios/touch_delay: + +- :ref:`float` **input_devices/pointing/ios/touch_delay** + ++-----------+----------+ +| *Default* | ``0.15`` | ++-----------+----------+ + +Default delay for touch events. This only affects iOS devices. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_1: + +- :ref:`String` **layer_names/2d_physics/layer_1** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 1. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_10: + +- :ref:`String` **layer_names/2d_physics/layer_10** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 10. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_11: + +- :ref:`String` **layer_names/2d_physics/layer_11** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 11. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_12: + +- :ref:`String` **layer_names/2d_physics/layer_12** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 12. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_13: + +- :ref:`String` **layer_names/2d_physics/layer_13** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 13. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_14: + +- :ref:`String` **layer_names/2d_physics/layer_14** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 14. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_15: + +- :ref:`String` **layer_names/2d_physics/layer_15** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 15. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_16: + +- :ref:`String` **layer_names/2d_physics/layer_16** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 16. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_17: + +- :ref:`String` **layer_names/2d_physics/layer_17** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 17. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_18: + +- :ref:`String` **layer_names/2d_physics/layer_18** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 18. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_19: + +- :ref:`String` **layer_names/2d_physics/layer_19** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 19. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_2: + +- :ref:`String` **layer_names/2d_physics/layer_2** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 2. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_20: + +- :ref:`String` **layer_names/2d_physics/layer_20** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 20. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_21: + +- :ref:`String` **layer_names/2d_physics/layer_21** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 21. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_22: + +- :ref:`String` **layer_names/2d_physics/layer_22** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 22. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_23: + +- :ref:`String` **layer_names/2d_physics/layer_23** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 23. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_24: + +- :ref:`String` **layer_names/2d_physics/layer_24** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 24. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_25: + +- :ref:`String` **layer_names/2d_physics/layer_25** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 25. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_26: + +- :ref:`String` **layer_names/2d_physics/layer_26** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 26. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_27: + +- :ref:`String` **layer_names/2d_physics/layer_27** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 27. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_28: + +- :ref:`String` **layer_names/2d_physics/layer_28** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 28. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_29: + +- :ref:`String` **layer_names/2d_physics/layer_29** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 29. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_3: + +- :ref:`String` **layer_names/2d_physics/layer_3** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 3. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_30: + +- :ref:`String` **layer_names/2d_physics/layer_30** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 30. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_31: + +- :ref:`String` **layer_names/2d_physics/layer_31** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 31. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_32: + +- :ref:`String` **layer_names/2d_physics/layer_32** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 32. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_4: + +- :ref:`String` **layer_names/2d_physics/layer_4** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 4. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_5: + +- :ref:`String` **layer_names/2d_physics/layer_5** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 5. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_6: + +- :ref:`String` **layer_names/2d_physics/layer_6** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 6. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_7: + +- :ref:`String` **layer_names/2d_physics/layer_7** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 7. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_8: + +- :ref:`String` **layer_names/2d_physics/layer_8** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 8. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_physics/layer_9: + +- :ref:`String` **layer_names/2d_physics/layer_9** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D physics layer 9. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_1: + +- :ref:`String` **layer_names/2d_render/layer_1** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 1. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_10: + +- :ref:`String` **layer_names/2d_render/layer_10** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 10. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_11: + +- :ref:`String` **layer_names/2d_render/layer_11** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 11. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_12: + +- :ref:`String` **layer_names/2d_render/layer_12** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 12. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_13: + +- :ref:`String` **layer_names/2d_render/layer_13** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 13. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_14: + +- :ref:`String` **layer_names/2d_render/layer_14** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 14. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_15: + +- :ref:`String` **layer_names/2d_render/layer_15** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 15. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_16: + +- :ref:`String` **layer_names/2d_render/layer_16** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 16. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_17: + +- :ref:`String` **layer_names/2d_render/layer_17** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 17. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_18: + +- :ref:`String` **layer_names/2d_render/layer_18** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 18. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_19: + +- :ref:`String` **layer_names/2d_render/layer_19** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 19. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_2: + +- :ref:`String` **layer_names/2d_render/layer_2** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 2. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_20: + +- :ref:`String` **layer_names/2d_render/layer_20** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 20. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_3: + +- :ref:`String` **layer_names/2d_render/layer_3** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 3. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_4: + +- :ref:`String` **layer_names/2d_render/layer_4** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 4. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_5: + +- :ref:`String` **layer_names/2d_render/layer_5** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 5. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_6: + +- :ref:`String` **layer_names/2d_render/layer_6** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 6. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_7: + +- :ref:`String` **layer_names/2d_render/layer_7** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 7. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_8: + +- :ref:`String` **layer_names/2d_render/layer_8** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 8. + +---- + +.. _class_ProjectSettings_property_layer_names/2d_render/layer_9: + +- :ref:`String` **layer_names/2d_render/layer_9** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 2D render layer 9. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_1: + +- :ref:`String` **layer_names/3d_physics/layer_1** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 1. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_10: + +- :ref:`String` **layer_names/3d_physics/layer_10** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 10. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_11: + +- :ref:`String` **layer_names/3d_physics/layer_11** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 11. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_12: + +- :ref:`String` **layer_names/3d_physics/layer_12** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 12. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_13: + +- :ref:`String` **layer_names/3d_physics/layer_13** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 13. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_14: + +- :ref:`String` **layer_names/3d_physics/layer_14** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 14. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_15: + +- :ref:`String` **layer_names/3d_physics/layer_15** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 15. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_16: + +- :ref:`String` **layer_names/3d_physics/layer_16** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 16. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_17: + +- :ref:`String` **layer_names/3d_physics/layer_17** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 17. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_18: + +- :ref:`String` **layer_names/3d_physics/layer_18** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 18. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_19: + +- :ref:`String` **layer_names/3d_physics/layer_19** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 19. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_2: + +- :ref:`String` **layer_names/3d_physics/layer_2** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 2. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_20: + +- :ref:`String` **layer_names/3d_physics/layer_20** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 20. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_21: + +- :ref:`String` **layer_names/3d_physics/layer_21** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 21. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_22: + +- :ref:`String` **layer_names/3d_physics/layer_22** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 22. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_23: + +- :ref:`String` **layer_names/3d_physics/layer_23** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 23. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_24: + +- :ref:`String` **layer_names/3d_physics/layer_24** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 24. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_25: + +- :ref:`String` **layer_names/3d_physics/layer_25** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 25. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_26: + +- :ref:`String` **layer_names/3d_physics/layer_26** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 26. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_27: + +- :ref:`String` **layer_names/3d_physics/layer_27** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 27. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_28: + +- :ref:`String` **layer_names/3d_physics/layer_28** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 28. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_29: + +- :ref:`String` **layer_names/3d_physics/layer_29** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 29. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_3: + +- :ref:`String` **layer_names/3d_physics/layer_3** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 3. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_30: + +- :ref:`String` **layer_names/3d_physics/layer_30** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 30. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_31: + +- :ref:`String` **layer_names/3d_physics/layer_31** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 31. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_32: + +- :ref:`String` **layer_names/3d_physics/layer_32** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 32. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_4: + +- :ref:`String` **layer_names/3d_physics/layer_4** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 4. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_5: + +- :ref:`String` **layer_names/3d_physics/layer_5** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 5. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_6: + +- :ref:`String` **layer_names/3d_physics/layer_6** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 6. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_7: + +- :ref:`String` **layer_names/3d_physics/layer_7** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 7. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_8: + +- :ref:`String` **layer_names/3d_physics/layer_8** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 8. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_physics/layer_9: + +- :ref:`String` **layer_names/3d_physics/layer_9** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D physics layer 9. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_1: + +- :ref:`String` **layer_names/3d_render/layer_1** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 1. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_10: + +- :ref:`String` **layer_names/3d_render/layer_10** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 10. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_11: + +- :ref:`String` **layer_names/3d_render/layer_11** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 11. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_12: + +- :ref:`String` **layer_names/3d_render/layer_12** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 12. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_13: + +- :ref:`String` **layer_names/3d_render/layer_13** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 13. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_14: + +- :ref:`String` **layer_names/3d_render/layer_14** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 14 + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_15: + +- :ref:`String` **layer_names/3d_render/layer_15** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 15. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_16: + +- :ref:`String` **layer_names/3d_render/layer_16** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 16. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_17: + +- :ref:`String` **layer_names/3d_render/layer_17** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 17. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_18: + +- :ref:`String` **layer_names/3d_render/layer_18** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 18. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_19: + +- :ref:`String` **layer_names/3d_render/layer_19** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 19. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_2: + +- :ref:`String` **layer_names/3d_render/layer_2** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 2. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_20: + +- :ref:`String` **layer_names/3d_render/layer_20** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 20. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_3: + +- :ref:`String` **layer_names/3d_render/layer_3** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 3. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_4: + +- :ref:`String` **layer_names/3d_render/layer_4** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 4. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_5: + +- :ref:`String` **layer_names/3d_render/layer_5** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 5. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_6: + +- :ref:`String` **layer_names/3d_render/layer_6** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 6. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_7: + +- :ref:`String` **layer_names/3d_render/layer_7** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 7. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_8: + +- :ref:`String` **layer_names/3d_render/layer_8** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 8. + +---- + +.. _class_ProjectSettings_property_layer_names/3d_render/layer_9: + +- :ref:`String` **layer_names/3d_render/layer_9** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +Optional name for the 3D render layer 9. + +---- + +.. _class_ProjectSettings_property_locale/fallback: + +- :ref:`String` **locale/fallback** + ++-----------+----------+ +| *Default* | ``"en"`` | ++-----------+----------+ + +The locale to fall back to if a translation isn't available in a given language. If left empty, ``en`` (English) will be used. + +---- + +.. _class_ProjectSettings_property_locale/test: + +- :ref:`String` **locale/test** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +If non-empty, this locale will be used when running the project from the editor. + +---- + +.. _class_ProjectSettings_property_logging/file_logging/enable_file_logging: + +- :ref:`bool` **logging/file_logging/enable_file_logging** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, logs all output to files. + +---- + +.. _class_ProjectSettings_property_logging/file_logging/enable_file_logging.pc: + +- :ref:`bool` **logging/file_logging/enable_file_logging.pc** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Desktop override for :ref:`logging/file_logging/enable_file_logging`, as log files are not readily accessible on mobile/Web platforms. + +---- + +.. _class_ProjectSettings_property_logging/file_logging/log_path: + +- :ref:`String` **logging/file_logging/log_path** + ++-----------+-----------------------------+ +| *Default* | ``"user://logs/godot.log"`` | ++-----------+-----------------------------+ + +Path to logs within the project. Using an ``user://`` path is recommended. + +---- + +.. _class_ProjectSettings_property_logging/file_logging/max_log_files: + +- :ref:`int` **logging/file_logging/max_log_files** + ++-----------+-------+ +| *Default* | ``5`` | ++-----------+-------+ + +Specifies the maximum amount of log files allowed (used for rotation). + +---- + +.. _class_ProjectSettings_property_memory/limits/command_queue/multithreading_queue_size_kb: + +- :ref:`int` **memory/limits/command_queue/multithreading_queue_size_kb** + ++-----------+---------+ +| *Default* | ``256`` | ++-----------+---------+ + +---- + +.. _class_ProjectSettings_property_memory/limits/message_queue/max_size_kb: + +- :ref:`int` **memory/limits/message_queue/max_size_kb** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +Godot uses a message queue to defer some function calls. If you run out of space on it (you will see an error), you can increase the size here. + +---- + +.. _class_ProjectSettings_property_memory/limits/multithreaded_server/rid_pool_prealloc: + +- :ref:`int` **memory/limits/multithreaded_server/rid_pool_prealloc** + ++-----------+--------+ +| *Default* | ``60`` | ++-----------+--------+ + +This is used by servers when used in multi-threading mode (servers and visual). RIDs are preallocated to avoid stalling the server requesting them on threads. If servers get stalled too often when loading resources in a thread, increase this number. + +---- + +.. _class_ProjectSettings_property_network/limits/debugger_stdout/max_chars_per_second: + +- :ref:`int` **network/limits/debugger_stdout/max_chars_per_second** + ++-----------+----------+ +| *Default* | ``2048`` | ++-----------+----------+ + +Maximum amount of characters allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + +---- + +.. _class_ProjectSettings_property_network/limits/debugger_stdout/max_errors_per_second: + +- :ref:`int` **network/limits/debugger_stdout/max_errors_per_second** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +Maximum number of errors allowed to be sent as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + +---- + +.. _class_ProjectSettings_property_network/limits/debugger_stdout/max_messages_per_frame: + +- :ref:`int` **network/limits/debugger_stdout/max_messages_per_frame** + ++-----------+--------+ +| *Default* | ``10`` | ++-----------+--------+ + +Maximum amount of messages allowed to send as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + +---- + +.. _class_ProjectSettings_property_network/limits/debugger_stdout/max_warnings_per_second: + +- :ref:`int` **network/limits/debugger_stdout/max_warnings_per_second** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +Maximum number of warnings allowed to be sent as output from the debugger. Over this value, content is dropped. This helps not to stall the debugger connection. + +---- + +.. _class_ProjectSettings_property_network/limits/packet_peer_stream/max_buffer_po2: + +- :ref:`int` **network/limits/packet_peer_stream/max_buffer_po2** + ++-----------+--------+ +| *Default* | ``16`` | ++-----------+--------+ + +Default size of packet peer stream for deserializing Godot data (in bytes, specified as a power of two). The default value ``16`` is equal to 65,536 bytes. Over this size, data is dropped. + +---- + +.. _class_ProjectSettings_property_network/limits/tcp/connect_timeout_seconds: + +- :ref:`int` **network/limits/tcp/connect_timeout_seconds** + ++-----------+--------+ +| *Default* | ``30`` | ++-----------+--------+ + +Timeout (in seconds) for connection attempts using TCP. + +---- + +.. _class_ProjectSettings_property_network/limits/webrtc/max_channel_in_buffer_kb: + +- :ref:`int` **network/limits/webrtc/max_channel_in_buffer_kb** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Maximum size (in kiB) for the :ref:`WebRTCDataChannel` input buffer. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_client/max_in_buffer_kb: + +- :ref:`int` **network/limits/websocket_client/max_in_buffer_kb** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Maximum size (in kiB) for the :ref:`WebSocketClient` input buffer. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_client/max_in_packets: + +- :ref:`int` **network/limits/websocket_client/max_in_packets** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum number of concurrent input packets for :ref:`WebSocketClient`. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_client/max_out_buffer_kb: + +- :ref:`int` **network/limits/websocket_client/max_out_buffer_kb** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Maximum size (in kiB) for the :ref:`WebSocketClient` output buffer. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_client/max_out_packets: + +- :ref:`int` **network/limits/websocket_client/max_out_packets** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum number of concurrent output packets for :ref:`WebSocketClient`. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_server/max_in_buffer_kb: + +- :ref:`int` **network/limits/websocket_server/max_in_buffer_kb** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Maximum size (in kiB) for the :ref:`WebSocketServer` input buffer. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_server/max_in_packets: + +- :ref:`int` **network/limits/websocket_server/max_in_packets** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum number of concurrent input packets for :ref:`WebSocketServer`. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_server/max_out_buffer_kb: + +- :ref:`int` **network/limits/websocket_server/max_out_buffer_kb** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Maximum size (in kiB) for the :ref:`WebSocketServer` output buffer. + +---- + +.. _class_ProjectSettings_property_network/limits/websocket_server/max_out_packets: + +- :ref:`int` **network/limits/websocket_server/max_out_packets** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Maximum number of concurrent output packets for :ref:`WebSocketServer`. + +---- + +.. _class_ProjectSettings_property_network/remote_fs/page_read_ahead: + +- :ref:`int` **network/remote_fs/page_read_ahead** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +Amount of read ahead used by remote filesystem. Higher values decrease the effects of latency at the cost of higher bandwidth usage. + +---- + +.. _class_ProjectSettings_property_network/remote_fs/page_size: + +- :ref:`int` **network/remote_fs/page_size** + ++-----------+-----------+ +| *Default* | ``65536`` | ++-----------+-----------+ + +Page size used by remote filesystem (in bytes). + +---- + +.. _class_ProjectSettings_property_network/ssl/certificates: + +- :ref:`String` **network/ssl/certificates** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +The CA certificates bundle to use for SSL connections. If this is set to a non-empty value, this will *override* Godot's default `Mozilla certificate bundle `__. If left empty, the default certificate bundle will be used. + +If in doubt, leave this setting empty. + +---- + +.. _class_ProjectSettings_property_node/name_casing: + +- :ref:`int` **node/name_casing** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +When creating node names automatically, set the type of casing in this project. This is mostly an editor setting. + +---- + +.. _class_ProjectSettings_property_node/name_num_separator: + +- :ref:`int` **node/name_num_separator** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +What to use to separate node name from number. This is mostly an editor setting. + +---- + +.. _class_ProjectSettings_property_physics/2d/bp_hash_table_size: + +- :ref:`int` **physics/2d/bp_hash_table_size** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +Size of the hash table used for the broad-phase 2D hash grid algorithm. + +**Note:** Not used if :ref:`physics/2d/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_physics/2d/bvh_collision_margin: + +- :ref:`float` **physics/2d/bvh_collision_margin** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +Additional expansion applied to object bounds in the 2D physics bounding volume hierarchy. This can reduce BVH processing at the cost of a slightly coarser broadphase, which can stress the physics more in some situations. + +The default value will work well in most situations. A value of 0.0 will turn this optimization off, and larger values may work better for larger, faster moving objects. + +**Note:** Used only if :ref:`physics/2d/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_physics/2d/cell_size: + +- :ref:`int` **physics/2d/cell_size** + ++-----------+---------+ +| *Default* | ``128`` | ++-----------+---------+ + +Cell size used for the broad-phase 2D hash grid algorithm (in pixels). + +**Note:** Not used if :ref:`physics/2d/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_physics/2d/default_angular_damp: + +- :ref:`float` **physics/2d/default_angular_damp** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +The default angular damp in 2D. + +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + +---- + +.. _class_ProjectSettings_property_physics/2d/default_gravity: + +- :ref:`int` **physics/2d/default_gravity** + ++-----------+--------+ +| *Default* | ``98`` | ++-----------+--------+ + +The default gravity strength in 2D (in pixels per second squared). + +**Note:** This property is only read when the project starts. To change the default gravity at runtime, use the following code sample: + +:: + + # Set the default gravity strength to 98. + Physics2DServer.area_set_param(get_viewport().find_world_2d().get_space(), Physics2DServer.AREA_PARAM_GRAVITY, 98) + +---- + +.. _class_ProjectSettings_property_physics/2d/default_gravity_vector: + +- :ref:`Vector2` **physics/2d/default_gravity_vector** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 1 )`` | ++-----------+---------------------+ + +The default gravity direction in 2D. + +**Note:** This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample: + +:: + + # Set the default gravity direction to `Vector2(0, 1)`. + Physics2DServer.area_set_param(get_viewport().find_world_2d().get_space(), Physics2DServer.AREA_PARAM_GRAVITY_VECTOR, Vector2(0, 1)) + +---- + +.. _class_ProjectSettings_property_physics/2d/default_linear_damp: + +- :ref:`float` **physics/2d/default_linear_damp** + ++-----------+---------+ +| *Default* | ``0.1`` | ++-----------+---------+ + +The default linear damp in 2D. + +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + +---- + +.. _class_ProjectSettings_property_physics/2d/large_object_surface_threshold_in_cells: + +- :ref:`int` **physics/2d/large_object_surface_threshold_in_cells** + ++-----------+---------+ +| *Default* | ``512`` | ++-----------+---------+ + +Threshold defining the surface size that constitutes a large object with regard to cells in the broad-phase 2D hash grid algorithm. + +**Note:** Not used if :ref:`physics/2d/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_physics/2d/physics_engine: + +- :ref:`String` **physics/2d/physics_engine** + ++-----------+---------------+ +| *Default* | ``"DEFAULT"`` | ++-----------+---------------+ + +Sets which physics engine to use for 2D physics. + +"DEFAULT" and "GodotPhysics" are the same, as there is currently no alternative 2D physics server implemented. + +---- + +.. _class_ProjectSettings_property_physics/2d/sleep_threshold_angular: + +- :ref:`float` **physics/2d/sleep_threshold_angular** + ++-----------+--------------+ +| *Default* | ``0.139626`` | ++-----------+--------------+ + +Threshold angular velocity under which a 2D physics body will be considered inactive. See :ref:`Physics2DServer.SPACE_PARAM_BODY_ANGULAR_VELOCITY_SLEEP_THRESHOLD`. + +---- + +.. _class_ProjectSettings_property_physics/2d/sleep_threshold_linear: + +- :ref:`float` **physics/2d/sleep_threshold_linear** + ++-----------+---------+ +| *Default* | ``2.0`` | ++-----------+---------+ + +Threshold linear velocity under which a 2D physics body will be considered inactive. See :ref:`Physics2DServer.SPACE_PARAM_BODY_LINEAR_VELOCITY_SLEEP_THRESHOLD`. + +---- + +.. _class_ProjectSettings_property_physics/2d/thread_model: + +- :ref:`int` **physics/2d/thread_model** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Sets whether physics is run on the main thread or a separate one. Running the server on a thread increases performance, but restricts API access to only physics process. + +**Warning:** As of Godot 3.2, there are mixed reports about the use of a Multi-Threaded thread model for physics. Be sure to assess whether it does give you extra performance and no regressions when using it. + +---- + +.. _class_ProjectSettings_property_physics/2d/time_before_sleep: + +- :ref:`float` **physics/2d/time_before_sleep** + ++-----------+---------+ +| *Default* | ``0.5`` | ++-----------+---------+ + +Time (in seconds) of inactivity before which a 2D physics body will put to sleep. See :ref:`Physics2DServer.SPACE_PARAM_BODY_TIME_TO_SLEEP`. + +---- + +.. _class_ProjectSettings_property_physics/2d/use_bvh: + +- :ref:`bool` **physics/2d/use_bvh** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Enables the use of bounding volume hierarchy instead of hash grid for 2D physics spatial partitioning. This may give better performance. + +---- + +.. _class_ProjectSettings_property_physics/3d/active_soft_world: + +- :ref:`bool` **physics/3d/active_soft_world** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Sets whether the 3D physics world will be created with support for :ref:`SoftBody` physics. Only applies to the Bullet physics engine. + +---- + +.. _class_ProjectSettings_property_physics/3d/default_angular_damp: + +- :ref:`float` **physics/3d/default_angular_damp** + ++-----------+---------+ +| *Default* | ``0.1`` | ++-----------+---------+ + +The default angular damp in 3D. + +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + +---- + +.. _class_ProjectSettings_property_physics/3d/default_gravity: + +- :ref:`float` **physics/3d/default_gravity** + ++-----------+---------+ +| *Default* | ``9.8`` | ++-----------+---------+ + +The default gravity strength in 3D (in meters per second squared). + +**Note:** This property is only read when the project starts. To change the default gravity at runtime, use the following code sample: + +:: + + # Set the default gravity strength to 9.8. + PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY, 9.8) + +---- + +.. _class_ProjectSettings_property_physics/3d/default_gravity_vector: + +- :ref:`Vector3` **physics/3d/default_gravity_vector** + ++-----------+-------------------------+ +| *Default* | ``Vector3( 0, -1, 0 )`` | ++-----------+-------------------------+ + +The default gravity direction in 3D. + +**Note:** This property is only read when the project starts. To change the default gravity vector at runtime, use the following code sample: + +:: + + # Set the default gravity direction to `Vector3(0, -1, 0)`. + PhysicsServer.area_set_param(get_viewport().find_world().get_space(), PhysicsServer.AREA_PARAM_GRAVITY_VECTOR, Vector3(0, -1, 0)) + +---- + +.. _class_ProjectSettings_property_physics/3d/default_linear_damp: + +- :ref:`float` **physics/3d/default_linear_damp** + ++-----------+---------+ +| *Default* | ``0.1`` | ++-----------+---------+ + +The default linear damp in 3D. + +**Note:** Good values are in the range ``0`` to ``1``. At value ``0`` objects will keep moving with the same velocity. Values greater than ``1`` will aim to reduce the velocity to ``0`` in less than a second e.g. a value of ``2`` will aim to reduce the velocity to ``0`` in half a second. A value equal to or greater than the physics frame rate (:ref:`physics/common/physics_fps`, ``60`` by default) will bring the object to a stop in one iteration. + +---- + +.. _class_ProjectSettings_property_physics/3d/godot_physics/bvh_collision_margin: + +- :ref:`float` **physics/3d/godot_physics/bvh_collision_margin** + ++-----------+---------+ +| *Default* | ``0.1`` | ++-----------+---------+ + +Additional expansion applied to object bounds in the 3D physics bounding volume hierarchy. This can reduce BVH processing at the cost of a slightly coarser broadphase, which can stress the physics more in some situations. + +The default value will work well in most situations. A value of 0.0 will turn this optimization off, and larger values may work better for larger, faster moving objects. + +**Note:** Used only if :ref:`physics/3d/godot_physics/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_physics/3d/godot_physics/use_bvh: + +- :ref:`bool` **physics/3d/godot_physics/use_bvh** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Enables the use of bounding volume hierarchy instead of octree for 3D physics spatial partitioning. This may give better performance. + +---- + +.. _class_ProjectSettings_property_physics/3d/physics_engine: + +- :ref:`String` **physics/3d/physics_engine** + ++-----------+---------------+ +| *Default* | ``"DEFAULT"`` | ++-----------+---------------+ + +Sets which physics engine to use for 3D physics. + +"DEFAULT" is currently the `Bullet `__ physics engine. The "GodotPhysics" engine is still supported as an alternative. + +---- + +.. _class_ProjectSettings_property_physics/common/enable_object_picking: + +- :ref:`bool` **physics/common/enable_object_picking** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Enables :ref:`Viewport.physics_object_picking` on the root viewport. + +---- + +.. _class_ProjectSettings_property_physics/common/enable_pause_aware_picking: + +- :ref:`bool` **physics/common/enable_pause_aware_picking** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If enabled, 2D and 3D physics picking behaves this way in relation to pause: + +- When pause is started, every collision object that is hovered or captured (3D only) is released from that condition, getting the relevant mouse-exit callback, unless its pause mode makes it immune to pause. + +- During pause, picking only considers collision objects immune to pause, sending input events and enter/exit callbacks to them as expected. + +If disabled, the legacy behavior is used, which consists in queuing the picking input events during pause (so nodes won't get them) and flushing that queue on resume, against the state of the 2D/3D world at that point. + +---- + +.. _class_ProjectSettings_property_physics/common/physics_fps: + +- :ref:`int` **physics/common/physics_fps** + ++-----------+--------+ +| *Default* | ``60`` | ++-----------+--------+ + +The number of fixed iterations per second. This controls how often physics simulation and :ref:`Node._physics_process` methods are run. See also :ref:`debug/settings/fps/force_fps`. + +**Note:** This property is only read when the project starts. To change the physics FPS at runtime, set :ref:`Engine.iterations_per_second` instead. + +**Note:** Only 8 physics ticks may be simulated per rendered frame at most. If more than 8 physics ticks have to be simulated per rendered frame to keep up with rendering, the game will appear to slow down (even if ``delta`` is used consistently in physics calculations). Therefore, it is recommended not to increase :ref:`physics/common/physics_fps` above 240. Otherwise, the game will slow down when the rendering framerate goes below 30 FPS. + +---- + +.. _class_ProjectSettings_property_physics/common/physics_jitter_fix: + +- :ref:`float` **physics/common/physics_jitter_fix** + ++-----------+---------+ +| *Default* | ``0.5`` | ++-----------+---------+ + +Controls how much physics ticks are synchronized with real time. For 0 or less, the ticks are synchronized. Such values are recommended for network games, where clock synchronization matters. Higher values cause higher deviation of in-game clock and real clock, but allows smoothing out framerate jitters. The default value of 0.5 should be fine for most; values above 2 could cause the game to react to dropped frames with a noticeable delay and are not recommended. + +**Note:** For best results, when using a custom physics interpolation solution, the physics jitter fix should be disabled by setting :ref:`physics/common/physics_jitter_fix` to ``0``. + +**Note:** This property is only read when the project starts. To change the physics FPS at runtime, set :ref:`Engine.physics_jitter_fix` instead. + +---- + +.. _class_ProjectSettings_property_rendering/2d/opengl/batching_send_null: + +- :ref:`int` **rendering/2d/opengl/batching_send_null** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +**Experimental.** Calls ``glBufferData`` with NULL data prior to uploading batching data. This may not be necessary but can be used for safety. + +**Note:** Use with care. You are advised to leave this as default for exports. A non-default setting that works better on your machine may adversely affect performance for end users. + +---- + +.. _class_ProjectSettings_property_rendering/2d/opengl/batching_stream: + +- :ref:`int` **rendering/2d/opengl/batching_stream** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +**Experimental.** If set to on, uses the ``GL_STREAM_DRAW`` flag for batching buffer uploads. If off, uses the ``GL_DYNAMIC_DRAW`` flag. + +**Note:** Use with care. You are advised to leave this as default for exports. A non-default setting that works better on your machine may adversely affect performance for end users. + +---- + +.. _class_ProjectSettings_property_rendering/2d/opengl/legacy_orphan_buffers: + +- :ref:`int` **rendering/2d/opengl/legacy_orphan_buffers** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +**Experimental.** If set to on, this applies buffer orphaning - ``glBufferData`` is called with NULL data and the full buffer size prior to uploading new data. This can be important to avoid stalling on some hardware. + +**Note:** Use with care. You are advised to leave this as default for exports. A non-default setting that works better on your machine may adversely affect performance for end users. + +---- + +.. _class_ProjectSettings_property_rendering/2d/opengl/legacy_stream: + +- :ref:`int` **rendering/2d/opengl/legacy_stream** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +**Experimental.** If set to on, uses the ``GL_STREAM_DRAW`` flag for legacy buffer uploads. If off, uses the ``GL_DYNAMIC_DRAW`` flag. + +**Note:** Use with care. You are advised to leave this as default for exports. A non-default setting that works better on your machine may adversely affect performance for end users. + +---- + +.. _class_ProjectSettings_property_rendering/2d/options/ninepatch_mode: + +- :ref:`int` **rendering/2d/options/ninepatch_mode** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Choose between fixed mode where corner scalings are preserved matching the artwork, and scaling mode. + +Not available in GLES3 when :ref:`rendering/batching/options/use_batching` is off. + +---- + +.. _class_ProjectSettings_property_rendering/2d/options/use_nvidia_rect_flicker_workaround: + +- :ref:`bool` **rendering/2d/options/use_nvidia_rect_flicker_workaround** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Some NVIDIA GPU drivers have a bug which produces flickering issues for the ``draw_rect`` method, especially as used in :ref:`TileMap`. Refer to `GitHub issue 9913 `__ for details. + +If ``true``, this option enables a "safe" code path for such NVIDIA GPUs at the cost of performance. This option affects GLES2 and GLES3 rendering, but only on desktop platforms. + +---- + +.. _class_ProjectSettings_property_rendering/2d/options/use_software_skinning: + +- :ref:`bool` **rendering/2d/options/use_software_skinning** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, performs 2D skinning on the CPU rather than the GPU. This provides greater compatibility with a wide range of hardware, and also may be faster in some circumstances. + +Currently only available when :ref:`rendering/batching/options/use_batching` is active. + +**Note:** Antialiased software skinned polys are not supported, and will be rendered without antialiasing. + +**Note:** Custom shaders that use the ``VERTEX`` built-in operate with ``VERTEX`` position *after* skinning, whereas with hardware skinning, ``VERTEX`` is the position *before* skinning. + +---- + +.. _class_ProjectSettings_property_rendering/2d/snapping/use_gpu_pixel_snap: + +- :ref:`bool` **rendering/2d/snapping/use_gpu_pixel_snap** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, forces snapping of vertices to pixels in 2D rendering. May help in some pixel art styles. + +This snapping is performed on the GPU in the vertex shader. + +Consider using the project setting :ref:`rendering/batching/precision/uv_contract` to prevent artifacts. + +---- + +.. _class_ProjectSettings_property_rendering/batching/debug/diagnose_frame: + +- :ref:`bool` **rendering/batching/debug/diagnose_frame** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +When batching is on, this regularly prints a frame diagnosis log. Note that this will degrade performance. + +---- + +.. _class_ProjectSettings_property_rendering/batching/debug/flash_batching: + +- :ref:`bool` **rendering/batching/debug/flash_batching** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +**Experimental.** For regression testing against the old renderer. If this is switched on, and ``use_batching`` is set, the renderer will swap alternately between using the old renderer, and the batched renderer, on each frame. This makes it easy to identify visual differences. Performance will be degraded. + +---- + +.. _class_ProjectSettings_property_rendering/batching/lights/max_join_items: + +- :ref:`int` **rendering/batching/lights/max_join_items** + ++-----------+--------+ +| *Default* | ``32`` | ++-----------+--------+ + +Lights have the potential to prevent joining items, and break many of the performance benefits of batching. This setting enables some complex logic to allow joining items if their lighting is similar, and overlap tests pass. This can significantly improve performance in some games. Set to 0 to switch off. With large values the cost of overlap tests may lead to diminishing returns. + +---- + +.. _class_ProjectSettings_property_rendering/batching/lights/scissor_area_threshold: + +- :ref:`float` **rendering/batching/lights/scissor_area_threshold** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +Sets the proportion of the total screen area (in pixels) that must be saved by a scissor operation in order to activate light scissoring. This can prevent parts of items being rendered outside the light area. Lower values scissor more aggressively. A value of 1 scissors none of the items, a value of 0 scissors every item. The power of 4 of the value is used, in order to emphasize the lower range, and multiplied by the total screen area in pixels to give the threshold. This can reduce fill rate requirements in scenes with a lot of lighting. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/single_rect_fallback: + +- :ref:`bool` **rendering/batching/options/single_rect_fallback** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enabling this setting uses the legacy method to draw batches containing only one rect. The legacy method is faster (approx twice as fast), but can cause flicker on some systems. In order to directly compare performance with the non-batching renderer you can set this to true, but it is recommended to turn this off unless you can guarantee your target hardware will work with this method. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/use_batching: + +- :ref:`bool` **rendering/batching/options/use_batching** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Turns 2D batching on and off. Batching increases performance by reducing the amount of graphics API drawcalls. + +---- + +.. _class_ProjectSettings_property_rendering/batching/options/use_batching_in_editor: + +- :ref:`bool` **rendering/batching/options/use_batching_in_editor** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Switches on 2D batching within the editor. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/batch_buffer_size: + +- :ref:`int` **rendering/batching/parameters/batch_buffer_size** + ++-----------+-----------+ +| *Default* | ``16384`` | ++-----------+-----------+ + +Size of buffer reserved for batched vertices. Larger size enables larger batches, but there are diminishing returns for the memory used. This should only have a minor effect on performance. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/colored_vertex_format_threshold: + +- :ref:`float` **rendering/batching/parameters/colored_vertex_format_threshold** + ++-----------+----------+ +| *Default* | ``0.25`` | ++-----------+----------+ + +Including color in the vertex format has a cost, however, not including color prevents batching across color changes. This threshold determines the ratio of ``number of vertex color changes / total number of vertices`` above which vertices will be translated to colored format. A value of 0 will always use colored vertices, 1 will never use colored vertices. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/item_reordering_lookahead: + +- :ref:`int` **rendering/batching/parameters/item_reordering_lookahead** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +In certain circumstances, the batcher can reorder items in order to better join them. This may result in better performance. An overlap test is needed however for each item lookahead, so there is a trade off, with diminishing returns. If you are getting no benefit, setting this to 0 will switch it off. + +---- + +.. _class_ProjectSettings_property_rendering/batching/parameters/max_join_item_commands: + +- :ref:`int` **rendering/batching/parameters/max_join_item_commands** + ++-----------+--------+ +| *Default* | ``16`` | ++-----------+--------+ + +Sets the number of commands to lookahead to determine whether to batch render items. A value of 1 can join items consisting of single commands, 0 turns off joining. Higher values are in theory more likely to join, however this has diminishing returns and has a runtime cost so a small value is recommended. + +---- + +.. _class_ProjectSettings_property_rendering/batching/precision/uv_contract: + +- :ref:`bool` **rendering/batching/precision/uv_contract** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +On some platforms (especially mobile), precision issues in shaders can lead to reading 1 texel outside of bounds, particularly where rects are scaled. This can particularly lead to border artifacts around tiles in tilemaps. + +This adjustment corrects for this by making a small contraction to the UV coordinates used. Note that this can result in a slight squashing of border texels. + +---- + +.. _class_ProjectSettings_property_rendering/batching/precision/uv_contract_amount: + +- :ref:`int` **rendering/batching/precision/uv_contract_amount** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +The amount of UV contraction. This figure is divided by 1000000, and is a proportion of the total texture dimensions, where the width and height are both ranged from 0.0 to 1.0. + +Use the default unless correcting for a problem on particular hardware. + +---- + +.. _class_ProjectSettings_property_rendering/cpu_lightmapper/quality/high_quality_ray_count: + +- :ref:`int` **rendering/cpu_lightmapper/quality/high_quality_ray_count** + ++-----------+---------+ +| *Default* | ``512`` | ++-----------+---------+ + +Amount of light samples taken when using :ref:`BakedLightmap.BAKE_QUALITY_HIGH`. + +---- + +.. _class_ProjectSettings_property_rendering/cpu_lightmapper/quality/low_quality_ray_count: + +- :ref:`int` **rendering/cpu_lightmapper/quality/low_quality_ray_count** + ++-----------+--------+ +| *Default* | ``64`` | ++-----------+--------+ + +Amount of light samples taken when using :ref:`BakedLightmap.BAKE_QUALITY_LOW`. + +---- + +.. _class_ProjectSettings_property_rendering/cpu_lightmapper/quality/medium_quality_ray_count: + +- :ref:`int` **rendering/cpu_lightmapper/quality/medium_quality_ray_count** + ++-----------+---------+ +| *Default* | ``256`` | ++-----------+---------+ + +Amount of light samples taken when using :ref:`BakedLightmap.BAKE_QUALITY_MEDIUM`. + +---- + +.. _class_ProjectSettings_property_rendering/cpu_lightmapper/quality/ultra_quality_ray_count: + +- :ref:`int` **rendering/cpu_lightmapper/quality/ultra_quality_ray_count** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Amount of light samples taken when using :ref:`BakedLightmap.BAKE_QUALITY_ULTRA`. + +---- + +.. _class_ProjectSettings_property_rendering/environment/default_clear_color: + +- :ref:`Color` **rendering/environment/default_clear_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.3, 0.3, 0.3, 1 )`` | ++-----------+-------------------------------+ + +Default background clear color. Overridable per :ref:`Viewport` using its :ref:`Environment`. See :ref:`Environment.background_mode` and :ref:`Environment.background_color` in particular. To change this default color programmatically, use :ref:`VisualServer.set_default_clear_color`. + +---- + +.. _class_ProjectSettings_property_rendering/environment/default_environment: + +- :ref:`String` **rendering/environment/default_environment** + ++-----------+--------+ +| *Default* | ``""`` | ++-----------+--------+ + +:ref:`Environment` that will be used as a fallback environment in case a scene does not specify its own environment. The default environment is loaded in at scene load time regardless of whether you have set an environment or not. If you do not rely on the fallback environment, it is best to delete ``default_env.tres``, or to specify a different default environment here. + +---- + +.. _class_ProjectSettings_property_rendering/gles2/compatibility/disable_half_float: + +- :ref:`bool` **rendering/gles2/compatibility/disable_half_float** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +The use of half-float vertex compression may be producing rendering errors on some platforms (especially iOS). These have been seen particularly in particles. Disabling half-float may resolve these problems. + +---- + +.. _class_ProjectSettings_property_rendering/gles2/compatibility/disable_half_float.iOS: + +- :ref:`bool` **rendering/gles2/compatibility/disable_half_float.iOS** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +iOS specific override for :ref:`rendering/gles2/compatibility/disable_half_float`, due to poor support for half-float vertex compression on many devices. + +---- + +.. _class_ProjectSettings_property_rendering/gles2/compatibility/enable_high_float.Android: + +- :ref:`bool` **rendering/gles2/compatibility/enable_high_float.Android** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true`` and available on the target Android device, enables high floating point precision for all shader computations in GLES2. + +**Warning:** High floating point precision can be extremely slow on older devices and is often not available at all. Use with caution. + +---- + +.. _class_ProjectSettings_property_rendering/limits/buffers/blend_shape_max_buffer_size_kb: + +- :ref:`int` **rendering/limits/buffers/blend_shape_max_buffer_size_kb** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +Max buffer size for blend shapes. Any blend shape bigger than this will not work. + +---- + +.. _class_ProjectSettings_property_rendering/limits/buffers/canvas_polygon_buffer_size_kb: + +- :ref:`int` **rendering/limits/buffers/canvas_polygon_buffer_size_kb** + ++-----------+---------+ +| *Default* | ``128`` | ++-----------+---------+ + +Max buffer size for drawing polygons. Any polygon bigger than this will not work. + +---- + +.. _class_ProjectSettings_property_rendering/limits/buffers/canvas_polygon_index_buffer_size_kb: + +- :ref:`int` **rendering/limits/buffers/canvas_polygon_index_buffer_size_kb** + ++-----------+---------+ +| *Default* | ``128`` | ++-----------+---------+ + +Max index buffer size for drawing polygons. Any polygon bigger than this will not work. + +---- + +.. _class_ProjectSettings_property_rendering/limits/buffers/immediate_buffer_size_kb: + +- :ref:`int` **rendering/limits/buffers/immediate_buffer_size_kb** + ++-----------+----------+ +| *Default* | ``2048`` | ++-----------+----------+ + +Max buffer size for drawing immediate objects (ImmediateGeometry nodes). Nodes using more than this size will not work. + +---- + +.. _class_ProjectSettings_property_rendering/limits/rendering/max_lights_per_object: + +- :ref:`int` **rendering/limits/rendering/max_lights_per_object** + ++-----------+--------+ +| *Default* | ``32`` | ++-----------+--------+ + +Max number of lights renderable per object. This is further limited by hardware support. Most devices only support 409 lights, while many devices (especially mobile) only support 102. Setting this low will slightly reduce memory usage and may decrease shader compile times. + +---- + +.. _class_ProjectSettings_property_rendering/limits/rendering/max_renderable_elements: + +- :ref:`int` **rendering/limits/rendering/max_renderable_elements** + ++-----------+-----------+ +| *Default* | ``65536`` | ++-----------+-----------+ + +Max amount of elements renderable in a frame. If more elements than this are visible per frame, they will not be drawn. Keep in mind elements refer to mesh surfaces and not meshes themselves. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. + +---- + +.. _class_ProjectSettings_property_rendering/limits/rendering/max_renderable_lights: + +- :ref:`int` **rendering/limits/rendering/max_renderable_lights** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +Max number of lights renderable in a frame. If more lights than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. + +---- + +.. _class_ProjectSettings_property_rendering/limits/rendering/max_renderable_reflections: + +- :ref:`int` **rendering/limits/rendering/max_renderable_reflections** + ++-----------+----------+ +| *Default* | ``1024`` | ++-----------+----------+ + +Max number of reflection probes renderable in a frame. If more reflection probes than this number are used, they will be ignored. Setting this low will slightly reduce memory usage and may decrease shader compile times, particularly on web. For most uses, the default value is suitable, but consider lowering as much as possible on web export. + +---- + +.. _class_ProjectSettings_property_rendering/limits/time/time_rollover_secs: + +- :ref:`float` **rendering/limits/time/time_rollover_secs** + ++-----------+----------+ +| *Default* | ``3600`` | ++-----------+----------+ + +Shaders have a time variable that constantly increases. At some point, it needs to be rolled back to zero to avoid precision errors on shader animations. This setting specifies when (in seconds). + +---- + +.. _class_ProjectSettings_property_rendering/misc/lossless_compression/force_png: + +- :ref:`bool` **rendering/misc/lossless_compression/force_png** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the texture importer will import lossless textures using the PNG format. Otherwise, it will default to using WebP. + +---- + +.. _class_ProjectSettings_property_rendering/misc/lossless_compression/webp_compression_level: + +- :ref:`int` **rendering/misc/lossless_compression/webp_compression_level** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +The default compression level for lossless WebP. Higher levels result in smaller files at the cost of compression speed. Decompression speed is mostly unaffected by the compression level. Supported values are 0 to 9. Note that compression levels above 6 are very slow and offer very little savings. + +---- + +.. _class_ProjectSettings_property_rendering/misc/mesh_storage/split_stream: + +- :ref:`bool` **rendering/misc/mesh_storage/split_stream** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +On import, mesh vertex data will be split into two streams within a single vertex buffer, one for position data and the other for interleaved attributes data. Recommended to be enabled if targeting mobile devices. Requires manual reimport of meshes after toggling. + +---- + +.. _class_ProjectSettings_property_rendering/misc/occlusion_culling/max_active_spheres: + +- :ref:`int` **rendering/misc/occlusion_culling/max_active_spheres** + ++-----------+-------+ +| *Default* | ``8`` | ++-----------+-------+ + +Determines the maximum number of sphere occluders that will be used at any one time. + +Although you can have many occluders in a scene, each frame the system will choose from these the most relevant based on a screen space metric, in order to give the best overall performance. + +---- + +.. _class_ProjectSettings_property_rendering/portals/advanced/flip_imported_portals: + +- :ref:`bool` **rendering/portals/advanced/flip_imported_portals** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +The default convention is for portal normals to point outward (face outward) from the source room. + +If you accidentally build your level with portals facing the wrong way, this setting can fix the problem. + +It will flip named portal meshes (i.e. ``-portal``) on the initial conversion to :ref:`Portal` nodes. + +---- + +.. _class_ProjectSettings_property_rendering/portals/debug/logging: + +- :ref:`bool` **rendering/portals/debug/logging** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Show conversion logs. + +**Note:** This will automatically be disabled in exports. + +---- + +.. _class_ProjectSettings_property_rendering/portals/gameplay/use_signals: + +- :ref:`bool` **rendering/portals/gameplay/use_signals** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, gameplay callbacks will be sent as ``signals``. If ``false``, they will be sent as ``notifications``. + +---- + +.. _class_ProjectSettings_property_rendering/portals/optimize/remove_danglers: + +- :ref:`bool` **rendering/portals/optimize/remove_danglers** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If enabled, while merging meshes, the system will also attempt to remove :ref:`Spatial` nodes that no longer have any children. + +Reducing the number of :ref:`Node`\ s in the scene tree can make traversal more efficient, but can be switched off in case you wish to use empty :ref:`Spatial`\ s for markers or some other purpose. + +---- + +.. _class_ProjectSettings_property_rendering/portals/pvs/pvs_logging: + +- :ref:`bool` **rendering/portals/pvs/pvs_logging** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Show logs during PVS generation. + +**Note:** This will automatically be disabled in exports. + +---- + +.. _class_ProjectSettings_property_rendering/portals/pvs/use_simple_pvs: + +- :ref:`bool` **rendering/portals/pvs/use_simple_pvs** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Uses a simplified method of generating PVS (potentially visible set) data. The results may not be accurate where more than one portal join adjacent rooms. + +**Note:** Generally you should only use this option if you encounter bugs when it is set to ``false``, i.e. there are problems with the default method. + +---- + +.. _class_ProjectSettings_property_rendering/quality/depth/hdr: + +- :ref:`bool` **rendering/quality/depth/hdr** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, allocates the main framebuffer with high dynamic range. High dynamic range allows the use of :ref:`Color` values greater than 1. + +**Note:** Only available on the GLES3 backend. + +---- + +.. _class_ProjectSettings_property_rendering/quality/depth/hdr.mobile: + +- :ref:`bool` **rendering/quality/depth/hdr.mobile** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Lower-end override for :ref:`rendering/quality/depth/hdr` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/depth_prepass/disable_for_vendors: + +- :ref:`String` **rendering/quality/depth_prepass/disable_for_vendors** + ++-----------+---------------------------------+ +| *Default* | ``"PowerVR,Mali,Adreno,Apple"`` | ++-----------+---------------------------------+ + +Disables depth pre-pass for some GPU vendors (usually mobile), as their architecture already does this. + +---- + +.. _class_ProjectSettings_property_rendering/quality/depth_prepass/enable: + +- :ref:`bool` **rendering/quality/depth_prepass/enable** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, performs a previous depth pass before rendering materials. This increases performance in scenes with high overdraw, when complex materials and lighting are used. + +---- + +.. _class_ProjectSettings_property_rendering/quality/directional_shadow/size: + +- :ref:`int` **rendering/quality/directional_shadow/size** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +The directional shadow's size in pixels. Higher values will result in sharper shadows, at the cost of performance. The value will be rounded up to the nearest power of 2. + +---- + +.. _class_ProjectSettings_property_rendering/quality/directional_shadow/size.mobile: + +- :ref:`int` **rendering/quality/directional_shadow/size.mobile** + ++-----------+----------+ +| *Default* | ``2048`` | ++-----------+----------+ + +Lower-end override for :ref:`rendering/quality/directional_shadow/size` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/driver/driver_name: + +- :ref:`String` **rendering/quality/driver/driver_name** + ++-----------+-------------+ +| *Default* | ``"GLES3"`` | ++-----------+-------------+ + +The video driver to use ("GLES2" or "GLES3"). + +**Note:** The backend in use can be overridden at runtime via the ``--video-driver`` command line argument, or by the :ref:`rendering/quality/driver/fallback_to_gles2` option if the target system does not support GLES3 and falls back to GLES2. In such cases, this property is not updated, so use :ref:`OS.get_current_video_driver` to query it at run-time. + +---- + +.. _class_ProjectSettings_property_rendering/quality/driver/fallback_to_gles2: + +- :ref:`bool` **rendering/quality/driver/fallback_to_gles2** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, allows falling back to the GLES2 driver if the GLES3 driver is not supported. + +**Note:** The two video drivers are not drop-in replacements for each other, so a game designed for GLES3 might not work properly when falling back to GLES2. In particular, some features of the GLES3 backend are not available in GLES2. Enabling this setting also means that both ETC and ETC2 VRAM-compressed textures will be exported on Android and iOS, increasing the data pack's size. + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/anisotropic_filter_level: + +- :ref:`int` **rendering/quality/filters/anisotropic_filter_level** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +Maximum anisotropic filter level used for textures with anisotropy enabled. Higher values will result in sharper textures when viewed from oblique angles, at the cost of performance. Only power-of-two values are valid (2, 4, 8, 16). + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/msaa: + +- :ref:`int` **rendering/quality/filters/msaa** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Sets the number of MSAA samples to use. MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. + +**Note:** MSAA is not available on HTML5 export using the GLES2 backend. + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/sharpen_intensity: + +- :ref:`float` **rendering/quality/filters/sharpen_intensity** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +If set to a value greater than ``0.0``, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around ``0.5`` generally give the best results. See also :ref:`rendering/quality/filters/use_fxaa`. + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/use_debanding: + +- :ref:`bool` **rendering/quality/filters/use_debanding** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`rendering/quality/depth/hdr` must also be ``true`` for debanding to be effective. + +**Note:** There are known issues with debanding breaking rendering on mobile platforms. Due to this, it is recommended to leave this option disabled when targeting mobile platforms. + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/use_fxaa: + +- :ref:`bool` **rendering/quality/filters/use_fxaa** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Enables FXAA in the root Viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see :ref:`rendering/quality/filters/sharpen_intensity`). + +---- + +.. _class_ProjectSettings_property_rendering/quality/filters/use_nearest_mipmap_filter: + +- :ref:`bool` **rendering/quality/filters/use_nearest_mipmap_filter** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, uses nearest-neighbor mipmap filtering when using mipmaps (also called "bilinear filtering"), which will result in visible seams appearing between mipmap stages. This may increase performance in mobile as less memory bandwidth is used. If ``false``, linear mipmap filtering (also called "trilinear filtering") is used. + +---- + +.. _class_ProjectSettings_property_rendering/quality/intended_usage/framebuffer_allocation: + +- :ref:`int` **rendering/quality/intended_usage/framebuffer_allocation** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +Strategy used for framebuffer allocation. The simpler it is, the less resources it uses (but the less features it supports). If set to "2D Without Sampling" or "3D Without Effects", sample buffers will not be allocated. This means ``SCREEN_TEXTURE`` and ``DEPTH_TEXTURE`` will not be available in shaders and post-processing effects will not be available in the :ref:`Environment`. + +---- + +.. _class_ProjectSettings_property_rendering/quality/intended_usage/framebuffer_allocation.mobile: + +- :ref:`int` **rendering/quality/intended_usage/framebuffer_allocation.mobile** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +Lower-end override for :ref:`rendering/quality/intended_usage/framebuffer_allocation` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/lightmapping/use_bicubic_sampling: + +- :ref:`bool` **rendering/quality/lightmapping/use_bicubic_sampling** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Enable usage of bicubic sampling in baked lightmaps. This results in smoother looking lighting at the expense of more bandwidth usage. On GLES2, changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_rendering/quality/lightmapping/use_bicubic_sampling.mobile: + +- :ref:`bool` **rendering/quality/lightmapping/use_bicubic_sampling.mobile** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Lower-end override for :ref:`rendering/quality/lightmapping/use_bicubic_sampling` on mobile devices, in order to reduce bandwidth usage. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/atlas_size: + +- :ref:`int` **rendering/quality/reflections/atlas_size** + ++-----------+----------+ +| *Default* | ``2048`` | ++-----------+----------+ + +Size of the atlas used by reflection probes. A larger size can result in higher visual quality, while a smaller size will be faster and take up less memory. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/atlas_subdiv: + +- :ref:`int` **rendering/quality/reflections/atlas_subdiv** + ++-----------+-------+ +| *Default* | ``8`` | ++-----------+-------+ + +Number of subdivisions to use for the reflection atlas. A higher number lowers the quality of each atlas, but allows you to use more. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/high_quality_ggx: + +- :ref:`bool` **rendering/quality/reflections/high_quality_ggx** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, uses a high amount of samples to create blurred variants of reflection probes and panorama backgrounds (sky). Those blurred variants are used by rough materials. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/high_quality_ggx.mobile: + +- :ref:`bool` **rendering/quality/reflections/high_quality_ggx.mobile** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Lower-end override for :ref:`rendering/quality/reflections/high_quality_ggx` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/irradiance_max_size: + +- :ref:`int` **rendering/quality/reflections/irradiance_max_size** + ++-----------+---------+ +| *Default* | ``128`` | ++-----------+---------+ + +Limits the size of the irradiance map which is normally determined by :ref:`Sky.radiance_size`. A higher size results in a higher quality irradiance map similarly to :ref:`rendering/quality/reflections/high_quality_ggx`. Use a higher value when using high-frequency HDRI maps, otherwise keep this as low as possible. + +**Note:** Low and mid range hardware do not support complex irradiance maps well and may crash if this is set too high. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/texture_array_reflections: + +- :ref:`bool` **rendering/quality/reflections/texture_array_reflections** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, uses texture arrays instead of mipmaps for reflection probes and panorama backgrounds (sky). This reduces jitter noise on reflections, but costs more performance and memory. + +---- + +.. _class_ProjectSettings_property_rendering/quality/reflections/texture_array_reflections.mobile: + +- :ref:`bool` **rendering/quality/reflections/texture_array_reflections.mobile** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Lower-end override for :ref:`rendering/quality/reflections/texture_array_reflections` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_blinn_over_ggx: + +- :ref:`bool` **rendering/quality/shading/force_blinn_over_ggx** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, uses faster but lower-quality Blinn model to generate blurred reflections instead of the GGX model. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_blinn_over_ggx.mobile: + +- :ref:`bool` **rendering/quality/shading/force_blinn_over_ggx.mobile** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Lower-end override for :ref:`rendering/quality/shading/force_blinn_over_ggx` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_lambert_over_burley: + +- :ref:`bool` **rendering/quality/shading/force_lambert_over_burley** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, uses faster but lower-quality Lambert material lighting model instead of Burley. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_lambert_over_burley.mobile: + +- :ref:`bool` **rendering/quality/shading/force_lambert_over_burley.mobile** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Lower-end override for :ref:`rendering/quality/shading/force_lambert_over_burley` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_vertex_shading: + +- :ref:`bool` **rendering/quality/shading/force_vertex_shading** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, forces vertex shading for all rendering. This can increase performance a lot, but also reduces quality immensely. Can be used to optimize performance on low-end mobile devices. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/force_vertex_shading.mobile: + +- :ref:`bool` **rendering/quality/shading/force_vertex_shading.mobile** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Lower-end override for :ref:`rendering/quality/shading/force_vertex_shading` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shading/use_physical_light_attenuation: + +- :ref:`bool` **rendering/quality/shading/use_physical_light_attenuation** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, enables new physical light attenuation for :ref:`OmniLight`\ s and :ref:`SpotLight`\ s. This results in more realistic lighting appearance with a very small performance cost. When physical light attenuation is enabled, lights will appear to be darker as a result of the new attenuation formula. This can be compensated by adjusting the lights' energy or attenuation values. + +Changes to this setting will only be applied upon restarting the application. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/cubemap_size: + +- :ref:`int` **rendering/quality/shadow_atlas/cubemap_size** + ++-----------+---------+ +| *Default* | ``512`` | ++-----------+---------+ + +Size for cubemap into which the shadow is rendered before being copied into the shadow atlas. A higher number can result in higher resolution shadows when used with a higher :ref:`rendering/quality/shadow_atlas/size`. Setting higher than a quarter of the :ref:`rendering/quality/shadow_atlas/size` will not result in a perceptible increase in visual quality. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/quadrant_0_subdiv: + +- :ref:`int` **rendering/quality/shadow_atlas/quadrant_0_subdiv** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/quadrant_1_subdiv: + +- :ref:`int` **rendering/quality/shadow_atlas/quadrant_1_subdiv** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/quadrant_2_subdiv: + +- :ref:`int` **rendering/quality/shadow_atlas/quadrant_2_subdiv** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/quadrant_3_subdiv: + +- :ref:`int` **rendering/quality/shadow_atlas/quadrant_3_subdiv** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +Subdivision quadrant size for shadow mapping. See shadow mapping documentation. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/size: + +- :ref:`int` **rendering/quality/shadow_atlas/size** + ++-----------+----------+ +| *Default* | ``4096`` | ++-----------+----------+ + +Size for shadow atlas (used for OmniLights and SpotLights). See documentation. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadow_atlas/size.mobile: + +- :ref:`int` **rendering/quality/shadow_atlas/size.mobile** + ++-----------+----------+ +| *Default* | ``2048`` | ++-----------+----------+ + +Lower-end override for :ref:`rendering/quality/shadow_atlas/size` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadows/filter_mode: + +- :ref:`int` **rendering/quality/shadows/filter_mode** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Shadow filter mode. Higher-quality settings result in smoother shadows that flicker less when moving. "Disabled" is the fastest option, but also has the lowest quality. "PCF5" is smoother but is also slower. "PCF13" is the smoothest option, but is also the slowest. + +**Note:** When using the GLES2 backend, the "PCF13" option actually uses 16 samples to emulate linear filtering in the shader. This results in a shadow appearance similar to the one produced by the GLES3 backend. + +---- + +.. _class_ProjectSettings_property_rendering/quality/shadows/filter_mode.mobile: + +- :ref:`int` **rendering/quality/shadows/filter_mode.mobile** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Lower-end override for :ref:`rendering/quality/shadows/filter_mode` on mobile devices, due to performance concerns or driver support. + +---- + +.. _class_ProjectSettings_property_rendering/quality/skinning/force_software_skinning: + +- :ref:`bool` **rendering/quality/skinning/force_software_skinning** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Forces :ref:`MeshInstance` to always perform skinning on the CPU (applies to both GLES2 and GLES3). + +See also :ref:`rendering/quality/skinning/software_skinning_fallback`. + +---- + +.. _class_ProjectSettings_property_rendering/quality/skinning/software_skinning_fallback: + +- :ref:`bool` **rendering/quality/skinning/software_skinning_fallback** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Allows :ref:`MeshInstance` to perform skinning on the CPU when the hardware doesn't support the default GPU skinning process with GLES2. + +If ``false``, an alternative skinning process on the GPU is used in this case (slower in most cases). + +See also :ref:`rendering/quality/skinning/force_software_skinning`. + +**Note:** When the software skinning fallback is triggered, custom vertex shaders will behave in a different way, because the bone transform will be already applied to the modelview matrix. + +---- + +.. _class_ProjectSettings_property_rendering/quality/spatial_partitioning/bvh_collision_margin: + +- :ref:`float` **rendering/quality/spatial_partitioning/bvh_collision_margin** + ++-----------+---------+ +| *Default* | ``0.1`` | ++-----------+---------+ + +Additional expansion applied to object bounds in the 3D rendering bounding volume hierarchy. This can reduce BVH processing at the cost of a slightly reduced accuracy. + +The default value will work well in most situations. A value of 0.0 will turn this optimization off, and larger values may work better for larger, faster moving objects. + +**Note:** Used only if :ref:`rendering/quality/spatial_partitioning/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_rendering/quality/spatial_partitioning/render_tree_balance: + +- :ref:`float` **rendering/quality/spatial_partitioning/render_tree_balance** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The rendering octree balance can be changed to favor smaller (``0``), or larger (``1``) branches. + +Larger branches can increase performance significantly in some projects. + +**Note:** Not used if :ref:`rendering/quality/spatial_partitioning/use_bvh` is enabled. + +---- + +.. _class_ProjectSettings_property_rendering/quality/spatial_partitioning/use_bvh: + +- :ref:`bool` **rendering/quality/spatial_partitioning/use_bvh** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Enables the use of bounding volume hierarchy instead of octree for rendering spatial partitioning. This may give better performance. + +---- + +.. _class_ProjectSettings_property_rendering/quality/subsurface_scattering/follow_surface: + +- :ref:`bool` **rendering/quality/subsurface_scattering/follow_surface** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Improves quality of subsurface scattering, but cost significantly increases. + +---- + +.. _class_ProjectSettings_property_rendering/quality/subsurface_scattering/quality: + +- :ref:`int` **rendering/quality/subsurface_scattering/quality** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Quality setting for subsurface scattering (samples taken). + +---- + +.. _class_ProjectSettings_property_rendering/quality/subsurface_scattering/scale: + +- :ref:`int` **rendering/quality/subsurface_scattering/scale** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +Max radius used for subsurface scattering samples. + +---- + +.. _class_ProjectSettings_property_rendering/quality/subsurface_scattering/weight_samples: + +- :ref:`bool` **rendering/quality/subsurface_scattering/weight_samples** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +Weight subsurface scattering samples. Helps to avoid reading samples from unrelated parts of the screen. + +---- + +.. _class_ProjectSettings_property_rendering/quality/voxel_cone_tracing/high_quality: + +- :ref:`bool` **rendering/quality/voxel_cone_tracing/high_quality** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +Use high-quality voxel cone tracing. This results in better-looking reflections, but is much more expensive on the GPU. + +---- + +.. _class_ProjectSettings_property_rendering/threads/thread_model: + +- :ref:`int` **rendering/threads/thread_model** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Thread model for rendering. Rendering on a thread can vastly improve performance, but synchronizing to the main thread can cause a bit more jitter. + +---- + +.. _class_ProjectSettings_property_rendering/threads/thread_safe_bvh: + +- :ref:`bool` **rendering/threads/thread_safe_bvh** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, a thread safe version of BVH (bounding volume hierarchy) will be used in rendering and Godot physics. + +Try enabling this option if you see any visual anomalies in 3D (such as incorrect object visibility). + +---- + +.. _class_ProjectSettings_property_rendering/vram_compression/import_bptc: + +- :ref:`bool` **rendering/vram_compression/import_bptc** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the texture importer will import VRAM-compressed textures using the BPTC algorithm. This texture compression algorithm is only supported on desktop platforms, and only when using the GLES3 renderer. + +**Note:** Changing this setting does *not* impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the ``.import/`` folder located inside the project folder then restart the editor (see :ref:`application/config/use_hidden_project_data_directory`). + +---- + +.. _class_ProjectSettings_property_rendering/vram_compression/import_etc: + +- :ref:`bool` **rendering/vram_compression/import_etc** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression algorithm. This algorithm doesn't support alpha channels in textures. + +**Note:** Changing this setting does *not* impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the ``.import/`` folder located inside the project folder then restart the editor (see :ref:`application/config/use_hidden_project_data_directory`). + +---- + +.. _class_ProjectSettings_property_rendering/vram_compression/import_etc2: + +- :ref:`bool` **rendering/vram_compression/import_etc2** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, the texture importer will import VRAM-compressed textures using the Ericsson Texture Compression 2 algorithm. This texture compression algorithm is only supported when using the GLES3 renderer. + +**Note:** Changing this setting does *not* impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the ``.import/`` folder located inside the project folder then restart the editor (see :ref:`application/config/use_hidden_project_data_directory`). + +---- + +.. _class_ProjectSettings_property_rendering/vram_compression/import_pvrtc: + +- :ref:`bool` **rendering/vram_compression/import_pvrtc** + ++-----------+-----------+ +| *Default* | ``false`` | ++-----------+-----------+ + +If ``true``, the texture importer will import VRAM-compressed textures using the PowerVR Texture Compression algorithm. This texture compression algorithm is only supported on iOS. + +**Note:** Changing this setting does *not* impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the ``.import/`` folder located inside the project folder then restart the editor (see :ref:`application/config/use_hidden_project_data_directory`). + +---- + +.. _class_ProjectSettings_property_rendering/vram_compression/import_s3tc: + +- :ref:`bool` **rendering/vram_compression/import_s3tc** + ++-----------+----------+ +| *Default* | ``true`` | ++-----------+----------+ + +If ``true``, the texture importer will import VRAM-compressed textures using the S3 Texture Compression algorithm. This algorithm is only supported on desktop platforms and consoles. + +**Note:** Changing this setting does *not* impact textures that were already imported before. To make this setting apply to textures that were already imported, exit the editor, remove the ``.import/`` folder located inside the project folder then restart the editor (see :ref:`application/config/use_hidden_project_data_directory`). + +---- + +.. _class_ProjectSettings_property_world/2d/cell_size: + +- :ref:`int` **world/2d/cell_size** + ++-----------+---------+ +| *Default* | ``100`` | ++-----------+---------+ + +Cell size used for the 2D hash grid that :ref:`VisibilityNotifier2D` uses (in pixels). + +Method Descriptions +------------------- + +.. _class_ProjectSettings_method_add_property_info: + +- void **add_property_info** **(** :ref:`Dictionary` hint **)** + +Adds a custom property info to a property. The dictionary must contain: + +- ``name``: :ref:`String` (the property's name) + +- ``type``: :ref:`int` (see :ref:`Variant.Type`) + +- optionally ``hint``: :ref:`int` (see :ref:`PropertyHint`) and ``hint_string``: :ref:`String` + +**Example:** + +:: + + ProjectSettings.set("category/property_name", 0) + + var property_info = { + "name": "category/property_name", + "type": TYPE_INT, + "hint": PROPERTY_HINT_ENUM, + "hint_string": "one,two,three" + } + + ProjectSettings.add_property_info(property_info) + +---- + +.. _class_ProjectSettings_method_clear: + +- void **clear** **(** :ref:`String` name **)** + +Clears the whole configuration (not recommended, may break things). + +---- + +.. _class_ProjectSettings_method_get_order: + +- :ref:`int` **get_order** **(** :ref:`String` name **)** |const| + +Returns the order of a configuration value (influences when saved to the config file). + +---- + +.. _class_ProjectSettings_method_get_setting: + +- :ref:`Variant` **get_setting** **(** :ref:`String` name **)** |const| + +Returns the value of a setting. + +**Example:** + +:: + + print(ProjectSettings.get_setting("application/config/name")) + +---- + +.. _class_ProjectSettings_method_globalize_path: + +- :ref:`String` **globalize_path** **(** :ref:`String` path **)** |const| + +Returns the absolute, native OS path corresponding to the localized ``path`` (starting with ``res://`` or ``user://``). The returned path will vary depending on the operating system and user preferences. See `File paths in Godot projects `__ to see what those paths convert to. See also :ref:`localize_path`. + +**Note:** :ref:`globalize_path` with ``res://`` will not work in an exported project. Instead, prepend the executable's base directory to the path when running from an exported project: + +:: + + var path = "" + if OS.has_feature("editor"): + # Running from an editor binary. + # `path` will contain the absolute path to `hello.txt` located in the project root. + path = ProjectSettings.globalize_path("res://hello.txt") + else: + # Running from an exported project. + # `path` will contain the absolute path to `hello.txt` next to the executable. + # This is *not* identical to using `ProjectSettings.globalize_path()` with a `res://` path, + # but is close enough in spirit. + path = OS.get_executable_path().get_base_dir().plus_file("hello.txt") + +---- + +.. _class_ProjectSettings_method_has_setting: + +- :ref:`bool` **has_setting** **(** :ref:`String` name **)** |const| + +Returns ``true`` if a configuration value is present. + +---- + +.. _class_ProjectSettings_method_load_resource_pack: + +- :ref:`bool` **load_resource_pack** **(** :ref:`String` pack, :ref:`bool` replace_files=true, :ref:`int` offset=0 **)** + +Loads the contents of the .pck or .zip file specified by ``pack`` into the resource filesystem (``res://``). Returns ``true`` on success. + +**Note:** If a file from ``pack`` shares the same path as a file already in the resource filesystem, any attempts to load that file will use the file from ``pack`` unless ``replace_files`` is set to ``false``. + +**Note:** The optional ``offset`` parameter can be used to specify the offset in bytes to the start of the resource pack. This is only supported for .pck files. + +---- + +.. _class_ProjectSettings_method_localize_path: + +- :ref:`String` **localize_path** **(** :ref:`String` path **)** |const| + +Returns the localized path (starting with ``res://``) corresponding to the absolute, native OS ``path``. See also :ref:`globalize_path`. + +---- + +.. _class_ProjectSettings_method_property_can_revert: + +- :ref:`bool` **property_can_revert** **(** :ref:`String` name **)** + +Returns ``true`` if the specified property exists and its initial value differs from the current value. + +---- + +.. _class_ProjectSettings_method_property_get_revert: + +- :ref:`Variant` **property_get_revert** **(** :ref:`String` name **)** + +Returns the specified property's initial value. Returns ``null`` if the property does not exist. + +---- + +.. _class_ProjectSettings_method_save: + +- :ref:`Error` **save** **(** **)** + +Saves the configuration to the ``project.godot`` file. + +**Note:** This method is intended to be used by editor plugins, as modified ``ProjectSettings`` can't be loaded back in the running app. If you want to change project settings in exported projects, use :ref:`save_custom` to save ``override.cfg`` file. + +---- + +.. _class_ProjectSettings_method_save_custom: + +- :ref:`Error` **save_custom** **(** :ref:`String` file **)** + +Saves the configuration to a custom file. The file extension must be ``.godot`` (to save in text-based :ref:`ConfigFile` format) or ``.binary`` (to save in binary format). You can also save ``override.cfg`` file, which is also text, but can be used in exported projects unlike other formats. + +---- + +.. _class_ProjectSettings_method_set_initial_value: + +- void **set_initial_value** **(** :ref:`String` name, :ref:`Variant` value **)** + +Sets the specified property's initial value. This is the value the property reverts to. + +---- + +.. _class_ProjectSettings_method_set_order: + +- void **set_order** **(** :ref:`String` name, :ref:`int` position **)** + +Sets the order of a configuration value (influences when saved to the config file). + +---- + +.. _class_ProjectSettings_method_set_setting: + +- void **set_setting** **(** :ref:`String` name, :ref:`Variant` value **)** + +Sets the value of a setting. + +**Example:** + +:: + + ProjectSettings.set_setting("application/config/name", "Example") + +This can also be used to erase custom project settings. To do this change the setting value to ``null``. + +.. |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.)` diff --git a/classes/class_proximitygroup.rst b/classes/class_proximitygroup.rst new file mode 100644 index 0000000..48067cf --- /dev/null +++ b/classes/class_proximitygroup.rst @@ -0,0 +1,113 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ProximityGroup.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ProximityGroup: + +ProximityGroup +============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +General-purpose proximity detection node. + +Description +----------- + +General-purpose proximity detection node. + +Properties +---------- + ++-------------------------------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`DispatchMode` | :ref:`dispatch_mode` | ``0`` | ++-------------------------------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`grid_radius` | ``Vector3( 1, 1, 1 )`` | ++-------------------------------------------------------+-------------------------------------------------------------------+------------------------+ +| :ref:`String` | :ref:`group_name` | ``""`` | ++-------------------------------------------------------+-------------------------------------------------------------------+------------------------+ + +Methods +------- + ++------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`broadcast` **(** :ref:`String` method, :ref:`Variant` parameters **)** | ++------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ProximityGroup_signal_broadcast: + +- **broadcast** **(** :ref:`String` method, :ref:`Array` parameters **)** + +Enumerations +------------ + +.. _enum_ProximityGroup_DispatchMode: + +.. _class_ProximityGroup_constant_MODE_PROXY: + +.. _class_ProximityGroup_constant_MODE_SIGNAL: + +enum **DispatchMode**: + +- **MODE_PROXY** = **0** + +- **MODE_SIGNAL** = **1** + +Property Descriptions +--------------------- + +.. _class_ProximityGroup_property_dispatch_mode: + +- :ref:`DispatchMode` **dispatch_mode** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_dispatch_mode(value) | ++-----------+--------------------------+ +| *Getter* | get_dispatch_mode() | ++-----------+--------------------------+ + +---- + +.. _class_ProximityGroup_property_grid_radius: + +- :ref:`Vector3` **grid_radius** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_grid_radius(value) | ++-----------+------------------------+ +| *Getter* | get_grid_radius() | ++-----------+------------------------+ + +---- + +.. _class_ProximityGroup_property_group_name: + +- :ref:`String` **group_name** + ++-----------+-----------------------+ +| *Default* | ``""`` | ++-----------+-----------------------+ +| *Setter* | set_group_name(value) | ++-----------+-----------------------+ +| *Getter* | get_group_name() | ++-----------+-----------------------+ + +Method Descriptions +------------------- + +.. _class_ProximityGroup_method_broadcast: + +- void **broadcast** **(** :ref:`String` method, :ref:`Variant` parameters **)** + +.. |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.)` diff --git a/classes/class_proxytexture.rst b/classes/class_proxytexture.rst new file mode 100644 index 0000000..0167ccf --- /dev/null +++ b/classes/class_proxytexture.rst @@ -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 ProxyTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ProxyTexture: + +ProxyTexture +============ + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------+-----------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`base` | | ++-------------------------------+-----------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-------------------------------+-----------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_ProxyTexture_property_base: + +- :ref:`Texture` **base** + ++----------+-----------------+ +| *Setter* | set_base(value) | ++----------+-----------------+ +| *Getter* | get_base() | ++----------+-----------------+ + +.. |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.)` diff --git a/classes/class_quadmesh.rst b/classes/class_quadmesh.rst new file mode 100644 index 0000000..b6785ac --- /dev/null +++ b/classes/class_quadmesh.rst @@ -0,0 +1,72 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the QuadMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_QuadMesh: + +QuadMesh +======== + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a square mesh. + +Description +----------- + +Class representing a square :ref:`PrimitiveMesh`. This flat mesh does not have a thickness. By default, this mesh is aligned on the X and Y axes; this default rotation is more suited for use with billboarded materials. Unlike :ref:`PlaneMesh`, this mesh doesn't provide subdivision options. + +Tutorials +--------- + +- `GUI in 3D Demo `__ + +- `2D in 3D Demo `__ + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`center_offset` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------+------------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 1, 1 )`` | ++-------------------------------+-------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_QuadMesh_property_center_offset: + +- :ref:`Vector3` **center_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_center_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_center_offset() | ++-----------+--------------------------+ + +Offset of the generated Quad. Useful for particles. + +---- + +.. _class_QuadMesh_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 1 )`` | ++-----------+---------------------+ +| *Setter* | set_size(value) | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +Size on the X and Y axes. + +.. |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.)` diff --git a/classes/class_quat.rst b/classes/class_quat.rst new file mode 100644 index 0000000..b3073cc --- /dev/null +++ b/classes/class_quat.rst @@ -0,0 +1,303 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Quat.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Quat: + +Quat +==== + +Quaternion. + +Description +----------- + +A unit quaternion used for representing 3D rotations. Quaternions need to be normalized to be used for rotation. + +It is similar to Basis, which implements matrix representation of rotations, and can be parametrized using both an axis-angle pair or Euler angles. Basis stores rotation, scale, and shearing, while Quat only stores rotation. + +Due to its compactness and the way it is stored in memory, certain operations (obtaining axis-angle and performing SLERP, in particular) are more efficient and robust against floating-point errors. + +Tutorials +--------- + +- `#interpolating-with-quaternions <../tutorials/3d/using_transforms.html#interpolating-with-quaternions>`_ in :doc:`../tutorials/3d/using_transforms` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+---------------------------------+---------+ +| :ref:`float` | :ref:`w` | ``1.0`` | ++---------------------------+---------------------------------+---------+ +| :ref:`float` | :ref:`x` | ``0.0`` | ++---------------------------+---------------------------------+---------+ +| :ref:`float` | :ref:`y` | ``0.0`` | ++---------------------------+---------------------------------+---------+ +| :ref:`float` | :ref:`z` | ``0.0`` | ++---------------------------+---------------------------------+---------+ + +Methods +------- + ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Basis` from **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` euler **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`Quat` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to` **(** :ref:`Quat` to **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`cubic_slerp` **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Quat` b **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_euler` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`inverse` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Quat` quat **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`normalized` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_angle` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_euler` **(** :ref:`Vector3` euler **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`slerp` **(** :ref:`Quat` to, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Quat` | :ref:`slerpni` **(** :ref:`Quat` to, :ref:`float` weight **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`xform` **(** :ref:`Vector3` v **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Quat_constant_IDENTITY: + +- **IDENTITY** = **Quat( 0, 0, 0, 1 )** --- The identity quaternion, representing no rotation. Equivalent to an identity :ref:`Basis` matrix. If a vector is transformed by an identity quaternion, it will not change. + +Property Descriptions +--------------------- + +.. _class_Quat_property_w: + +- :ref:`float` **w** + ++-----------+---------+ +| *Default* | ``1.0`` | ++-----------+---------+ + +W component of the quaternion (real part). + +Quaternion components should usually not be manipulated directly. + +---- + +.. _class_Quat_property_x: + +- :ref:`float` **x** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +X component of the quaternion (imaginary ``i`` axis part). + +Quaternion components should usually not be manipulated directly. + +---- + +.. _class_Quat_property_y: + +- :ref:`float` **y** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +Y component of the quaternion (imaginary ``j`` axis part). + +Quaternion components should usually not be manipulated directly. + +---- + +.. _class_Quat_property_z: + +- :ref:`float` **z** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +Z component of the quaternion (imaginary ``k`` axis part). + +Quaternion components should usually not be manipulated directly. + +Method Descriptions +------------------- + +.. _class_Quat_method_Quat: + +- :ref:`Quat` **Quat** **(** :ref:`Basis` from **)** + +Constructs a quaternion from the given :ref:`Basis`. + +---- + +- :ref:`Quat` **Quat** **(** :ref:`Vector3` euler **)** + +Constructs a quaternion that will perform a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). + +---- + +- :ref:`Quat` **Quat** **(** :ref:`Vector3` axis, :ref:`float` angle **)** + +Constructs a quaternion that will rotate around the given axis by the specified angle. The axis must be a normalized vector. + +---- + +- :ref:`Quat` **Quat** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z, :ref:`float` w **)** + +Constructs a quaternion defined by the given values. + +---- + +.. _class_Quat_method_angle_to: + +- :ref:`float` **angle_to** **(** :ref:`Quat` to **)** + +Returns the angle between this quaternion and ``to``. This is the magnitude of the angle you would need to rotate by to get from one to the other. + +**Note:** This method has an abnormally high amount of floating-point error, so methods such as :ref:`@GDScript.is_zero_approx` will not work reliably. + +---- + +.. _class_Quat_method_cubic_slerp: + +- :ref:`Quat` **cubic_slerp** **(** :ref:`Quat` b, :ref:`Quat` pre_a, :ref:`Quat` post_b, :ref:`float` weight **)** + +Performs a cubic spherical interpolation between quaternions ``pre_a``, this vector, ``b``, and ``post_b``, by the given amount ``weight``. + +---- + +.. _class_Quat_method_dot: + +- :ref:`float` **dot** **(** :ref:`Quat` b **)** + +Returns the dot product of two quaternions. + +---- + +.. _class_Quat_method_get_euler: + +- :ref:`Vector3` **get_euler** **(** **)** + +Returns Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last) corresponding to the rotation represented by the unit quaternion. Returned vector contains the rotation angles in the format (X angle, Y angle, Z angle). + +---- + +.. _class_Quat_method_inverse: + +- :ref:`Quat` **inverse** **(** **)** + +Returns the inverse of the quaternion. + +---- + +.. _class_Quat_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Quat` quat **)** + +Returns ``true`` if this quaternion and ``quat`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_Quat_method_is_normalized: + +- :ref:`bool` **is_normalized** **(** **)** + +Returns whether the quaternion is normalized or not. + +---- + +.. _class_Quat_method_length: + +- :ref:`float` **length** **(** **)** + +Returns the length of the quaternion. + +---- + +.. _class_Quat_method_length_squared: + +- :ref:`float` **length_squared** **(** **)** + +Returns the length of the quaternion, squared. + +---- + +.. _class_Quat_method_normalized: + +- :ref:`Quat` **normalized** **(** **)** + +Returns a copy of the quaternion, normalized to unit length. + +---- + +.. _class_Quat_method_set_axis_angle: + +- void **set_axis_angle** **(** :ref:`Vector3` axis, :ref:`float` angle **)** + +Sets the quaternion to a rotation which rotates around axis by the specified angle, in radians. The axis must be a normalized vector. + +---- + +.. _class_Quat_method_set_euler: + +- void **set_euler** **(** :ref:`Vector3` euler **)** + +Sets the quaternion to a rotation specified by Euler angles (in the YXZ convention: when decomposing, first Z, then X, and Y last), given in the vector format as (X angle, Y angle, Z angle). + +---- + +.. _class_Quat_method_slerp: + +- :ref:`Quat` **slerp** **(** :ref:`Quat` to, :ref:`float` weight **)** + +Returns the result of the spherical linear interpolation between this quaternion and ``to`` by amount ``weight``. + +**Note:** Both quaternions must be normalized. + +---- + +.. _class_Quat_method_slerpni: + +- :ref:`Quat` **slerpni** **(** :ref:`Quat` to, :ref:`float` weight **)** + +Returns the result of the spherical linear interpolation between this quaternion and ``to`` by amount ``weight``, but without checking if the rotation path is not bigger than 90 degrees. + +---- + +.. _class_Quat_method_xform: + +- :ref:`Vector3` **xform** **(** :ref:`Vector3` v **)** + +Returns a vector transformed (multiplied) by this quaternion. + +.. |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.)` diff --git a/classes/class_randomnumbergenerator.rst b/classes/class_randomnumbergenerator.rst new file mode 100644 index 0000000..de3cf7b --- /dev/null +++ b/classes/class_randomnumbergenerator.rst @@ -0,0 +1,172 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RandomNumberGenerator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RandomNumberGenerator: + +RandomNumberGenerator +===================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A class for generating pseudo-random numbers. + +Description +----------- + +RandomNumberGenerator is a class for generating pseudo-random numbers. It currently uses `PCG32 `__. + +**Note:** The underlying algorithm is an implementation detail. As a result, it should not be depended upon for reproducible random streams across Godot versions. + +To generate a random float number (within a given range) based on a time-dependant seed: + +:: + + var rng = RandomNumberGenerator.new() + func _ready(): + rng.randomize() + var my_random_number = rng.randf_range(-10.0, 10.0) + +**Note:** The default values of :ref:`seed` and :ref:`state` properties are pseudo-random, and changes when calling :ref:`randomize`. The ``0`` value documented here is a placeholder, and not the actual default seed. + +Tutorials +--------- + +- :doc:`../tutorials/math/random_number_generation` + +Properties +---------- + ++-----------------------+----------------------------------------------------------+-------+ +| :ref:`int` | :ref:`seed` | ``0`` | ++-----------------------+----------------------------------------------------------+-------+ +| :ref:`int` | :ref:`state` | ``0`` | ++-----------------------+----------------------------------------------------------+-------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randf` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randf_range` **(** :ref:`float` from, :ref:`float` to **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`randfn` **(** :ref:`float` mean=0.0, :ref:`float` deviation=1.0 **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`randi` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`randi_range` **(** :ref:`int` from, :ref:`int` to **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`randomize` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RandomNumberGenerator_property_seed: + +- :ref:`int` **seed** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_seed(value) | ++-----------+-----------------+ +| *Getter* | get_seed() | ++-----------+-----------------+ + +Initializes the random number generator state based on the given seed value. A given seed will give a reproducible sequence of pseudo-random numbers. + +**Note:** The RNG does not have an avalanche effect, and can output similar random streams given similar seeds. Consider using a hash function to improve your seed quality if they're sourced externally. + +**Note:** Setting this property produces a side effect of changing the internal :ref:`state`, so make sure to initialize the seed *before* modifying the :ref:`state`: + +:: + + var rng = RandomNumberGenerator.new() + rng.seed = hash("Godot") + rng.state = 100 # Restore to some previously saved state. + +**Warning:** the getter of this property returns the previous :ref:`state`, and not the initial seed value, which is going to be fixed in Godot 4.0. + +---- + +.. _class_RandomNumberGenerator_property_state: + +- :ref:`int` **state** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_state(value) | ++-----------+------------------+ +| *Getter* | get_state() | ++-----------+------------------+ + +The current state of the random number generator. Save and restore this property to restore the generator to a previous state: + +:: + + var rng = RandomNumberGenerator.new() + print(rng.randf()) + var saved_state = rng.state # Store current state. + print(rng.randf()) # Advance internal state. + rng.state = saved_state # Restore the state. + print(rng.randf()) # Prints the same value as in previous. + +**Note:** Do not set state to arbitrary values, since the random number generator requires the state to have certain qualities to behave properly. It should only be set to values that came from the state property itself. To initialize the random number generator with arbitrary input, use :ref:`seed` instead. + +Method Descriptions +------------------- + +.. _class_RandomNumberGenerator_method_randf: + +- :ref:`float` **randf** **(** **)** + +Generates a pseudo-random float between ``0.0`` and ``1.0`` (inclusive). + +---- + +.. _class_RandomNumberGenerator_method_randf_range: + +- :ref:`float` **randf_range** **(** :ref:`float` from, :ref:`float` to **)** + +Generates a pseudo-random float between ``from`` and ``to`` (inclusive). + +---- + +.. _class_RandomNumberGenerator_method_randfn: + +- :ref:`float` **randfn** **(** :ref:`float` mean=0.0, :ref:`float` deviation=1.0 **)** + +Generates a `normally-distributed `__ pseudo-random number, using Box-Muller transform with the specified ``mean`` and a standard ``deviation``. This is also called Gaussian distribution. + +---- + +.. _class_RandomNumberGenerator_method_randi: + +- :ref:`int` **randi** **(** **)** + +Generates a pseudo-random 32-bit unsigned integer between ``0`` and ``4294967295`` (inclusive). + +---- + +.. _class_RandomNumberGenerator_method_randi_range: + +- :ref:`int` **randi_range** **(** :ref:`int` from, :ref:`int` to **)** + +Generates a pseudo-random 32-bit signed integer between ``from`` and ``to`` (inclusive). + +---- + +.. _class_RandomNumberGenerator_method_randomize: + +- void **randomize** **(** **)** + +Setups a time-based seed to generator. + +.. |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.)` diff --git a/classes/class_range.rst b/classes/class_range.rst new file mode 100644 index 0000000..e0dafec --- /dev/null +++ b/classes/class_range.rst @@ -0,0 +1,252 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Range.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Range: + +Range +===== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorSpinSlider`, :ref:`ProgressBar`, :ref:`ScrollBar`, :ref:`Slider`, :ref:`SpinBox`, :ref:`TextureProgress` + +Abstract base class for range-based controls. + +Description +----------- + +Range is a base class for :ref:`Control` nodes that change a floating-point *value* between a *minimum* and a *maximum*, using *step* and *page*, for example a :ref:`ScrollBar`. + +Properties +---------- + ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`allow_greater` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`allow_lesser` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`exp_edit` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`max_value` | ``100.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`min_value` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`page` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`ratio` | | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`rounded` | ``false`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`step` | ``1.0`` | ++---------------------------+----------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`value` | ``0.0`` | ++---------------------------+----------------------------------------------------------+-----------+ + +Methods +------- + ++------+---------------------------------------------------------------------------------+ +| void | :ref:`share` **(** :ref:`Node` with **)** | ++------+---------------------------------------------------------------------------------+ +| void | :ref:`unshare` **(** **)** | ++------+---------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Range_signal_changed: + +- **changed** **(** **)** + +Emitted when :ref:`min_value`, :ref:`max_value`, :ref:`page`, or :ref:`step` change. + +---- + +.. _class_Range_signal_value_changed: + +- **value_changed** **(** :ref:`float` value **)** + +Emitted when :ref:`value` changes. + +Property Descriptions +--------------------- + +.. _class_Range_property_allow_greater: + +- :ref:`bool` **allow_greater** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_allow_greater(value) | ++-----------+--------------------------+ +| *Getter* | is_greater_allowed() | ++-----------+--------------------------+ + +If ``true``, :ref:`value` may be greater than :ref:`max_value`. + +---- + +.. _class_Range_property_allow_lesser: + +- :ref:`bool` **allow_lesser** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_allow_lesser(value) | ++-----------+-------------------------+ +| *Getter* | is_lesser_allowed() | ++-----------+-------------------------+ + +If ``true``, :ref:`value` may be less than :ref:`min_value`. + +---- + +.. _class_Range_property_exp_edit: + +- :ref:`bool` **exp_edit** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_exp_ratio(value) | ++-----------+----------------------+ +| *Getter* | is_ratio_exp() | ++-----------+----------------------+ + +If ``true``, and ``min_value`` is greater than 0, ``value`` will be represented exponentially rather than linearly. + +---- + +.. _class_Range_property_max_value: + +- :ref:`float` **max_value** + ++-----------+----------------+ +| *Default* | ``100.0`` | ++-----------+----------------+ +| *Setter* | set_max(value) | ++-----------+----------------+ +| *Getter* | get_max() | ++-----------+----------------+ + +Maximum value. Range is clamped if ``value`` is greater than ``max_value``. + +---- + +.. _class_Range_property_min_value: + +- :ref:`float` **min_value** + ++-----------+----------------+ +| *Default* | ``0.0`` | ++-----------+----------------+ +| *Setter* | set_min(value) | ++-----------+----------------+ +| *Getter* | get_min() | ++-----------+----------------+ + +Minimum value. Range is clamped if ``value`` is less than ``min_value``. + +---- + +.. _class_Range_property_page: + +- :ref:`float` **page** + ++-----------+-----------------+ +| *Default* | ``0.0`` | ++-----------+-----------------+ +| *Setter* | set_page(value) | ++-----------+-----------------+ +| *Getter* | get_page() | ++-----------+-----------------+ + +Page size. Used mainly for :ref:`ScrollBar`. ScrollBar's length is its size multiplied by ``page`` over the difference between ``min_value`` and ``max_value``. + +---- + +.. _class_Range_property_ratio: + +- :ref:`float` **ratio** + ++----------+---------------------+ +| *Setter* | set_as_ratio(value) | ++----------+---------------------+ +| *Getter* | get_as_ratio() | ++----------+---------------------+ + +The value mapped between 0 and 1. + +---- + +.. _class_Range_property_rounded: + +- :ref:`bool` **rounded** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_use_rounded_values(value) | ++-----------+-------------------------------+ +| *Getter* | is_using_rounded_values() | ++-----------+-------------------------------+ + +If ``true``, ``value`` will always be rounded to the nearest integer. + +---- + +.. _class_Range_property_step: + +- :ref:`float` **step** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_step(value) | ++-----------+-----------------+ +| *Getter* | get_step() | ++-----------+-----------------+ + +If greater than 0, ``value`` will always be rounded to a multiple of ``step``. If ``rounded`` is also ``true``, ``value`` will first be rounded to a multiple of ``step`` then rounded to the nearest integer. + +---- + +.. _class_Range_property_value: + +- :ref:`float` **value** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_value(value) | ++-----------+------------------+ +| *Getter* | get_value() | ++-----------+------------------+ + +Range's current value. + +Method Descriptions +------------------- + +.. _class_Range_method_share: + +- void **share** **(** :ref:`Node` with **)** + +Binds two ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group. + +---- + +.. _class_Range_method_unshare: + +- void **unshare** **(** **)** + +Stops range from sharing its member variables with any other. + +.. |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.)` diff --git a/classes/class_raycast.rst b/classes/class_raycast.rst new file mode 100644 index 0000000..6be7f4d --- /dev/null +++ b/classes/class_raycast.rst @@ -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 RayCast.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RayCast: + +RayCast +======= + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Query the closest object intersecting a ray. + +Description +----------- + +A RayCast represents a line from its origin to its destination position, ``cast_to``. It is used to query the 3D space in order to find the closest object along the path of the ray. + +RayCast can ignore some objects by adding them to the exception list via ``add_exception`` or by setting proper filtering with collision layers and masks. + +RayCast can be configured to report collisions with :ref:`Area`\ s (:ref:`collide_with_areas`) and/or :ref:`PhysicsBody`\ s (:ref:`collide_with_bodies`). + +Only enabled raycasts will be able to query the space and report collisions. + +RayCast calculates intersection every physics frame (see :ref:`Node`), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame), use :ref:`force_raycast_update` after adjusting the raycast. + +Tutorials +--------- + +- :doc:`../tutorials/physics/ray-casting` + +- `3D Voxel Demo `__ + +Properties +---------- + ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`cast_to` | ``Vector3( 0, -1, 0 )`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`collide_with_areas` | ``false`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`collide_with_bodies` | ``true`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`debug_shape_custom_color` | ``Color( 0, 0, 0, 1 )`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`debug_shape_thickness` | ``2`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`enabled` | ``false`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`exclude_parent` | ``true`` | ++-------------------------------+----------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception` **(** :ref:`Object` node **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception_rid` **(** :ref:`RID` rid **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_exceptions` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_raycast_update` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_collider` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_collider_shape` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_collision_normal` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_collision_point` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_colliding` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception` **(** :ref:`Object` node **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception_rid` **(** :ref:`RID` rid **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RayCast_property_cast_to: + +- :ref:`Vector3` **cast_to** + ++-----------+-------------------------+ +| *Default* | ``Vector3( 0, -1, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_cast_to(value) | ++-----------+-------------------------+ +| *Getter* | get_cast_to() | ++-----------+-------------------------+ + +The ray's destination point, relative to the RayCast's ``position``. + +---- + +.. _class_RayCast_property_collide_with_areas: + +- :ref:`bool` **collide_with_areas** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_collide_with_areas(value) | ++-----------+---------------------------------+ +| *Getter* | is_collide_with_areas_enabled() | ++-----------+---------------------------------+ + +If ``true``, collision with :ref:`Area`\ s will be reported. + +---- + +.. _class_RayCast_property_collide_with_bodies: + +- :ref:`bool` **collide_with_bodies** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_collide_with_bodies(value) | ++-----------+----------------------------------+ +| *Getter* | is_collide_with_bodies_enabled() | ++-----------+----------------------------------+ + +If ``true``, collision with :ref:`PhysicsBody`\ s will be reported. + +---- + +.. _class_RayCast_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_RayCast_property_debug_shape_custom_color: + +- :ref:`Color` **debug_shape_custom_color** + ++-----------+-------------------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_debug_shape_custom_color(value) | ++-----------+-------------------------------------+ +| *Getter* | get_debug_shape_custom_color() | ++-----------+-------------------------------------+ + +The custom color to use to draw the shape in the editor and at run-time if **Visible Collision Shapes** is enabled in the **Debug** menu. This color will be highlighted at run-time if the ``RayCast`` is colliding with something. + +If set to ``Color(0.0, 0.0, 0.0)`` (by default), the color set in :ref:`ProjectSettings.debug/shapes/collision/shape_color` is used. + +---- + +.. _class_RayCast_property_debug_shape_thickness: + +- :ref:`int` **debug_shape_thickness** + ++-----------+----------------------------------+ +| *Default* | ``2`` | ++-----------+----------------------------------+ +| *Setter* | set_debug_shape_thickness(value) | ++-----------+----------------------------------+ +| *Getter* | get_debug_shape_thickness() | ++-----------+----------------------------------+ + +If set to ``1``, a line is used as the debug shape. Otherwise, a truncated pyramid is drawn to represent the ``RayCast``. Requires **Visible Collision Shapes** to be enabled in the **Debug** menu for the debug shape to be visible at run-time. + +---- + +.. _class_RayCast_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_enabled(value) | ++-----------+--------------------+ +| *Getter* | is_enabled() | ++-----------+--------------------+ + +If ``true``, collisions will be reported. + +---- + +.. _class_RayCast_property_exclude_parent: + +- :ref:`bool` **exclude_parent** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_exclude_parent_body(value) | ++-----------+--------------------------------+ +| *Getter* | get_exclude_parent_body() | ++-----------+--------------------------------+ + +If ``true``, collisions will be ignored for this RayCast's immediate parent. + +Method Descriptions +------------------- + +.. _class_RayCast_method_add_exception: + +- void **add_exception** **(** :ref:`Object` node **)** + +Adds a collision exception so the ray does not report collisions with the specified node. + +---- + +.. _class_RayCast_method_add_exception_rid: + +- void **add_exception_rid** **(** :ref:`RID` rid **)** + +Adds a collision exception so the ray does not report collisions with the specified :ref:`RID`. + +---- + +.. _class_RayCast_method_clear_exceptions: + +- void **clear_exceptions** **(** **)** + +Removes all collision exceptions for this ray. + +---- + +.. _class_RayCast_method_force_raycast_update: + +- void **force_raycast_update** **(** **)** + +Updates the collision information for the ray. + +Use this method to update the collision information immediately instead of waiting for the next ``_physics_process`` call, for example if the ray or its parent has changed state. + +**Note:** ``enabled`` is not required for this to work. + +---- + +.. _class_RayCast_method_get_collider: + +- :ref:`Object` **get_collider** **(** **)** |const| + +Returns the first object that the ray intersects, or ``null`` if no object is intersecting the ray (i.e. :ref:`is_colliding` returns ``false``). + +---- + +.. _class_RayCast_method_get_collider_shape: + +- :ref:`int` **get_collider_shape** **(** **)** |const| + +Returns the shape ID of the first object that the ray intersects, or ``0`` if no object is intersecting the ray (i.e. :ref:`is_colliding` returns ``false``). + +---- + +.. _class_RayCast_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns ``true`` if the bit index passed is turned on. + +**Note:** Bit indices range from 0-19. + +---- + +.. _class_RayCast_method_get_collision_normal: + +- :ref:`Vector3` **get_collision_normal** **(** **)** |const| + +Returns the normal of the intersecting object's shape at the collision point. + +---- + +.. _class_RayCast_method_get_collision_point: + +- :ref:`Vector3` **get_collision_point** **(** **)** |const| + +Returns the collision point at which the ray intersects the closest object. + +**Note:** This point is in the **global** coordinate system. + +---- + +.. _class_RayCast_method_is_colliding: + +- :ref:`bool` **is_colliding** **(** **)** |const| + +Returns whether any object is intersecting with the ray's vector (considering the vector length). + +---- + +.. _class_RayCast_method_remove_exception: + +- void **remove_exception** **(** :ref:`Object` node **)** + +Removes a collision exception so the ray does report collisions with the specified node. + +---- + +.. _class_RayCast_method_remove_exception_rid: + +- void **remove_exception_rid** **(** :ref:`RID` rid **)** + +Removes a collision exception so the ray does report collisions with the specified :ref:`RID`. + +---- + +.. _class_RayCast_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets the bit index passed to the ``value`` passed. + +**Note:** Bit indexes range from 0-19. + +.. |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.)` diff --git a/classes/class_raycast2d.rst b/classes/class_raycast2d.rst new file mode 100644 index 0000000..df45a28 --- /dev/null +++ b/classes/class_raycast2d.rst @@ -0,0 +1,290 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RayCast2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RayCast2D: + +RayCast2D +========= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Query the closest object intersecting a ray. + +Description +----------- + +A RayCast represents a line from its origin to its destination position, ``cast_to``. It is used to query the 2D space in order to find the closest object along the path of the ray. + +RayCast2D can ignore some objects by adding them to the exception list via ``add_exception``, by setting proper filtering with collision layers, or by filtering object types with type masks. + +RayCast2D can be configured to report collisions with :ref:`Area2D`\ s (:ref:`collide_with_areas`) and/or :ref:`PhysicsBody2D`\ s (:ref:`collide_with_bodies`). + +Only enabled raycasts will be able to query the space and report collisions. + +RayCast2D calculates intersection every physics frame (see :ref:`Node`), and the result is cached so it can be used later until the next frame. If multiple queries are required between physics frames (or during the same frame) use :ref:`force_raycast_update` after adjusting the raycast. + +Tutorials +--------- + +- :doc:`../tutorials/physics/ray-casting` + +Properties +---------- + ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`Vector2` | :ref:`cast_to` | ``Vector2( 0, 50 )`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`collide_with_areas` | ``false`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`collide_with_bodies` | ``true`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`enabled` | ``false`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ +| :ref:`bool` | :ref:`exclude_parent` | ``true`` | ++-------------------------------+--------------------------------------------------------------------------+----------------------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception` **(** :ref:`Object` node **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_exception_rid` **(** :ref:`RID` rid **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_exceptions` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_raycast_update` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Object` | :ref:`get_collider` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_collider_shape` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_collision_normal` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_collision_point` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_colliding` **(** **)** |const| | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception` **(** :ref:`Object` node **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_exception_rid` **(** :ref:`RID` rid **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RayCast2D_property_cast_to: + +- :ref:`Vector2` **cast_to** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, 50 )`` | ++-----------+----------------------+ +| *Setter* | set_cast_to(value) | ++-----------+----------------------+ +| *Getter* | get_cast_to() | ++-----------+----------------------+ + +The ray's destination point, relative to the RayCast's ``position``. + +---- + +.. _class_RayCast2D_property_collide_with_areas: + +- :ref:`bool` **collide_with_areas** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_collide_with_areas(value) | ++-----------+---------------------------------+ +| *Getter* | is_collide_with_areas_enabled() | ++-----------+---------------------------------+ + +If ``true``, collision with :ref:`Area2D`\ s will be reported. + +---- + +.. _class_RayCast2D_property_collide_with_bodies: + +- :ref:`bool` **collide_with_bodies** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_collide_with_bodies(value) | ++-----------+----------------------------------+ +| *Getter* | is_collide_with_bodies_enabled() | ++-----------+----------------------------------+ + +If ``true``, collision with :ref:`PhysicsBody2D`\ s will be reported. + +---- + +.. _class_RayCast2D_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The ray's collision mask. Only objects in at least one collision layer enabled in the mask will be detected. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_RayCast2D_property_enabled: + +- :ref:`bool` **enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_enabled(value) | ++-----------+--------------------+ +| *Getter* | is_enabled() | ++-----------+--------------------+ + +If ``true``, collisions will be reported. + +---- + +.. _class_RayCast2D_property_exclude_parent: + +- :ref:`bool` **exclude_parent** + ++-----------+--------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------+ +| *Setter* | set_exclude_parent_body(value) | ++-----------+--------------------------------+ +| *Getter* | get_exclude_parent_body() | ++-----------+--------------------------------+ + +If ``true``, the parent node will be excluded from collision detection. + +Method Descriptions +------------------- + +.. _class_RayCast2D_method_add_exception: + +- void **add_exception** **(** :ref:`Object` node **)** + +Adds a collision exception so the ray does not report collisions with the specified node. + +---- + +.. _class_RayCast2D_method_add_exception_rid: + +- void **add_exception_rid** **(** :ref:`RID` rid **)** + +Adds a collision exception so the ray does not report collisions with the specified :ref:`RID`. + +---- + +.. _class_RayCast2D_method_clear_exceptions: + +- void **clear_exceptions** **(** **)** + +Removes all collision exceptions for this ray. + +---- + +.. _class_RayCast2D_method_force_raycast_update: + +- void **force_raycast_update** **(** **)** + +Updates the collision information for the ray. Use this method to update the collision information immediately instead of waiting for the next ``_physics_process`` call, for example if the ray or its parent has changed state. + +**Note:** ``enabled`` is not required for this to work. + +---- + +.. _class_RayCast2D_method_get_collider: + +- :ref:`Object` **get_collider** **(** **)** |const| + +Returns the first object that the ray intersects, or ``null`` if no object is intersecting the ray (i.e. :ref:`is_colliding` returns ``false``). + +---- + +.. _class_RayCast2D_method_get_collider_shape: + +- :ref:`int` **get_collider_shape** **(** **)** |const| + +Returns the shape ID of the first object that the ray intersects, or ``0`` if no object is intersecting the ray (i.e. :ref:`is_colliding` returns ``false``). + +---- + +.. _class_RayCast2D_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the collision mask. + +---- + +.. _class_RayCast2D_method_get_collision_normal: + +- :ref:`Vector2` **get_collision_normal** **(** **)** |const| + +Returns the normal of the intersecting object's shape at the collision point. + +---- + +.. _class_RayCast2D_method_get_collision_point: + +- :ref:`Vector2` **get_collision_point** **(** **)** |const| + +Returns the collision point at which the ray intersects the closest object. + +**Note:** This point is in the **global** coordinate system. + +---- + +.. _class_RayCast2D_method_is_colliding: + +- :ref:`bool` **is_colliding** **(** **)** |const| + +Returns whether any object is intersecting with the ray's vector (considering the vector length). + +---- + +.. _class_RayCast2D_method_remove_exception: + +- void **remove_exception** **(** :ref:`Object` node **)** + +Removes a collision exception so the ray does report collisions with the specified node. + +---- + +.. _class_RayCast2D_method_remove_exception_rid: + +- void **remove_exception_rid** **(** :ref:`RID` rid **)** + +Removes a collision exception so the ray does report collisions with the specified :ref:`RID`. + +---- + +.. _class_RayCast2D_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets or clears individual bits on the collision mask. This makes selecting the areas scanned easier. + +.. |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.)` diff --git a/classes/class_rayshape.rst b/classes/class_rayshape.rst new file mode 100644 index 0000000..ec2b6a7 --- /dev/null +++ b/classes/class_rayshape.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RayShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RayShape: + +RayShape +======== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Ray shape for 3D collisions. + +Description +----------- + +Ray shape for 3D collisions, which can be set into a :ref:`PhysicsBody` or :ref:`Area`. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + +Properties +---------- + ++---------------------------+---------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`length` | ``1.0`` | ++---------------------------+---------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`slips_on_slope` | ``false`` | ++---------------------------+---------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_RayShape_property_length: + +- :ref:`float` **length** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_length(value) | ++-----------+-------------------+ +| *Getter* | get_length() | ++-----------+-------------------+ + +The ray's length. + +---- + +.. _class_RayShape_property_slips_on_slope: + +- :ref:`bool` **slips_on_slope** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_slips_on_slope(value) | ++-----------+---------------------------+ +| *Getter* | get_slips_on_slope() | ++-----------+---------------------------+ + +If ``true``, allow the shape to return the correct normal. + +.. |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.)` diff --git a/classes/class_rayshape2d.rst b/classes/class_rayshape2d.rst new file mode 100644 index 0000000..932038c --- /dev/null +++ b/classes/class_rayshape2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RayShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RayShape2D: + +RayShape2D +========== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Ray shape for 2D collisions. + +Description +----------- + +Ray shape for 2D collisions. A ray is not really a collision body; instead, it tries to separate itself from whatever is touching its far endpoint. It's often useful for characters. + +Properties +---------- + ++---------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`length` | ``20.0`` | ++---------------------------+-----------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`slips_on_slope` | ``false`` | ++---------------------------+-----------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_RayShape2D_property_length: + +- :ref:`float` **length** + ++-----------+-------------------+ +| *Default* | ``20.0`` | ++-----------+-------------------+ +| *Setter* | set_length(value) | ++-----------+-------------------+ +| *Getter* | get_length() | ++-----------+-------------------+ + +The ray's length. + +---- + +.. _class_RayShape2D_property_slips_on_slope: + +- :ref:`bool` **slips_on_slope** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_slips_on_slope(value) | ++-----------+---------------------------+ +| *Getter* | get_slips_on_slope() | ++-----------+---------------------------+ + +If ``true``, allow the shape to return the correct normal. + +.. |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.)` diff --git a/classes/class_rect2.rst b/classes/class_rect2.rst new file mode 100644 index 0000000..df9fbe4 --- /dev/null +++ b/classes/class_rect2.rst @@ -0,0 +1,253 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Rect2.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Rect2: + +Rect2 +===== + +2D axis-aligned bounding box. + +Description +----------- + +``Rect2`` consists of a position, a size, and several utility functions. It is typically used for fast overlap tests. + +It uses floating-point coordinates. + +The 3D counterpart to ``Rect2`` is :ref:`AABB`. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + +Properties +---------- + ++-------------------------------+------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`end` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`position` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`Rect2` **(** :ref:`Vector2` position, :ref:`Vector2` size **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`Rect2` **(** :ref:`float` x, :ref:`float` y, :ref:`float` width, :ref:`float` height **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`abs` **(** **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`clip` **(** :ref:`Rect2` b **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`encloses` **(** :ref:`Rect2` b **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`expand` **(** :ref:`Vector2` to **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_area` **(** **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`grow` **(** :ref:`float` by **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`grow_individual` **(** :ref:`float` left, :ref:`float` top, :ref:`float` right, :ref:`float` bottom **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`grow_margin` **(** :ref:`int` margin, :ref:`float` by **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_no_area` **(** **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_point` **(** :ref:`Vector2` point **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`intersects` **(** :ref:`Rect2` b, :ref:`bool` include_borders=false **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Rect2` rect **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`merge` **(** :ref:`Rect2` b **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Rect2_property_end: + +- :ref:`Vector2` **end** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ + +Ending corner. This is calculated as ``position + size``. Setting this value will change the size. + +---- + +.. _class_Rect2_property_position: + +- :ref:`Vector2` **position** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ + +Beginning corner. Typically has values lower than :ref:`end`. + +---- + +.. _class_Rect2_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ + +Size from :ref:`position` to :ref:`end`. Typically, all components are positive. + +If the size is negative, you can use :ref:`abs` to fix it. + +Method Descriptions +------------------- + +.. _class_Rect2_method_Rect2: + +- :ref:`Rect2` **Rect2** **(** :ref:`Vector2` position, :ref:`Vector2` size **)** + +Constructs a ``Rect2`` by position and size. + +---- + +- :ref:`Rect2` **Rect2** **(** :ref:`float` x, :ref:`float` y, :ref:`float` width, :ref:`float` height **)** + +Constructs a ``Rect2`` by x, y, width, and height. + +---- + +.. _class_Rect2_method_abs: + +- :ref:`Rect2` **abs** **(** **)** + +Returns a ``Rect2`` with equivalent position and area, modified so that the top-left corner is the origin and ``width`` and ``height`` are positive. + +---- + +.. _class_Rect2_method_clip: + +- :ref:`Rect2` **clip** **(** :ref:`Rect2` b **)** + +Returns the intersection of this ``Rect2`` and b. + +---- + +.. _class_Rect2_method_encloses: + +- :ref:`bool` **encloses** **(** :ref:`Rect2` b **)** + +Returns ``true`` if this ``Rect2`` completely encloses another one. + +---- + +.. _class_Rect2_method_expand: + +- :ref:`Rect2` **expand** **(** :ref:`Vector2` to **)** + +Returns a copy of this ``Rect2`` expanded to include a given point. + +**Example:** + +:: + + # position (-3, 2), size (1, 1) + var rect = Rect2(Vector2(-3, 2), Vector2(1, 1)) + # position (-3, -1), size (3, 4), so we fit both rect and Vector2(0, -1) + var rect2 = rect.expand(Vector2(0, -1)) + +---- + +.. _class_Rect2_method_get_area: + +- :ref:`float` **get_area** **(** **)** + +Returns the area of the ``Rect2``. See also :ref:`has_no_area`. + +---- + +.. _class_Rect2_method_grow: + +- :ref:`Rect2` **grow** **(** :ref:`float` by **)** + +Returns a copy of the ``Rect2`` grown a given amount of units towards all the sides. + +---- + +.. _class_Rect2_method_grow_individual: + +- :ref:`Rect2` **grow_individual** **(** :ref:`float` left, :ref:`float` top, :ref:`float` right, :ref:`float` bottom **)** + +Returns a copy of the ``Rect2`` grown a given amount of units towards each direction individually. + +---- + +.. _class_Rect2_method_grow_margin: + +- :ref:`Rect2` **grow_margin** **(** :ref:`int` margin, :ref:`float` by **)** + +Returns a copy of the ``Rect2`` grown a given amount of units towards the :ref:`Margin` direction. + +---- + +.. _class_Rect2_method_has_no_area: + +- :ref:`bool` **has_no_area** **(** **)** + +Returns ``true`` if the ``Rect2`` is flat or empty, ``false`` otherwise. See also :ref:`get_area`. + +**Note:** If the ``Rect2`` has a negative size and is not flat or empty, :ref:`has_no_area` will return ``true``. + +---- + +.. _class_Rect2_method_has_point: + +- :ref:`bool` **has_point** **(** :ref:`Vector2` point **)** + +Returns ``true`` if the ``Rect2`` contains a point. By convention, the right and bottom edges of the ``Rect2`` are considered exclusive, so points on these edges are **not** included. + +**Note:** This method is not reliable for ``Rect2`` with a *negative size*. Use :ref:`abs` to get a positive sized equivalent rectangle to check for contained points. + +---- + +.. _class_Rect2_method_intersects: + +- :ref:`bool` **intersects** **(** :ref:`Rect2` b, :ref:`bool` include_borders=false **)** + +Returns ``true`` if the ``Rect2`` overlaps with ``b`` (i.e. they have at least one point in common). + +If ``include_borders`` is ``true``, they will also be considered overlapping if their borders touch, even without intersection. + +---- + +.. _class_Rect2_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Rect2` rect **)** + +Returns ``true`` if this ``Rect2`` and ``rect`` are approximately equal, by calling ``is_equal_approx`` on each component. + +---- + +.. _class_Rect2_method_merge: + +- :ref:`Rect2` **merge** **(** :ref:`Rect2` b **)** + +Returns a larger ``Rect2`` that contains this ``Rect2`` and ``b``. + +.. |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.)` diff --git a/classes/class_rectangleshape2d.rst b/classes/class_rectangleshape2d.rst new file mode 100644 index 0000000..59c200f --- /dev/null +++ b/classes/class_rectangleshape2d.rst @@ -0,0 +1,54 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RectangleShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RectangleShape2D: + +RectangleShape2D +================ + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Rectangle shape for 2D collisions. + +Description +----------- + +Rectangle shape for 2D collisions. This shape is useful for modeling box-like 2D objects. + +Tutorials +--------- + +- `2D Pong Demo `__ + +- `2D Kinematic Character Demo `__ + +Properties +---------- + ++-------------------------------+---------------------------------------------------------+-----------------------+ +| :ref:`Vector2` | :ref:`extents` | ``Vector2( 10, 10 )`` | ++-------------------------------+---------------------------------------------------------+-----------------------+ + +Property Descriptions +--------------------- + +.. _class_RectangleShape2D_property_extents: + +- :ref:`Vector2` **extents** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 10, 10 )`` | ++-----------+-----------------------+ +| *Setter* | set_extents(value) | ++-----------+-----------------------+ +| *Getter* | get_extents() | ++-----------+-----------------------+ + +The rectangle's half extents. The width and height of this shape is twice the half extents. + +.. |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.)` diff --git a/classes/class_reference.rst b/classes/class_reference.rst new file mode 100644 index 0000000..409667e --- /dev/null +++ b/classes/class_reference.rst @@ -0,0 +1,78 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Reference.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Reference: + +Reference +========= + +**Inherits:** :ref:`Object` + +**Inherited By:** :ref:`AESContext`, :ref:`ARVRInterface`, :ref:`ARVRPositionalTracker`, :ref:`AStar`, :ref:`AStar2D`, :ref:`AnimationTrackEditPlugin`, :ref:`AudioEffectInstance`, :ref:`AudioStreamPlayback`, :ref:`CameraFeed`, :ref:`CharFXTransform`, :ref:`ConfigFile`, :ref:`Crypto`, :ref:`DTLSServer`, :ref:`Directory`, :ref:`EditorExportPlugin`, :ref:`EditorFeatureProfile`, :ref:`EditorInspectorPlugin`, :ref:`EditorResourceConversionPlugin`, :ref:`EditorResourcePreviewGenerator`, :ref:`EditorSceneImporter`, :ref:`EditorScenePostImport`, :ref:`EditorScript`, :ref:`EncodedObjectAsID`, :ref:`Expression`, :ref:`File`, :ref:`FuncRef`, :ref:`GDNative`, :ref:`GDScriptFunctionState`, :ref:`HMACContext`, :ref:`HTTPClient`, :ref:`HashingContext`, :ref:`JSONParseResult`, :ref:`JavaClass`, :ref:`JavaScriptObject`, :ref:`KinematicCollision`, :ref:`KinematicCollision2D`, :ref:`MeshDataTool`, :ref:`MultiplayerAPI`, :ref:`Mutex`, :ref:`PCKPacker`, :ref:`PackedDataContainerRef`, :ref:`PacketPeer`, :ref:`Physics2DShapeQueryParameters`, :ref:`Physics2DTestMotionResult`, :ref:`PhysicsShapeQueryParameters`, :ref:`PhysicsTestMotionResult`, :ref:`RandomNumberGenerator`, :ref:`RegEx`, :ref:`RegExMatch`, :ref:`Resource`, :ref:`ResourceFormatLoader`, :ref:`ResourceFormatSaver`, :ref:`ResourceImporter`, :ref:`ResourceInteractiveLoader`, :ref:`SceneState`, :ref:`SceneTreeTimer`, :ref:`Semaphore`, :ref:`SkinReference`, :ref:`SpatialGizmo`, :ref:`SpatialVelocityTracker`, :ref:`StreamPeer`, :ref:`SurfaceTool`, :ref:`TCP_Server`, :ref:`Thread`, :ref:`TriangleMesh`, :ref:`UDPServer`, :ref:`UPNP`, :ref:`UPNPDevice`, :ref:`VisualScriptFunctionState`, :ref:`WeakRef`, :ref:`WebRTCPeerConnection`, :ref:`XMLParser` + +Base class for reference-counted objects. + +Description +----------- + +Base class for any object that keeps a reference count. :ref:`Resource` and many other helper objects inherit this class. + +Unlike other :ref:`Object` types, References keep an internal reference counter so that they are automatically released when no longer in use, and only then. References therefore do not need to be freed manually with :ref:`Object.free`. + +In the vast majority of use cases, instantiating and using ``Reference``-derived types is all you need to do. The methods provided in this class are only for advanced users, and can cause issues if misused. + +**Note:** In C#, references will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free references that are no longer in use. This means that unused references will linger on for a while before being removed. + +Tutorials +--------- + +- :doc:`../tutorials/best_practices/node_alternatives` + +Methods +------- + ++-------------------------+--------------------------------------------------------------------+ +| :ref:`bool` | :ref:`init_ref` **(** **)** | ++-------------------------+--------------------------------------------------------------------+ +| :ref:`bool` | :ref:`reference` **(** **)** | ++-------------------------+--------------------------------------------------------------------+ +| :ref:`bool` | :ref:`unreference` **(** **)** | ++-------------------------+--------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Reference_method_init_ref: + +- :ref:`bool` **init_ref** **(** **)** + +Initializes the internal reference counter. Use this only if you really know what you are doing. + +Returns whether the initialization was successful. + +---- + +.. _class_Reference_method_reference: + +- :ref:`bool` **reference** **(** **)** + +Increments the internal reference counter. Use this only if you really know what you are doing. + +Returns ``true`` if the increment was successful, ``false`` otherwise. + +---- + +.. _class_Reference_method_unreference: + +- :ref:`bool` **unreference** **(** **)** + +Decrements the internal reference counter. Use this only if you really know what you are doing. + +Returns ``true`` if the decrement was successful, ``false`` otherwise. + +.. |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.)` diff --git a/classes/class_referencerect.rst b/classes/class_referencerect.rst new file mode 100644 index 0000000..fae4faf --- /dev/null +++ b/classes/class_referencerect.rst @@ -0,0 +1,83 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ReferenceRect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ReferenceRect: + +ReferenceRect +============= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Reference frame for GUI. + +Description +----------- + +A rectangle box that displays only a :ref:`border_color` border color around its rectangle. ``ReferenceRect`` has no fill :ref:`Color`. If you need to display a rectangle filled with a solid color, consider using :ref:`ColorRect` instead. + +Properties +---------- + ++---------------------------+----------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`border_color` | ``Color( 1, 0, 0, 1 )`` | ++---------------------------+----------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`border_width` | ``1.0`` | ++---------------------------+----------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`editor_only` | ``true`` | ++---------------------------+----------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_ReferenceRect_property_border_color: + +- :ref:`Color` **border_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_border_color(value) | ++-----------+-------------------------+ +| *Getter* | get_border_color() | ++-----------+-------------------------+ + +Sets the border :ref:`Color` of the ``ReferenceRect``. + +---- + +.. _class_ReferenceRect_property_border_width: + +- :ref:`float` **border_width** + ++-----------+-------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Sets the border width of the ``ReferenceRect``. The border grows both inwards and outwards with respect to the rectangle box. + +---- + +.. _class_ReferenceRect_property_editor_only: + +- :ref:`bool` **editor_only** + ++-----------+------------------------+ +| *Default* | ``true`` | ++-----------+------------------------+ +| *Setter* | set_editor_only(value) | ++-----------+------------------------+ +| *Getter* | get_editor_only() | ++-----------+------------------------+ + +If set to ``true``, the ``ReferenceRect`` will only be visible while in editor. Otherwise, ``ReferenceRect`` will be visible in game. + +.. |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.)` diff --git a/classes/class_reflectionprobe.rst b/classes/class_reflectionprobe.rst new file mode 100644 index 0000000..558fba8 --- /dev/null +++ b/classes/class_reflectionprobe.rst @@ -0,0 +1,279 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ReflectionProbe.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ReflectionProbe: + +ReflectionProbe +=============== + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Captures its surroundings to create fast, accurate reflections from a given point. + +Description +----------- + +Capture its surroundings as a dual paraboloid image, and stores versions of it with increasing levels of blur to simulate different material roughnesses. + +The ``ReflectionProbe`` is used to create high-quality reflections at a low performance cost (when :ref:`update_mode` is :ref:`UPDATE_ONCE`). ``ReflectionProbe``\ s can be blended together and with the rest of the scene smoothly. ``ReflectionProbe``\ s can also be combined with :ref:`GIProbe` and screen-space reflections (:ref:`Environment.ss_reflections_enabled`) to get more accurate reflections in specific areas. ``ReflectionProbe``\ s render all objects within their :ref:`cull_mask`, so updating them can be quite expensive. It is best to update them once with the important static objects and then leave them as-is. + +**Note:** Unlike :ref:`GIProbe`, ``ReflectionProbe``\ s only source their environment from a :ref:`WorldEnvironment` node. If you specify an :ref:`Environment` resource within a :ref:`Camera` node, it will be ignored by the ``ReflectionProbe``. This can lead to incorrect lighting within the ``ReflectionProbe``. + +**Note:** By default, Godot will only render 16 reflection probes. If you need more, increase the number of atlas subdivisions. This setting can be found in :ref:`ProjectSettings.rendering/quality/reflections/atlas_subdiv`. + +**Note:** The GLES2 backend will only display two reflection probes at the same time for a single mesh. If possible, split up large meshes that span over multiple reflection probes into smaller ones. + +Tutorials +--------- + +- :doc:`../tutorials/3d/reflection_probes` + +Properties +---------- + ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`box_projection` | ``false`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`cull_mask` | ``1048575`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`enable_shadows` | ``false`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`extents` | ``Vector3( 1, 1, 1 )`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`intensity` | ``1.0`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`interior_ambient_color` | ``Color( 0, 0, 0, 1 )`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`interior_ambient_contrib` | ``0.0`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`interior_ambient_energy` | ``1.0`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`interior_enable` | ``false`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`max_distance` | ``0.0`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`origin_offset` | ``Vector3( 0, 0, 0 )`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`UpdateMode` | :ref:`update_mode` | ``0`` | ++----------------------------------------------------+------------------------------------------------------------------------------------------+-------------------------+ + +Enumerations +------------ + +.. _enum_ReflectionProbe_UpdateMode: + +.. _class_ReflectionProbe_constant_UPDATE_ONCE: + +.. _class_ReflectionProbe_constant_UPDATE_ALWAYS: + +enum **UpdateMode**: + +- **UPDATE_ONCE** = **0** --- Update the probe once on the next frame (recommended for most objects). The corresponding radiance map will be generated over the following six frames. This takes more time to update than :ref:`UPDATE_ALWAYS`, but it has a lower performance cost and can result in higher-quality reflections. The ReflectionProbe is updated when its transform changes, but not when nearby geometry changes. You can force a ``ReflectionProbe`` update by moving the ``ReflectionProbe`` slightly in any direction. + +- **UPDATE_ALWAYS** = **1** --- Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with :ref:`UPDATE_ALWAYS` at most per scene. For all other use cases, use :ref:`UPDATE_ONCE`. + +Property Descriptions +--------------------- + +.. _class_ReflectionProbe_property_box_projection: + +- :ref:`bool` **box_projection** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_enable_box_projection(value) | ++-----------+----------------------------------+ +| *Getter* | is_box_projection_enabled() | ++-----------+----------------------------------+ + +If ``true``, enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. + +**Note:** To better fit rectangle-shaped rooms that are not aligned to the grid, you can rotate the ``ReflectionProbe`` node. + +---- + +.. _class_ReflectionProbe_property_cull_mask: + +- :ref:`int` **cull_mask** + ++-----------+----------------------+ +| *Default* | ``1048575`` | ++-----------+----------------------+ +| *Setter* | set_cull_mask(value) | ++-----------+----------------------+ +| *Getter* | get_cull_mask() | ++-----------+----------------------+ + +Sets the cull mask which determines what objects are drawn by this probe. Every :ref:`VisualInstance` with a layer included in this cull mask will be rendered by the probe. To improve performance, it is best to only include large objects which are likely to take up a lot of space in the reflection. + +---- + +.. _class_ReflectionProbe_property_enable_shadows: + +- :ref:`bool` **enable_shadows** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_enable_shadows(value) | ++-----------+---------------------------+ +| *Getter* | are_shadows_enabled() | ++-----------+---------------------------+ + +If ``true``, computes shadows in the reflection probe. This makes the reflection probe slower to render; you may want to disable this if using the :ref:`UPDATE_ALWAYS` :ref:`update_mode`. + +---- + +.. _class_ReflectionProbe_property_extents: + +- :ref:`Vector3` **extents** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_extents(value) | ++-----------+------------------------+ +| *Getter* | get_extents() | ++-----------+------------------------+ + +The size of the reflection probe. The larger the extents the more space covered by the probe which will lower the perceived resolution. It is best to keep the extents only as large as you need them. + +**Note:** To better fit areas that are not aligned to the grid, you can rotate the ``ReflectionProbe`` node. + +---- + +.. _class_ReflectionProbe_property_intensity: + +- :ref:`float` **intensity** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_intensity(value) | ++-----------+----------------------+ +| *Getter* | get_intensity() | ++-----------+----------------------+ + +Defines the reflection intensity. Intensity modulates the strength of the reflection. + +---- + +.. _class_ReflectionProbe_property_interior_ambient_color: + +- :ref:`Color` **interior_ambient_color** + ++-----------+-----------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-----------------------------+ +| *Setter* | set_interior_ambient(value) | ++-----------+-----------------------------+ +| *Getter* | get_interior_ambient() | ++-----------+-----------------------------+ + +Sets the ambient light color to be used when this probe is set to :ref:`interior_enable`. + +---- + +.. _class_ReflectionProbe_property_interior_ambient_contrib: + +- :ref:`float` **interior_ambient_contrib** + ++-----------+------------------------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------------------------+ +| *Setter* | set_interior_ambient_probe_contribution(value) | ++-----------+------------------------------------------------+ +| *Getter* | get_interior_ambient_probe_contribution() | ++-----------+------------------------------------------------+ + +Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to :ref:`interior_enable`. Useful so that ambient light matches the color of the room. + +---- + +.. _class_ReflectionProbe_property_interior_ambient_energy: + +- :ref:`float` **interior_ambient_energy** + ++-----------+------------------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------------------+ +| *Setter* | set_interior_ambient_energy(value) | ++-----------+------------------------------------+ +| *Getter* | get_interior_ambient_energy() | ++-----------+------------------------------------+ + +Sets the energy multiplier for this reflection probe's ambient light contribution when set to :ref:`interior_enable`. + +---- + +.. _class_ReflectionProbe_property_interior_enable: + +- :ref:`bool` **interior_enable** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_as_interior(value) | ++-----------+------------------------+ +| *Getter* | is_set_as_interior() | ++-----------+------------------------+ + +If ``true``, reflections will ignore sky contribution. Ambient lighting is then controlled by the ``interior_ambient_*`` properties. + +---- + +.. _class_ReflectionProbe_property_max_distance: + +- :ref:`float` **max_distance** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_max_distance(value) | ++-----------+-------------------------+ +| *Getter* | get_max_distance() | ++-----------+-------------------------+ + +The maximum distance away from the ``ReflectionProbe`` an object can be before it is culled. Decrease this to improve performance, especially when using the :ref:`UPDATE_ALWAYS` :ref:`update_mode`. + +**Note:** The maximum reflection distance is always at least equal to the :ref:`extents`. This means that decreasing :ref:`max_distance` will not always cull objects from reflections, especially if the reflection probe's :ref:`extents` are already large. + +---- + +.. _class_ReflectionProbe_property_origin_offset: + +- :ref:`Vector3` **origin_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_origin_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_origin_offset() | ++-----------+--------------------------+ + +Sets the origin offset to be used when this ``ReflectionProbe`` is in :ref:`box_projection` mode. This can be set to a non-zero value to ensure a reflection fits a rectangle-shaped room, while reducing the amount of objects that "get in the way" of the reflection. + +---- + +.. _class_ReflectionProbe_property_update_mode: + +- :ref:`UpdateMode` **update_mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_update_mode(value) | ++-----------+------------------------+ +| *Getter* | get_update_mode() | ++-----------+------------------------+ + +Sets how frequently the ``ReflectionProbe`` is updated. Can be :ref:`UPDATE_ONCE` or :ref:`UPDATE_ALWAYS`. + +.. |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.)` diff --git a/classes/class_regex.rst b/classes/class_regex.rst new file mode 100644 index 0000000..d61c542 --- /dev/null +++ b/classes/class_regex.rst @@ -0,0 +1,173 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RegEx.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RegEx: + +RegEx +===== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Class for searching text for patterns using regular expressions. + +Description +----------- + +A regular expression (or regex) is a compact language that can be used to recognise strings that follow a specific pattern, such as URLs, email addresses, complete sentences, etc. For instance, a regex of ``ab[0-9]`` would find any string that is ``ab`` followed by any number from ``0`` to ``9``. For a more in-depth look, you can easily find various tutorials and detailed explanations on the Internet. + +To begin, the RegEx object needs to be compiled with the search pattern using :ref:`compile` before it can be used. + +:: + + var regex = RegEx.new() + regex.compile("\\w-(\\d+)") + +The search pattern must be escaped first for GDScript before it is escaped for the expression. For example, ``compile("\\d+")`` would be read by RegEx as ``\d+``. Similarly, ``compile("\"(?:\\\\.|[^\"])*\"")`` would be read as ``"(?:\\.|[^"])*"``. + +Using :ref:`search`, you can find the pattern within the given text. If a pattern is found, :ref:`RegExMatch` is returned and you can retrieve details of the results using methods such as :ref:`RegExMatch.get_string` and :ref:`RegExMatch.get_start`. + +:: + + var regex = RegEx.new() + regex.compile("\\w-(\\d+)") + var result = regex.search("abc n-0123") + if result: + print(result.get_string()) # Would print n-0123 + +The results of capturing groups ``()`` can be retrieved by passing the group number to the various methods in :ref:`RegExMatch`. Group 0 is the default and will always refer to the entire pattern. In the above example, calling ``result.get_string(1)`` would give you ``0123``. + +This version of RegEx also supports named capturing groups, and the names can be used to retrieve the results. If two or more groups have the same name, the name would only refer to the first one with a match. + +:: + + var regex = RegEx.new() + regex.compile("d(?[0-9]+)|x(?[0-9a-f]+)") + var result = regex.search("the number is x2f") + if result: + print(result.get_string("digit")) # Would print 2f + +If you need to process multiple results, :ref:`search_all` generates a list of all non-overlapping results. This can be combined with a ``for`` loop for convenience. + +:: + + for result in regex.search_all("d01, d03, d0c, x3f and x42"): + print(result.get_string("digit")) + # Would print 01 03 0 3f 42 + +**Example of splitting a string using a RegEx:** + +:: + + var regex = RegEx.new() + regex.compile("\\S+") # Negated whitespace character class. + var results = [] + for result in regex.search_all("One Two \n\tThree"): + results.push_back(result.get_string()) + # The `results` array now contains "One", "Two", "Three". + +**Note:** Godot's regex implementation is based on the `PCRE2 `__ library. You can view the full pattern reference `here `__. + +**Tip:** You can use `Regexr `__ to test regular expressions online. + +Methods +------- + ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`compile` **(** :ref:`String` pattern **)** | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_group_count` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_names` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_pattern` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid` **(** **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RegExMatch` | :ref:`search` **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`search_all` **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`sub` **(** :ref:`String` subject, :ref:`String` replacement, :ref:`bool` all=false, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| | ++---------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_RegEx_method_clear: + +- void **clear** **(** **)** + +This method resets the state of the object, as if it was freshly created. Namely, it unassigns the regular expression of this object. + +---- + +.. _class_RegEx_method_compile: + +- :ref:`Error` **compile** **(** :ref:`String` pattern **)** + +Compiles and assign the search pattern to use. Returns :ref:`@GlobalScope.OK` if the compilation is successful. If an error is encountered, details are printed to standard output and an error is returned. + +---- + +.. _class_RegEx_method_get_group_count: + +- :ref:`int` **get_group_count** **(** **)** |const| + +Returns the number of capturing groups in compiled pattern. + +---- + +.. _class_RegEx_method_get_names: + +- :ref:`Array` **get_names** **(** **)** |const| + +Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance. + +---- + +.. _class_RegEx_method_get_pattern: + +- :ref:`String` **get_pattern** **(** **)** |const| + +Returns the original search pattern that was compiled. + +---- + +.. _class_RegEx_method_is_valid: + +- :ref:`bool` **is_valid** **(** **)** |const| + +Returns whether this object has a valid search pattern assigned. + +---- + +.. _class_RegEx_method_search: + +- :ref:`RegExMatch` **search** **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| + +Searches the text for the compiled pattern. Returns a :ref:`RegExMatch` container of the first matching result if found, otherwise ``null``. The region to search within can be specified without modifying where the start and end anchor would be. + +---- + +.. _class_RegEx_method_search_all: + +- :ref:`Array` **search_all** **(** :ref:`String` subject, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| + +Searches the text for the compiled pattern. Returns an array of :ref:`RegExMatch` containers for each non-overlapping result. If no results were found, an empty array is returned instead. The region to search within can be specified without modifying where the start and end anchor would be. + +---- + +.. _class_RegEx_method_sub: + +- :ref:`String` **sub** **(** :ref:`String` subject, :ref:`String` replacement, :ref:`bool` all=false, :ref:`int` offset=0, :ref:`int` end=-1 **)** |const| + +Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as ``$1`` and ``$name`` are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be. + +.. |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.)` diff --git a/classes/class_regexmatch.rst b/classes/class_regexmatch.rst new file mode 100644 index 0000000..a8df47a --- /dev/null +++ b/classes/class_regexmatch.rst @@ -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 RegExMatch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RegExMatch: + +RegExMatch +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Contains the results of a :ref:`RegEx` search. + +Description +----------- + +Contains the results of a single :ref:`RegEx` match returned by :ref:`RegEx.search` and :ref:`RegEx.search_all`. It can be used to find the position and range of the match and its capturing groups, and it can extract its substring for you. + +Properties +---------- + ++-------------------------------------+---------------------------------------------------+----------+ +| :ref:`Dictionary` | :ref:`names` | ``{}`` | ++-------------------------------------+---------------------------------------------------+----------+ +| :ref:`Array` | :ref:`strings` | ``[ ]`` | ++-------------------------------------+---------------------------------------------------+----------+ +| :ref:`String` | :ref:`subject` | ``""`` | ++-------------------------------------+---------------------------------------------------+----------+ + +Methods +------- + ++-----------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_end` **(** :ref:`Variant` name=0 **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_group_count` **(** **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_start` **(** :ref:`Variant` name=0 **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_string` **(** :ref:`Variant` name=0 **)** |const| | ++-----------------------------+----------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RegExMatch_property_names: + +- :ref:`Dictionary` **names** + ++-----------+-------------+ +| *Default* | ``{}`` | ++-----------+-------------+ +| *Getter* | get_names() | ++-----------+-------------+ + +A dictionary of named groups and its corresponding group number. Only groups that were matched are included. If multiple groups have the same name, that name would refer to the first matching one. + +---- + +.. _class_RegExMatch_property_strings: + +- :ref:`Array` **strings** + ++-----------+---------------+ +| *Default* | ``[ ]`` | ++-----------+---------------+ +| *Getter* | get_strings() | ++-----------+---------------+ + +An :ref:`Array` of the match and its capturing groups. + +---- + +.. _class_RegExMatch_property_subject: + +- :ref:`String` **subject** + ++-----------+---------------+ +| *Default* | ``""`` | ++-----------+---------------+ +| *Getter* | get_subject() | ++-----------+---------------+ + +The source string used with the search pattern to find this matching result. + +Method Descriptions +------------------- + +.. _class_RegExMatch_method_get_end: + +- :ref:`int` **get_end** **(** :ref:`Variant` name=0 **)** |const| + +Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + +Returns -1 if the group did not match or doesn't exist. + +---- + +.. _class_RegExMatch_method_get_group_count: + +- :ref:`int` **get_group_count** **(** **)** |const| + +Returns the number of capturing groups. + +---- + +.. _class_RegExMatch_method_get_start: + +- :ref:`int` **get_start** **(** :ref:`Variant` name=0 **)** |const| + +Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + +Returns -1 if the group did not match or doesn't exist. + +---- + +.. _class_RegExMatch_method_get_string: + +- :ref:`String` **get_string** **(** :ref:`Variant` name=0 **)** |const| + +Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern. + +Returns an empty string if the group did not match or doesn't exist. + +.. |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.)` diff --git a/classes/class_remotetransform.rst b/classes/class_remotetransform.rst new file mode 100644 index 0000000..eacf6d0 --- /dev/null +++ b/classes/class_remotetransform.rst @@ -0,0 +1,137 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RemoteTransform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RemoteTransform: + +RemoteTransform +=============== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +RemoteTransform pushes its own :ref:`Transform` to another :ref:`Spatial` derived Node in the scene. + +Description +----------- + +RemoteTransform pushes its own :ref:`Transform` to another :ref:`Spatial` derived Node (called the remote node) in the scene. + +It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`remote_path` | ``NodePath("")`` | ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_position` | ``true`` | ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_rotation` | ``true`` | ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_scale` | ``true`` | ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`use_global_coordinates` | ``true`` | ++---------------------------------+--------------------------------------------------------------------------------------+------------------+ + +Methods +------- + ++------+----------------------------------------------------------------------------------------+ +| void | :ref:`force_update_cache` **(** **)** | ++------+----------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RemoteTransform_property_remote_path: + +- :ref:`NodePath` **remote_path** + ++-----------+------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------+ +| *Setter* | set_remote_node(value) | ++-----------+------------------------+ +| *Getter* | get_remote_node() | ++-----------+------------------------+ + +The :ref:`NodePath` to the remote node, relative to the RemoteTransform's position in the scene. + +---- + +.. _class_RemoteTransform_property_update_position: + +- :ref:`bool` **update_position** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_update_position(value) | ++-----------+----------------------------+ +| *Getter* | get_update_position() | ++-----------+----------------------------+ + +If ``true``, the remote node's position is updated. + +---- + +.. _class_RemoteTransform_property_update_rotation: + +- :ref:`bool` **update_rotation** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_update_rotation(value) | ++-----------+----------------------------+ +| *Getter* | get_update_rotation() | ++-----------+----------------------------+ + +If ``true``, the remote node's rotation is updated. + +---- + +.. _class_RemoteTransform_property_update_scale: + +- :ref:`bool` **update_scale** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_update_scale(value) | ++-----------+-------------------------+ +| *Getter* | get_update_scale() | ++-----------+-------------------------+ + +If ``true``, the remote node's scale is updated. + +---- + +.. _class_RemoteTransform_property_use_global_coordinates: + +- :ref:`bool` **use_global_coordinates** + ++-----------+-----------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------+ +| *Setter* | set_use_global_coordinates(value) | ++-----------+-----------------------------------+ +| *Getter* | get_use_global_coordinates() | ++-----------+-----------------------------------+ + +If ``true``, global coordinates are used. If ``false``, local coordinates are used. + +Method Descriptions +------------------- + +.. _class_RemoteTransform_method_force_update_cache: + +- void **force_update_cache** **(** **)** + +``RemoteTransform`` caches the remote node. It may not notice if the remote node disappears; :ref:`force_update_cache` forces it to update the cache again. + +.. |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.)` diff --git a/classes/class_remotetransform2d.rst b/classes/class_remotetransform2d.rst new file mode 100644 index 0000000..e3d8f60 --- /dev/null +++ b/classes/class_remotetransform2d.rst @@ -0,0 +1,137 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RemoteTransform2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RemoteTransform2D: + +RemoteTransform2D +================= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +RemoteTransform2D pushes its own :ref:`Transform2D` to another :ref:`CanvasItem` derived Node in the scene. + +Description +----------- + +RemoteTransform2D pushes its own :ref:`Transform2D` to another :ref:`CanvasItem` derived Node (called the remote node) in the scene. + +It can be set to update another Node's position, rotation and/or scale. It can use either global or local coordinates. + +Properties +---------- + ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`remote_path` | ``NodePath("")`` | ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_position` | ``true`` | ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_rotation` | ``true`` | ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`update_scale` | ``true`` | ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`use_global_coordinates` | ``true`` | ++---------------------------------+----------------------------------------------------------------------------------------+------------------+ + +Methods +------- + ++------+------------------------------------------------------------------------------------------+ +| void | :ref:`force_update_cache` **(** **)** | ++------+------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RemoteTransform2D_property_remote_path: + +- :ref:`NodePath` **remote_path** + ++-----------+------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------+ +| *Setter* | set_remote_node(value) | ++-----------+------------------------+ +| *Getter* | get_remote_node() | ++-----------+------------------------+ + +The :ref:`NodePath` to the remote node, relative to the RemoteTransform2D's position in the scene. + +---- + +.. _class_RemoteTransform2D_property_update_position: + +- :ref:`bool` **update_position** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_update_position(value) | ++-----------+----------------------------+ +| *Getter* | get_update_position() | ++-----------+----------------------------+ + +If ``true``, the remote node's position is updated. + +---- + +.. _class_RemoteTransform2D_property_update_rotation: + +- :ref:`bool` **update_rotation** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_update_rotation(value) | ++-----------+----------------------------+ +| *Getter* | get_update_rotation() | ++-----------+----------------------------+ + +If ``true``, the remote node's rotation is updated. + +---- + +.. _class_RemoteTransform2D_property_update_scale: + +- :ref:`bool` **update_scale** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_update_scale(value) | ++-----------+-------------------------+ +| *Getter* | get_update_scale() | ++-----------+-------------------------+ + +If ``true``, the remote node's scale is updated. + +---- + +.. _class_RemoteTransform2D_property_use_global_coordinates: + +- :ref:`bool` **use_global_coordinates** + ++-----------+-----------------------------------+ +| *Default* | ``true`` | ++-----------+-----------------------------------+ +| *Setter* | set_use_global_coordinates(value) | ++-----------+-----------------------------------+ +| *Getter* | get_use_global_coordinates() | ++-----------+-----------------------------------+ + +If ``true``, global coordinates are used. If ``false``, local coordinates are used. + +Method Descriptions +------------------- + +.. _class_RemoteTransform2D_method_force_update_cache: + +- void **force_update_cache** **(** **)** + +``RemoteTransform2D`` caches the remote node. It may not notice if the remote node disappears; :ref:`force_update_cache` forces it to update the cache again. + +.. |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.)` diff --git a/classes/class_resource.rst b/classes/class_resource.rst new file mode 100644 index 0000000..0b87780 --- /dev/null +++ b/classes/class_resource.rst @@ -0,0 +1,199 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Resource.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Resource: + +Resource +======== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`Animation`, :ref:`AnimationNode`, :ref:`AnimationNodeStateMachinePlayback`, :ref:`AnimationNodeStateMachineTransition`, :ref:`AudioBusLayout`, :ref:`AudioEffect`, :ref:`AudioStream`, :ref:`BakedLightmapData`, :ref:`BitMap`, :ref:`ButtonGroup`, :ref:`CryptoKey`, :ref:`CubeMap`, :ref:`Curve`, :ref:`Curve2D`, :ref:`Curve3D`, :ref:`DynamicFontData`, :ref:`EditorSettings`, :ref:`EditorSpatialGizmoPlugin`, :ref:`Environment`, :ref:`Font`, :ref:`GDNativeLibrary`, :ref:`GIProbeData`, :ref:`GLTFAccessor`, :ref:`GLTFAnimation`, :ref:`GLTFBufferView`, :ref:`GLTFCamera`, :ref:`GLTFDocument`, :ref:`GLTFLight`, :ref:`GLTFMesh`, :ref:`GLTFNode`, :ref:`GLTFSkeleton`, :ref:`GLTFSkin`, :ref:`GLTFSpecGloss`, :ref:`GLTFState`, :ref:`GLTFTexture`, :ref:`Gradient`, :ref:`Image`, :ref:`InputEvent`, :ref:`Material`, :ref:`Mesh`, :ref:`MeshLibrary`, :ref:`MultiMesh`, :ref:`NavigationMesh`, :ref:`NavigationPolygon`, :ref:`OccluderPolygon2D`, :ref:`OccluderShape`, :ref:`OpenSimplexNoise`, :ref:`PackedDataContainer`, :ref:`PackedScene`, :ref:`PhysicsMaterial`, :ref:`PolygonPathFinder`, :ref:`RichTextEffect`, :ref:`Script`, :ref:`Shader`, :ref:`Shape`, :ref:`Shape2D`, :ref:`ShortCut`, :ref:`Skin`, :ref:`Sky`, :ref:`SpriteFrames`, :ref:`StyleBox`, :ref:`TextFile`, :ref:`Texture`, :ref:`TextureLayered`, :ref:`Theme`, :ref:`TileSet`, :ref:`Translation`, :ref:`VideoStream`, :ref:`VisualScriptNode`, :ref:`VisualShaderNode`, :ref:`World`, :ref:`World2D`, :ref:`X509Certificate` + +Base class for all resources. + +Description +----------- + +Resource is the base class for all Godot-specific resource types, serving primarily as data containers. Since they inherit from :ref:`Reference`, resources are reference-counted and freed when no longer in use. They are also cached once loaded from disk, so that any further attempts to load a resource from a given path will return the same reference (all this in contrast to a :ref:`Node`, which is not reference-counted and can be instanced from disk as many times as desired). Resources can be saved externally on disk or bundled into another object, such as a :ref:`Node` or another resource. + +**Note:** In C#, resources will not be freed instantly after they are no longer in use. Instead, garbage collection will run periodically and will free resources that are no longer in use. This means that unused resources will linger on for a while before being removed. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/resources` + +- :doc:`../tutorials/best_practices/node_alternatives` + +Properties +---------- + ++-----------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`resource_local_to_scene` | ``false`` | ++-----------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`resource_name` | ``""`` | ++-----------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`resource_path` | ``""`` | ++-----------------------------+---------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_setup_local_to_scene` **(** **)** |virtual| | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`duplicate` **(** :ref:`bool` subresources=false **)** |const| | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`emit_changed` **(** **)** | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| :ref:`Node` | :ref:`get_local_scene` **(** **)** |const| | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_rid` **(** **)** |const| | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`setup_local_to_scene` **(** **)** | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`take_over_path` **(** :ref:`String` path **)** | ++---------------------------------+------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Resource_signal_changed: + +- **changed** **(** **)** + +Emitted whenever the resource changes. + +**Note:** This signal is not emitted automatically for custom resources, which means that you need to create a setter and emit the signal yourself. + +Property Descriptions +--------------------- + +.. _class_Resource_property_resource_local_to_scene: + +- :ref:`bool` **resource_local_to_scene** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_local_to_scene(value) | ++-----------+---------------------------+ +| *Getter* | is_local_to_scene() | ++-----------+---------------------------+ + +If ``true``, the resource will be made unique in each instance of its local scene. It can thus be modified in a scene instance without impacting other instances of that same scene. + +---- + +.. _class_Resource_property_resource_name: + +- :ref:`String` **resource_name** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_name(value) | ++-----------+-----------------+ +| *Getter* | get_name() | ++-----------+-----------------+ + +The name of the resource. This is an optional identifier. If :ref:`resource_name` is not empty, its value will be displayed to represent the current resource in the editor inspector. For built-in scripts, the :ref:`resource_name` will be displayed as the tab name in the script editor. + +---- + +.. _class_Resource_property_resource_path: + +- :ref:`String` **resource_path** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_path(value) | ++-----------+-----------------+ +| *Getter* | get_path() | ++-----------+-----------------+ + +The path to the resource. In case it has its own file, it will return its filepath. If it's tied to the scene, it will return the scene's path, followed by the resource's index. + +Method Descriptions +------------------- + +.. _class_Resource_method__setup_local_to_scene: + +- void **_setup_local_to_scene** **(** **)** |virtual| + +Virtual function which can be overridden to customize the behavior value of :ref:`setup_local_to_scene`. + +---- + +.. _class_Resource_method_duplicate: + +- :ref:`Resource` **duplicate** **(** :ref:`bool` subresources=false **)** |const| + +Duplicates the resource, returning a new resource with the exported members copied. **Note:** To duplicate the resource the constructor is called without arguments. This method will error when the constructor doesn't have default values. + +By default, sub-resources are shared between resource copies for efficiency. This can be changed by passing ``true`` to the ``subresources`` argument which will copy the subresources. + +**Note:** If ``subresources`` is ``true``, this method will only perform a shallow copy. Nested resources within subresources will not be duplicated and will still be shared. + +**Note:** When duplicating a resource, only ``export``\ ed properties are copied. Other properties will be set to their default value in the new resource. + +---- + +.. _class_Resource_method_emit_changed: + +- void **emit_changed** **(** **)** + +Emits the :ref:`changed` signal. + +If external objects which depend on this resource should be updated, this method must be called manually whenever the state of this resource has changed (such as modification of properties). + +The method is equivalent to: + +:: + + emit_signal("changed") + +**Note:** This method is called automatically for built-in resources. + +---- + +.. _class_Resource_method_get_local_scene: + +- :ref:`Node` **get_local_scene** **(** **)** |const| + +If :ref:`resource_local_to_scene` is enabled and the resource was loaded from a :ref:`PackedScene` instantiation, returns the local scene where this resource's unique copy is in use. Otherwise, returns ``null``. + +---- + +.. _class_Resource_method_get_rid: + +- :ref:`RID` **get_rid** **(** **)** |const| + +Returns the RID of the resource (or an empty RID). Many resources (such as :ref:`Texture`, :ref:`Mesh`, etc) are high-level abstractions of resources stored in a server, so this function will return the original RID. + +---- + +.. _class_Resource_method_setup_local_to_scene: + +- void **setup_local_to_scene** **(** **)** + +This method is called when a resource with :ref:`resource_local_to_scene` enabled is loaded from a :ref:`PackedScene` instantiation. Its behavior can be customized by overriding :ref:`_setup_local_to_scene` from script. + +For most resources, this method performs no base logic. :ref:`ViewportTexture` performs custom logic to properly set the proxy texture and flags in the local viewport. + +---- + +.. _class_Resource_method_take_over_path: + +- void **take_over_path** **(** :ref:`String` path **)** + +Sets the path of the resource, potentially overriding an existing cache entry for this path. This differs from setting :ref:`resource_path`, as the latter would error out if another resource was already cached for the given 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.)` diff --git a/classes/class_resourceformatloader.rst b/classes/class_resourceformatloader.rst new file mode 100644 index 0000000..bf0a13f --- /dev/null +++ b/classes/class_resourceformatloader.rst @@ -0,0 +1,101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ResourceFormatLoader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceFormatLoader: + +ResourceFormatLoader +==================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Loads a specific resource type from a file. + +Description +----------- + +Godot loads resources in the editor or in exported games using ResourceFormatLoaders. They are queried automatically via the :ref:`ResourceLoader` singleton, or when a resource with internal dependencies is loaded. Each file type may load as a different resource type, so multiple ResourceFormatLoaders are registered in the engine. + +Extending this class allows you to define your own loader. Be sure to respect the documented return types and values. You should give it a global class name with ``class_name`` for it to be registered. Like built-in ResourceFormatLoaders, it will be called automatically when loading resources of its handled type(s). You may also implement a :ref:`ResourceFormatSaver`. + +**Note:** You can also extend :ref:`EditorImportPlugin` if the resource type you need exists but Godot is unable to load its format. Choosing one way over another depends on if the format is suitable or not for the final exported game. For example, it's better to import ``.png`` textures as ``.stex`` (:ref:`StreamTexture`) first, so they can be loaded with better efficiency on the graphics card. + +Methods +------- + ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`get_dependencies` **(** :ref:`String` path, :ref:`String` add_types **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_recognized_extensions` **(** **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_resource_type` **(** :ref:`String` path **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`handles_type` **(** :ref:`String` typename **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`load` **(** :ref:`String` path, :ref:`String` original_path **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rename_dependencies` **(** :ref:`String` path, :ref:`String` renames **)** |virtual| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ResourceFormatLoader_method_get_dependencies: + +- void **get_dependencies** **(** :ref:`String` path, :ref:`String` add_types **)** |virtual| + +If implemented, gets the dependencies of a given resource. If ``add_types`` is ``true``, paths should be appended ``::TypeName``, where ``TypeName`` is the class name of the dependency. + +**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB`, so you might just return ``"Resource"`` for them. + +---- + +.. _class_ResourceFormatLoader_method_get_recognized_extensions: + +- :ref:`PoolStringArray` **get_recognized_extensions** **(** **)** |virtual| + +Gets the list of extensions for files this loader is able to read. + +---- + +.. _class_ResourceFormatLoader_method_get_resource_type: + +- :ref:`String` **get_resource_type** **(** :ref:`String` path **)** |virtual| + +Gets the class name of the resource associated with the given path. If the loader cannot handle it, it should return ``""``. + +**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB`, so you might just return ``"Resource"`` for them. + +---- + +.. _class_ResourceFormatLoader_method_handles_type: + +- :ref:`bool` **handles_type** **(** :ref:`String` typename **)** |virtual| + +Tells which resource class this loader can load. + +**Note:** Custom resource types defined by scripts aren't known by the :ref:`ClassDB`, so you might just handle ``"Resource"`` for them. + +---- + +.. _class_ResourceFormatLoader_method_load: + +- :ref:`Variant` **load** **(** :ref:`String` path, :ref:`String` original_path **)** |virtual| + +Loads a resource when the engine finds this loader to be compatible. If the loaded resource is the result of an import, ``original_path`` will target the source file. Returns a :ref:`Resource` object on success, or an :ref:`Error` constant in case of failure. + +---- + +.. _class_ResourceFormatLoader_method_rename_dependencies: + +- :ref:`int` **rename_dependencies** **(** :ref:`String` path, :ref:`String` renames **)** |virtual| + +If implemented, renames dependencies within the given resource and saves it. ``renames`` is a dictionary ``{ String => String }`` mapping old dependency paths to new paths. + +Returns :ref:`@GlobalScope.OK` on success, or an :ref:`Error` constant in case of failure. + +.. |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.)` diff --git a/classes/class_resourceformatsaver.rst b/classes/class_resourceformatsaver.rst new file mode 100644 index 0000000..1e05010 --- /dev/null +++ b/classes/class_resourceformatsaver.rst @@ -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 ResourceFormatSaver.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceFormatSaver: + +ResourceFormatSaver +=================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Saves a specific resource type to a file. + +Description +----------- + +The engine can save resources when you do it from the editor, or when you use the :ref:`ResourceSaver` singleton. This is accomplished thanks to multiple ``ResourceFormatSaver``\ s, each handling its own format and called automatically by the engine. + +By default, Godot saves resources as ``.tres`` (text-based), ``.res`` (binary) or another built-in format, but you can choose to create your own format by extending this class. Be sure to respect the documented return types and values. You should give it a global class name with ``class_name`` for it to be registered. Like built-in ResourceFormatSavers, it will be called automatically when saving resources of its recognized type(s). You may also implement a :ref:`ResourceFormatLoader`. + +Methods +------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_recognized_extensions` **(** :ref:`Resource` resource **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`recognize` **(** :ref:`Resource` resource **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`save` **(** :ref:`String` path, :ref:`Resource` resource, :ref:`int` flags **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ResourceFormatSaver_method_get_recognized_extensions: + +- :ref:`PoolStringArray` **get_recognized_extensions** **(** :ref:`Resource` resource **)** |virtual| + +Returns the list of extensions available for saving the resource object, provided it is recognized (see :ref:`recognize`). + +---- + +.. _class_ResourceFormatSaver_method_recognize: + +- :ref:`bool` **recognize** **(** :ref:`Resource` resource **)** |virtual| + +Returns whether the given resource object can be saved by this saver. + +---- + +.. _class_ResourceFormatSaver_method_save: + +- :ref:`int` **save** **(** :ref:`String` path, :ref:`Resource` resource, :ref:`int` flags **)** |virtual| + +Saves the given resource object to a file at the target ``path``. ``flags`` is a bitmask composed with :ref:`SaverFlags` constants. + +Returns :ref:`@GlobalScope.OK` on success, or an :ref:`Error` constant in case of failure. + +.. |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.)` diff --git a/classes/class_resourceimporter.rst b/classes/class_resourceimporter.rst new file mode 100644 index 0000000..809a687 --- /dev/null +++ b/classes/class_resourceimporter.rst @@ -0,0 +1,45 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ResourceImporter.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceImporter: + +ResourceImporter +================ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorImportPlugin` + +Base class for the implementation of core resource importers. + +Description +----------- + +This is the base class for the resource importers implemented in core. To implement your own resource importers using editor plugins, see :ref:`EditorImportPlugin`. + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/import_plugins` + +Enumerations +------------ + +.. _enum_ResourceImporter_ImportOrder: + +.. _class_ResourceImporter_constant_IMPORT_ORDER_DEFAULT: + +.. _class_ResourceImporter_constant_IMPORT_ORDER_SCENE: + +enum **ImportOrder**: + +- **IMPORT_ORDER_DEFAULT** = **0** --- The default import order. + +- **IMPORT_ORDER_SCENE** = **100** --- The import order for scenes, which ensures scenes are imported *after* all other core resources such as textures. Custom importers should generally have an import order lower than ``100`` to avoid issues when importing scenes that rely on custom resources. + +.. |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.)` diff --git a/classes/class_resourceinteractiveloader.rst b/classes/class_resourceinteractiveloader.rst new file mode 100644 index 0000000..49f3a73 --- /dev/null +++ b/classes/class_resourceinteractiveloader.rst @@ -0,0 +1,89 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ResourceInteractiveLoader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceInteractiveLoader: + +ResourceInteractiveLoader +========================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Interactive :ref:`Resource` loader. + +Description +----------- + +Interactive :ref:`Resource` loader. This object is returned by :ref:`ResourceLoader` when performing an interactive load. It allows loading resources with high granularity, which makes it mainly useful for displaying loading bars or percentages. + +Methods +------- + ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`get_resource` **(** **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_stage` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_stage_count` **(** **)** |const| | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`poll` **(** **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`wait` **(** **)** | ++---------------------------------------+----------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ResourceInteractiveLoader_method_get_resource: + +- :ref:`Resource` **get_resource** **(** **)** + +Returns the loaded resource if the load operation completed successfully, ``null`` otherwise. + +---- + +.. _class_ResourceInteractiveLoader_method_get_stage: + +- :ref:`int` **get_stage** **(** **)** |const| + +Returns the load stage. The total amount of stages can be queried with :ref:`get_stage_count`. + +---- + +.. _class_ResourceInteractiveLoader_method_get_stage_count: + +- :ref:`int` **get_stage_count** **(** **)** |const| + +Returns the total amount of stages (calls to :ref:`poll`) needed to completely load this resource. + +---- + +.. _class_ResourceInteractiveLoader_method_poll: + +- :ref:`Error` **poll** **(** **)** + +Polls the loading operation, i.e. loads a data chunk up to the next stage. + +Returns :ref:`@GlobalScope.OK` if the poll is successful but the load operation has not finished yet (intermediate stage). This means :ref:`poll` will have to be called again until the last stage is completed. + +Returns :ref:`@GlobalScope.ERR_FILE_EOF` if the load operation has completed successfully. The loaded resource can be obtained by calling :ref:`get_resource`. + +Returns another :ref:`Error` code if the poll has failed. + +---- + +.. _class_ResourceInteractiveLoader_method_wait: + +- :ref:`Error` **wait** **(** **)** + +Polls the loading operation successively until the resource is completely loaded or a :ref:`poll` fails. + +Returns :ref:`@GlobalScope.ERR_FILE_EOF` if the load operation has completed successfully. The loaded resource can be obtained by calling :ref:`get_resource`. + +Returns another :ref:`Error` code if a poll has failed, aborting the operation. + +.. |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.)` diff --git a/classes/class_resourceloader.rst b/classes/class_resourceloader.rst new file mode 100644 index 0000000..ae1244f --- /dev/null +++ b/classes/class_resourceloader.rst @@ -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 ResourceLoader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceLoader: + +ResourceLoader +============== + +**Inherits:** :ref:`Object` + +Singleton used to load resource files. + +Description +----------- + +Singleton used to load resource files from the filesystem. + +It uses the many :ref:`ResourceFormatLoader` classes registered in the engine (either built-in or from a plugin) to load files into memory and convert them to a format that can be used by the engine. + +Tutorials +--------- + +- `OS Test Demo `__ + +Methods +------- + ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`exists` **(** :ref:`String` path, :ref:`String` type_hint="" **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_dependencies` **(** :ref:`String` path **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_recognized_extensions_for_type` **(** :ref:`String` type **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has` **(** :ref:`String` path **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_cached` **(** :ref:`String` path **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`load` **(** :ref:`String` path, :ref:`String` type_hint="", :ref:`bool` no_cache=false **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ResourceInteractiveLoader` | :ref:`load_interactive` **(** :ref:`String` path, :ref:`String` type_hint="" **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_abort_on_missing_resources` **(** :ref:`bool` abort **)** | ++-------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ResourceLoader_method_exists: + +- :ref:`bool` **exists** **(** :ref:`String` path, :ref:`String` type_hint="" **)** + +Returns whether a recognized resource exists for the given ``path``. + +An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. + +---- + +.. _class_ResourceLoader_method_get_dependencies: + +- :ref:`PoolStringArray` **get_dependencies** **(** :ref:`String` path **)** + +Returns the dependencies for the resource at the given ``path``. + +---- + +.. _class_ResourceLoader_method_get_recognized_extensions_for_type: + +- :ref:`PoolStringArray` **get_recognized_extensions_for_type** **(** :ref:`String` type **)** + +Returns the list of recognized extensions for a resource type. + +---- + +.. _class_ResourceLoader_method_has: + +- :ref:`bool` **has** **(** :ref:`String` path **)** + +*Deprecated method.* Use :ref:`has_cached` or :ref:`exists` instead. + +---- + +.. _class_ResourceLoader_method_has_cached: + +- :ref:`bool` **has_cached** **(** :ref:`String` path **)** + +Returns whether a cached resource is available for the given ``path``. + +Once a resource has been loaded by the engine, it is cached in memory for faster access, and future calls to the :ref:`load` or :ref:`load_interactive` methods will use the cached version. The cached resource can be overridden by using :ref:`Resource.take_over_path` on a new resource for that same path. + +---- + +.. _class_ResourceLoader_method_load: + +- :ref:`Resource` **load** **(** :ref:`String` path, :ref:`String` type_hint="", :ref:`bool` no_cache=false **)** + +Loads a resource at the given ``path``, caching the result for further access. + +The registered :ref:`ResourceFormatLoader`\ s are queried sequentially to find the first one which can handle the file's extension, and then attempt loading. If loading fails, the remaining ResourceFormatLoaders are also attempted. + +An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. Anything that inherits from :ref:`Resource` can be used as a type hint, for example :ref:`Image`. + +If ``no_cache`` is ``true``, the resource cache will be bypassed and the resource will be loaded anew. Otherwise, the cached resource will be returned if it exists. + +Returns an empty resource if no :ref:`ResourceFormatLoader` could handle the file. + +GDScript has a simplified :ref:`@GDScript.load` built-in method which can be used in most situations, leaving the use of ``ResourceLoader`` for more advanced scenarios. + +---- + +.. _class_ResourceLoader_method_load_interactive: + +- :ref:`ResourceInteractiveLoader` **load_interactive** **(** :ref:`String` path, :ref:`String` type_hint="" **)** + +Starts loading a resource interactively. The returned :ref:`ResourceInteractiveLoader` object allows to load with high granularity, calling its :ref:`ResourceInteractiveLoader.poll` method successively to load chunks. + +An optional ``type_hint`` can be used to further specify the :ref:`Resource` type that should be handled by the :ref:`ResourceFormatLoader`. Anything that inherits from :ref:`Resource` can be used as a type hint, for example :ref:`Image`. + +---- + +.. _class_ResourceLoader_method_set_abort_on_missing_resources: + +- void **set_abort_on_missing_resources** **(** :ref:`bool` abort **)** + +Changes the behavior on missing sub-resources. The default behavior is to abort loading. + +.. |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.)` diff --git a/classes/class_resourcepreloader.rst b/classes/class_resourcepreloader.rst new file mode 100644 index 0000000..390e8a4 --- /dev/null +++ b/classes/class_resourcepreloader.rst @@ -0,0 +1,91 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ResourcePreloader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourcePreloader: + +ResourcePreloader +================= + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Resource Preloader Node. + +Description +----------- + +This node is used to preload sub-resources inside a scene, so when the scene is loaded, all the resources are ready to use and can be retrieved from the preloader. + +GDScript has a simplified :ref:`@GDScript.preload` built-in method which can be used in most situations, leaving the use of ``ResourcePreloader`` for more advanced scenarios. + +Methods +------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_resource` **(** :ref:`String` name, :ref:`Resource` resource **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Resource` | :ref:`get_resource` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_resource_list` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_resource` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_resource` **(** :ref:`String` name **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_resource` **(** :ref:`String` name, :ref:`String` newname **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_ResourcePreloader_method_add_resource: + +- void **add_resource** **(** :ref:`String` name, :ref:`Resource` resource **)** + +Adds a resource to the preloader with the given ``name``. If a resource with the given ``name`` already exists, the new resource will be renamed to "``name`` N" where N is an incrementing number starting from 2. + +---- + +.. _class_ResourcePreloader_method_get_resource: + +- :ref:`Resource` **get_resource** **(** :ref:`String` name **)** |const| + +Returns the resource associated to ``name``. + +---- + +.. _class_ResourcePreloader_method_get_resource_list: + +- :ref:`PoolStringArray` **get_resource_list** **(** **)** |const| + +Returns the list of resources inside the preloader. + +---- + +.. _class_ResourcePreloader_method_has_resource: + +- :ref:`bool` **has_resource** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the preloader contains a resource associated to ``name``. + +---- + +.. _class_ResourcePreloader_method_remove_resource: + +- void **remove_resource** **(** :ref:`String` name **)** + +Removes the resource associated to ``name`` from the preloader. + +---- + +.. _class_ResourcePreloader_method_rename_resource: + +- void **rename_resource** **(** :ref:`String` name, :ref:`String` newname **)** + +Renames a resource inside the preloader from ``name`` to ``newname``. + +.. |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.)` diff --git a/classes/class_resourcesaver.rst b/classes/class_resourcesaver.rst new file mode 100644 index 0000000..832387e --- /dev/null +++ b/classes/class_resourcesaver.rst @@ -0,0 +1,90 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ResourceSaver.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ResourceSaver: + +ResourceSaver +============= + +**Inherits:** :ref:`Object` + +Singleton for saving Godot-specific resource types. + +Description +----------- + +Singleton for saving Godot-specific resource types to the filesystem. + +It uses the many :ref:`ResourceFormatSaver` classes registered in the engine (either built-in or from a plugin) to save engine-specific resource data to text-based (e.g. ``.tres`` or ``.tscn``) or binary files (e.g. ``.res`` or ``.scn``). + +Methods +------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_recognized_extensions` **(** :ref:`Resource` type **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** :ref:`String` path, :ref:`Resource` resource, :ref:`SaverFlags` flags=0 **)** | ++-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_ResourceSaver_SaverFlags: + +.. _class_ResourceSaver_constant_FLAG_RELATIVE_PATHS: + +.. _class_ResourceSaver_constant_FLAG_BUNDLE_RESOURCES: + +.. _class_ResourceSaver_constant_FLAG_CHANGE_PATH: + +.. _class_ResourceSaver_constant_FLAG_OMIT_EDITOR_PROPERTIES: + +.. _class_ResourceSaver_constant_FLAG_SAVE_BIG_ENDIAN: + +.. _class_ResourceSaver_constant_FLAG_COMPRESS: + +.. _class_ResourceSaver_constant_FLAG_REPLACE_SUBRESOURCE_PATHS: + +enum **SaverFlags**: + +- **FLAG_RELATIVE_PATHS** = **1** --- Save the resource with a path relative to the scene which uses it. + +- **FLAG_BUNDLE_RESOURCES** = **2** --- Bundles external resources. + +- **FLAG_CHANGE_PATH** = **4** --- Changes the :ref:`Resource.resource_path` of the saved resource to match its new location. + +- **FLAG_OMIT_EDITOR_PROPERTIES** = **8** --- Do not save editor-specific metadata (identified by their ``__editor`` prefix). + +- **FLAG_SAVE_BIG_ENDIAN** = **16** --- Save as big endian (see :ref:`File.endian_swap`). + +- **FLAG_COMPRESS** = **32** --- Compress the resource on save using :ref:`File.COMPRESSION_ZSTD`. Only available for binary resource types. + +- **FLAG_REPLACE_SUBRESOURCE_PATHS** = **64** --- Take over the paths of the saved subresources (see :ref:`Resource.take_over_path`). + +Method Descriptions +------------------- + +.. _class_ResourceSaver_method_get_recognized_extensions: + +- :ref:`PoolStringArray` **get_recognized_extensions** **(** :ref:`Resource` type **)** + +Returns the list of extensions available for saving a resource of a given type. + +---- + +.. _class_ResourceSaver_method_save: + +- :ref:`Error` **save** **(** :ref:`String` path, :ref:`Resource` resource, :ref:`SaverFlags` flags=0 **)** + +Saves a resource to disk to the given path, using a :ref:`ResourceFormatSaver` that recognizes the resource object. + +The ``flags`` bitmask can be specified to customize the save behavior. + +Returns :ref:`@GlobalScope.OK` on success. + +.. |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.)` diff --git a/classes/class_richtexteffect.rst b/classes/class_richtexteffect.rst new file mode 100644 index 0000000..c3c0d54 --- /dev/null +++ b/classes/class_richtexteffect.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RichTextEffect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RichTextEffect: + +RichTextEffect +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A custom effect for use with :ref:`RichTextLabel`. + +Description +----------- + +A custom effect for use with :ref:`RichTextLabel`. + +**Note:** For a ``RichTextEffect`` to be usable, a BBCode tag must be defined as a member variable called ``bbcode`` in the script. + +:: + + # The RichTextEffect will be usable like this: `[example]Some text[/example]` + var bbcode = "example" + +**Note:** As soon as a :ref:`RichTextLabel` contains at least one ``RichTextEffect``, it will continuously process the effect unless the project is paused. This may impact battery life negatively. + +Tutorials +--------- + +- :doc:`../tutorials/ui/bbcode_in_richtextlabel` + +- `https://github.com/Eoin-ONeill-Yokai/Godot-Rich-Text-Effect-Test-Project `__ + +Methods +------- + ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_process_custom_fx` **(** :ref:`CharFXTransform` char_fx **)** |virtual| | ++-------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_RichTextEffect_method__process_custom_fx: + +- :ref:`bool` **_process_custom_fx** **(** :ref:`CharFXTransform` char_fx **)** |virtual| + +Override this method to modify properties in ``char_fx``. The method must return ``true`` if the character could be transformed successfully. If the method returns ``false``, it will skip transformation to avoid displaying broken text. + +.. |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.)` diff --git a/classes/class_richtextlabel.rst b/classes/class_richtextlabel.rst new file mode 100644 index 0000000..dfba2f8 --- /dev/null +++ b/classes/class_richtextlabel.rst @@ -0,0 +1,1000 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RichTextLabel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RichTextLabel: + +RichTextLabel +============= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Label that displays rich text. + +Description +----------- + +Rich text can contain custom text, fonts, images and some basic formatting. The label manages these as an internal tag stack. It also adapts itself to given width/heights. + +**Note:** Assignments to :ref:`bbcode_text` clear the tag stack and reconstruct it from the property's contents. Any edits made to :ref:`bbcode_text` will erase previous edits made from other manual sources such as :ref:`append_bbcode` and the ``push_*`` / :ref:`pop` methods. + +**Note:** RichTextLabel doesn't support entangled BBCode tags. For example, instead of using ``[b]bold[i]bold italic[/b]italic[/i]``, use ``[b]bold[i]bold italic[/i][/b][i]italic[/i]``. + +**Note:** ``push_*/pop`` functions won't affect BBCode. + +**Note:** Unlike :ref:`Label`, RichTextLabel doesn't have a *property* to horizontally align text to the center. Instead, enable :ref:`bbcode_enabled` and surround the text in a ``[center]`` tag as follows: ``[center]Example[/center]``. There is currently no built-in way to vertically align text either, but this can be emulated by relying on anchors/containers and the :ref:`fit_content_height` property. + +**Note:** Unicode characters after ``0xffff`` (such as most emoji) are *not* supported on Windows. They will display as unknown characters instead. This will be resolved in Godot 4.0. + +Tutorials +--------- + +- :doc:`../tutorials/ui/bbcode_in_richtextlabel` + +- `GUI Rich Text/BBcode Demo `__ + +- `OS Test Demo `__ + +Properties +---------- + ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`bbcode_enabled` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`String` | :ref:`bbcode_text` | ``""`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`Array` | :ref:`custom_effects` | ``[ ]`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`fit_content_height` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`meta_underlined` | ``true`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`float` | :ref:`percent_visible` | ``1.0`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`scroll_active` | ``true`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`scroll_following` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`selection_enabled` | ``false`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`tab_size` | ``4`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`visible_characters` | ``-1`` | ++-----------------------------+------------------------------------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_image` **(** :ref:`Texture` image, :ref:`int` width=0, :ref:`int` height=0 **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_text` **(** :ref:`String` text **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`append_bbcode` **(** :ref:`String` bbcode **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_content_height` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_count` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_total_character_count` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VScrollBar` | :ref:`get_v_scroll` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_visible_line_count` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`install_effect` **(** :ref:`Variant` effect **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`newline` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`parse_bbcode` **(** :ref:`String` bbcode **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`parse_expressions_for_values` **(** :ref:`PoolStringArray` expressions **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`pop` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_align` **(** :ref:`Align` align **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_bold` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_bold_italics` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_cell` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_color` **(** :ref:`Color` color **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_font` **(** :ref:`Font` font **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_indent` **(** :ref:`int` level **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_italics` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_list` **(** :ref:`ListType` type **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_meta` **(** :ref:`Variant` data **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_mono` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_normal` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_strikethrough` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_table` **(** :ref:`int` columns **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`push_underline` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`remove_line` **(** :ref:`int` line **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scroll_to_line` **(** :ref:`int` line **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_table_column_expand` **(** :ref:`int` column, :ref:`bool` expand, :ref:`int` ratio **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`default_color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_selected` | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_shadow` | ``Color( 0, 0, 0, 0 )`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`selection_color` | ``Color( 0.1, 0.1, 1, 0.8 )`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`line_separation` | ``1`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`shadow_as_outline` | ``0`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`shadow_offset_x` | ``1`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`shadow_offset_y` | ``1`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`table_hseparation` | ``3`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`table_vseparation` | ``3`` | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`bold_font` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`bold_italics_font` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`italics_font` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`mono_font` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`normal_font` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+---------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_RichTextLabel_signal_meta_clicked: + +- **meta_clicked** **(** :ref:`Variant` meta **)** + +Triggered when the user clicks on content between meta tags. If the meta is defined in text, e.g. ``[url={"data"="hi"}]hi[/url]``, then the parameter for this signal will be a :ref:`String` type. If a particular type or an object is desired, the :ref:`push_meta` method must be used to manually insert the data into the tag stack. + +---- + +.. _class_RichTextLabel_signal_meta_hover_ended: + +- **meta_hover_ended** **(** :ref:`Variant` meta **)** + +Triggers when the mouse exits a meta tag. + +---- + +.. _class_RichTextLabel_signal_meta_hover_started: + +- **meta_hover_started** **(** :ref:`Variant` meta **)** + +Triggers when the mouse enters a meta tag. + +Enumerations +------------ + +.. _enum_RichTextLabel_Align: + +.. _class_RichTextLabel_constant_ALIGN_LEFT: + +.. _class_RichTextLabel_constant_ALIGN_CENTER: + +.. _class_RichTextLabel_constant_ALIGN_RIGHT: + +.. _class_RichTextLabel_constant_ALIGN_FILL: + +enum **Align**: + +- **ALIGN_LEFT** = **0** --- Makes text left aligned. + +- **ALIGN_CENTER** = **1** --- Makes text centered. + +- **ALIGN_RIGHT** = **2** --- Makes text right aligned. + +- **ALIGN_FILL** = **3** --- Makes text fill width. + +---- + +.. _enum_RichTextLabel_ListType: + +.. _class_RichTextLabel_constant_LIST_NUMBERS: + +.. _class_RichTextLabel_constant_LIST_LETTERS: + +.. _class_RichTextLabel_constant_LIST_DOTS: + +enum **ListType**: + +- **LIST_NUMBERS** = **0** --- Each list item has a number marker. + +- **LIST_LETTERS** = **1** --- Each list item has a letter marker. + +- **LIST_DOTS** = **2** --- Each list item has a filled circle marker. + +---- + +.. _enum_RichTextLabel_ItemType: + +.. _class_RichTextLabel_constant_ITEM_FRAME: + +.. _class_RichTextLabel_constant_ITEM_TEXT: + +.. _class_RichTextLabel_constant_ITEM_IMAGE: + +.. _class_RichTextLabel_constant_ITEM_NEWLINE: + +.. _class_RichTextLabel_constant_ITEM_FONT: + +.. _class_RichTextLabel_constant_ITEM_COLOR: + +.. _class_RichTextLabel_constant_ITEM_UNDERLINE: + +.. _class_RichTextLabel_constant_ITEM_STRIKETHROUGH: + +.. _class_RichTextLabel_constant_ITEM_ALIGN: + +.. _class_RichTextLabel_constant_ITEM_INDENT: + +.. _class_RichTextLabel_constant_ITEM_LIST: + +.. _class_RichTextLabel_constant_ITEM_TABLE: + +.. _class_RichTextLabel_constant_ITEM_FADE: + +.. _class_RichTextLabel_constant_ITEM_SHAKE: + +.. _class_RichTextLabel_constant_ITEM_WAVE: + +.. _class_RichTextLabel_constant_ITEM_TORNADO: + +.. _class_RichTextLabel_constant_ITEM_RAINBOW: + +.. _class_RichTextLabel_constant_ITEM_CUSTOMFX: + +.. _class_RichTextLabel_constant_ITEM_META: + +enum **ItemType**: + +- **ITEM_FRAME** = **0** + +- **ITEM_TEXT** = **1** + +- **ITEM_IMAGE** = **2** + +- **ITEM_NEWLINE** = **3** + +- **ITEM_FONT** = **4** + +- **ITEM_COLOR** = **5** + +- **ITEM_UNDERLINE** = **6** + +- **ITEM_STRIKETHROUGH** = **7** + +- **ITEM_ALIGN** = **8** + +- **ITEM_INDENT** = **9** + +- **ITEM_LIST** = **10** + +- **ITEM_TABLE** = **11** + +- **ITEM_FADE** = **12** + +- **ITEM_SHAKE** = **13** + +- **ITEM_WAVE** = **14** + +- **ITEM_TORNADO** = **15** + +- **ITEM_RAINBOW** = **16** + +- **ITEM_CUSTOMFX** = **18** + +- **ITEM_META** = **17** + +Property Descriptions +--------------------- + +.. _class_RichTextLabel_property_bbcode_enabled: + +- :ref:`bool` **bbcode_enabled** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_use_bbcode(value) | ++-----------+-----------------------+ +| *Getter* | is_using_bbcode() | ++-----------+-----------------------+ + +If ``true``, the label uses BBCode formatting. + +**Note:** Trying to alter the ``RichTextLabel``'s text with :ref:`add_text` will reset this to ``false``. Use instead :ref:`append_bbcode` to preserve BBCode formatting. + +---- + +.. _class_RichTextLabel_property_bbcode_text: + +- :ref:`String` **bbcode_text** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_bbcode(value) | ++-----------+-------------------+ +| *Getter* | get_bbcode() | ++-----------+-------------------+ + +The label's text in BBCode format. Is not representative of manual modifications to the internal tag stack. Erases changes made by other methods when edited. + +**Note:** It is unadvised to use the ``+=`` operator with ``bbcode_text`` (e.g. ``bbcode_text += "some string"``) as it replaces the whole text and can cause slowdowns. It will also erase all BBCode that was added to stack using ``push_*`` methods. Use :ref:`append_bbcode` for adding text instead, unless you absolutely need to close a tag that was opened in an earlier method call. + +---- + +.. _class_RichTextLabel_property_custom_effects: + +- :ref:`Array` **custom_effects** + ++-----------+--------------------+ +| *Default* | ``[ ]`` | ++-----------+--------------------+ +| *Setter* | set_effects(value) | ++-----------+--------------------+ +| *Getter* | get_effects() | ++-----------+--------------------+ + +The currently installed custom effects. This is an array of :ref:`RichTextEffect`\ s. + +To add a custom effect, it's more convenient to use :ref:`install_effect`. + +---- + +.. _class_RichTextLabel_property_fit_content_height: + +- :ref:`bool` **fit_content_height** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_fit_content_height(value) | ++-----------+---------------------------------+ +| *Getter* | is_fit_content_height_enabled() | ++-----------+---------------------------------+ + +If ``true``, the label's height will be automatically updated to fit its content. + +**Note:** This property is used as a workaround to fix issues with ``RichTextLabel`` in :ref:`Container`\ s, but it's unreliable in some cases and will be removed in future versions. + +---- + +.. _class_RichTextLabel_property_meta_underlined: + +- :ref:`bool` **meta_underlined** + ++-----------+---------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------+ +| *Setter* | set_meta_underline(value) | ++-----------+---------------------------+ +| *Getter* | is_meta_underlined() | ++-----------+---------------------------+ + +If ``true``, the label underlines meta tags such as ``[url]{text}[/url]``. + +---- + +.. _class_RichTextLabel_property_override_selected_font_color: + +- :ref:`bool` **override_selected_font_color** + ++-----------+-----------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------+ +| *Setter* | set_override_selected_font_color(value) | ++-----------+-----------------------------------------+ +| *Getter* | is_overriding_selected_font_color() | ++-----------+-----------------------------------------+ + +If ``true``, the label uses the custom font color. + +---- + +.. _class_RichTextLabel_property_percent_visible: + +- :ref:`float` **percent_visible** + ++-----------+----------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------+ +| *Setter* | set_percent_visible(value) | ++-----------+----------------------------+ +| *Getter* | get_percent_visible() | ++-----------+----------------------------+ + +The range of characters to display, as a :ref:`float` between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0. + +**Note:** Setting this property updates :ref:`visible_characters` based on current :ref:`get_total_character_count`. + +---- + +.. _class_RichTextLabel_property_scroll_active: + +- :ref:`bool` **scroll_active** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_scroll_active(value) | ++-----------+--------------------------+ +| *Getter* | is_scroll_active() | ++-----------+--------------------------+ + +If ``true``, the scrollbar is visible. Setting this to ``false`` does not block scrolling completely. See :ref:`scroll_to_line`. + +---- + +.. _class_RichTextLabel_property_scroll_following: + +- :ref:`bool` **scroll_following** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_scroll_follow(value) | ++-----------+--------------------------+ +| *Getter* | is_scroll_following() | ++-----------+--------------------------+ + +If ``true``, the window scrolls down to display new content automatically. + +---- + +.. _class_RichTextLabel_property_selection_enabled: + +- :ref:`bool` **selection_enabled** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_selection_enabled(value) | ++-----------+------------------------------+ +| *Getter* | is_selection_enabled() | ++-----------+------------------------------+ + +If ``true``, the label allows text selection. + +---- + +.. _class_RichTextLabel_property_tab_size: + +- :ref:`int` **tab_size** + ++-----------+---------------------+ +| *Default* | ``4`` | ++-----------+---------------------+ +| *Setter* | set_tab_size(value) | ++-----------+---------------------+ +| *Getter* | get_tab_size() | ++-----------+---------------------+ + +The number of spaces associated with a single tab length. Does not affect ``\t`` in text tags, only indent tags. + +---- + +.. _class_RichTextLabel_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +The raw text of the label. + +When set, clears the tag stack and adds a raw text tag to the top of it. Does not parse BBCodes. Does not modify :ref:`bbcode_text`. + +---- + +.. _class_RichTextLabel_property_visible_characters: + +- :ref:`int` **visible_characters** + ++-----------+-------------------------------+ +| *Default* | ``-1`` | ++-----------+-------------------------------+ +| *Setter* | set_visible_characters(value) | ++-----------+-------------------------------+ +| *Getter* | get_visible_characters() | ++-----------+-------------------------------+ + +The restricted number of characters to display in the label. If ``-1``, all characters will be displayed. + +**Note:** Setting this property updates :ref:`percent_visible` based on current :ref:`get_total_character_count`. + +Method Descriptions +------------------- + +.. _class_RichTextLabel_method_add_image: + +- void **add_image** **(** :ref:`Texture` image, :ref:`int` width=0, :ref:`int` height=0 **)** + +Adds an image's opening and closing tags to the tag stack, optionally providing a ``width`` and ``height`` to resize the image. + +If ``width`` or ``height`` is set to 0, the image size will be adjusted in order to keep the original aspect ratio. + +---- + +.. _class_RichTextLabel_method_add_text: + +- void **add_text** **(** :ref:`String` text **)** + +Adds raw non-BBCode-parsed text to the tag stack. + +---- + +.. _class_RichTextLabel_method_append_bbcode: + +- :ref:`Error` **append_bbcode** **(** :ref:`String` bbcode **)** + +Parses ``bbcode`` and adds tags to the tag stack as needed. Returns the result of the parsing, :ref:`@GlobalScope.OK` if successful. + +**Note:** Using this method, you can't close a tag that was opened in a previous :ref:`append_bbcode` call. This is done to improve performance, especially when updating large RichTextLabels since rebuilding the whole BBCode every time would be slower. If you absolutely need to close a tag in a future method call, append the :ref:`bbcode_text` instead of using :ref:`append_bbcode`. + +---- + +.. _class_RichTextLabel_method_clear: + +- void **clear** **(** **)** + +Clears the tag stack and sets :ref:`bbcode_text` to an empty string. + +---- + +.. _class_RichTextLabel_method_get_content_height: + +- :ref:`int` **get_content_height** **(** **)** |const| + +Returns the height of the content. + +---- + +.. _class_RichTextLabel_method_get_line_count: + +- :ref:`int` **get_line_count** **(** **)** |const| + +Returns the total number of newlines in the tag stack's text tags. Considers wrapped text as one line. + +---- + +.. _class_RichTextLabel_method_get_total_character_count: + +- :ref:`int` **get_total_character_count** **(** **)** |const| + +Returns the total number of characters from text tags. Does not include BBCodes. + +---- + +.. _class_RichTextLabel_method_get_v_scroll: + +- :ref:`VScrollBar` **get_v_scroll** **(** **)** + +Returns the vertical scrollbar. + +**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` property. + +---- + +.. _class_RichTextLabel_method_get_visible_line_count: + +- :ref:`int` **get_visible_line_count** **(** **)** |const| + +Returns the number of visible lines. + +---- + +.. _class_RichTextLabel_method_install_effect: + +- void **install_effect** **(** :ref:`Variant` effect **)** + +Installs a custom effect. ``effect`` should be a valid :ref:`RichTextEffect`. + +---- + +.. _class_RichTextLabel_method_newline: + +- void **newline** **(** **)** + +Adds a newline tag to the tag stack. + +---- + +.. _class_RichTextLabel_method_parse_bbcode: + +- :ref:`Error` **parse_bbcode** **(** :ref:`String` bbcode **)** + +The assignment version of :ref:`append_bbcode`. Clears the tag stack and inserts the new content. Returns :ref:`@GlobalScope.OK` if parses ``bbcode`` successfully. + +---- + +.. _class_RichTextLabel_method_parse_expressions_for_values: + +- :ref:`Dictionary` **parse_expressions_for_values** **(** :ref:`PoolStringArray` expressions **)** + +Parses BBCode parameter ``expressions`` into a dictionary. + +---- + +.. _class_RichTextLabel_method_pop: + +- void **pop** **(** **)** + +Terminates the current tag. Use after ``push_*`` methods to close BBCodes manually. Does not need to follow ``add_*`` methods. + +---- + +.. _class_RichTextLabel_method_push_align: + +- void **push_align** **(** :ref:`Align` align **)** + +Adds an ``[align]`` tag based on the given ``align`` value. See :ref:`Align` for possible values. + +---- + +.. _class_RichTextLabel_method_push_bold: + +- void **push_bold** **(** **)** + +Adds a ``[font]`` tag with a bold font to the tag stack. This is the same as adding a ``[b]`` tag if not currently in a ``[i]`` tag. + +---- + +.. _class_RichTextLabel_method_push_bold_italics: + +- void **push_bold_italics** **(** **)** + +Adds a ``[font]`` tag with a bold italics font to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_cell: + +- void **push_cell** **(** **)** + +Adds a ``[cell]`` tag to the tag stack. Must be inside a ``[table]`` tag. See :ref:`push_table` for details. + +---- + +.. _class_RichTextLabel_method_push_color: + +- void **push_color** **(** :ref:`Color` color **)** + +Adds a ``[color]`` tag to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_font: + +- void **push_font** **(** :ref:`Font` font **)** + +Adds a ``[font]`` tag to the tag stack. Overrides default fonts for its duration. + +---- + +.. _class_RichTextLabel_method_push_indent: + +- void **push_indent** **(** :ref:`int` level **)** + +Adds an ``[indent]`` tag to the tag stack. Multiplies ``level`` by current :ref:`tab_size` to determine new margin length. + +---- + +.. _class_RichTextLabel_method_push_italics: + +- void **push_italics** **(** **)** + +Adds a ``[font]`` tag with a italics font to the tag stack. This is the same as adding a ``[i]`` tag if not currently in a ``[b]`` tag. + +---- + +.. _class_RichTextLabel_method_push_list: + +- void **push_list** **(** :ref:`ListType` type **)** + +Adds a ``[list]`` tag to the tag stack. Similar to the BBCodes ``[ol]`` or ``[ul]``, but supports more list types. Not fully implemented! + +---- + +.. _class_RichTextLabel_method_push_meta: + +- void **push_meta** **(** :ref:`Variant` data **)** + +Adds a ``[meta]`` tag to the tag stack. Similar to the BBCode ``[url=something]{text}[/url]``, but supports non-:ref:`String` metadata types. + +---- + +.. _class_RichTextLabel_method_push_mono: + +- void **push_mono** **(** **)** + +Adds a ``[font]`` tag with a monospace font to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_normal: + +- void **push_normal** **(** **)** + +Adds a ``[font]`` tag with a normal font to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_strikethrough: + +- void **push_strikethrough** **(** **)** + +Adds a ``[s]`` tag to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_table: + +- void **push_table** **(** :ref:`int` columns **)** + +Adds a ``[table=columns]`` tag to the tag stack. + +---- + +.. _class_RichTextLabel_method_push_underline: + +- void **push_underline** **(** **)** + +Adds a ``[u]`` tag to the tag stack. + +---- + +.. _class_RichTextLabel_method_remove_line: + +- :ref:`bool` **remove_line** **(** :ref:`int` line **)** + +Removes a line of content from the label. Returns ``true`` if the line exists. + +The ``line`` argument is the index of the line to remove, it can take values in the interval ``[0, get_line_count() - 1]``. + +---- + +.. _class_RichTextLabel_method_scroll_to_line: + +- void **scroll_to_line** **(** :ref:`int` line **)** + +Scrolls the window's top line to match ``line``. + +---- + +.. _class_RichTextLabel_method_set_table_column_expand: + +- void **set_table_column_expand** **(** :ref:`int` column, :ref:`bool` expand, :ref:`int` ratio **)** + +Edits the selected column's expansion options. If ``expand`` is ``true``, the column expands in proportion to its expansion ratio versus the other columns' ratios. + +For example, 2 columns with ratios 3 and 4 plus 70 pixels in available width would expand 30 and 40 pixels, respectively. + +If ``expand`` is ``false``, the column will not contribute to the total ratio. + +Theme Property Descriptions +--------------------------- + +.. _class_RichTextLabel_theme_color_default_color: + +- :ref:`Color` **default_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +The default text color. + +---- + +.. _class_RichTextLabel_theme_color_font_color_selected: + +- :ref:`Color` **font_color_selected** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++-----------+----------------------------------+ + +The color of selected text, used when :ref:`selection_enabled` is ``true``. + +---- + +.. _class_RichTextLabel_theme_color_font_color_shadow: + +- :ref:`Color` **font_color_shadow** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ + +The color of the font's shadow. + +---- + +.. _class_RichTextLabel_theme_color_selection_color: + +- :ref:`Color` **selection_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.1, 0.1, 1, 0.8 )`` | ++-----------+-------------------------------+ + +The color of the selection box. + +---- + +.. _class_RichTextLabel_theme_constant_line_separation: + +- :ref:`int` **line_separation** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The vertical space between lines. + +---- + +.. _class_RichTextLabel_theme_constant_shadow_as_outline: + +- :ref:`int` **shadow_as_outline** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Boolean value. If 1 (``true``), the shadow will be displayed around the whole text as an outline. + +---- + +.. _class_RichTextLabel_theme_constant_shadow_offset_x: + +- :ref:`int` **shadow_offset_x** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The horizontal offset of the font's shadow. + +---- + +.. _class_RichTextLabel_theme_constant_shadow_offset_y: + +- :ref:`int` **shadow_offset_y** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +The vertical offset of the font's shadow. + +---- + +.. _class_RichTextLabel_theme_constant_table_hseparation: + +- :ref:`int` **table_hseparation** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The horizontal separation of elements in a table. + +---- + +.. _class_RichTextLabel_theme_constant_table_vseparation: + +- :ref:`int` **table_vseparation** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The vertical separation of elements in a table. + +---- + +.. _class_RichTextLabel_theme_font_bold_font: + +- :ref:`Font` **bold_font** + +The font used for bold text. + +---- + +.. _class_RichTextLabel_theme_font_bold_italics_font: + +- :ref:`Font` **bold_italics_font** + +The font used for bold italics text. + +---- + +.. _class_RichTextLabel_theme_font_italics_font: + +- :ref:`Font` **italics_font** + +The font used for italics text. + +---- + +.. _class_RichTextLabel_theme_font_mono_font: + +- :ref:`Font` **mono_font** + +The font used for monospace text. + +---- + +.. _class_RichTextLabel_theme_font_normal_font: + +- :ref:`Font` **normal_font** + +The default text font. + +---- + +.. _class_RichTextLabel_theme_style_focus: + +- :ref:`StyleBox` **focus** + +The background The background used when the ``RichTextLabel`` is focused. + +---- + +.. _class_RichTextLabel_theme_style_normal: + +- :ref:`StyleBox` **normal** + +The normal background for the ``RichTextLabel``. + +.. |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.)` diff --git a/classes/class_rid.rst b/classes/class_rid.rst new file mode 100644 index 0000000..15623cc --- /dev/null +++ b/classes/class_rid.rst @@ -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 RID.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RID: + +RID +=== + +Handle for a :ref:`Resource`'s unique ID. + +Description +----------- + +The RID type is used to access the unique integer ID of a resource. They are opaque, which means they do not grant access to the associated resource by themselves. They are used by and with the low-level Server classes such as :ref:`VisualServer`. + +Methods +------- + ++-----------------------+-------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`RID` **(** :ref:`Object` from **)** | ++-----------------------+-------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_id` **(** **)** | ++-----------------------+-------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_RID_method_RID: + +- :ref:`RID` **RID** **(** :ref:`Object` from **)** + +Creates a new RID instance with the ID of a given resource. When not handed a valid resource, silently stores the unused ID 0. + +---- + +.. _class_RID_method_get_id: + +- :ref:`int` **get_id** **(** **)** + +Returns the ID of the referenced resource. + +.. |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.)` diff --git a/classes/class_rigidbody.rst b/classes/class_rigidbody.rst new file mode 100644 index 0000000..640906c --- /dev/null +++ b/classes/class_rigidbody.rst @@ -0,0 +1,696 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RigidBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RigidBody: + +RigidBody +========= + +**Inherits:** :ref:`PhysicsBody` **<** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`VehicleBody` + +Physics Body whose position is determined through physics simulation in 3D space. + +Description +----------- + +This is the node that implements full 3D physics. This means that you do not control a RigidBody directly. Instead, you can apply forces to it (gravity, impulses, etc.), and the physics simulation will calculate the resulting movement, collision, bouncing, rotating, etc. + +A RigidBody has 4 behavior :ref:`mode`\ s: Rigid, Static, Character, and Kinematic. + +**Note:** Don't change a RigidBody's position every frame or very often. Sporadic changes work fine, but physics runs at a different granularity (fixed Hz) than usual rendering (process callback) and maybe even in a separate thread, so changing this from a process loop may result in strange behavior. If you need to directly affect the body's state, use :ref:`_integrate_forces`, which allows you to directly access the physics state. + +If you need to override the default physics behavior, you can write a custom force integration function. See :ref:`custom_integrator`. + +With Bullet physics (the default), the center of mass is the RigidBody3D center. With GodotPhysics, the center of mass is the average of the :ref:`CollisionShape` centers. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +- `3D Truck Town Demo `__ + +- `3D Physics Tests Demo `__ + +Properties +---------- + ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`angular_damp` | ``-1.0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`angular_velocity` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_angular_x` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_angular_y` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_angular_z` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_linear_x` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_linear_y` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`axis_lock_linear_z` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`bounce` | | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`can_sleep` | ``true`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`contact_monitor` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`int` | :ref:`contacts_reported` | ``0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`continuous_cd` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`custom_integrator` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`friction` | | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`gravity_scale` | ``1.0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`linear_damp` | ``-1.0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`linear_velocity` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`mass` | ``1.0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`PhysicsMaterial` | :ref:`physics_material_override` | | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`bool` | :ref:`sleeping` | ``false`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`weight` | ``9.8`` | ++-----------------------------------------------+--------------------------------------------------------------------------------------+------------------------+ + +Methods +------- + ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_integrate_forces` **(** :ref:`PhysicsDirectBodyState` state **)** |virtual| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_central_force` **(** :ref:`Vector3` force **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_force` **(** :ref:`Vector3` force, :ref:`Vector3` position **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_torque` **(** :ref:`Vector3` torque **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_central_impulse` **(** :ref:`Vector3` impulse **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_impulse` **(** :ref:`Vector3` position, :ref:`Vector3` impulse **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_torque_impulse` **(** :ref:`Vector3` impulse **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_axis_lock` **(** :ref:`BodyAxis` axis **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_colliding_bodies` **(** **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`get_inverse_inertia_tensor` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_lock` **(** :ref:`BodyAxis` axis, :ref:`bool` lock **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_velocity` **(** :ref:`Vector3` axis_velocity **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_RigidBody_signal_body_entered: + +- **body_entered** **(** :ref:`Node` body **)** + +Emitted when a collision with another :ref:`PhysicsBody` or :ref:`GridMap` occurs. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +---- + +.. _class_RigidBody_signal_body_exited: + +- **body_exited** **(** :ref:`Node` body **)** + +Emitted when the collision with another :ref:`PhysicsBody` or :ref:`GridMap` ends. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +---- + +.. _class_RigidBody_signal_body_shape_entered: + +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of this RigidBody's :ref:`Shape`\ s collides with another :ref:`PhysicsBody` or :ref:`GridMap`'s :ref:`Shape`\ s. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body_rid`` the :ref:`RID` of the other :ref:`PhysicsBody` or :ref:`MeshLibrary`'s :ref:`CollisionObject` used by the :ref:`PhysicsServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +``body_shape_index`` the index of the :ref:`Shape` of the other :ref:`PhysicsBody` or :ref:`GridMap` used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this RigidBody used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``self.shape_owner_get_owner(local_shape_index)``. + +**Note:** Bullet physics cannot identify the shape index when using a :ref:`ConcavePolygonShape`. Don't use multiple :ref:`CollisionShape`\ s when using a :ref:`ConcavePolygonShape` with Bullet physics if you need shape indices. + +---- + +.. _class_RigidBody_signal_body_shape_exited: + +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when the collision between one of this RigidBody's :ref:`Shape`\ s and another :ref:`PhysicsBody` or :ref:`GridMap`'s :ref:`Shape`\ s ends. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`GridMap`\ s are detected if the :ref:`MeshLibrary` has Collision :ref:`Shape`\ s. + +``body_rid`` the :ref:`RID` of the other :ref:`PhysicsBody` or :ref:`MeshLibrary`'s :ref:`CollisionObject` used by the :ref:`PhysicsServer`. :ref:`GridMap`\ s are detected if the Meshes have :ref:`Shape`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody` or :ref:`GridMap`. + +``body_shape_index`` the index of the :ref:`Shape` of the other :ref:`PhysicsBody` or :ref:`GridMap` used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape` of this RigidBody used by the :ref:`PhysicsServer`. Get the :ref:`CollisionShape` node with ``self.shape_owner_get_owner(local_shape_index)``. + +**Note:** Bullet physics cannot identify the shape index when using a :ref:`ConcavePolygonShape`. Don't use multiple :ref:`CollisionShape`\ s when using a :ref:`ConcavePolygonShape` with Bullet physics if you need shape indices. + +---- + +.. _class_RigidBody_signal_sleeping_state_changed: + +- **sleeping_state_changed** **(** **)** + +Emitted when the physics engine changes the body's sleeping state. + +**Note:** Changing the value :ref:`sleeping` will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or ``emit_signal("sleeping_state_changed")`` is used. + +Enumerations +------------ + +.. _enum_RigidBody_Mode: + +.. _class_RigidBody_constant_MODE_RIGID: + +.. _class_RigidBody_constant_MODE_STATIC: + +.. _class_RigidBody_constant_MODE_CHARACTER: + +.. _class_RigidBody_constant_MODE_KINEMATIC: + +enum **Mode**: + +- **MODE_RIGID** = **0** --- Rigid body mode. This is the "natural" state of a rigid body. It is affected by forces, and can move, rotate, and be affected by user code. + +- **MODE_STATIC** = **1** --- Static mode. The body behaves like a :ref:`StaticBody`, and can only move by user code. + +- **MODE_CHARACTER** = **2** --- Character body mode. This behaves like a rigid body, but can not rotate. + +- **MODE_KINEMATIC** = **3** --- Kinematic body mode. The body behaves like a :ref:`KinematicBody`, and can only move by user code. + +Property Descriptions +--------------------- + +.. _class_RigidBody_property_angular_damp: + +- :ref:`float` **angular_damp** + ++-----------+-------------------------+ +| *Default* | ``-1.0`` | ++-----------+-------------------------+ +| *Setter* | set_angular_damp(value) | ++-----------+-------------------------+ +| *Getter* | get_angular_damp() | ++-----------+-------------------------+ + +Damps RigidBody's rotational forces. + +See :ref:`ProjectSettings.physics/3d/default_angular_damp` for more details about damping. + +---- + +.. _class_RigidBody_property_angular_velocity: + +- :ref:`Vector3` **angular_velocity** + ++-----------+-----------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++-----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++-----------+-----------------------------+ + +The body's rotational velocity in axis-angle format. The magnitude of the vector is the rotation rate in *radians* per second. + +---- + +.. _class_RigidBody_property_axis_lock_angular_x: + +- :ref:`bool` **axis_lock_angular_x** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's rotation in the X axis. + +---- + +.. _class_RigidBody_property_axis_lock_angular_y: + +- :ref:`bool` **axis_lock_angular_y** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's rotation in the Y axis. + +---- + +.. _class_RigidBody_property_axis_lock_angular_z: + +- :ref:`bool` **axis_lock_angular_z** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's rotation in the Z axis. + +---- + +.. _class_RigidBody_property_axis_lock_linear_x: + +- :ref:`bool` **axis_lock_linear_x** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's movement in the X axis. + +---- + +.. _class_RigidBody_property_axis_lock_linear_y: + +- :ref:`bool` **axis_lock_linear_y** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's movement in the Y axis. + +---- + +.. _class_RigidBody_property_axis_lock_linear_z: + +- :ref:`bool` **axis_lock_linear_z** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_axis_lock(value) | ++-----------+----------------------+ +| *Getter* | get_axis_lock() | ++-----------+----------------------+ + +Lock the body's movement in the Z axis. + +---- + +.. _class_RigidBody_property_bounce: + +- :ref:`float` **bounce** + ++----------+-------------------+ +| *Setter* | set_bounce(value) | ++----------+-------------------+ +| *Getter* | get_bounce() | ++----------+-------------------+ + +The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness). + +Deprecated, use :ref:`PhysicsMaterial.bounce` instead via :ref:`physics_material_override`. + +---- + +.. _class_RigidBody_property_can_sleep: + +- :ref:`bool` **can_sleep** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_can_sleep(value) | ++-----------+----------------------+ +| *Getter* | is_able_to_sleep() | ++-----------+----------------------+ + +If ``true``, the body can enter sleep mode when there is no movement. See :ref:`sleeping`. + +**Note:** A RigidBody3D will never enter sleep mode automatically if its :ref:`mode` is :ref:`MODE_CHARACTER`. It can still be put to sleep manually by setting its :ref:`sleeping` property to ``true``. + +---- + +.. _class_RigidBody_property_contact_monitor: + +- :ref:`bool` **contact_monitor** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_contact_monitor(value) | ++-----------+------------------------------+ +| *Getter* | is_contact_monitor_enabled() | ++-----------+------------------------------+ + +If ``true``, the RigidBody will emit signals when it collides with another RigidBody. See also :ref:`contacts_reported`. + +---- + +.. _class_RigidBody_property_contacts_reported: + +- :ref:`int` **contacts_reported** + ++-----------+----------------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------------+ +| *Setter* | set_max_contacts_reported(value) | ++-----------+----------------------------------+ +| *Getter* | get_max_contacts_reported() | ++-----------+----------------------------------+ + +The maximum number of contacts that will be recorded. Requires :ref:`contact_monitor` to be set to ``true``. + +**Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end), and collisions between parallel faces will result in four contacts (one at each corner). + +---- + +.. _class_RigidBody_property_continuous_cd: + +- :ref:`bool` **continuous_cd** + ++-----------+-----------------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------------+ +| *Setter* | set_use_continuous_collision_detection(value) | ++-----------+-----------------------------------------------+ +| *Getter* | is_using_continuous_collision_detection() | ++-----------+-----------------------------------------------+ + +If ``true``, continuous collision detection is used. + +Continuous collision detection tries to predict where a moving body will collide, instead of moving it and correcting its movement if it collided. Continuous collision detection is more precise, and misses fewer impacts by small, fast-moving objects. Not using continuous collision detection is faster to compute, but can miss small, fast-moving objects. + +---- + +.. _class_RigidBody_property_custom_integrator: + +- :ref:`bool` **custom_integrator** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_use_custom_integrator(value) | ++-----------+----------------------------------+ +| *Getter* | is_using_custom_integrator() | ++-----------+----------------------------------+ + +If ``true``, internal force integration will be disabled (like gravity or air friction) for this body. Other than collision response, the body will only move as determined by the :ref:`_integrate_forces` function, if defined. + +---- + +.. _class_RigidBody_property_friction: + +- :ref:`float` **friction** + ++----------+---------------------+ +| *Setter* | set_friction(value) | ++----------+---------------------+ +| *Getter* | get_friction() | ++----------+---------------------+ + +The body's friction, from 0 (frictionless) to 1 (max friction). + +Deprecated, use :ref:`PhysicsMaterial.friction` instead via :ref:`physics_material_override`. + +---- + +.. _class_RigidBody_property_gravity_scale: + +- :ref:`float` **gravity_scale** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_gravity_scale(value) | ++-----------+--------------------------+ +| *Getter* | get_gravity_scale() | ++-----------+--------------------------+ + +This is multiplied by the global 3D gravity setting found in **Project > Project Settings > Physics > 3d** to produce RigidBody's gravity. For example, a value of 1 will be normal gravity, 2 will apply double gravity, and 0.5 will apply half gravity to this object. + +---- + +.. _class_RigidBody_property_linear_damp: + +- :ref:`float` **linear_damp** + ++-----------+------------------------+ +| *Default* | ``-1.0`` | ++-----------+------------------------+ +| *Setter* | set_linear_damp(value) | ++-----------+------------------------+ +| *Getter* | get_linear_damp() | ++-----------+------------------------+ + +The body's linear damp. Cannot be less than -1.0. If this value is different from -1.0, any linear damp derived from the world or areas will be overridden. + +See :ref:`ProjectSettings.physics/3d/default_linear_damp` for more details about damping. + +---- + +.. _class_RigidBody_property_linear_velocity: + +- :ref:`Vector3` **linear_velocity** + ++-----------+----------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++-----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++-----------+----------------------------+ + +The body's linear velocity in units per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use :ref:`_integrate_forces` as your process loop for precise control of the body state. + +---- + +.. _class_RigidBody_property_mass: + +- :ref:`float` **mass** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_mass(value) | ++-----------+-----------------+ +| *Getter* | get_mass() | ++-----------+-----------------+ + +The body's mass. + +---- + +.. _class_RigidBody_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The body mode. See :ref:`Mode` for possible values. + +---- + +.. _class_RigidBody_property_physics_material_override: + +- :ref:`PhysicsMaterial` **physics_material_override** + ++----------+--------------------------------------+ +| *Setter* | set_physics_material_override(value) | ++----------+--------------------------------------+ +| *Getter* | get_physics_material_override() | ++----------+--------------------------------------+ + +The physics material override for the body. + +If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + +---- + +.. _class_RigidBody_property_sleeping: + +- :ref:`bool` **sleeping** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_sleeping(value) | ++-----------+---------------------+ +| *Getter* | is_sleeping() | ++-----------+---------------------+ + +If ``true``, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the :ref:`apply_impulse` or :ref:`add_force` methods. + +---- + +.. _class_RigidBody_property_weight: + +- :ref:`float` **weight** + ++-----------+-------------------+ +| *Default* | ``9.8`` | ++-----------+-------------------+ +| *Setter* | set_weight(value) | ++-----------+-------------------+ +| *Getter* | get_weight() | ++-----------+-------------------+ + +The body's weight based on its mass and the global 3D gravity. Global values are set in **Project > Project Settings > Physics > 3d**. + +Method Descriptions +------------------- + +.. _class_RigidBody_method__integrate_forces: + +- void **_integrate_forces** **(** :ref:`PhysicsDirectBodyState` state **)** |virtual| + +Called during physics processing, allowing you to read and safely modify the simulation state for the object. By default, it works in addition to the usual physics behavior, but the :ref:`custom_integrator` property allows you to disable the default behavior and do fully custom force integration for a body. + +---- + +.. _class_RigidBody_method_add_central_force: + +- void **add_central_force** **(** :ref:`Vector3` force **)** + +Adds a constant directional force (i.e. acceleration) without affecting rotation. + +This is equivalent to ``add_force(force, Vector3(0,0,0))``. + +---- + +.. _class_RigidBody_method_add_force: + +- void **add_force** **(** :ref:`Vector3` force, :ref:`Vector3` position **)** + +Adds a constant directional force (i.e. acceleration). + +The position uses the rotation of the global coordinate system, but is centered at the object's origin. + +---- + +.. _class_RigidBody_method_add_torque: + +- void **add_torque** **(** :ref:`Vector3` torque **)** + +Adds a constant rotational force (i.e. a motor) without affecting position. + +---- + +.. _class_RigidBody_method_apply_central_impulse: + +- void **apply_central_impulse** **(** :ref:`Vector3` impulse **)** + +Applies a directional impulse without affecting rotation. + +This is equivalent to ``apply_impulse(Vector3(0,0,0), impulse)``. + +---- + +.. _class_RigidBody_method_apply_impulse: + +- void **apply_impulse** **(** :ref:`Vector3` position, :ref:`Vector3` impulse **)** + +Applies a positioned impulse to the body. An impulse is time independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts. The position uses the rotation of the global coordinate system, but is centered at the object's origin. + +---- + +.. _class_RigidBody_method_apply_torque_impulse: + +- void **apply_torque_impulse** **(** :ref:`Vector3` impulse **)** + +Applies a torque impulse which will be affected by the body mass and shape. This will rotate the body around the ``impulse`` vector passed. + +---- + +.. _class_RigidBody_method_get_axis_lock: + +- :ref:`bool` **get_axis_lock** **(** :ref:`BodyAxis` axis **)** |const| + +Returns ``true`` if the specified linear or rotational axis is locked. + +---- + +.. _class_RigidBody_method_get_colliding_bodies: + +- :ref:`Array` **get_colliding_bodies** **(** **)** |const| + +Returns a list of the bodies colliding with this one. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. + +**Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. + +---- + +.. _class_RigidBody_method_get_inverse_inertia_tensor: + +- :ref:`Basis` **get_inverse_inertia_tensor** **(** **)** + +Returns the inverse inertia tensor basis. This is used to calculate the angular acceleration resulting from a torque applied to the RigidBody. + +---- + +.. _class_RigidBody_method_set_axis_lock: + +- void **set_axis_lock** **(** :ref:`BodyAxis` axis, :ref:`bool` lock **)** + +Locks the specified linear or rotational axis. + +---- + +.. _class_RigidBody_method_set_axis_velocity: + +- void **set_axis_velocity** **(** :ref:`Vector3` axis_velocity **)** + +Sets an axis velocity. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + +.. |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.)` diff --git a/classes/class_rigidbody2d.rst b/classes/class_rigidbody2d.rst new file mode 100644 index 0000000..9b90fbf --- /dev/null +++ b/classes/class_rigidbody2d.rst @@ -0,0 +1,626 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RigidBody2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RigidBody2D: + +RigidBody2D +=========== + +**Inherits:** :ref:`PhysicsBody2D` **<** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +A body that is controlled by the 2D physics engine. + +Description +----------- + +This node implements simulated 2D physics. You do not control a RigidBody2D directly. Instead, you apply forces to it (gravity, impulses, etc.) and the physics simulation calculates the resulting movement based on its mass, friction, and other physical properties. + +A RigidBody2D has 4 behavior :ref:`mode`\ s: Rigid, Static, Character, and Kinematic. + +**Note:** You should not change a RigidBody2D's ``position`` or ``linear_velocity`` every frame or even very often. If you need to directly affect the body's state, use :ref:`_integrate_forces`, which allows you to directly access the physics state. + +Please also keep in mind that physics bodies manage their own transform which overwrites the ones you set. So any direct or indirect transformation (including scaling of the node or its parent) will be visible in the editor only, and immediately reset at runtime. + +If you need to override the default physics behavior or add a transformation at runtime, you can write a custom force integration. See :ref:`custom_integrator`. + +The center of mass is always located at the node's origin without taking into account the :ref:`CollisionShape2D` centroid offsets. + +Tutorials +--------- + +- `2D Physics Platformer Demo `__ + +- `Instancing Demo `__ + +Properties +---------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`angular_damp` | ``-1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`angular_velocity` | ``0.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`applied_force` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`applied_torque` | ``0.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`bounce` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`can_sleep` | ``true`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`contact_monitor` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`contacts_reported` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`CCDMode` | :ref:`continuous_cd` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`custom_integrator` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`friction` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`gravity_scale` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`inertia` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`linear_damp` | ``-1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`linear_velocity` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`mass` | ``1.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`PhysicsMaterial` | :ref:`physics_material_override` | | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`sleeping` | ``false`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`weight` | ``9.8`` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`_integrate_forces` **(** :ref:`Physics2DDirectBodyState` state **)** |virtual| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_central_force` **(** :ref:`Vector2` force **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_force` **(** :ref:`Vector2` offset, :ref:`Vector2` force **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_torque` **(** :ref:`float` torque **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_central_impulse` **(** :ref:`Vector2` impulse **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_impulse` **(** :ref:`Vector2` offset, :ref:`Vector2` impulse **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`apply_torque_impulse` **(** :ref:`float` torque **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_colliding_bodies` **(** **)** |const| | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_axis_velocity` **(** :ref:`Vector2` axis_velocity **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`test_motion` **(** :ref:`Vector2` motion, :ref:`bool` infinite_inertia=true, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=null **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_RigidBody2D_signal_body_entered: + +- **body_entered** **(** :ref:`Node` body **)** + +Emitted when a collision with another :ref:`PhysicsBody2D` or :ref:`TileMap` occurs. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +---- + +.. _class_RigidBody2D_signal_body_exited: + +- **body_exited** **(** :ref:`Node` body **)** + +Emitted when the collision with another :ref:`PhysicsBody2D` or :ref:`TileMap` ends. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +---- + +.. _class_RigidBody2D_signal_body_shape_entered: + +- **body_shape_entered** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when one of this RigidBody2D's :ref:`Shape2D`\ s collides with another :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body_rid`` the :ref:`RID` of the other :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape_index`` the index of the :ref:`Shape2D` of the other :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this RigidBody2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_RigidBody2D_signal_body_shape_exited: + +- **body_shape_exited** **(** :ref:`RID` body_rid, :ref:`Node` body, :ref:`int` body_shape_index, :ref:`int` local_shape_index **)** + +Emitted when the collision between one of this RigidBody2D's :ref:`Shape2D`\ s and another :ref:`PhysicsBody2D` or :ref:`TileMap`'s :ref:`Shape2D`\ s ends. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. :ref:`TileMap`\ s are detected if the :ref:`TileSet` has Collision :ref:`Shape2D`\ s. + +``body_rid`` the :ref:`RID` of the other :ref:`PhysicsBody2D` or :ref:`TileSet`'s :ref:`CollisionObject2D` used by the :ref:`Physics2DServer`. + +``body`` the :ref:`Node`, if it exists in the tree, of the other :ref:`PhysicsBody2D` or :ref:`TileMap`. + +``body_shape_index`` the index of the :ref:`Shape2D` of the other :ref:`PhysicsBody2D` or :ref:`TileMap` used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``body.shape_owner_get_owner(body_shape_index)``. + +``local_shape_index`` the index of the :ref:`Shape2D` of this RigidBody2D used by the :ref:`Physics2DServer`. Get the :ref:`CollisionShape2D` node with ``self.shape_owner_get_owner(local_shape_index)``. + +---- + +.. _class_RigidBody2D_signal_sleeping_state_changed: + +- **sleeping_state_changed** **(** **)** + +Emitted when the physics engine changes the body's sleeping state. + +**Note:** Changing the value :ref:`sleeping` will not trigger this signal. It is only emitted if the sleeping state is changed by the physics engine or ``emit_signal("sleeping_state_changed")`` is used. + +Enumerations +------------ + +.. _enum_RigidBody2D_Mode: + +.. _class_RigidBody2D_constant_MODE_RIGID: + +.. _class_RigidBody2D_constant_MODE_STATIC: + +.. _class_RigidBody2D_constant_MODE_CHARACTER: + +.. _class_RigidBody2D_constant_MODE_KINEMATIC: + +enum **Mode**: + +- **MODE_RIGID** = **0** --- Rigid mode. The body behaves as a physical object. It collides with other bodies and responds to forces applied to it. This is the default mode. + +- **MODE_STATIC** = **1** --- Static mode. The body behaves like a :ref:`StaticBody2D` and does not move. + +- **MODE_CHARACTER** = **2** --- Character mode. Similar to :ref:`MODE_RIGID`, but the body can not rotate. + +- **MODE_KINEMATIC** = **3** --- Kinematic mode. The body behaves like a :ref:`KinematicBody2D`, and must be moved by code. + +---- + +.. _enum_RigidBody2D_CCDMode: + +.. _class_RigidBody2D_constant_CCD_MODE_DISABLED: + +.. _class_RigidBody2D_constant_CCD_MODE_CAST_RAY: + +.. _class_RigidBody2D_constant_CCD_MODE_CAST_SHAPE: + +enum **CCDMode**: + +- **CCD_MODE_DISABLED** = **0** --- Continuous collision detection disabled. This is the fastest way to detect body collisions, but can miss small, fast-moving objects. + +- **CCD_MODE_CAST_RAY** = **1** --- Continuous collision detection enabled using raycasting. This is faster than shapecasting but less precise. + +- **CCD_MODE_CAST_SHAPE** = **2** --- Continuous collision detection enabled using shapecasting. This is the slowest CCD method and the most precise. + +Property Descriptions +--------------------- + +.. _class_RigidBody2D_property_angular_damp: + +- :ref:`float` **angular_damp** + ++-----------+-------------------------+ +| *Default* | ``-1.0`` | ++-----------+-------------------------+ +| *Setter* | set_angular_damp(value) | ++-----------+-------------------------+ +| *Getter* | get_angular_damp() | ++-----------+-------------------------+ + +Damps the body's :ref:`angular_velocity`. If ``-1``, the body will use the **Default Angular Damp** defined in **Project > Project Settings > Physics > 2d**. + +See :ref:`ProjectSettings.physics/2d/default_angular_damp` for more details about damping. + +---- + +.. _class_RigidBody2D_property_angular_velocity: + +- :ref:`float` **angular_velocity** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_angular_velocity(value) | ++-----------+-----------------------------+ +| *Getter* | get_angular_velocity() | ++-----------+-----------------------------+ + +The body's rotational velocity in *radians* per second. + +---- + +.. _class_RigidBody2D_property_applied_force: + +- :ref:`Vector2` **applied_force** + ++-----------+--------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_applied_force(value) | ++-----------+--------------------------+ +| *Getter* | get_applied_force() | ++-----------+--------------------------+ + +The body's total applied force. + +---- + +.. _class_RigidBody2D_property_applied_torque: + +- :ref:`float` **applied_torque** + ++-----------+---------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------+ +| *Setter* | set_applied_torque(value) | ++-----------+---------------------------+ +| *Getter* | get_applied_torque() | ++-----------+---------------------------+ + +The body's total applied torque. + +---- + +.. _class_RigidBody2D_property_bounce: + +- :ref:`float` **bounce** + ++----------+-------------------+ +| *Setter* | set_bounce(value) | ++----------+-------------------+ +| *Getter* | get_bounce() | ++----------+-------------------+ + +The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness). + +Deprecated, use :ref:`PhysicsMaterial.bounce` instead via :ref:`physics_material_override`. + +---- + +.. _class_RigidBody2D_property_can_sleep: + +- :ref:`bool` **can_sleep** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_can_sleep(value) | ++-----------+----------------------+ +| *Getter* | is_able_to_sleep() | ++-----------+----------------------+ + +If ``true``, the body can enter sleep mode when there is no movement. See :ref:`sleeping`. + +**Note:** A RigidBody2D will never enter sleep mode automatically if its :ref:`mode` is :ref:`MODE_CHARACTER`. It can still be put to sleep manually by setting its :ref:`sleeping` property to ``true``. + +---- + +.. _class_RigidBody2D_property_contact_monitor: + +- :ref:`bool` **contact_monitor** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_contact_monitor(value) | ++-----------+------------------------------+ +| *Getter* | is_contact_monitor_enabled() | ++-----------+------------------------------+ + +If ``true``, the body will emit signals when it collides with another RigidBody2D. See also :ref:`contacts_reported`. + +---- + +.. _class_RigidBody2D_property_contacts_reported: + +- :ref:`int` **contacts_reported** + ++-----------+----------------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------------+ +| *Setter* | set_max_contacts_reported(value) | ++-----------+----------------------------------+ +| *Getter* | get_max_contacts_reported() | ++-----------+----------------------------------+ + +The maximum number of contacts that will be recorded. Requires :ref:`contact_monitor` to be set to ``true``. + +**Note:** The number of contacts is different from the number of collisions. Collisions between parallel edges will result in two contacts (one at each end). + +---- + +.. _class_RigidBody2D_property_continuous_cd: + +- :ref:`CCDMode` **continuous_cd** + ++-----------+------------------------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------------------------+ +| *Setter* | set_continuous_collision_detection_mode(value) | ++-----------+------------------------------------------------+ +| *Getter* | get_continuous_collision_detection_mode() | ++-----------+------------------------------------------------+ + +Continuous collision detection mode. + +Continuous collision detection tries to predict where a moving body will collide instead of moving it and correcting its movement after collision. Continuous collision detection is slower, but more precise and misses fewer collisions with small, fast-moving objects. Raycasting and shapecasting methods are available. See :ref:`CCDMode` for details. + +---- + +.. _class_RigidBody2D_property_custom_integrator: + +- :ref:`bool` **custom_integrator** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_use_custom_integrator(value) | ++-----------+----------------------------------+ +| *Getter* | is_using_custom_integrator() | ++-----------+----------------------------------+ + +If ``true``, internal force integration is disabled for this body. Aside from collision response, the body will only move as determined by the :ref:`_integrate_forces` function. + +---- + +.. _class_RigidBody2D_property_friction: + +- :ref:`float` **friction** + ++----------+---------------------+ +| *Setter* | set_friction(value) | ++----------+---------------------+ +| *Getter* | get_friction() | ++----------+---------------------+ + +The body's friction. Values range from ``0`` (frictionless) to ``1`` (maximum friction). + +Deprecated, use :ref:`PhysicsMaterial.friction` instead via :ref:`physics_material_override`. + +---- + +.. _class_RigidBody2D_property_gravity_scale: + +- :ref:`float` **gravity_scale** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_gravity_scale(value) | ++-----------+--------------------------+ +| *Getter* | get_gravity_scale() | ++-----------+--------------------------+ + +Multiplies the gravity applied to the body. The body's gravity is calculated from the **Default Gravity** value in **Project > Project Settings > Physics > 2d** and/or any additional gravity vector applied by :ref:`Area2D`\ s. + +---- + +.. _class_RigidBody2D_property_inertia: + +- :ref:`float` **inertia** + ++----------+--------------------+ +| *Setter* | set_inertia(value) | ++----------+--------------------+ +| *Getter* | get_inertia() | ++----------+--------------------+ + +The body's moment of inertia. This is like mass, but for rotation: it determines how much torque it takes to rotate the body. The moment of inertia is usually computed automatically from the mass and the shapes, but this function allows you to set a custom value. Set 0 inertia to return to automatically computing it. + +---- + +.. _class_RigidBody2D_property_linear_damp: + +- :ref:`float` **linear_damp** + ++-----------+------------------------+ +| *Default* | ``-1.0`` | ++-----------+------------------------+ +| *Setter* | set_linear_damp(value) | ++-----------+------------------------+ +| *Getter* | get_linear_damp() | ++-----------+------------------------+ + +Damps the body's :ref:`linear_velocity`. If ``-1``, the body will use the **Default Linear Damp** in **Project > Project Settings > Physics > 2d**. + +See :ref:`ProjectSettings.physics/2d/default_linear_damp` for more details about damping. + +---- + +.. _class_RigidBody2D_property_linear_velocity: + +- :ref:`Vector2` **linear_velocity** + ++-----------+----------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_linear_velocity(value) | ++-----------+----------------------------+ +| *Getter* | get_linear_velocity() | ++-----------+----------------------------+ + +The body's linear velocity in pixels per second. Can be used sporadically, but **don't set this every frame**, because physics may run in another thread and runs at a different granularity. Use :ref:`_integrate_forces` as your process loop for precise control of the body state. + +---- + +.. _class_RigidBody2D_property_mass: + +- :ref:`float` **mass** + ++-----------+-----------------+ +| *Default* | ``1.0`` | ++-----------+-----------------+ +| *Setter* | set_mass(value) | ++-----------+-----------------+ +| *Getter* | get_mass() | ++-----------+-----------------+ + +The body's mass. + +---- + +.. _class_RigidBody2D_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The body's mode. See :ref:`Mode` for possible values. + +---- + +.. _class_RigidBody2D_property_physics_material_override: + +- :ref:`PhysicsMaterial` **physics_material_override** + ++----------+--------------------------------------+ +| *Setter* | set_physics_material_override(value) | ++----------+--------------------------------------+ +| *Getter* | get_physics_material_override() | ++----------+--------------------------------------+ + +The physics material override for the body. + +If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + +---- + +.. _class_RigidBody2D_property_sleeping: + +- :ref:`bool` **sleeping** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_sleeping(value) | ++-----------+---------------------+ +| *Getter* | is_sleeping() | ++-----------+---------------------+ + +If ``true``, the body will not move and will not calculate forces until woken up by another body through, for example, a collision, or by using the :ref:`apply_impulse` or :ref:`add_force` methods. + +---- + +.. _class_RigidBody2D_property_weight: + +- :ref:`float` **weight** + ++-----------+-------------------+ +| *Default* | ``9.8`` | ++-----------+-------------------+ +| *Setter* | set_weight(value) | ++-----------+-------------------+ +| *Getter* | get_weight() | ++-----------+-------------------+ + +The body's weight based on its mass and the **Default Gravity** value in **Project > Project Settings > Physics > 2d**. + +Method Descriptions +------------------- + +.. _class_RigidBody2D_method__integrate_forces: + +- void **_integrate_forces** **(** :ref:`Physics2DDirectBodyState` state **)** |virtual| + +Allows you to read and safely modify the simulation state for the object. Use this instead of :ref:`Node._physics_process` if you need to directly change the body's ``position`` or other physics properties. By default, it works in addition to the usual physics behavior, but :ref:`custom_integrator` allows you to disable the default behavior and write custom force integration for a body. + +---- + +.. _class_RigidBody2D_method_add_central_force: + +- void **add_central_force** **(** :ref:`Vector2` force **)** + +Adds a constant directional force without affecting rotation. + +---- + +.. _class_RigidBody2D_method_add_force: + +- void **add_force** **(** :ref:`Vector2` offset, :ref:`Vector2` force **)** + +Adds a positioned force to the body. Both the force and the offset from the body origin are in global coordinates. + +---- + +.. _class_RigidBody2D_method_add_torque: + +- void **add_torque** **(** :ref:`float` torque **)** + +Adds a constant rotational force. + +---- + +.. _class_RigidBody2D_method_apply_central_impulse: + +- void **apply_central_impulse** **(** :ref:`Vector2` impulse **)** + +Applies a directional impulse without affecting rotation. + +---- + +.. _class_RigidBody2D_method_apply_impulse: + +- void **apply_impulse** **(** :ref:`Vector2` offset, :ref:`Vector2` impulse **)** + +Applies a positioned impulse to the body. An impulse is time-independent! Applying an impulse every frame would result in a framerate-dependent force. For this reason it should only be used when simulating one-time impacts (use the "_force" functions otherwise). The position uses the rotation of the global coordinate system, but is centered at the object's origin. + +---- + +.. _class_RigidBody2D_method_apply_torque_impulse: + +- void **apply_torque_impulse** **(** :ref:`float` torque **)** + +Applies a rotational impulse to the body. + +---- + +.. _class_RigidBody2D_method_get_colliding_bodies: + +- :ref:`Array` **get_colliding_bodies** **(** **)** |const| + +Returns a list of the bodies colliding with this one. Requires :ref:`contact_monitor` to be set to ``true`` and :ref:`contacts_reported` to be set high enough to detect all the collisions. + +**Note:** The result of this test is not immediate after moving objects. For performance, list of collisions is updated once per frame and before the physics step. Consider using signals instead. + +---- + +.. _class_RigidBody2D_method_set_axis_velocity: + +- void **set_axis_velocity** **(** :ref:`Vector2` axis_velocity **)** + +Sets the body's velocity on the given axis. The velocity in the given vector axis will be set as the given vector length. This is useful for jumping behavior. + +---- + +.. _class_RigidBody2D_method_test_motion: + +- :ref:`bool` **test_motion** **(** :ref:`Vector2` motion, :ref:`bool` infinite_inertia=true, :ref:`float` margin=0.08, :ref:`Physics2DTestMotionResult` result=null **)** + +Returns ``true`` if a collision would result from moving in the given vector. ``margin`` increases the size of the shapes involved in the collision detection, and ``result`` is an object of type :ref:`Physics2DTestMotionResult`, which contains additional information about the collision (should there be one). + +.. |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.)` diff --git a/classes/class_room.rst b/classes/class_room.rst new file mode 100644 index 0000000..a6c045e --- /dev/null +++ b/classes/class_room.rst @@ -0,0 +1,109 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Room.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Room: + +Room +==== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Room node, used to group objects together locally for :ref:`Portal` culling. + +Description +----------- + +The :ref:`Portal` culling system requires levels to be built using objects grouped together by location in areas called ``Room``\ s. In many cases these will correspond to actual rooms in buildings, but not necessarily (a canyon area may be treated as a room). + +Any :ref:`VisualInstance` that is a child or grandchild of a ``Room`` will be assigned to that room, if the ``portal_mode`` of that :ref:`VisualInstance` is set to ``STATIC`` (does not move) or ``DYNAMIC`` (moves only within the room). + +Internally the room boundary must form a **convex hull**, and by default this is determined automatically by the geometry of the objects you place within the room. + +You can alternatively precisely specify a **manual bound**. If you place a :ref:`MeshInstance` with a name prefixed by ``Bound_``, it will turn off the bound generation from geometry, and instead use the vertices of this MeshInstance to directly calculate a convex hull during the conversion stage (see :ref:`RoomManager`). + +In order to see from one room into an adjacent room, :ref:`Portal`\ s must be placed over non-occluded openings between rooms. These will often be placed over doors and windows. + +Properties +---------- + ++-------------------------------------------------+-----------------------------------------------------------------------+--------------------------+ +| :ref:`PoolVector3Array` | :ref:`points` | ``PoolVector3Array( )`` | ++-------------------------------------------------+-----------------------------------------------------------------------+--------------------------+ +| :ref:`float` | :ref:`room_simplify` | ``0.5`` | ++-------------------------------------------------+-----------------------------------------------------------------------+--------------------------+ +| :ref:`bool` | :ref:`use_default_simplify` | ``true`` | ++-------------------------------------------------+-----------------------------------------------------------------------+--------------------------+ + +Methods +------- + ++------+-------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point` **(** :ref:`int` index, :ref:`Vector3` position **)** | ++------+-------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Room_property_points: + +- :ref:`PoolVector3Array` **points** + ++-----------+--------------------------+ +| *Default* | ``PoolVector3Array( )`` | ++-----------+--------------------------+ +| *Setter* | set_points(value) | ++-----------+--------------------------+ +| *Getter* | get_points() | ++-----------+--------------------------+ + +If ``points`` are set, the ``Room`` bounding convex hull will be built from these points. If no points are set, the room bound will either be derived from a manual bound (:ref:`MeshInstance` with name prefix ``Bound_``), or from the geometry within the room. + +Note that you can use the ``Generate Points`` editor button to get started. This will use either the geometry or manual bound to generate the room hull, and save the resulting points, allowing you to edit them to further refine the bound. + +---- + +.. _class_Room_property_room_simplify: + +- :ref:`float` **room_simplify** + ++-----------+--------------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------------+ +| *Setter* | set_room_simplify(value) | ++-----------+--------------------------+ +| *Getter* | get_room_simplify() | ++-----------+--------------------------+ + +The ``simplify`` value determines to what degree room hulls (bounds) are simplified, by removing similar planes. A value of 0 gives no simplification, 1 gives maximum simplification. + +---- + +.. _class_Room_property_use_default_simplify: + +- :ref:`bool` **use_default_simplify** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_use_default_simplify(value) | ++-----------+---------------------------------+ +| *Getter* | get_use_default_simplify() | ++-----------+---------------------------------+ + +The room hull simplification can either use the default value set in the :ref:`RoomManager`, or override this and use the per room setting. + +Method Descriptions +------------------- + +.. _class_Room_method_set_point: + +- void **set_point** **(** :ref:`int` index, :ref:`Vector3` position **)** + +Sets individual points. Primarily for use by the editor. + +.. |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.)` diff --git a/classes/class_roomgroup.rst b/classes/class_roomgroup.rst new file mode 100644 index 0000000..505cb6b --- /dev/null +++ b/classes/class_roomgroup.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RoomGroup.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RoomGroup: + +RoomGroup +========= + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Groups :ref:`Room`\ s together to allow common functionality. + +Description +----------- + +Although :ref:`Room` behaviour can be specified individually, sometimes it is faster and more convenient to write functionality for a group of rooms. + +``RoomGroup``\ s should be placed as children of the **room list** (the parent :ref:`Node` of your :ref:`Room`\ s), and :ref:`Room`\ s should be placed in turn as children of a ``RoomGroup`` in order to assign them to the RoomGroup. + +A ``RoomGroup`` can for example be used to specify :ref:`Room`\ s that are **outside**, and switch on or off a directional light, sky, or rain effect as the player enters / exits the area. + +``RoomGroup``\ s receive **gameplay callbacks** when the ``gameplay_monitor`` is switched on, as ``signal``\ s or ``notification``\ s as they enter and exit the **gameplay area** (see :ref:`RoomManager` for details). + +Properties +---------- + ++-----------------------+------------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`roomgroup_priority` | ``0`` | ++-----------------------+------------------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_RoomGroup_property_roomgroup_priority: + +- :ref:`int` **roomgroup_priority** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_roomgroup_priority(value) | ++-----------+-------------------------------+ +| *Getter* | get_roomgroup_priority() | ++-----------+-------------------------------+ + +This priority will be applied to :ref:`Room`\ s within the group. The :ref:`Room` priority allows the use of **internal rooms**, rooms *within* another room or rooms. + +When the :ref:`Camera` is within more than one room (regular and internal), the higher priority room will take precedence. So with for example, a house inside a terrain 'room', you would make the house higher priority, so that when the camera is within the house, the house is used as the source room, but outside the house, the terrain room would be used instead. + +.. |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.)` diff --git a/classes/class_roommanager.rst b/classes/class_roommanager.rst new file mode 100644 index 0000000..c3126f1 --- /dev/null +++ b/classes/class_roommanager.rst @@ -0,0 +1,390 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the RoomManager.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RoomManager: + +RoomManager +=========== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +The RoomManager node is used to control the portal culling system. + +Description +----------- + +In order to utilize the portal occlusion culling system, you must build your level using :ref:`Room`\ s and :ref:`Portal`\ s. Before these can be used at runtime, they must undergo a short conversion process to build the ``room graph``, runtime data needed for portal culling. The ``room graph`` is controlled by the ``RoomManager`` node, and the ``RoomManager`` also contains settings that are common throughout the portal system. + +Properties +---------- + ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`active` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`debug_sprawl` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`default_portal_margin` | ``1.0`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`gameplay_monitor` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`merge_meshes` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`overlap_warning_threshold` | ``1`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`portal_depth_limit` | ``16`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`NodePath` | :ref:`preview_camera` | ``NodePath("")`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | process_priority | ``10000`` *(parent override)* | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`PVSMode` | :ref:`pvs_mode` | ``1`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`roaming_expansion_margin` | ``1.0`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`room_simplify` | ``0.5`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`NodePath` | :ref:`roomlist` | ``NodePath("")`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`show_margins` | ``true`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`use_secondary_pvs` | ``false`` | ++------------------------------------------+----------------------------------------------------------------------------------------+-------------------------------+ + +Methods +------- + ++------+--------------------------------------------------------------------------+ +| void | :ref:`rooms_clear` **(** **)** | ++------+--------------------------------------------------------------------------+ +| void | :ref:`rooms_convert` **(** **)** | ++------+--------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_RoomManager_PVSMode: + +.. _class_RoomManager_constant_PVS_MODE_DISABLED: + +.. _class_RoomManager_constant_PVS_MODE_PARTIAL: + +.. _class_RoomManager_constant_PVS_MODE_FULL: + +enum **PVSMode**: + +- **PVS_MODE_DISABLED** = **0** --- Use only :ref:`Portal`\ s at runtime to determine visibility. PVS will not be generated at :ref:`Room`\ s conversion, and gameplay notifications cannot be used. + +- **PVS_MODE_PARTIAL** = **1** --- Use a combination of PVS and :ref:`Portal`\ s to determine visibility (this is usually fastest and most accurate). + +- **PVS_MODE_FULL** = **2** --- Use only the PVS (potentially visible set) of :ref:`Room`\ s to determine visibility. + +Property Descriptions +--------------------- + +.. _class_RoomManager_property_active: + +- :ref:`bool` **active** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | rooms_set_active(value) | ++-----------+-------------------------+ +| *Getter* | rooms_get_active() | ++-----------+-------------------------+ + +Switches the portal culling system on and off. + +It is important to note that when portal culling is active, it is responsible for **all** the 3d culling. Some editor functionality may be more difficult to use, so switching the active flag is intended to be used to make sure your :ref:`Room` / :ref:`Portal` layout works within the editor. + +Switching to ``active`` will have no effect when the ``room graph`` is unloaded (the rooms have not yet been converted). + +---- + +.. _class_RoomManager_property_debug_sprawl: + +- :ref:`bool` **debug_sprawl** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_debug_sprawl(value) | ++-----------+-------------------------+ +| *Getter* | get_debug_sprawl() | ++-----------+-------------------------+ + +Large objects can 'sprawl' over (be present in) more than one room. It can be useful to visualize which objects are sprawling outside the current room. + +Toggling this setting turns this debug view on and off. + +---- + +.. _class_RoomManager_property_default_portal_margin: + +- :ref:`float` **default_portal_margin** + ++-----------+----------------------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------------------+ +| *Setter* | set_default_portal_margin(value) | ++-----------+----------------------------------+ +| *Getter* | get_default_portal_margin() | ++-----------+----------------------------------+ + +Usually we don't want objects that only **just** cross a boundary into an adjacent :ref:`Room` to sprawl into that room. To prevent this, each :ref:`Portal` has an extra margin, or tolerance zone where objects can enter without sprawling to a neighbouring room. + +In most cases you can set this here for all portals. It is possible to override the margin for each portal. + +---- + +.. _class_RoomManager_property_gameplay_monitor: + +- :ref:`bool` **gameplay_monitor** + ++-----------+-------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------+ +| *Setter* | set_gameplay_monitor_enabled(value) | ++-----------+-------------------------------------+ +| *Getter* | get_gameplay_monitor_enabled() | ++-----------+-------------------------------------+ + +When using a partial or full PVS, the gameplay monitor allows you to receive callbacks when roaming objects or rooms enter or exit the **gameplay area**. The gameplay area is defined as either the primary, or secondary PVS. + +These callbacks allow you to, for example, reduce processing for objects that are far from the player, or turn on and off AI. + +You can either choose to receive callbacks as notifications through the ``_notification`` function, or as signals. + +``NOTIFICATION_ENTER_GAMEPLAY`` + +``NOTIFICATION_EXIT_GAMEPLAY`` + +Signals: ``"gameplay_entered"``, ``"gameplay_exited"`` + +---- + +.. _class_RoomManager_property_merge_meshes: + +- :ref:`bool` **merge_meshes** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_merge_meshes(value) | ++-----------+-------------------------+ +| *Getter* | get_merge_meshes() | ++-----------+-------------------------+ + +If enabled, the system will attempt to merge similar meshes (particularly in terms of materials) within :ref:`Room`\ s during conversion. This can significantly reduce the number of drawcalls and state changes required during rendering, albeit at a cost of reduced culling granularity. + +**Note:** This operates at runtime during the conversion process, and will only operate on exported or running projects, in order to prevent accidental alteration to the scene and loss of data. + +---- + +.. _class_RoomManager_property_overlap_warning_threshold: + +- :ref:`int` **overlap_warning_threshold** + ++-----------+--------------------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------------------+ +| *Setter* | set_overlap_warning_threshold(value) | ++-----------+--------------------------------------+ +| *Getter* | get_overlap_warning_threshold() | ++-----------+--------------------------------------+ + +When converting rooms, the editor will warn you if overlap is detected between rooms. Overlap can interfere with determining the room that cameras and objects are within. A small amount can be acceptable, depending on your level. Here you can alter the threshold at which the editor warning appears. There are no other side effects. + +---- + +.. _class_RoomManager_property_portal_depth_limit: + +- :ref:`int` **portal_depth_limit** + ++-----------+-------------------------------+ +| *Default* | ``16`` | ++-----------+-------------------------------+ +| *Setter* | set_portal_depth_limit(value) | ++-----------+-------------------------------+ +| *Getter* | get_portal_depth_limit() | ++-----------+-------------------------------+ + +Portal rendering is recursive - each time a portal is seen through an earlier portal there is some cost. For this reason, and to prevent the possibility of infinite loops, this setting provides a hard limit on the recursion depth. + +**Note:** This value is unused when using ``Full`` PVS mode. + +---- + +.. _class_RoomManager_property_preview_camera: + +- :ref:`NodePath` **preview_camera** + ++-----------+--------------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+--------------------------------+ +| *Setter* | set_preview_camera_path(value) | ++-----------+--------------------------------+ +| *Getter* | get_preview_camera_path() | ++-----------+--------------------------------+ + +Portal culling normally operates using the current :ref:`Camera` / :ref:`Camera`\ s, however for debugging purposes within the editor, you can use this setting to override this behaviour and force it to use a particular camera to get a better idea of what the occlusion culling is doing. + +---- + +.. _class_RoomManager_property_pvs_mode: + +- :ref:`PVSMode` **pvs_mode** + ++-----------+---------------------+ +| *Default* | ``1`` | ++-----------+---------------------+ +| *Setter* | set_pvs_mode(value) | ++-----------+---------------------+ +| *Getter* | get_pvs_mode() | ++-----------+---------------------+ + +Optionally during conversion the potentially visible set (PVS) of rooms that are potentially visible from each room can be calculated. This can be used either to aid in dynamic portal culling, or to totally replace portal culling. + +In ``Full`` PVS Mode, all objects within the potentially visible rooms will be frustum culled, and rendered if they are within the view frustum. + +---- + +.. _class_RoomManager_property_roaming_expansion_margin: + +- :ref:`float` **roaming_expansion_margin** + ++-----------+-------------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------------+ +| *Setter* | set_roaming_expansion_margin(value) | ++-----------+-------------------------------------+ +| *Getter* | get_roaming_expansion_margin() | ++-----------+-------------------------------------+ + +In order to reduce processing for roaming objects, an expansion is applied to their AABB as they move. This expanded volume is used to calculate which rooms the roaming object is within. If the object's exact AABB is still within this expanded volume on the next move, there is no need to reprocess the object, which can save considerable CPU. + +The downside is that if the expansion is too much, the object may end up unexpectedly sprawling into neighbouring rooms and showing up where it might otherwise be culled. + +In order to balance roaming performance against culling accuracy, this expansion margin can be customized by the user. It will typically depend on your room and object sizes, and movement speeds. The default value should work reasonably in most circumstances. + +---- + +.. _class_RoomManager_property_room_simplify: + +- :ref:`float` **room_simplify** + ++-----------+--------------------------+ +| *Default* | ``0.5`` | ++-----------+--------------------------+ +| *Setter* | set_room_simplify(value) | ++-----------+--------------------------+ +| *Getter* | get_room_simplify() | ++-----------+--------------------------+ + +During the conversion process, the geometry of objects within :ref:`Room`\ s, or a custom specified manual bound, are used to generate a **convex hull bound**. + +This convex hull is **required** in the visibility system, and is used for many purposes. Most importantly, it is used to decide whether the :ref:`Camera` (or an object) is within a :ref:`Room`. The convex hull generating algorithm is good, but occasionally it can create too many (or too few) planes to give a good representation of the room volume. + +The ``room_simplify`` value can be used to gain fine control over this process. It determines how similar planes can be for them to be considered the same (and duplicates removed). The value can be set between 0 (no simplification) and 1 (maximum simplification). + +The value set here is the default for all rooms, but individual rooms can override this value if desired. + +The room convex hulls are shown as a wireframe in the editor. + +---- + +.. _class_RoomManager_property_roomlist: + +- :ref:`NodePath` **roomlist** + ++-----------+--------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+--------------------------+ +| *Setter* | set_roomlist_path(value) | ++-----------+--------------------------+ +| *Getter* | get_roomlist_path() | ++-----------+--------------------------+ + +For the :ref:`Room` conversion process to succeed, you must point the ``RoomManager`` to the parent :ref:`Node` of your :ref:`Room`\ s and :ref:`RoomGroup`\ s, which we refer to as the ``roomlist`` (the roomlist is not a special node type, it is normally just a :ref:`Spatial`). + +---- + +.. _class_RoomManager_property_show_margins: + +- :ref:`bool` **show_margins** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_show_margins(value) | ++-----------+-------------------------+ +| *Getter* | get_show_margins() | ++-----------+-------------------------+ + +Shows the :ref:`Portal` margins when the portal gizmo is used in the editor. + +---- + +.. _class_RoomManager_property_use_secondary_pvs: + +- :ref:`bool` **use_secondary_pvs** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_use_secondary_pvs(value) | ++-----------+------------------------------+ +| *Getter* | get_use_secondary_pvs() | ++-----------+------------------------------+ + +When receiving gameplay callbacks when objects enter and exit gameplay, the **gameplay area** can be defined by either the primary PVS (potentially visible set) of :ref:`Room`\ s, or the secondary PVS (the primary PVS and their neighbouring :ref:`Room`\ s). + +Sometimes using the larger gameplay area of the secondary PVS may be preferable. + +Method Descriptions +------------------- + +.. _class_RoomManager_method_rooms_clear: + +- void **rooms_clear** **(** **)** + +This function clears all converted data from the **room graph**. Use this before unloading a level, when transitioning from level to level, or returning to a main menu. + +---- + +.. _class_RoomManager_method_rooms_convert: + +- void **rooms_convert** **(** **)** + +This is the most important function in the whole portal culling system. Without it, the system cannot function. + +First it goes through every :ref:`Room` that is a child of the ``room list`` node (and :ref:`RoomGroup`\ s within) and converts and adds it to the ``room graph``. + +This works for both :ref:`Room` nodes, and :ref:`Spatial` nodes that follow a special naming convention. They should begin with the prefix *'Room\_'*, followed by the name you wish to give the room, e.g. *'Room_lounge'*. This will automatically convert such :ref:`Spatial`\ s to :ref:`Room` nodes for you. This is useful if you want to build you entire room system in e.g. Blender, and reimport multiple times as you work on the level. + +The conversion will try to assign :ref:`VisualInstance`\ s that are children and grandchildren of the :ref:`Room` to the room. These should be given a suitable ``portal mode`` (see the :ref:`CullInstance` documentation). The default ``portal mode`` is ``STATIC`` - objects which are not expected to move while the level is played, which will typically be most objects. + +The conversion will usually use the geometry of these :ref:`VisualInstance`\ s (and the :ref:`Portal`\ s) to calculate a convex hull bound for the room. These bounds will be shown in the editor with a wireframe. Alternatively you can specify a manual custom bound for any room, see the :ref:`Room` documentation. + +By definition, :ref:`Camera`\ s within a room can see everything else within the room (that is one advantage to using convex hulls). However, in order to see from one room into adjacent rooms, you must place :ref:`Portal`\ s, which represent openings that the camera can see through, like windows and doors. + +:ref:`Portal`\ s are really just specialized :ref:`MeshInstance`\ s. In fact you will usually first create a portal by creating a :ref:`MeshInstance`, especially a ``plane`` mesh instance. You would move the plane in the editor to cover a window or doorway, with the front face pointing outward from the room. To let the conversion process know you want this mesh to be a portal, again we use a special naming convention. :ref:`MeshInstance`\ s to be converted to a :ref:`Portal` should start with the prefix *'Portal\_'*. + +You now have a choice - you can leave the name as *'Portal\_'* and allow the system to automatically detect the nearest :ref:`Room` to link. In most cases this will work fine. + +An alternative method is to specify the :ref:`Room` to link to manually, appending a suffix to the portal name, which should be the name of the room you intend to link to. For example *'Portal_lounge'* will attempt to link to the room named *'Room_lounge'*. + +There is a special case here - Godot does not allow two nodes to share the same name. What if you want to manually have more than one portal leading into the same room? Surely they will need to both be called, e.g. *'Portal_lounge'*? + +The solution is a wildcard character. After the room name, if you use the character *'\*'*, this character and anything following it will be ignored. So you can use for example *'Portal_lounge\*0'*, *'Portal_lounge\*1'* etc. + +Note that :ref:`Portal`\ s that have already been converted to :ref:`Portal` nodes (rather than :ref:`MeshInstance`\ s) still need to follow the same naming convention, as they will be relinked each time during conversion. + +It is recommended that you only place objects in rooms that are desired to stay within those rooms - i.e. ``portal mode``\ s ``STATIC`` or ``DYNAMIC`` (not crossing portals). ``GLOBAL`` and ``ROAMING`` objects are best placed in another part of the scene tree, to avoid confusion. See :ref:`CullInstance` for a full description of portal modes. + +.. |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.)` diff --git a/classes/class_rootmotionview.rst b/classes/class_rootmotionview.rst new file mode 100644 index 0000000..8a9c5ff --- /dev/null +++ b/classes/class_rootmotionview.rst @@ -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 RootMotionView.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_RootMotionView: + +RootMotionView +============== + +**Inherits:** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Editor-only helper for setting up root motion in :ref:`AnimationTree`. + +Description +----------- + +*Root motion* refers to an animation technique where a mesh's skeleton is used to give impulse to a character. When working with 3D animations, a popular technique is for animators to use the root skeleton bone to give motion to the rest of the skeleton. This allows animating characters in a way where steps actually match the floor below. It also allows precise interaction with objects during cinematics. See also :ref:`AnimationTree`. + +**Note:** ``RootMotionView`` is only visible in the editor. It will be hidden automatically in the running project, and will also be converted to a plain :ref:`Node` in the running project. This means a script attached to a ``RootMotionView`` node *must* have ``extends Node`` instead of ``extends RootMotionView``. Additionally, it must not be a ``tool`` script. + +Tutorials +--------- + +- `#root-motion <../tutorials/animation/animation_tree.html#root-motion>`_ in :doc:`../tutorials/animation/animation_tree` + +Properties +---------- + ++---------------------------------+---------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`animation_path` | ++---------------------------------+---------------------------------------------------------------------+ +| :ref:`float` | :ref:`cell_size` | ++---------------------------------+---------------------------------------------------------------------+ +| :ref:`Color` | :ref:`color` | ++---------------------------------+---------------------------------------------------------------------+ +| :ref:`float` | :ref:`radius` | ++---------------------------------+---------------------------------------------------------------------+ +| :ref:`bool` | :ref:`zero_y` | ++---------------------------------+---------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_RootMotionView_property_animation_path: + +- :ref:`NodePath` **animation_path** + ++----------+---------------------------+ +| *Setter* | set_animation_path(value) | ++----------+---------------------------+ +| *Getter* | get_animation_path() | ++----------+---------------------------+ + +Path to an :ref:`AnimationTree` node to use as a basis for root motion. + +---- + +.. _class_RootMotionView_property_cell_size: + +- :ref:`float` **cell_size** + ++----------+----------------------+ +| *Setter* | set_cell_size(value) | ++----------+----------------------+ +| *Getter* | get_cell_size() | ++----------+----------------------+ + +The grid's cell size in 3D units. + +---- + +.. _class_RootMotionView_property_color: + +- :ref:`Color` **color** + ++----------+------------------+ +| *Setter* | set_color(value) | ++----------+------------------+ +| *Getter* | get_color() | ++----------+------------------+ + +The grid's color. + +---- + +.. _class_RootMotionView_property_radius: + +- :ref:`float` **radius** + ++----------+-------------------+ +| *Setter* | set_radius(value) | ++----------+-------------------+ +| *Getter* | get_radius() | ++----------+-------------------+ + +The grid's radius in 3D units. The grid's opacity will fade gradually as the distance from the origin increases until this :ref:`radius` is reached. + +---- + +.. _class_RootMotionView_property_zero_y: + +- :ref:`bool` **zero_y** + ++----------+-------------------+ +| *Setter* | set_zero_y(value) | ++----------+-------------------+ +| *Getter* | get_zero_y() | ++----------+-------------------+ + +If ``true``, the grid's points will all be on the same Y coordinate (*local* Y = 0). If ``false``, the points' original Y coordinate is preserved. + +.. |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.)` diff --git a/classes/class_scenestate.rst b/classes/class_scenestate.rst new file mode 100644 index 0000000..412a200 --- /dev/null +++ b/classes/class_scenestate.rst @@ -0,0 +1,262 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SceneState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SceneState: + +SceneState +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A script interface to a scene file's data. + +Description +----------- + +Maintains a list of resources, nodes, exported, and overridden properties, and built-in scripts associated with a scene. + +This class cannot be instantiated directly, it is retrieved for a given scene as the result of :ref:`PackedScene.get_state`. + +Methods +------- + ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_connection_binds` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_count` **(** **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connection_flags` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connection_method` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connection_signal` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_connection_source` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_connection_target` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_node_count` **(** **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_node_groups` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_node_index` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PackedScene` | :ref:`get_node_instance` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_instance_placeholder` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_name` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_node_owner_path` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodePath` | :ref:`get_node_path` **(** :ref:`int` idx, :ref:`bool` for_parent=false **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_node_property_count` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_property_name` **(** :ref:`int` idx, :ref:`int` prop_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_node_property_value` **(** :ref:`int` idx, :ref:`int` prop_idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_type` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_node_instance_placeholder` **(** :ref:`int` idx **)** |const| | ++-----------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_SceneState_GenEditState: + +.. _class_SceneState_constant_GEN_EDIT_STATE_DISABLED: + +.. _class_SceneState_constant_GEN_EDIT_STATE_INSTANCE: + +.. _class_SceneState_constant_GEN_EDIT_STATE_MAIN: + +enum **GenEditState**: + +- **GEN_EDIT_STATE_DISABLED** = **0** --- If passed to :ref:`PackedScene.instance`, blocks edits to the scene state. + +- **GEN_EDIT_STATE_INSTANCE** = **1** --- If passed to :ref:`PackedScene.instance`, provides inherited scene resources to the local scene. + +**Note:** Only available in editor builds. + +- **GEN_EDIT_STATE_MAIN** = **2** --- If passed to :ref:`PackedScene.instance`, provides local scene resources to the local scene. Only the main scene should receive the main edit state. + +**Note:** Only available in editor builds. + +Method Descriptions +------------------- + +.. _class_SceneState_method_get_connection_binds: + +- :ref:`Array` **get_connection_binds** **(** :ref:`int` idx **)** |const| + +Returns the list of bound parameters for the signal at ``idx``. + +---- + +.. _class_SceneState_method_get_connection_count: + +- :ref:`int` **get_connection_count** **(** **)** |const| + +Returns the number of signal connections in the scene. + +The ``idx`` argument used to query connection metadata in other ``get_connection_*`` methods in the interval ``[0, get_connection_count() - 1]``. + +---- + +.. _class_SceneState_method_get_connection_flags: + +- :ref:`int` **get_connection_flags** **(** :ref:`int` idx **)** |const| + +Returns the connection flags for the signal at ``idx``. See :ref:`ConnectFlags` constants. + +---- + +.. _class_SceneState_method_get_connection_method: + +- :ref:`String` **get_connection_method** **(** :ref:`int` idx **)** |const| + +Returns the method connected to the signal at ``idx``. + +---- + +.. _class_SceneState_method_get_connection_signal: + +- :ref:`String` **get_connection_signal** **(** :ref:`int` idx **)** |const| + +Returns the name of the signal at ``idx``. + +---- + +.. _class_SceneState_method_get_connection_source: + +- :ref:`NodePath` **get_connection_source** **(** :ref:`int` idx **)** |const| + +Returns the path to the node that owns the signal at ``idx``, relative to the root node. + +---- + +.. _class_SceneState_method_get_connection_target: + +- :ref:`NodePath` **get_connection_target** **(** :ref:`int` idx **)** |const| + +Returns the path to the node that owns the method connected to the signal at ``idx``, relative to the root node. + +---- + +.. _class_SceneState_method_get_node_count: + +- :ref:`int` **get_node_count** **(** **)** |const| + +Returns the number of nodes in the scene. + +The ``idx`` argument used to query node data in other ``get_node_*`` methods in the interval ``[0, get_node_count() - 1]``. + +---- + +.. _class_SceneState_method_get_node_groups: + +- :ref:`PoolStringArray` **get_node_groups** **(** :ref:`int` idx **)** |const| + +Returns the list of group names associated with the node at ``idx``. + +---- + +.. _class_SceneState_method_get_node_index: + +- :ref:`int` **get_node_index** **(** :ref:`int` idx **)** |const| + +Returns the node's index, which is its position relative to its siblings. This is only relevant and saved in scenes for cases where new nodes are added to an instanced or inherited scene among siblings from the base scene. Despite the name, this index is not related to the ``idx`` argument used here and in other methods. + +---- + +.. _class_SceneState_method_get_node_instance: + +- :ref:`PackedScene` **get_node_instance** **(** :ref:`int` idx **)** |const| + +Returns a :ref:`PackedScene` for the node at ``idx`` (i.e. the whole branch starting at this node, with its child nodes and resources), or ``null`` if the node is not an instance. + +---- + +.. _class_SceneState_method_get_node_instance_placeholder: + +- :ref:`String` **get_node_instance_placeholder** **(** :ref:`int` idx **)** |const| + +Returns the path to the represented scene file if the node at ``idx`` is an :ref:`InstancePlaceholder`. + +---- + +.. _class_SceneState_method_get_node_name: + +- :ref:`String` **get_node_name** **(** :ref:`int` idx **)** |const| + +Returns the name of the node at ``idx``. + +---- + +.. _class_SceneState_method_get_node_owner_path: + +- :ref:`NodePath` **get_node_owner_path** **(** :ref:`int` idx **)** |const| + +Returns the path to the owner of the node at ``idx``, relative to the root node. + +---- + +.. _class_SceneState_method_get_node_path: + +- :ref:`NodePath` **get_node_path** **(** :ref:`int` idx, :ref:`bool` for_parent=false **)** |const| + +Returns the path to the node at ``idx``. + +If ``for_parent`` is ``true``, returns the path of the ``idx`` node's parent instead. + +---- + +.. _class_SceneState_method_get_node_property_count: + +- :ref:`int` **get_node_property_count** **(** :ref:`int` idx **)** |const| + +Returns the number of exported or overridden properties for the node at ``idx``. + +The ``prop_idx`` argument used to query node property data in other ``get_node_property_*`` methods in the interval ``[0, get_node_property_count() - 1]``. + +---- + +.. _class_SceneState_method_get_node_property_name: + +- :ref:`String` **get_node_property_name** **(** :ref:`int` idx, :ref:`int` prop_idx **)** |const| + +Returns the name of the property at ``prop_idx`` for the node at ``idx``. + +---- + +.. _class_SceneState_method_get_node_property_value: + +- :ref:`Variant` **get_node_property_value** **(** :ref:`int` idx, :ref:`int` prop_idx **)** |const| + +Returns the value of the property at ``prop_idx`` for the node at ``idx``. + +---- + +.. _class_SceneState_method_get_node_type: + +- :ref:`String` **get_node_type** **(** :ref:`int` idx **)** |const| + +Returns the type of the node at ``idx``. + +---- + +.. _class_SceneState_method_is_node_instance_placeholder: + +- :ref:`bool` **is_node_instance_placeholder** **(** :ref:`int` idx **)** |const| + +Returns ``true`` if the node at ``idx`` is an :ref:`InstancePlaceholder`. + +.. |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.)` diff --git a/classes/class_scenetree.rst b/classes/class_scenetree.rst new file mode 100644 index 0000000..c9ecc4a --- /dev/null +++ b/classes/class_scenetree.rst @@ -0,0 +1,732 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SceneTree.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SceneTree: + +SceneTree +========= + +**Inherits:** :ref:`MainLoop` **<** :ref:`Object` + +Manages the game loop via a hierarchy of nodes. + +Description +----------- + +As one of the most important classes, the ``SceneTree`` manages the hierarchy of nodes in a scene as well as scenes themselves. Nodes can be added, retrieved and removed. The whole scene tree (and thus the current scene) can be paused. Scenes can be loaded, switched and reloaded. + +You can also use the ``SceneTree`` to organize your nodes into groups: every node can be assigned as many groups as you want to create, e.g. an "enemy" group. You can then iterate these groups or even call methods and set properties on all the group's members at once. + +``SceneTree`` is the default :ref:`MainLoop` implementation used by scenes, and is thus in charge of the game loop. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/scene_tree` + +- :doc:`../tutorials/rendering/multiple_resolutions` + +Properties +---------- + ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Node` | :ref:`current_scene` | | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`debug_collisions_hint` | ``false`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`debug_navigation_hint` | ``false`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Node` | :ref:`edited_scene_root` | | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`MultiplayerAPI` | :ref:`multiplayer` | | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`multiplayer_poll` | ``true`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`NetworkedMultiplayerPeer` | :ref:`network_peer` | | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`paused` | ``false`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`refuse_new_network_connections` | ``false`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`Viewport` | :ref:`root` | | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_font_oversampling` | ``false`` | ++-----------------------------------------------------------------+------------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_group` **(** :ref:`String` group, :ref:`String` method, ... **)** |vararg| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_group_flags` **(** :ref:`int` flags, :ref:`String` group, :ref:`String` method, ... **)** |vararg| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`change_scene` **(** :ref:`String` path **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`change_scene_to` **(** :ref:`PackedScene` packed_scene **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SceneTreeTimer` | :ref:`create_timer` **(** :ref:`float` time_sec, :ref:`bool` pause_mode_process=true **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frame` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_network_connected_peers` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_network_unique_id` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_node_count` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_nodes_in_group` **(** :ref:`String` group **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_rpc_sender_id` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_group` **(** :ref:`String` name **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_network_peer` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_input_handled` **(** **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_network_server` **(** **)** |const| | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`notify_group` **(** :ref:`String` group, :ref:`int` notification **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`notify_group_flags` **(** :ref:`int` call_flags, :ref:`String` group, :ref:`int` notification **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`queue_delete` **(** :ref:`Object` obj **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`quit` **(** :ref:`int` exit_code=-1 **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`reload_current_scene` **(** **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_auto_accept_quit` **(** :ref:`bool` enabled **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_group` **(** :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_group_flags` **(** :ref:`int` call_flags, :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_as_handled` **(** **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_quit_on_go_back` **(** :ref:`bool` enabled **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_screen_stretch` **(** :ref:`StretchMode` mode, :ref:`StretchAspect` aspect, :ref:`Vector2` minsize, :ref:`float` scale=1 **)** | ++---------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_SceneTree_signal_connected_to_server: + +- **connected_to_server** **(** **)** + +Emitted whenever this ``SceneTree``'s :ref:`network_peer` successfully connected to a server. Only emitted on clients. + +---- + +.. _class_SceneTree_signal_connection_failed: + +- **connection_failed** **(** **)** + +Emitted whenever this ``SceneTree``'s :ref:`network_peer` fails to establish a connection to a server. Only emitted on clients. + +---- + +.. _class_SceneTree_signal_files_dropped: + +- **files_dropped** **(** :ref:`PoolStringArray` files, :ref:`int` screen **)** + +Emitted when files are dragged from the OS file manager and dropped in the game window. The arguments are a list of file paths and the identifier of the screen where the drag originated. + +---- + +.. _class_SceneTree_signal_global_menu_action: + +- **global_menu_action** **(** :ref:`Variant` id, :ref:`Variant` meta **)** + +Emitted whenever global menu item is clicked. + +---- + +.. _class_SceneTree_signal_idle_frame: + +- **idle_frame** **(** **)** + +Emitted immediately before :ref:`Node._process` is called on every node in the ``SceneTree``. + +---- + +.. _class_SceneTree_signal_network_peer_connected: + +- **network_peer_connected** **(** :ref:`int` id **)** + +Emitted whenever this ``SceneTree``'s :ref:`network_peer` connects with a new peer. ID is the peer ID of the new peer. Clients get notified when other clients connect to the same server. Upon connecting to a server, a client also receives this signal for the server (with ID being 1). + +---- + +.. _class_SceneTree_signal_network_peer_disconnected: + +- **network_peer_disconnected** **(** :ref:`int` id **)** + +Emitted whenever this ``SceneTree``'s :ref:`network_peer` disconnects from a peer. Clients get notified when other clients disconnect from the same server. + +---- + +.. _class_SceneTree_signal_node_added: + +- **node_added** **(** :ref:`Node` node **)** + +Emitted whenever a node is added to the ``SceneTree``. + +---- + +.. _class_SceneTree_signal_node_configuration_warning_changed: + +- **node_configuration_warning_changed** **(** :ref:`Node` node **)** + +Emitted when a node's configuration changed. Only emitted in ``tool`` mode. + +---- + +.. _class_SceneTree_signal_node_removed: + +- **node_removed** **(** :ref:`Node` node **)** + +Emitted whenever a node is removed from the ``SceneTree``. + +---- + +.. _class_SceneTree_signal_node_renamed: + +- **node_renamed** **(** :ref:`Node` node **)** + +Emitted whenever a node is renamed. + +---- + +.. _class_SceneTree_signal_physics_frame: + +- **physics_frame** **(** **)** + +Emitted immediately before :ref:`Node._physics_process` is called on every node in the ``SceneTree``. + +---- + +.. _class_SceneTree_signal_screen_resized: + +- **screen_resized** **(** **)** + +Emitted when the screen resolution (fullscreen) or window size (windowed) changes. + +---- + +.. _class_SceneTree_signal_server_disconnected: + +- **server_disconnected** **(** **)** + +Emitted whenever this ``SceneTree``'s :ref:`network_peer` disconnected from server. Only emitted on clients. + +---- + +.. _class_SceneTree_signal_tree_changed: + +- **tree_changed** **(** **)** + +Emitted whenever the ``SceneTree`` hierarchy changed (children being moved or renamed, etc.). + +Enumerations +------------ + +.. _enum_SceneTree_GroupCallFlags: + +.. _class_SceneTree_constant_GROUP_CALL_DEFAULT: + +.. _class_SceneTree_constant_GROUP_CALL_REVERSE: + +.. _class_SceneTree_constant_GROUP_CALL_REALTIME: + +.. _class_SceneTree_constant_GROUP_CALL_UNIQUE: + +enum **GroupCallFlags**: + +- **GROUP_CALL_DEFAULT** = **0** --- Call a group with no flags (default). + +- **GROUP_CALL_REVERSE** = **1** --- Call a group in reverse scene order. + +- **GROUP_CALL_REALTIME** = **2** --- Call a group immediately (calls are normally made on idle). + +- **GROUP_CALL_UNIQUE** = **4** --- Call a group only once even if the call is executed many times. + +---- + +.. _enum_SceneTree_StretchMode: + +.. _class_SceneTree_constant_STRETCH_MODE_DISABLED: + +.. _class_SceneTree_constant_STRETCH_MODE_2D: + +.. _class_SceneTree_constant_STRETCH_MODE_VIEWPORT: + +enum **StretchMode**: + +- **STRETCH_MODE_DISABLED** = **0** --- No stretching. + +- **STRETCH_MODE_2D** = **1** --- Render stretching in higher resolution (interpolated). + +- **STRETCH_MODE_VIEWPORT** = **2** --- Keep the specified display resolution. No interpolation. Content may appear pixelated. + +---- + +.. _enum_SceneTree_StretchAspect: + +.. _class_SceneTree_constant_STRETCH_ASPECT_IGNORE: + +.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP: + +.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_WIDTH: + +.. _class_SceneTree_constant_STRETCH_ASPECT_KEEP_HEIGHT: + +.. _class_SceneTree_constant_STRETCH_ASPECT_EXPAND: + +enum **StretchAspect**: + +- **STRETCH_ASPECT_IGNORE** = **0** --- Fill the window with the content stretched to cover excessive space. Content may appear stretched. + +- **STRETCH_ASPECT_KEEP** = **1** --- Retain the same aspect ratio by padding with black bars on either axis. This prevents distortion. + +- **STRETCH_ASPECT_KEEP_WIDTH** = **2** --- Expand vertically. Left/right black bars may appear if the window is too wide. + +- **STRETCH_ASPECT_KEEP_HEIGHT** = **3** --- Expand horizontally. Top/bottom black bars may appear if the window is too tall. + +- **STRETCH_ASPECT_EXPAND** = **4** --- Expand in both directions, retaining the same aspect ratio. This prevents distortion while avoiding black bars. + +Property Descriptions +--------------------- + +.. _class_SceneTree_property_current_scene: + +- :ref:`Node` **current_scene** + ++----------+--------------------------+ +| *Setter* | set_current_scene(value) | ++----------+--------------------------+ +| *Getter* | get_current_scene() | ++----------+--------------------------+ + +The current scene. + +---- + +.. _class_SceneTree_property_debug_collisions_hint: + +- :ref:`bool` **debug_collisions_hint** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_debug_collisions_hint(value) | ++-----------+----------------------------------+ +| *Getter* | is_debugging_collisions_hint() | ++-----------+----------------------------------+ + +If ``true``, collision shapes will be visible when running the game from the editor for debugging purposes. + +---- + +.. _class_SceneTree_property_debug_navigation_hint: + +- :ref:`bool` **debug_navigation_hint** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_debug_navigation_hint(value) | ++-----------+----------------------------------+ +| *Getter* | is_debugging_navigation_hint() | ++-----------+----------------------------------+ + +If ``true``, navigation polygons will be visible when running the game from the editor for debugging purposes. + +---- + +.. _class_SceneTree_property_edited_scene_root: + +- :ref:`Node` **edited_scene_root** + ++----------+------------------------------+ +| *Setter* | set_edited_scene_root(value) | ++----------+------------------------------+ +| *Getter* | get_edited_scene_root() | ++----------+------------------------------+ + +The root of the edited scene. + +---- + +.. _class_SceneTree_property_multiplayer: + +- :ref:`MultiplayerAPI` **multiplayer** + ++----------+------------------------+ +| *Setter* | set_multiplayer(value) | ++----------+------------------------+ +| *Getter* | get_multiplayer() | ++----------+------------------------+ + +The default :ref:`MultiplayerAPI` instance for this ``SceneTree``. + +---- + +.. _class_SceneTree_property_multiplayer_poll: + +- :ref:`bool` **multiplayer_poll** + ++-----------+-------------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------------+ +| *Setter* | set_multiplayer_poll_enabled(value) | ++-----------+-------------------------------------+ +| *Getter* | is_multiplayer_poll_enabled() | ++-----------+-------------------------------------+ + +If ``true`` (default value), enables automatic polling of the :ref:`MultiplayerAPI` for this SceneTree during :ref:`idle_frame`. + +If ``false``, you need to manually call :ref:`MultiplayerAPI.poll` to process network packets and deliver RPCs/RSETs. This allows running RPCs/RSETs in a different loop (e.g. physics, thread, specific time step) and for manual :ref:`Mutex` protection when accessing the :ref:`MultiplayerAPI` from threads. + +---- + +.. _class_SceneTree_property_network_peer: + +- :ref:`NetworkedMultiplayerPeer` **network_peer** + ++----------+-------------------------+ +| *Setter* | set_network_peer(value) | ++----------+-------------------------+ +| *Getter* | get_network_peer() | ++----------+-------------------------+ + +The peer object to handle the RPC system (effectively enabling networking when set). Depending on the peer itself, the ``SceneTree`` will become a network server (check with :ref:`is_network_server`) and will set the root node's network mode to master, or it will become a regular peer with the root node set to puppet. All child nodes are set to inherit the network mode by default. Handling of networking-related events (connection, disconnection, new clients) is done by connecting to ``SceneTree``'s signals. + +---- + +.. _class_SceneTree_property_paused: + +- :ref:`bool` **paused** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_pause(value) | ++-----------+------------------+ +| *Getter* | is_paused() | ++-----------+------------------+ + +If ``true``, the ``SceneTree`` is paused. Doing so will have the following behavior: + +- 2D and 3D physics will be stopped. This includes signals and collision detection. + +- :ref:`Node._process`, :ref:`Node._physics_process` and :ref:`Node._input` will not be called anymore in nodes. + +---- + +.. _class_SceneTree_property_refuse_new_network_connections: + +- :ref:`bool` **refuse_new_network_connections** + ++-----------+-------------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------------+ +| *Setter* | set_refuse_new_network_connections(value) | ++-----------+-------------------------------------------+ +| *Getter* | is_refusing_new_network_connections() | ++-----------+-------------------------------------------+ + +If ``true``, the ``SceneTree``'s :ref:`network_peer` refuses new incoming connections. + +---- + +.. _class_SceneTree_property_root: + +- :ref:`Viewport` **root** + ++----------+------------+ +| *Getter* | get_root() | ++----------+------------+ + +The ``SceneTree``'s root :ref:`Viewport`. + +---- + +.. _class_SceneTree_property_use_font_oversampling: + +- :ref:`bool` **use_font_oversampling** + ++-----------+----------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------+ +| *Setter* | set_use_font_oversampling(value) | ++-----------+----------------------------------+ +| *Getter* | is_using_font_oversampling() | ++-----------+----------------------------------+ + +If ``true``, font oversampling is enabled. This means that :ref:`DynamicFont`\ s will be rendered at higher or lower size than configured based on the viewport's scaling ratio. For example, in a viewport scaled with a factor 1.5, a font configured with size 14 would be rendered with size 21 (``14 * 1.5``). + +**Note:** Font oversampling is only used if the viewport stretch mode is :ref:`STRETCH_MODE_VIEWPORT`, and if the stretch aspect mode is different from :ref:`STRETCH_ASPECT_IGNORE`. + +**Note:** This property is set automatically for the active ``SceneTree`` when the project starts based on the configuration of ``rendering/quality/dynamic_fonts/use_oversampling`` in :ref:`ProjectSettings`. The property can however be overridden at runtime as needed. + +Method Descriptions +------------------- + +.. _class_SceneTree_method_call_group: + +- :ref:`Variant` **call_group** **(** :ref:`String` group, :ref:`String` method, ... **)** |vararg| + +Calls ``method`` on each member of the given group. You can pass arguments to ``method`` by specifying them at the end of the method call. This method is equivalent of calling :ref:`call_group_flags` with :ref:`GROUP_CALL_DEFAULT` flag. + +**Note:** ``method`` may only have 5 arguments at most (7 arguments passed to this method in total). + +**Note:** Due to design limitations, :ref:`call_group` will fail silently if one of the arguments is ``null``. + +**Note:** :ref:`call_group` will always call methods with an one-frame delay, in a way similar to :ref:`Object.call_deferred`. To call methods immediately, use :ref:`call_group_flags` with the :ref:`GROUP_CALL_REALTIME` flag. + +---- + +.. _class_SceneTree_method_call_group_flags: + +- :ref:`Variant` **call_group_flags** **(** :ref:`int` flags, :ref:`String` group, :ref:`String` method, ... **)** |vararg| + +Calls ``method`` on each member of the given group, respecting the given :ref:`GroupCallFlags`. You can pass arguments to ``method`` by specifying them at the end of the method call. + +**Note:** ``method`` may only have 5 arguments at most (8 arguments passed to this method in total). + +**Note:** Due to design limitations, :ref:`call_group_flags` will fail silently if one of the arguments is ``null``. + +:: + + # Call the method immediately and in reverse order. + get_tree().call_group_flags(SceneTree.GROUP_CALL_REALTIME | SceneTree.GROUP_CALL_REVERSE, "bases", "destroy") + +---- + +.. _class_SceneTree_method_change_scene: + +- :ref:`Error` **change_scene** **(** :ref:`String` path **)** + +Changes the running scene to the one at the given ``path``, after loading it into a :ref:`PackedScene` and creating a new instance. + +Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_CANT_OPEN` if the ``path`` cannot be loaded into a :ref:`PackedScene`, or :ref:`@GlobalScope.ERR_CANT_CREATE` if that scene cannot be instantiated. + +**Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene` call. + +---- + +.. _class_SceneTree_method_change_scene_to: + +- :ref:`Error` **change_scene_to** **(** :ref:`PackedScene` packed_scene **)** + +Changes the running scene to a new instance of the given :ref:`PackedScene`. + +Returns :ref:`@GlobalScope.OK` on success or :ref:`@GlobalScope.ERR_CANT_CREATE` if the scene cannot be instantiated. + +**Note:** The scene change is deferred, which means that the new scene node is added on the next idle frame. You won't be able to access it immediately after the :ref:`change_scene_to` call. + +---- + +.. _class_SceneTree_method_create_timer: + +- :ref:`SceneTreeTimer` **create_timer** **(** :ref:`float` time_sec, :ref:`bool` pause_mode_process=true **)** + +Returns a :ref:`SceneTreeTimer` which will :ref:`SceneTreeTimer.timeout` after the given time in seconds elapsed in this ``SceneTree``. If ``pause_mode_process`` is set to ``false``, pausing the ``SceneTree`` will also pause the timer. + +Commonly used to create a one-shot delay timer as in the following example: + +:: + + func some_function(): + print("start") + yield(get_tree().create_timer(1.0), "timeout") + print("end") + +The timer will be automatically freed after its time elapses. + +---- + +.. _class_SceneTree_method_get_frame: + +- :ref:`int` **get_frame** **(** **)** |const| + +Returns the current frame number, i.e. the total frame count since the application started. + +---- + +.. _class_SceneTree_method_get_network_connected_peers: + +- :ref:`PoolIntArray` **get_network_connected_peers** **(** **)** |const| + +Returns the peer IDs of all connected peers of this ``SceneTree``'s :ref:`network_peer`. + +---- + +.. _class_SceneTree_method_get_network_unique_id: + +- :ref:`int` **get_network_unique_id** **(** **)** |const| + +Returns the unique peer ID of this ``SceneTree``'s :ref:`network_peer`. + +---- + +.. _class_SceneTree_method_get_node_count: + +- :ref:`int` **get_node_count** **(** **)** |const| + +Returns the number of nodes in this ``SceneTree``. + +---- + +.. _class_SceneTree_method_get_nodes_in_group: + +- :ref:`Array` **get_nodes_in_group** **(** :ref:`String` group **)** + +Returns a list of all nodes assigned to the given group. + +---- + +.. _class_SceneTree_method_get_rpc_sender_id: + +- :ref:`int` **get_rpc_sender_id** **(** **)** |const| + +Returns the sender's peer ID for the most recently received RPC call. + +---- + +.. _class_SceneTree_method_has_group: + +- :ref:`bool` **has_group** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the given group exists. + +---- + +.. _class_SceneTree_method_has_network_peer: + +- :ref:`bool` **has_network_peer** **(** **)** |const| + +Returns ``true`` if there is a :ref:`network_peer` set. + +---- + +.. _class_SceneTree_method_is_input_handled: + +- :ref:`bool` **is_input_handled** **(** **)** + +Returns ``true`` if the most recent :ref:`InputEvent` was marked as handled with :ref:`set_input_as_handled`. + +---- + +.. _class_SceneTree_method_is_network_server: + +- :ref:`bool` **is_network_server** **(** **)** |const| + +Returns ``true`` if this ``SceneTree``'s :ref:`network_peer` is in server mode (listening for connections). + +---- + +.. _class_SceneTree_method_notify_group: + +- void **notify_group** **(** :ref:`String` group, :ref:`int` notification **)** + +Sends the given notification to all members of the ``group``. + +---- + +.. _class_SceneTree_method_notify_group_flags: + +- void **notify_group_flags** **(** :ref:`int` call_flags, :ref:`String` group, :ref:`int` notification **)** + +Sends the given notification to all members of the ``group``, respecting the given :ref:`GroupCallFlags`. + +---- + +.. _class_SceneTree_method_queue_delete: + +- void **queue_delete** **(** :ref:`Object` obj **)** + +Queues the given object for deletion, delaying the call to :ref:`Object.free` to after the current frame. + +---- + +.. _class_SceneTree_method_quit: + +- void **quit** **(** :ref:`int` exit_code=-1 **)** + +Quits the application at the end of the current iteration. A process ``exit_code`` can optionally be passed as an argument. If this argument is ``0`` or greater, it will override the :ref:`OS.exit_code` defined before quitting the application. + +**Note:** On iOS this method doesn't work. Instead, as recommended by the iOS Human Interface Guidelines, the user is expected to close apps via the Home button. + +---- + +.. _class_SceneTree_method_reload_current_scene: + +- :ref:`Error` **reload_current_scene** **(** **)** + +Reloads the currently active scene. + +Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_UNCONFIGURED` if no :ref:`current_scene` was defined yet, :ref:`@GlobalScope.ERR_CANT_OPEN` if :ref:`current_scene` cannot be loaded into a :ref:`PackedScene`, or :ref:`@GlobalScope.ERR_CANT_CREATE` if the scene cannot be instantiated. + +---- + +.. _class_SceneTree_method_set_auto_accept_quit: + +- void **set_auto_accept_quit** **(** :ref:`bool` enabled **)** + +If ``true``, the application automatically accepts quitting. Enabled by default. + +For mobile platforms, see :ref:`set_quit_on_go_back`. + +---- + +.. _class_SceneTree_method_set_group: + +- void **set_group** **(** :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** + +Sets the given ``property`` to ``value`` on all members of the given group. + +---- + +.. _class_SceneTree_method_set_group_flags: + +- void **set_group_flags** **(** :ref:`int` call_flags, :ref:`String` group, :ref:`String` property, :ref:`Variant` value **)** + +Sets the given ``property`` to ``value`` on all members of the given group, respecting the given :ref:`GroupCallFlags`. + +---- + +.. _class_SceneTree_method_set_input_as_handled: + +- void **set_input_as_handled** **(** **)** + +Marks the most recent :ref:`InputEvent` as handled. + +---- + +.. _class_SceneTree_method_set_quit_on_go_back: + +- void **set_quit_on_go_back** **(** :ref:`bool` enabled **)** + +If ``true``, the application quits automatically on going back (e.g. on Android). Enabled by default. + +To handle 'Go Back' button when this option is disabled, use :ref:`MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST`. + +---- + +.. _class_SceneTree_method_set_screen_stretch: + +- void **set_screen_stretch** **(** :ref:`StretchMode` mode, :ref:`StretchAspect` aspect, :ref:`Vector2` minsize, :ref:`float` scale=1 **)** + +Configures screen stretching to the given :ref:`StretchMode`, :ref:`StretchAspect`, minimum size and ``scale``. + +.. |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.)` diff --git a/classes/class_scenetreetimer.rst b/classes/class_scenetreetimer.rst new file mode 100644 index 0000000..c6b889c --- /dev/null +++ b/classes/class_scenetreetimer.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SceneTreeTimer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SceneTreeTimer: + +SceneTreeTimer +============== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +One-shot timer. + +Description +----------- + +A one-shot timer managed by the scene tree, which emits :ref:`timeout` on completion. See also :ref:`SceneTree.create_timer`. + +As opposed to :ref:`Timer`, it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example: + +:: + + func some_function(): + print("Timer started.") + yield(get_tree().create_timer(1.0), "timeout") + print("Timer ended.") + +The timer will be automatically freed after its time elapses. + +Properties +---------- + ++---------------------------+-----------------------------------------------------------+ +| :ref:`float` | :ref:`time_left` | ++---------------------------+-----------------------------------------------------------+ + +Signals +------- + +.. _class_SceneTreeTimer_signal_timeout: + +- **timeout** **(** **)** + +Emitted when the timer reaches 0. + +Property Descriptions +--------------------- + +.. _class_SceneTreeTimer_property_time_left: + +- :ref:`float` **time_left** + ++----------+----------------------+ +| *Setter* | set_time_left(value) | ++----------+----------------------+ +| *Getter* | get_time_left() | ++----------+----------------------+ + +The time remaining (in seconds). + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_script.rst b/classes/class_script.rst new file mode 100644 index 0000000..da25461 --- /dev/null +++ b/classes/class_script.rst @@ -0,0 +1,190 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Script.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Script: + +Script +====== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`CSharpScript`, :ref:`GDScript`, :ref:`NativeScript`, :ref:`PluginScript`, :ref:`VisualScript` + +A class stored as a resource. + +Description +----------- + +A class stored as a resource. A script extends the functionality of all objects that instance it. + +The ``new`` method of a script subclass creates a new instance. :ref:`Object.set_script` extends an existing object, if that object's class matches one of the script's base classes. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/index` + +Properties +---------- + ++-----------------------------+-------------------------------------------------------+ +| :ref:`String` | :ref:`source_code` | ++-----------------------------+-------------------------------------------------------+ + +Methods +------- + ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_instance` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Script` | :ref:`get_base_script` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_instance_base_type` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_property_default_value` **(** :ref:`String` property **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_script_constant_map` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_script_method_list` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_script_property_list` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_script_signal_list` **(** **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_script_signal` **(** :ref:`String` signal_name **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_source_code` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`instance_has` **(** :ref:`Object` base_object **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_tool` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`reload` **(** :ref:`bool` keep_state=false **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Script_property_source_code: + +- :ref:`String` **source_code** + ++----------+------------------------+ +| *Setter* | set_source_code(value) | ++----------+------------------------+ +| *Getter* | get_source_code() | ++----------+------------------------+ + +The script source code or an empty string if source code is not available. When set, does not reload the class implementation automatically. + +Method Descriptions +------------------- + +.. _class_Script_method_can_instance: + +- :ref:`bool` **can_instance** **(** **)** |const| + +Returns ``true`` if the script can be instanced. + +---- + +.. _class_Script_method_get_base_script: + +- :ref:`Script` **get_base_script** **(** **)** |const| + +Returns the script directly inherited by this script. + +---- + +.. _class_Script_method_get_instance_base_type: + +- :ref:`String` **get_instance_base_type** **(** **)** |const| + +Returns the script's base type. + +---- + +.. _class_Script_method_get_property_default_value: + +- :ref:`Variant` **get_property_default_value** **(** :ref:`String` property **)** + +Returns the default value of the specified property. + +---- + +.. _class_Script_method_get_script_constant_map: + +- :ref:`Dictionary` **get_script_constant_map** **(** **)** + +Returns a dictionary containing constant names and their values. + +---- + +.. _class_Script_method_get_script_method_list: + +- :ref:`Array` **get_script_method_list** **(** **)** + +Returns the list of methods in this ``Script``. + +---- + +.. _class_Script_method_get_script_property_list: + +- :ref:`Array` **get_script_property_list** **(** **)** + +Returns the list of properties in this ``Script``. + +---- + +.. _class_Script_method_get_script_signal_list: + +- :ref:`Array` **get_script_signal_list** **(** **)** + +Returns the list of user signals defined in this ``Script``. + +---- + +.. _class_Script_method_has_script_signal: + +- :ref:`bool` **has_script_signal** **(** :ref:`String` signal_name **)** |const| + +Returns ``true`` if the script, or a base class, defines a signal with the given name. + +---- + +.. _class_Script_method_has_source_code: + +- :ref:`bool` **has_source_code** **(** **)** |const| + +Returns ``true`` if the script contains non-empty source code. + +---- + +.. _class_Script_method_instance_has: + +- :ref:`bool` **instance_has** **(** :ref:`Object` base_object **)** |const| + +Returns ``true`` if ``base_object`` is an instance of this script. + +---- + +.. _class_Script_method_is_tool: + +- :ref:`bool` **is_tool** **(** **)** |const| + +Returns ``true`` if the script is a tool script. A tool script can run in the editor. + +---- + +.. _class_Script_method_reload: + +- :ref:`Error` **reload** **(** :ref:`bool` keep_state=false **)** + +Reloads the script's class implementation. Returns an error code. + +.. |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.)` diff --git a/classes/class_scriptcreatedialog.rst b/classes/class_scriptcreatedialog.rst new file mode 100644 index 0000000..0f828c6 --- /dev/null +++ b/classes/class_scriptcreatedialog.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ScriptCreateDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ScriptCreateDialog: + +ScriptCreateDialog +================== + +**Inherits:** :ref:`ConfirmationDialog` **<** :ref:`AcceptDialog` **<** :ref:`WindowDialog` **<** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +The Editor's popup dialog for creating new :ref:`Script` files. + +Description +----------- + +The ``ScriptCreateDialog`` creates script files according to a given template for a given scripting language. The standard use is to configure its fields prior to calling one of the :ref:`Popup.popup` methods. + +:: + + func _ready(): + dialog.config("Node", "res://new_node.gd") # For in-engine types + dialog.config("\"res://base_node.gd\"", "res://derived_node.gd") # For script types + dialog.popup_centered() + +Properties +---------- + ++-------------------------------+-------------------+----------------------------------------------+ +| :ref:`bool` | dialog_hide_on_ok | ``false`` *(parent override)* | ++-------------------------------+-------------------+----------------------------------------------+ +| :ref:`float` | margin_bottom | ``258.0`` *(parent override)* | ++-------------------------------+-------------------+----------------------------------------------+ +| :ref:`float` | margin_right | ``366.0`` *(parent override)* | ++-------------------------------+-------------------+----------------------------------------------+ +| :ref:`Vector2` | rect_size | ``Vector2( 366, 258 )`` *(parent override)* | ++-------------------------------+-------------------+----------------------------------------------+ +| :ref:`String` | window_title | ``"Attach Node Script"`` *(parent override)* | ++-------------------------------+-------------------+----------------------------------------------+ + +Methods +------- + ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`config` **(** :ref:`String` inherits, :ref:`String` path, :ref:`bool` built_in_enabled=true, :ref:`bool` load_enabled=true **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ScriptCreateDialog_signal_script_created: + +- **script_created** **(** :ref:`Script` script **)** + +Emitted when the user clicks the OK button. + +Method Descriptions +------------------- + +.. _class_ScriptCreateDialog_method_config: + +- void **config** **(** :ref:`String` inherits, :ref:`String` path, :ref:`bool` built_in_enabled=true, :ref:`bool` load_enabled=true **)** + +Prefills required fields to configure the ScriptCreateDialog for use. + +.. |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.)` diff --git a/classes/class_scripteditor.rst b/classes/class_scripteditor.rst new file mode 100644 index 0000000..945b7e2 --- /dev/null +++ b/classes/class_scripteditor.rst @@ -0,0 +1,110 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ScriptEditor.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ScriptEditor: + +ScriptEditor +============ + +**Inherits:** :ref:`PanelContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Godot editor's script editor. + +Description +----------- + +**Note:** This class shouldn't be instantiated directly. Instead, access the singleton using :ref:`EditorInterface.get_script_editor`. + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_drop_data_fw` **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`drop_data_fw` **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Script` | :ref:`get_current_script` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_drag_data_fw` **(** :ref:`Vector2` point, :ref:`Control` from **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_open_scripts` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`goto_line` **(** :ref:`int` line_number **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`open_script_create_dialog` **(** :ref:`String` base_name, :ref:`String` base_path **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_ScriptEditor_signal_editor_script_changed: + +- **editor_script_changed** **(** :ref:`Script` script **)** + +Emitted when user changed active script. Argument is a freshly activated :ref:`Script`. + +---- + +.. _class_ScriptEditor_signal_script_close: + +- **script_close** **(** :ref:`Script` script **)** + +Emitted when editor is about to close the active script. Argument is a :ref:`Script` that is going to be closed. + +Method Descriptions +------------------- + +.. _class_ScriptEditor_method_can_drop_data_fw: + +- :ref:`bool` **can_drop_data_fw** **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** |const| + +---- + +.. _class_ScriptEditor_method_drop_data_fw: + +- void **drop_data_fw** **(** :ref:`Vector2` point, :ref:`Variant` data, :ref:`Control` from **)** + +---- + +.. _class_ScriptEditor_method_get_current_script: + +- :ref:`Script` **get_current_script** **(** **)** + +Returns a :ref:`Script` that is currently active in editor. + +---- + +.. _class_ScriptEditor_method_get_drag_data_fw: + +- :ref:`Variant` **get_drag_data_fw** **(** :ref:`Vector2` point, :ref:`Control` from **)** + +---- + +.. _class_ScriptEditor_method_get_open_scripts: + +- :ref:`Array` **get_open_scripts** **(** **)** |const| + +Returns an array with all :ref:`Script` objects which are currently open in editor. + +---- + +.. _class_ScriptEditor_method_goto_line: + +- void **goto_line** **(** :ref:`int` line_number **)** + +Goes to the specified line in the current script. + +---- + +.. _class_ScriptEditor_method_open_script_create_dialog: + +- void **open_script_create_dialog** **(** :ref:`String` base_name, :ref:`String` base_path **)** + +Opens the script create dialog. The script will extend ``base_name``. The file extension can be omitted from ``base_path``. It will be added based on the selected scripting language. + +.. |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.)` diff --git a/classes/class_scrollbar.rst b/classes/class_scrollbar.rst new file mode 100644 index 0000000..76d6148 --- /dev/null +++ b/classes/class_scrollbar.rst @@ -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 ScrollBar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ScrollBar: + +ScrollBar +========= + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`HScrollBar`, :ref:`VScrollBar` + +Base class for scroll bars. + +Description +----------- + +Scrollbars are a :ref:`Range`-based :ref:`Control`, that display a draggable area (the size of the page). Horizontal (:ref:`HScrollBar`) and Vertical (:ref:`VScrollBar`) versions are available. + +Properties +---------- + ++---------------------------+----------------------------------------------------------+-----------------------------+ +| :ref:`float` | :ref:`custom_step` | ``-1.0`` | ++---------------------------+----------------------------------------------------------+-----------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` *(parent override)* | ++---------------------------+----------------------------------------------------------+-----------------------------+ +| :ref:`float` | step | ``0.0`` *(parent override)* | ++---------------------------+----------------------------------------------------------+-----------------------------+ + +Signals +------- + +.. _class_ScrollBar_signal_scrolling: + +- **scrolling** **(** **)** + +Emitted when the scrollbar is being scrolled. + +Property Descriptions +--------------------- + +.. _class_ScrollBar_property_custom_step: + +- :ref:`float` **custom_step** + ++-----------+------------------------+ +| *Default* | ``-1.0`` | ++-----------+------------------------+ +| *Setter* | set_custom_step(value) | ++-----------+------------------------+ +| *Getter* | get_custom_step() | ++-----------+------------------------+ + +Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the ``ScrollBar`` is focused. + +.. |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.)` diff --git a/classes/class_scrollcontainer.rst b/classes/class_scrollcontainer.rst new file mode 100644 index 0000000..5847ae3 --- /dev/null +++ b/classes/class_scrollcontainer.rst @@ -0,0 +1,220 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ScrollContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ScrollContainer: + +ScrollContainer +=============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorInspector` + +A helper node for displaying scrollable elements such as lists. + +Description +----------- + +A ScrollContainer node meant to contain a :ref:`Control` child. ScrollContainers will automatically create a scrollbar child (:ref:`HScrollBar`, :ref:`VScrollBar`, or both) when needed and will only draw the Control within the ScrollContainer area. Scrollbars will automatically be drawn at the right (for vertical) or bottom (for horizontal) and will enable dragging to move the viewable Control (and its children) within the ScrollContainer. Scrollbars will also automatically resize the grabber based on the :ref:`Control.rect_min_size` of the Control relative to the ScrollContainer. Works great with a :ref:`Panel` control. You can set ``EXPAND`` on the children's size flags, so they will upscale to the ScrollContainer's size if it's larger (scroll is invisible for the chosen dimension). + +Properties +---------- + ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`follow_focus` | ``false`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`scroll_deadzone` | ``0`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`scroll_horizontal` | ``0`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`scroll_horizontal_enabled` | ``true`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`scroll_vertical` | ``0`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`scroll_vertical_enabled` | ``true`` | ++-------------------------+--------------------------------------------------------------------------------------------+------------------------------+ + +Methods +------- + ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`ensure_control_visible` **(** :ref:`Control` control **)** | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`HScrollBar` | :ref:`get_h_scrollbar` **(** **)** | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VScrollBar` | :ref:`get_v_scrollbar` **(** **)** | ++-------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-------------------------------------------------+ +| :ref:`StyleBox` | :ref:`bg` | ++---------------------------------+-------------------------------------------------+ + +Signals +------- + +.. _class_ScrollContainer_signal_scroll_ended: + +- **scroll_ended** **(** **)** + +Emitted when scrolling stops. + +---- + +.. _class_ScrollContainer_signal_scroll_started: + +- **scroll_started** **(** **)** + +Emitted when scrolling is started. + +Property Descriptions +--------------------- + +.. _class_ScrollContainer_property_follow_focus: + +- :ref:`bool` **follow_focus** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_follow_focus(value) | ++-----------+-------------------------+ +| *Getter* | is_following_focus() | ++-----------+-------------------------+ + +If ``true``, the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. + +---- + +.. _class_ScrollContainer_property_scroll_deadzone: + +- :ref:`int` **scroll_deadzone** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_deadzone(value) | ++-----------+---------------------+ +| *Getter* | get_deadzone() | ++-----------+---------------------+ + +---- + +.. _class_ScrollContainer_property_scroll_horizontal: + +- :ref:`int` **scroll_horizontal** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_h_scroll(value) | ++-----------+---------------------+ +| *Getter* | get_h_scroll() | ++-----------+---------------------+ + +The current horizontal scroll value. + +---- + +.. _class_ScrollContainer_property_scroll_horizontal_enabled: + +- :ref:`bool` **scroll_horizontal_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_enable_h_scroll(value) | ++-----------+----------------------------+ +| *Getter* | is_h_scroll_enabled() | ++-----------+----------------------------+ + +If ``true``, enables horizontal scrolling. + +---- + +.. _class_ScrollContainer_property_scroll_vertical: + +- :ref:`int` **scroll_vertical** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_v_scroll(value) | ++-----------+---------------------+ +| *Getter* | get_v_scroll() | ++-----------+---------------------+ + +The current vertical scroll value. + +---- + +.. _class_ScrollContainer_property_scroll_vertical_enabled: + +- :ref:`bool` **scroll_vertical_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_enable_v_scroll(value) | ++-----------+----------------------------+ +| *Getter* | is_v_scroll_enabled() | ++-----------+----------------------------+ + +If ``true``, enables vertical scrolling. + +Method Descriptions +------------------- + +.. _class_ScrollContainer_method_ensure_control_visible: + +- void **ensure_control_visible** **(** :ref:`Control` control **)** + +Ensures the given ``control`` is visible (must be a direct or indirect child of the ScrollContainer). Used by :ref:`follow_focus`. + +**Note:** This will not work on a node that was just added during the same frame. If you want to scroll to a newly added child, you must wait until the next frame using :ref:`SceneTree.idle_frame`: + +:: + + add_child(child_node) + yield(get_tree(), "idle_frame") + ensure_control_visible(child_node) + +---- + +.. _class_ScrollContainer_method_get_h_scrollbar: + +- :ref:`HScrollBar` **get_h_scrollbar** **(** **)** + +Returns the horizontal scrollbar :ref:`HScrollBar` of this ``ScrollContainer``. + +**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the horizontal scrollbar, use :ref:`scroll_horizontal_enabled`. If you want to only hide it instead, use its :ref:`CanvasItem.visible` property. + +---- + +.. _class_ScrollContainer_method_get_v_scrollbar: + +- :ref:`VScrollBar` **get_v_scrollbar** **(** **)** + +Returns the vertical scrollbar :ref:`VScrollBar` of this ``ScrollContainer``. + +**Warning:** This is a required internal node, removing and freeing it may cause a crash. If you wish to disable the vertical scrollbar, use :ref:`scroll_vertical_enabled`. If you want to only hide it instead, use its :ref:`CanvasItem.visible` property. + +Theme Property Descriptions +--------------------------- + +.. _class_ScrollContainer_theme_style_bg: + +- :ref:`StyleBox` **bg** + +The background :ref:`StyleBox` of the ``ScrollContainer``. + +.. |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.)` diff --git a/classes/class_segmentshape2d.rst b/classes/class_segmentshape2d.rst new file mode 100644 index 0000000..a905569 --- /dev/null +++ b/classes/class_segmentshape2d.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SegmentShape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SegmentShape2D: + +SegmentShape2D +============== + +**Inherits:** :ref:`Shape2D` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Segment shape for 2D collisions. + +Description +----------- + +Segment shape for 2D collisions. Consists of two points, ``a`` and ``b``. + +Properties +---------- + ++-------------------------------+-------------------------------------------+----------------------+ +| :ref:`Vector2` | :ref:`a` | ``Vector2( 0, 0 )`` | ++-------------------------------+-------------------------------------------+----------------------+ +| :ref:`Vector2` | :ref:`b` | ``Vector2( 0, 10 )`` | ++-------------------------------+-------------------------------------------+----------------------+ + +Property Descriptions +--------------------- + +.. _class_SegmentShape2D_property_a: + +- :ref:`Vector2` **a** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_a(value) | ++-----------+---------------------+ +| *Getter* | get_a() | ++-----------+---------------------+ + +The segment's first point position. + +---- + +.. _class_SegmentShape2D_property_b: + +- :ref:`Vector2` **b** + ++-----------+----------------------+ +| *Default* | ``Vector2( 0, 10 )`` | ++-----------+----------------------+ +| *Setter* | set_b(value) | ++-----------+----------------------+ +| *Getter* | get_b() | ++-----------+----------------------+ + +The segment's second point position. + +.. |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.)` diff --git a/classes/class_semaphore.rst b/classes/class_semaphore.rst new file mode 100644 index 0000000..c5a124e --- /dev/null +++ b/classes/class_semaphore.rst @@ -0,0 +1,54 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Semaphore.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Semaphore: + +Semaphore +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A synchronization semaphore. + +Description +----------- + +A synchronization semaphore which can be used to synchronize multiple :ref:`Thread`\ s. Initialized to zero on creation. Be careful to avoid deadlocks. For a binary version, see :ref:`Mutex`. + +Tutorials +--------- + +- :doc:`../tutorials/performance/threads/using_multiple_threads` + +Methods +------- + ++---------------------------------------+------------------------------------------------------+ +| :ref:`Error` | :ref:`post` **(** **)** | ++---------------------------------------+------------------------------------------------------+ +| :ref:`Error` | :ref:`wait` **(** **)** | ++---------------------------------------+------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Semaphore_method_post: + +- :ref:`Error` **post** **(** **)** + +Lowers the ``Semaphore``, allowing one more thread in. Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_BUSY` otherwise. + +---- + +.. _class_Semaphore_method_wait: + +- :ref:`Error` **wait** **(** **)** + +Tries to wait for the ``Semaphore``, if its value is zero, blocks until non-zero. Returns :ref:`@GlobalScope.OK` on success, :ref:`@GlobalScope.ERR_BUSY` otherwise. + +.. |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.)` diff --git a/classes/class_separator.rst b/classes/class_separator.rst new file mode 100644 index 0000000..be0204a --- /dev/null +++ b/classes/class_separator.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Separator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Separator: + +Separator +========= + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`HSeparator`, :ref:`VSeparator` + +Base class for separators. + +Description +----------- + +Separator is a :ref:`Control` used for separating other controls. It's purely a visual decoration. Horizontal (:ref:`HSeparator`) and Vertical (:ref:`VSeparator`) versions are available. + +.. |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.)` diff --git a/classes/class_shader.rst b/classes/class_shader.rst new file mode 100644 index 0000000..29bc46c --- /dev/null +++ b/classes/class_shader.rst @@ -0,0 +1,147 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Shader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Shader: + +Shader +====== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShader` + +A custom shader program. + +Description +----------- + +This class allows you to define a custom shader program that can be used by a :ref:`ShaderMaterial`. Shaders allow you to write your own custom behavior for rendering objects or updating particle information. For a detailed explanation and usage, please see the tutorials linked below. + +Tutorials +--------- + +- :doc:`../tutorials/shaders/index` + +- :doc:`../tutorials/shaders/introduction_to_shaders` + +Properties +---------- + ++-----------------------------+-------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`code` | ``""`` | ++-----------------------------+-------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`custom_defines` | ``""`` | ++-----------------------------+-------------------------------------------------------------+--------+ + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_default_texture_param` **(** :ref:`String` param **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Mode` | :ref:`get_mode` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_param` **(** :ref:`String` name **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_texture_param` **(** :ref:`String` param, :ref:`Texture` texture **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Shader_Mode: + +.. _class_Shader_constant_MODE_SPATIAL: + +.. _class_Shader_constant_MODE_CANVAS_ITEM: + +.. _class_Shader_constant_MODE_PARTICLES: + +enum **Mode**: + +- **MODE_SPATIAL** = **0** --- Mode used to draw all 3D objects. + +- **MODE_CANVAS_ITEM** = **1** --- Mode used to draw all 2D objects. + +- **MODE_PARTICLES** = **2** --- Mode used to calculate particle information on a per-particle basis. Not used for drawing. + +Property Descriptions +--------------------- + +.. _class_Shader_property_code: + +- :ref:`String` **code** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_code(value) | ++-----------+-----------------+ +| *Getter* | get_code() | ++-----------+-----------------+ + +Returns the shader's code as the user has written it, not the full generated code used internally. + +---- + +.. _class_Shader_property_custom_defines: + +- :ref:`String` **custom_defines** + ++-----------+---------------------------+ +| *Default* | ``""`` | ++-----------+---------------------------+ +| *Setter* | set_custom_defines(value) | ++-----------+---------------------------+ +| *Getter* | get_custom_defines() | ++-----------+---------------------------+ + +Returns the shader's custom defines. Custom defines can be used in Godot to add GLSL preprocessor directives (e.g: extensions) required for the shader logic. + +**Note:** Custom defines are not validated by the Godot shader parser, so care should be taken when using them. + +Method Descriptions +------------------- + +.. _class_Shader_method_get_default_texture_param: + +- :ref:`Texture` **get_default_texture_param** **(** :ref:`String` param **)** |const| + +Returns the texture that is set as default for the specified parameter. + +**Note:** ``param`` must match the name of the uniform in the code exactly. + +---- + +.. _class_Shader_method_get_mode: + +- :ref:`Mode` **get_mode** **(** **)** |const| + +Returns the shader mode for the shader, either :ref:`MODE_CANVAS_ITEM`, :ref:`MODE_SPATIAL` or :ref:`MODE_PARTICLES`. + +---- + +.. _class_Shader_method_has_param: + +- :ref:`bool` **has_param** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the shader has this param defined as a uniform in its code. + +**Note:** ``param`` must match the name of the uniform in the code exactly. + +---- + +.. _class_Shader_method_set_default_texture_param: + +- void **set_default_texture_param** **(** :ref:`String` param, :ref:`Texture` texture **)** + +Sets the default texture to be used with a texture uniform. The default is used if a texture is not set in the :ref:`ShaderMaterial`. + +**Note:** ``param`` must match the name of the uniform in the code exactly. + +.. |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.)` diff --git a/classes/class_shadermaterial.rst b/classes/class_shadermaterial.rst new file mode 100644 index 0000000..d5d109a --- /dev/null +++ b/classes/class_shadermaterial.rst @@ -0,0 +1,100 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ShaderMaterial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ShaderMaterial: + +ShaderMaterial +============== + +**Inherits:** :ref:`Material` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A material that uses a custom :ref:`Shader` program. + +Description +----------- + +A material that uses a custom :ref:`Shader` program to render either items to screen or process particles. You can create multiple materials for the same shader but configure different values for the uniforms defined in the shader. + +**Note:** Due to a renderer limitation, emissive ``ShaderMaterial``\ s cannot emit light when used in a :ref:`GIProbe`. Only emissive :ref:`SpatialMaterial`\ s can emit light in a :ref:`GIProbe`. + +Tutorials +--------- + +- :doc:`../tutorials/shaders/index` + +Properties +---------- + ++-----------------------------+-----------------------------------------------------+ +| :ref:`Shader` | :ref:`shader` | ++-----------------------------+-----------------------------------------------------+ + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_shader_param` **(** :ref:`String` param **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`property_can_revert` **(** :ref:`String` name **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`property_get_revert` **(** :ref:`String` name **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shader_param` **(** :ref:`String` param, :ref:`Variant` value **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ShaderMaterial_property_shader: + +- :ref:`Shader` **shader** + ++----------+-------------------+ +| *Setter* | set_shader(value) | ++----------+-------------------+ +| *Getter* | get_shader() | ++----------+-------------------+ + +The :ref:`Shader` program used to render this material. + +Method Descriptions +------------------- + +.. _class_ShaderMaterial_method_get_shader_param: + +- :ref:`Variant` **get_shader_param** **(** :ref:`String` param **)** |const| + +Returns the current value set for this material of a uniform in the shader. + +---- + +.. _class_ShaderMaterial_method_property_can_revert: + +- :ref:`bool` **property_can_revert** **(** :ref:`String` name **)** + +Returns ``true`` if the property identified by ``name`` can be reverted to a default value. + +---- + +.. _class_ShaderMaterial_method_property_get_revert: + +- :ref:`Variant` **property_get_revert** **(** :ref:`String` name **)** + +Returns the default value of the material property with given ``name``. + +---- + +.. _class_ShaderMaterial_method_set_shader_param: + +- void **set_shader_param** **(** :ref:`String` param, :ref:`Variant` value **)** + +Changes the value set for this material of a uniform in the shader. + +**Note:** ``param`` must match the name of the uniform in the code exactly. + +.. |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.)` diff --git a/classes/class_shape.rst b/classes/class_shape.rst new file mode 100644 index 0000000..1f21007 --- /dev/null +++ b/classes/class_shape.rst @@ -0,0 +1,72 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Shape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Shape: + +Shape +===== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`BoxShape`, :ref:`CapsuleShape`, :ref:`ConcavePolygonShape`, :ref:`ConvexPolygonShape`, :ref:`CylinderShape`, :ref:`HeightMapShape`, :ref:`PlaneShape`, :ref:`RayShape`, :ref:`SphereShape` + +Base class for all 3D shape resources. + +Description +----------- + +Base class for all 3D shape resources. Nodes that inherit from this can be used as shapes for a :ref:`PhysicsBody` or :ref:`Area` objects. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +Properties +---------- + ++---------------------------+--------------------------------------------+----------+ +| :ref:`float` | :ref:`margin` | ``0.04`` | ++---------------------------+--------------------------------------------+----------+ + +Methods +------- + ++-----------------------------------+----------------------------------------------------------------------+ +| :ref:`ArrayMesh` | :ref:`get_debug_mesh` **(** **)** | ++-----------------------------------+----------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Shape_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.04`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +The collision margin for the shape. Used in Bullet Physics only. + +Collision margins allow collision detection to be more efficient by adding an extra shell around shapes. Collision algorithms are more expensive when objects overlap by more than their margin, so a higher value for margins is better for performance, at the cost of accuracy around edges as it makes them less sharp. + +Method Descriptions +------------------- + +.. _class_Shape_method_get_debug_mesh: + +- :ref:`ArrayMesh` **get_debug_mesh** **(** **)** + +Returns the :ref:`ArrayMesh` used to draw the debug collision for this ``Shape``. + +.. |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.)` diff --git a/classes/class_shape2d.rst b/classes/class_shape2d.rst new file mode 100644 index 0000000..a238ea1 --- /dev/null +++ b/classes/class_shape2d.rst @@ -0,0 +1,118 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Shape2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Shape2D: + +Shape2D +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`CapsuleShape2D`, :ref:`CircleShape2D`, :ref:`ConcavePolygonShape2D`, :ref:`ConvexPolygonShape2D`, :ref:`LineShape2D`, :ref:`RayShape2D`, :ref:`RectangleShape2D`, :ref:`SegmentShape2D` + +Base class for all 2D shapes. + +Description +----------- + +Base class for all 2D shapes. All 2D shape types inherit from this. + +Tutorials +--------- + +- :doc:`../tutorials/physics/physics_introduction` + +Properties +---------- + ++---------------------------+----------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`custom_solver_bias` | ``0.0`` | ++---------------------------+----------------------------------------------------------------------+---------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`collide` **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`collide_and_get_contacts` **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`collide_with_motion` **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`collide_with_motion_and_get_contacts` **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Color` color **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Shape2D_property_custom_solver_bias: + +- :ref:`float` **custom_solver_bias** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_custom_solver_bias(value) | ++-----------+-------------------------------+ +| *Getter* | get_custom_solver_bias() | ++-----------+-------------------------------+ + +The shape's custom solver bias. + +Method Descriptions +------------------- + +.. _class_Shape2D_method_collide: + +- :ref:`bool` **collide** **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** + +Returns ``true`` if this shape is colliding with another. + +This method needs the transformation matrix for this shape (``local_xform``), the shape to check collisions with (``with_shape``), and the transformation matrix of that shape (``shape_xform``). + +---- + +.. _class_Shape2D_method_collide_and_get_contacts: + +- :ref:`Array` **collide_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform **)** + +Returns a list of the points where this shape touches another. If there are no collisions the list is empty. + +This method needs the transformation matrix for this shape (``local_xform``), the shape to check collisions with (``with_shape``), and the transformation matrix of that shape (``shape_xform``). + +---- + +.. _class_Shape2D_method_collide_with_motion: + +- :ref:`bool` **collide_with_motion** **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** + +Returns whether this shape would collide with another, if a given movement was applied. + +This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). + +---- + +.. _class_Shape2D_method_collide_with_motion_and_get_contacts: + +- :ref:`Array` **collide_with_motion_and_get_contacts** **(** :ref:`Transform2D` local_xform, :ref:`Vector2` local_motion, :ref:`Shape2D` with_shape, :ref:`Transform2D` shape_xform, :ref:`Vector2` shape_motion **)** + +Returns a list of the points where this shape would touch another, if a given movement was applied. If there are no collisions the list is empty. + +This method needs the transformation matrix for this shape (``local_xform``), the movement to test on this shape (``local_motion``), the shape to check collisions with (``with_shape``), the transformation matrix of that shape (``shape_xform``), and the movement to test onto the other object (``shape_motion``). + +---- + +.. _class_Shape2D_method_draw: + +- void **draw** **(** :ref:`RID` canvas_item, :ref:`Color` color **)** + +Draws a solid shape onto a :ref:`CanvasItem` with the :ref:`VisualServer` API filled with the specified ``color``. The exact drawing method is specific for each shape and cannot be configured. + +.. |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.)` diff --git a/classes/class_shortcut.rst b/classes/class_shortcut.rst new file mode 100644 index 0000000..9791970 --- /dev/null +++ b/classes/class_shortcut.rst @@ -0,0 +1,85 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ShortCut.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ShortCut: + +ShortCut +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A shortcut for binding input. + +Description +----------- + +A shortcut for binding input. + +Shortcuts are commonly used for interacting with a :ref:`Control` element from a :ref:`InputEvent`. + +Properties +---------- + ++-------------------------------------+---------------------------------------------------+ +| :ref:`InputEvent` | :ref:`shortcut` | ++-------------------------------------+---------------------------------------------------+ + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_as_text` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_shortcut` **(** :ref:`InputEvent` event **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ShortCut_property_shortcut: + +- :ref:`InputEvent` **shortcut** + ++----------+---------------------+ +| *Setter* | set_shortcut(value) | ++----------+---------------------+ +| *Getter* | get_shortcut() | ++----------+---------------------+ + +The shortcut's :ref:`InputEvent`. + +Generally the :ref:`InputEvent` is a keyboard key, though it can be any :ref:`InputEvent`. + +Method Descriptions +------------------- + +.. _class_ShortCut_method_get_as_text: + +- :ref:`String` **get_as_text** **(** **)** |const| + +Returns the shortcut's :ref:`InputEvent` as a :ref:`String`. + +---- + +.. _class_ShortCut_method_is_shortcut: + +- :ref:`bool` **is_shortcut** **(** :ref:`InputEvent` event **)** |const| + +Returns ``true`` if the shortcut's :ref:`InputEvent` equals ``event``. + +---- + +.. _class_ShortCut_method_is_valid: + +- :ref:`bool` **is_valid** **(** **)** |const| + +If ``true``, this shortcut is valid. + +.. |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.)` diff --git a/classes/class_skeleton.rst b/classes/class_skeleton.rst new file mode 100644 index 0000000..9098304 --- /dev/null +++ b/classes/class_skeleton.rst @@ -0,0 +1,332 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Skeleton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Skeleton: + +Skeleton +======== + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Skeleton for characters and animated objects. + +Description +----------- + +Skeleton provides a hierarchical interface for managing bones, including pose, rest and animation (see :ref:`Animation`). It can also use ragdoll physics. + +The overall transform of a bone with respect to the skeleton is determined by the following hierarchical order: rest pose, custom pose and pose. + +Note that "global pose" below refers to the overall transform of the bone with respect to skeleton, so it not the actual global/world transform of the bone. + +Tutorials +--------- + +- `3D Inverse Kinematics Demo `__ + +- `Third Person Shooter Demo `__ + +Methods +------- + ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bone` **(** :ref:`String` name **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`bind_child_node_to_bone` **(** :ref:`int` bone_idx, :ref:`Node` node **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_bones` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_bones_global_pose_override` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_bone` **(** :ref:`String` name **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_count` **(** **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_custom_pose` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_global_pose` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_global_pose_no_override` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_bone_name` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_parent` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_pose` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bone_rest` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_bound_child_nodes_to_bone` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_bone_rest_disabled` **(** :ref:`int` bone_idx **)** |const| | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`localize_rests` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`physical_bones_add_collision_exception` **(** :ref:`RID` exception **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`physical_bones_remove_collision_exception` **(** :ref:`RID` exception **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`physical_bones_start_simulation` **(** :ref:`Array` bones=[ ] **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`physical_bones_stop_simulation` **(** **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`SkinReference` | :ref:`register_skin` **(** :ref:`Skin` skin **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_custom_pose` **(** :ref:`int` bone_idx, :ref:`Transform` custom_pose **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_disable_rest` **(** :ref:`int` bone_idx, :ref:`bool` disable **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_global_pose_override` **(** :ref:`int` bone_idx, :ref:`Transform` pose, :ref:`float` amount, :ref:`bool` persistent=false **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_name` **(** :ref:`int` bone_idx, :ref:`String` name **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_parent` **(** :ref:`int` bone_idx, :ref:`int` parent_idx **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_pose` **(** :ref:`int` bone_idx, :ref:`Transform` pose **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bone_rest` **(** :ref:`int` bone_idx, :ref:`Transform` rest **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unbind_child_node_from_bone` **(** :ref:`int` bone_idx, :ref:`Node` node **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unparent_bone_and_rest` **(** :ref:`int` bone_idx **)** | ++-------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Skeleton_signal_skeleton_updated: + +- **skeleton_updated** **(** **)** + +Constants +--------- + +.. _class_Skeleton_constant_NOTIFICATION_UPDATE_SKELETON: + +- **NOTIFICATION_UPDATE_SKELETON** = **50** + +Method Descriptions +------------------- + +.. _class_Skeleton_method_add_bone: + +- void **add_bone** **(** :ref:`String` name **)** + +Adds a bone, with name ``name``. :ref:`get_bone_count` will become the bone index. + +---- + +.. _class_Skeleton_method_bind_child_node_to_bone: + +- void **bind_child_node_to_bone** **(** :ref:`int` bone_idx, :ref:`Node` node **)** + +*Deprecated soon.* + +---- + +.. _class_Skeleton_method_clear_bones: + +- void **clear_bones** **(** **)** + +Clear all the bones in this skeleton. + +---- + +.. _class_Skeleton_method_clear_bones_global_pose_override: + +- void **clear_bones_global_pose_override** **(** **)** + +---- + +.. _class_Skeleton_method_find_bone: + +- :ref:`int` **find_bone** **(** :ref:`String` name **)** |const| + +Returns the bone index that matches ``name`` as its name. + +---- + +.. _class_Skeleton_method_get_bone_count: + +- :ref:`int` **get_bone_count** **(** **)** |const| + +Returns the amount of bones in the skeleton. + +---- + +.. _class_Skeleton_method_get_bone_custom_pose: + +- :ref:`Transform` **get_bone_custom_pose** **(** :ref:`int` bone_idx **)** |const| + +Returns the custom pose of the specified bone. Custom pose is applied on top of the rest pose. + +---- + +.. _class_Skeleton_method_get_bone_global_pose: + +- :ref:`Transform` **get_bone_global_pose** **(** :ref:`int` bone_idx **)** |const| + +Returns the overall transform of the specified bone, with respect to the skeleton. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. + +---- + +.. _class_Skeleton_method_get_bone_global_pose_no_override: + +- :ref:`Transform` **get_bone_global_pose_no_override** **(** :ref:`int` bone_idx **)** |const| + +Returns the overall transform of the specified bone, with respect to the skeleton, but without any global pose overrides. Being relative to the skeleton frame, this is not the actual "global" transform of the bone. + +---- + +.. _class_Skeleton_method_get_bone_name: + +- :ref:`String` **get_bone_name** **(** :ref:`int` bone_idx **)** |const| + +Returns the name of the bone at index ``index``. + +---- + +.. _class_Skeleton_method_get_bone_parent: + +- :ref:`int` **get_bone_parent** **(** :ref:`int` bone_idx **)** |const| + +Returns the bone index which is the parent of the bone at ``bone_idx``. If -1, then bone has no parent. + +**Note:** The parent bone returned will always be less than ``bone_idx``. + +---- + +.. _class_Skeleton_method_get_bone_pose: + +- :ref:`Transform` **get_bone_pose** **(** :ref:`int` bone_idx **)** |const| + +Returns the pose transform of the specified bone. Pose is applied on top of the custom pose, which is applied on top the rest pose. + +---- + +.. _class_Skeleton_method_get_bone_rest: + +- :ref:`Transform` **get_bone_rest** **(** :ref:`int` bone_idx **)** |const| + +Returns the rest transform for a bone ``bone_idx``. + +---- + +.. _class_Skeleton_method_get_bound_child_nodes_to_bone: + +- :ref:`Array` **get_bound_child_nodes_to_bone** **(** :ref:`int` bone_idx **)** |const| + +*Deprecated soon.* + +---- + +.. _class_Skeleton_method_is_bone_rest_disabled: + +- :ref:`bool` **is_bone_rest_disabled** **(** :ref:`int` bone_idx **)** |const| + +---- + +.. _class_Skeleton_method_localize_rests: + +- void **localize_rests** **(** **)** + +---- + +.. _class_Skeleton_method_physical_bones_add_collision_exception: + +- void **physical_bones_add_collision_exception** **(** :ref:`RID` exception **)** + +---- + +.. _class_Skeleton_method_physical_bones_remove_collision_exception: + +- void **physical_bones_remove_collision_exception** **(** :ref:`RID` exception **)** + +---- + +.. _class_Skeleton_method_physical_bones_start_simulation: + +- void **physical_bones_start_simulation** **(** :ref:`Array` bones=[ ] **)** + +---- + +.. _class_Skeleton_method_physical_bones_stop_simulation: + +- void **physical_bones_stop_simulation** **(** **)** + +---- + +.. _class_Skeleton_method_register_skin: + +- :ref:`SkinReference` **register_skin** **(** :ref:`Skin` skin **)** + +---- + +.. _class_Skeleton_method_set_bone_custom_pose: + +- void **set_bone_custom_pose** **(** :ref:`int` bone_idx, :ref:`Transform` custom_pose **)** + +---- + +.. _class_Skeleton_method_set_bone_disable_rest: + +- void **set_bone_disable_rest** **(** :ref:`int` bone_idx, :ref:`bool` disable **)** + +---- + +.. _class_Skeleton_method_set_bone_global_pose_override: + +- void **set_bone_global_pose_override** **(** :ref:`int` bone_idx, :ref:`Transform` pose, :ref:`float` amount, :ref:`bool` persistent=false **)** + +---- + +.. _class_Skeleton_method_set_bone_name: + +- void **set_bone_name** **(** :ref:`int` bone_idx, :ref:`String` name **)** + +---- + +.. _class_Skeleton_method_set_bone_parent: + +- void **set_bone_parent** **(** :ref:`int` bone_idx, :ref:`int` parent_idx **)** + +Sets the bone index ``parent_idx`` as the parent of the bone at ``bone_idx``. If -1, then bone has no parent. + +**Note:** ``parent_idx`` must be less than ``bone_idx``. + +---- + +.. _class_Skeleton_method_set_bone_pose: + +- void **set_bone_pose** **(** :ref:`int` bone_idx, :ref:`Transform` pose **)** + +Sets the pose transform for bone ``bone_idx``. + +---- + +.. _class_Skeleton_method_set_bone_rest: + +- void **set_bone_rest** **(** :ref:`int` bone_idx, :ref:`Transform` rest **)** + +Sets the rest transform for bone ``bone_idx``. + +---- + +.. _class_Skeleton_method_unbind_child_node_from_bone: + +- void **unbind_child_node_from_bone** **(** :ref:`int` bone_idx, :ref:`Node` node **)** + +*Deprecated soon.* + +---- + +.. _class_Skeleton_method_unparent_bone_and_rest: + +- void **unparent_bone_and_rest** **(** :ref:`int` bone_idx **)** + +.. |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.)` diff --git a/classes/class_skeleton2d.rst b/classes/class_skeleton2d.rst new file mode 100644 index 0000000..ed0683a --- /dev/null +++ b/classes/class_skeleton2d.rst @@ -0,0 +1,71 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Skeleton2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Skeleton2D: + +Skeleton2D +========== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Skeleton for 2D characters and animated objects. + +Description +----------- + +Skeleton2D parents a hierarchy of :ref:`Bone2D` objects. It is a requirement of :ref:`Bone2D`. Skeleton2D holds a reference to the rest pose of its children and acts as a single point of access to its bones. + +Tutorials +--------- + +- :doc:`../tutorials/animation/2d_skeletons` + +Methods +------- + ++-----------------------------+-----------------------------------------------------------------------------------------+ +| :ref:`Bone2D` | :ref:`get_bone` **(** :ref:`int` idx **)** | ++-----------------------------+-----------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bone_count` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_skeleton` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Skeleton2D_signal_bone_setup_changed: + +- **bone_setup_changed** **(** **)** + +Method Descriptions +------------------- + +.. _class_Skeleton2D_method_get_bone: + +- :ref:`Bone2D` **get_bone** **(** :ref:`int` idx **)** + +Returns a :ref:`Bone2D` from the node hierarchy parented by Skeleton2D. The object to return is identified by the parameter ``idx``. Bones are indexed by descending the node hierarchy from top to bottom, adding the children of each branch before moving to the next sibling. + +---- + +.. _class_Skeleton2D_method_get_bone_count: + +- :ref:`int` **get_bone_count** **(** **)** |const| + +Returns the number of :ref:`Bone2D` nodes in the node hierarchy parented by Skeleton2D. + +---- + +.. _class_Skeleton2D_method_get_skeleton: + +- :ref:`RID` **get_skeleton** **(** **)** |const| + +Returns the :ref:`RID` of a Skeleton2D instance. + +.. |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.)` diff --git a/classes/class_skeletonik.rst b/classes/class_skeletonik.rst new file mode 100644 index 0000000..d3fb8e3 --- /dev/null +++ b/classes/class_skeletonik.rst @@ -0,0 +1,280 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SkeletonIK.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SkeletonIK: + +SkeletonIK +========== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +SkeletonIK is used to place the end bone of a :ref:`Skeleton` bone chain at a certain point in 3D by rotating all bones in the chain accordingly. + +Description +----------- + +SkeletonIK is used to place the end bone of a :ref:`Skeleton` bone chain at a certain point in 3D by rotating all bones in the chain accordingly. A typical scenario for IK in games is to place a characters feet on the ground or a characters hands on a currently hold object. SkeletonIK uses FabrikInverseKinematic internally to solve the bone chain and applies the results to the :ref:`Skeleton` ``bones_global_pose_override`` property for all affected bones in the chain. If fully applied this overwrites any bone transform from :ref:`Animation`\ s or bone custom poses set by users. The applied amount can be controlled with the ``interpolation`` property. + +:: + + # Apply IK effect automatically on every new frame (not the current) + skeleton_ik_node.start() + + # Apply IK effect only on the current frame + skeleton_ik_node.start(true) + + # Stop IK effect and reset bones_global_pose_override on Skeleton + skeleton_ik_node.stop() + + # Apply full IK effect + skeleton_ik_node.set_interpolation(1.0) + + # Apply half IK effect + skeleton_ik_node.set_interpolation(0.5) + + # Apply zero IK effect (a value at or below 0.01 also removes bones_global_pose_override on Skeleton) + skeleton_ik_node.set_interpolation(0.0) + +Tutorials +--------- + +- `3D Inverse Kinematics Demo `__ + +Properties +---------- + ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`interpolation` | ``1.0`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`magnet` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`int` | :ref:`max_iterations` | ``10`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`float` | :ref:`min_distance` | ``0.01`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`override_tip_basis` | ``true`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`String` | :ref:`root_bone` | ``""`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`target` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`NodePath` | :ref:`target_node` | ``NodePath("")`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`String` | :ref:`tip_bone` | ``""`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`use_magnet` | ``false`` | ++-----------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+ + +Methods +------- + ++---------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`Skeleton` | :ref:`get_parent_skeleton` **(** **)** |const| | ++---------------------------------+------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_running` **(** **)** | ++---------------------------------+------------------------------------------------------------------------------------------------+ +| void | :ref:`start` **(** :ref:`bool` one_time=false **)** | ++---------------------------------+------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++---------------------------------+------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SkeletonIK_property_interpolation: + +- :ref:`float` **interpolation** + ++-----------+--------------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------------+ +| *Setter* | set_interpolation(value) | ++-----------+--------------------------+ +| *Getter* | get_interpolation() | ++-----------+--------------------------+ + +Interpolation value for how much the IK results are applied to the current skeleton bone chain. A value of ``1.0`` will overwrite all skeleton bone transforms completely while a value of ``0.0`` will visually disable the SkeletonIK. A value at or below ``0.01`` also calls :ref:`Skeleton.clear_bones_global_pose_override`. + +---- + +.. _class_SkeletonIK_property_magnet: + +- :ref:`Vector3` **magnet** + ++-----------+----------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+----------------------------+ +| *Setter* | set_magnet_position(value) | ++-----------+----------------------------+ +| *Getter* | get_magnet_position() | ++-----------+----------------------------+ + +Secondary target position (first is :ref:`target` property or :ref:`target_node`) for the IK chain. Use magnet position (pole target) to control the bending of the IK chain. Only works if the bone chain has more than 2 bones. The middle chain bone position will be linearly interpolated with the magnet position. + +---- + +.. _class_SkeletonIK_property_max_iterations: + +- :ref:`int` **max_iterations** + ++-----------+---------------------------+ +| *Default* | ``10`` | ++-----------+---------------------------+ +| *Setter* | set_max_iterations(value) | ++-----------+---------------------------+ +| *Getter* | get_max_iterations() | ++-----------+---------------------------+ + +Number of iteration loops used by the IK solver to produce more accurate (and elegant) bone chain results. + +---- + +.. _class_SkeletonIK_property_min_distance: + +- :ref:`float` **min_distance** + ++-----------+-------------------------+ +| *Default* | ``0.01`` | ++-----------+-------------------------+ +| *Setter* | set_min_distance(value) | ++-----------+-------------------------+ +| *Getter* | get_min_distance() | ++-----------+-------------------------+ + +The minimum distance between bone and goal target. If the distance is below this value, the IK solver stops further iterations. + +---- + +.. _class_SkeletonIK_property_override_tip_basis: + +- :ref:`bool` **override_tip_basis** + ++-----------+-------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------+ +| *Setter* | set_override_tip_basis(value) | ++-----------+-------------------------------+ +| *Getter* | is_override_tip_basis() | ++-----------+-------------------------------+ + +If ``true`` overwrites the rotation of the tip bone with the rotation of the :ref:`target` (or :ref:`target_node` if defined). + +---- + +.. _class_SkeletonIK_property_root_bone: + +- :ref:`String` **root_bone** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_root_bone(value) | ++-----------+----------------------+ +| *Getter* | get_root_bone() | ++-----------+----------------------+ + +The name of the current root bone, the first bone in the IK chain. + +---- + +.. _class_SkeletonIK_property_target: + +- :ref:`Transform` **target** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_target_transform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_target_transform() | ++-----------+-----------------------------------------------------+ + +First target of the IK chain where the tip bone is placed and, if :ref:`override_tip_basis` is ``true``, how the tip bone is rotated. If a :ref:`target_node` path is available the nodes transform is used instead and this property is ignored. + +---- + +.. _class_SkeletonIK_property_target_node: + +- :ref:`NodePath` **target_node** + ++-----------+------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------+ +| *Setter* | set_target_node(value) | ++-----------+------------------------+ +| *Getter* | get_target_node() | ++-----------+------------------------+ + +Target node :ref:`NodePath` for the IK chain. If available, the node's current :ref:`Transform` is used instead of the :ref:`target` property. + +---- + +.. _class_SkeletonIK_property_tip_bone: + +- :ref:`String` **tip_bone** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_tip_bone(value) | ++-----------+---------------------+ +| *Getter* | get_tip_bone() | ++-----------+---------------------+ + +The name of the current tip bone, the last bone in the IK chain placed at the :ref:`target` transform (or :ref:`target_node` if defined). + +---- + +.. _class_SkeletonIK_property_use_magnet: + +- :ref:`bool` **use_magnet** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_use_magnet(value) | ++-----------+-----------------------+ +| *Getter* | is_using_magnet() | ++-----------+-----------------------+ + +If ``true``, instructs the IK solver to consider the secondary magnet target (pole target) when calculating the bone chain. Use the magnet position (pole target) to control the bending of the IK chain. + +Method Descriptions +------------------- + +.. _class_SkeletonIK_method_get_parent_skeleton: + +- :ref:`Skeleton` **get_parent_skeleton** **(** **)** |const| + +Returns the parent :ref:`Skeleton` Node that was present when SkeletonIK entered the :ref:`SceneTree`. Returns null if the parent node was not a :ref:`Skeleton` Node when SkeletonIK entered the :ref:`SceneTree`. + +---- + +.. _class_SkeletonIK_method_is_running: + +- :ref:`bool` **is_running** **(** **)** + +Returns ``true`` if SkeletonIK is applying IK effects on continues frames to the :ref:`Skeleton` bones. Returns ``false`` if SkeletonIK is stopped or :ref:`start` was used with the ``one_time`` parameter set to ``true``. + +---- + +.. _class_SkeletonIK_method_start: + +- void **start** **(** :ref:`bool` one_time=false **)** + +Starts applying IK effects on each frame to the :ref:`Skeleton` bones but will only take effect starting on the next frame. If ``one_time`` is ``true``, this will take effect immediately but also reset on the next frame. + +---- + +.. _class_SkeletonIK_method_stop: + +- void **stop** **(** **)** + +Stops applying IK effects on each frame to the :ref:`Skeleton` bones and also calls :ref:`Skeleton.clear_bones_global_pose_override` to remove existing overrides on all bones. + +.. |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.)` diff --git a/classes/class_skin.rst b/classes/class_skin.rst new file mode 100644 index 0000000..15f0993 --- /dev/null +++ b/classes/class_skin.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Skin.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Skin: + +Skin +==== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bind` **(** :ref:`int` bone, :ref:`Transform` pose **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_binds` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bind_bone` **(** :ref:`int` bind_index **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_bind_count` **(** **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_bind_name` **(** :ref:`int` bind_index **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`get_bind_pose` **(** :ref:`int` bind_index **)** |const| | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_bone` **(** :ref:`int` bind_index, :ref:`int` bone **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_count` **(** :ref:`int` bind_count **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_name` **(** :ref:`int` bind_index, :ref:`String` name **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_bind_pose` **(** :ref:`int` bind_index, :ref:`Transform` pose **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Skin_method_add_bind: + +- void **add_bind** **(** :ref:`int` bone, :ref:`Transform` pose **)** + +---- + +.. _class_Skin_method_clear_binds: + +- void **clear_binds** **(** **)** + +---- + +.. _class_Skin_method_get_bind_bone: + +- :ref:`int` **get_bind_bone** **(** :ref:`int` bind_index **)** |const| + +---- + +.. _class_Skin_method_get_bind_count: + +- :ref:`int` **get_bind_count** **(** **)** |const| + +---- + +.. _class_Skin_method_get_bind_name: + +- :ref:`String` **get_bind_name** **(** :ref:`int` bind_index **)** |const| + +---- + +.. _class_Skin_method_get_bind_pose: + +- :ref:`Transform` **get_bind_pose** **(** :ref:`int` bind_index **)** |const| + +---- + +.. _class_Skin_method_set_bind_bone: + +- void **set_bind_bone** **(** :ref:`int` bind_index, :ref:`int` bone **)** + +---- + +.. _class_Skin_method_set_bind_count: + +- void **set_bind_count** **(** :ref:`int` bind_count **)** + +---- + +.. _class_Skin_method_set_bind_name: + +- void **set_bind_name** **(** :ref:`int` bind_index, :ref:`String` name **)** + +---- + +.. _class_Skin_method_set_bind_pose: + +- void **set_bind_pose** **(** :ref:`int` bind_index, :ref:`Transform` pose **)** + +.. |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.)` diff --git a/classes/class_skinreference.rst b/classes/class_skinreference.rst new file mode 100644 index 0000000..13f9232 --- /dev/null +++ b/classes/class_skinreference.rst @@ -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 SkinReference.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SkinReference: + +SkinReference +============= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_skeleton` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`Skin` | :ref:`get_skin` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_SkinReference_method_get_skeleton: + +- :ref:`RID` **get_skeleton** **(** **)** |const| + +---- + +.. _class_SkinReference_method_get_skin: + +- :ref:`Skin` **get_skin** **(** **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_sky.rst b/classes/class_sky.rst new file mode 100644 index 0000000..d846787 --- /dev/null +++ b/classes/class_sky.rst @@ -0,0 +1,96 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Sky.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Sky: + +Sky +=== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`PanoramaSky`, :ref:`ProceduralSky` + +The base class for :ref:`PanoramaSky` and :ref:`ProceduralSky`. + +Description +----------- + +The base class for :ref:`PanoramaSky` and :ref:`ProceduralSky`. + +Properties +---------- + ++--------------------------------------------+--------------------------------------------------------+-------+ +| :ref:`RadianceSize` | :ref:`radiance_size` | ``2`` | ++--------------------------------------------+--------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_Sky_RadianceSize: + +.. _class_Sky_constant_RADIANCE_SIZE_32: + +.. _class_Sky_constant_RADIANCE_SIZE_64: + +.. _class_Sky_constant_RADIANCE_SIZE_128: + +.. _class_Sky_constant_RADIANCE_SIZE_256: + +.. _class_Sky_constant_RADIANCE_SIZE_512: + +.. _class_Sky_constant_RADIANCE_SIZE_1024: + +.. _class_Sky_constant_RADIANCE_SIZE_2048: + +.. _class_Sky_constant_RADIANCE_SIZE_MAX: + +enum **RadianceSize**: + +- **RADIANCE_SIZE_32** = **0** --- Radiance texture size is 32×32 pixels. + +- **RADIANCE_SIZE_64** = **1** --- Radiance texture size is 64×64 pixels. + +- **RADIANCE_SIZE_128** = **2** --- Radiance texture size is 128×128 pixels. + +- **RADIANCE_SIZE_256** = **3** --- Radiance texture size is 256×256 pixels. + +- **RADIANCE_SIZE_512** = **4** --- Radiance texture size is 512×512 pixels. + +- **RADIANCE_SIZE_1024** = **5** --- Radiance texture size is 1024×1024 pixels. + +**Note:** :ref:`RADIANCE_SIZE_1024` is not exposed in the inspector as it is known to cause GPU hangs on certain systems. + +- **RADIANCE_SIZE_2048** = **6** --- Radiance texture size is 2048×2048 pixels. + +**Note:** :ref:`RADIANCE_SIZE_2048` is not exposed in the inspector as it is known to cause GPU hangs on certain systems. + +- **RADIANCE_SIZE_MAX** = **7** --- Represents the size of the :ref:`RadianceSize` enum. + +Property Descriptions +--------------------- + +.. _class_Sky_property_radiance_size: + +- :ref:`RadianceSize` **radiance_size** + ++-----------+--------------------------+ +| *Default* | ``2`` | ++-----------+--------------------------+ +| *Setter* | set_radiance_size(value) | ++-----------+--------------------------+ +| *Getter* | get_radiance_size() | ++-----------+--------------------------+ + +The ``Sky``'s radiance map size. The higher the radiance map size, the more detailed the lighting from the ``Sky`` will be. + +See :ref:`RadianceSize` constants for values. + +**Note:** You will only benefit from high radiance sizes if you have perfectly sharp reflective surfaces in your project and are not using :ref:`ReflectionProbe`\ s or :ref:`GIProbe`\ s. For most projects, keeping :ref:`radiance_size` to the default value is the best compromise between visuals and performance. Be careful when using high radiance size values as these can cause crashes on low-end GPUs. + +.. |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.)` diff --git a/classes/class_slider.rst b/classes/class_slider.rst new file mode 100644 index 0000000..f975b01 --- /dev/null +++ b/classes/class_slider.rst @@ -0,0 +1,109 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Slider.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Slider: + +Slider +====== + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`HSlider`, :ref:`VSlider` + +Base class for GUI sliders. + +Description +----------- + +Base class for GUI sliders. + +**Note:** The :ref:`Range.changed` and :ref:`Range.value_changed` signals are part of the :ref:`Range` class which this class inherits from. + +Properties +---------- + ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`editable` | ``true`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`scrollable` | ``true`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | size_flags_vertical | ``0`` *(parent override)* | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`tick_count` | ``0`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`ticks_on_borders` | ``false`` | ++------------------------------------------+-----------------------------------------------------------------+---------------------------+ + +Property Descriptions +--------------------- + +.. _class_Slider_property_editable: + +- :ref:`bool` **editable** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_editable(value) | ++-----------+---------------------+ +| *Getter* | is_editable() | ++-----------+---------------------+ + +If ``true``, the slider can be interacted with. If ``false``, the value can be changed only by code. + +---- + +.. _class_Slider_property_scrollable: + +- :ref:`bool` **scrollable** + ++-----------+-----------------------+ +| *Default* | ``true`` | ++-----------+-----------------------+ +| *Setter* | set_scrollable(value) | ++-----------+-----------------------+ +| *Getter* | is_scrollable() | ++-----------+-----------------------+ + +If ``true``, the value can be changed using the mouse wheel. + +---- + +.. _class_Slider_property_tick_count: + +- :ref:`int` **tick_count** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_ticks(value) | ++-----------+------------------+ +| *Getter* | get_ticks() | ++-----------+------------------+ + +Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. + +---- + +.. _class_Slider_property_ticks_on_borders: + +- :ref:`bool` **ticks_on_borders** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_ticks_on_borders(value) | ++-----------+-----------------------------+ +| *Getter* | get_ticks_on_borders() | ++-----------+-----------------------------+ + +If ``true``, the slider will display ticks for minimum and maximum values. + +.. |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.)` diff --git a/classes/class_sliderjoint.rst b/classes/class_sliderjoint.rst new file mode 100644 index 0000000..c56ccff --- /dev/null +++ b/classes/class_sliderjoint.rst @@ -0,0 +1,544 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SliderJoint.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SliderJoint: + +SliderJoint +=========== + +**Inherits:** :ref:`Joint` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Slider between two PhysicsBodies in 3D. + +Description +----------- + +Slides across the X axis of the pivot object. See also :ref:`Generic6DOFJoint`. + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_limit/damping` | ``0.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_limit/lower_angle` | ``0.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_limit/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_limit/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_limit/upper_angle` | ``0.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_motion/damping` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_motion/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_motion/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_ortho/damping` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_ortho/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`angular_ortho/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_limit/damping` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_limit/lower_distance` | ``-1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_limit/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_limit/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_limit/upper_distance` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_motion/damping` | ``0.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_motion/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_motion/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_ortho/damping` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_ortho/restitution` | ``0.7`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`linear_ortho/softness` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------------------+----------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_param` **(** :ref:`Param` param **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_param` **(** :ref:`Param` param, :ref:`float` value **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_SliderJoint_Param: + +.. _class_SliderJoint_constant_PARAM_LINEAR_LIMIT_UPPER: + +.. _class_SliderJoint_constant_PARAM_LINEAR_LIMIT_LOWER: + +.. _class_SliderJoint_constant_PARAM_LINEAR_LIMIT_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_LINEAR_LIMIT_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_LINEAR_LIMIT_DAMPING: + +.. _class_SliderJoint_constant_PARAM_LINEAR_MOTION_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_LINEAR_MOTION_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_LINEAR_MOTION_DAMPING: + +.. _class_SliderJoint_constant_PARAM_LINEAR_ORTHOGONAL_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_LINEAR_ORTHOGONAL_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_LINEAR_ORTHOGONAL_DAMPING: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_LIMIT_UPPER: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_LIMIT_LOWER: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_LIMIT_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_LIMIT_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_LIMIT_DAMPING: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_MOTION_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_MOTION_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_MOTION_DAMPING: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_ORTHOGONAL_SOFTNESS: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_ORTHOGONAL_RESTITUTION: + +.. _class_SliderJoint_constant_PARAM_ANGULAR_ORTHOGONAL_DAMPING: + +.. _class_SliderJoint_constant_PARAM_MAX: + +enum **Param**: + +- **PARAM_LINEAR_LIMIT_UPPER** = **0** --- The maximum difference between the pivot points on their X axis before damping happens. + +- **PARAM_LINEAR_LIMIT_LOWER** = **1** --- The minimum difference between the pivot points on their X axis before damping happens. + +- **PARAM_LINEAR_LIMIT_SOFTNESS** = **2** --- A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + +- **PARAM_LINEAR_LIMIT_RESTITUTION** = **3** --- The amount of restitution once the limits are surpassed. The lower, the more velocityenergy gets lost. + +- **PARAM_LINEAR_LIMIT_DAMPING** = **4** --- The amount of damping once the slider limits are surpassed. + +- **PARAM_LINEAR_MOTION_SOFTNESS** = **5** --- A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + +- **PARAM_LINEAR_MOTION_RESTITUTION** = **6** --- The amount of restitution inside the slider limits. + +- **PARAM_LINEAR_MOTION_DAMPING** = **7** --- The amount of damping inside the slider limits. + +- **PARAM_LINEAR_ORTHOGONAL_SOFTNESS** = **8** --- A factor applied to the movement across axes orthogonal to the slider. + +- **PARAM_LINEAR_ORTHOGONAL_RESTITUTION** = **9** --- The amount of restitution when movement is across axes orthogonal to the slider. + +- **PARAM_LINEAR_ORTHOGONAL_DAMPING** = **10** --- The amount of damping when movement is across axes orthogonal to the slider. + +- **PARAM_ANGULAR_LIMIT_UPPER** = **11** --- The upper limit of rotation in the slider. + +- **PARAM_ANGULAR_LIMIT_LOWER** = **12** --- The lower limit of rotation in the slider. + +- **PARAM_ANGULAR_LIMIT_SOFTNESS** = **13** --- A factor applied to the all rotation once the limit is surpassed. + +- **PARAM_ANGULAR_LIMIT_RESTITUTION** = **14** --- The amount of restitution of the rotation when the limit is surpassed. + +- **PARAM_ANGULAR_LIMIT_DAMPING** = **15** --- The amount of damping of the rotation when the limit is surpassed. + +- **PARAM_ANGULAR_MOTION_SOFTNESS** = **16** --- A factor applied to the all rotation in the limits. + +- **PARAM_ANGULAR_MOTION_RESTITUTION** = **17** --- The amount of restitution of the rotation in the limits. + +- **PARAM_ANGULAR_MOTION_DAMPING** = **18** --- The amount of damping of the rotation in the limits. + +- **PARAM_ANGULAR_ORTHOGONAL_SOFTNESS** = **19** --- A factor applied to the all rotation across axes orthogonal to the slider. + +- **PARAM_ANGULAR_ORTHOGONAL_RESTITUTION** = **20** --- The amount of restitution of the rotation across axes orthogonal to the slider. + +- **PARAM_ANGULAR_ORTHOGONAL_DAMPING** = **21** --- The amount of damping of the rotation across axes orthogonal to the slider. + +- **PARAM_MAX** = **22** --- Represents the size of the :ref:`Param` enum. + +Property Descriptions +--------------------- + +.. _class_SliderJoint_property_angular_limit/damping: + +- :ref:`float` **angular_limit/damping** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping of the rotation when the limit is surpassed. + +A lower damping value allows a rotation initiated by body A to travel to body B slower. + +---- + +.. _class_SliderJoint_property_angular_limit/lower_angle: + +- :ref:`float` **angular_limit/lower_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The lower limit of rotation in the slider. + +---- + +.. _class_SliderJoint_property_angular_limit/restitution: + +- :ref:`float` **angular_limit/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution of the rotation when the limit is surpassed. + +Does not affect damping. + +---- + +.. _class_SliderJoint_property_angular_limit/softness: + +- :ref:`float` **angular_limit/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the all rotation once the limit is surpassed. + +Makes all rotation slower when between 0 and 1. + +---- + +.. _class_SliderJoint_property_angular_limit/upper_angle: + +- :ref:`float` **angular_limit/upper_angle** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The upper limit of rotation in the slider. + +---- + +.. _class_SliderJoint_property_angular_motion/damping: + +- :ref:`float` **angular_motion/damping** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping of the rotation in the limits. + +---- + +.. _class_SliderJoint_property_angular_motion/restitution: + +- :ref:`float` **angular_motion/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution of the rotation in the limits. + +---- + +.. _class_SliderJoint_property_angular_motion/softness: + +- :ref:`float` **angular_motion/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the all rotation in the limits. + +---- + +.. _class_SliderJoint_property_angular_ortho/damping: + +- :ref:`float` **angular_ortho/damping** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping of the rotation across axes orthogonal to the slider. + +---- + +.. _class_SliderJoint_property_angular_ortho/restitution: + +- :ref:`float` **angular_ortho/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution of the rotation across axes orthogonal to the slider. + +---- + +.. _class_SliderJoint_property_angular_ortho/softness: + +- :ref:`float` **angular_ortho/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the all rotation across axes orthogonal to the slider. + +---- + +.. _class_SliderJoint_property_linear_limit/damping: + +- :ref:`float` **linear_limit/damping** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping that happens once the limit defined by :ref:`linear_limit/lower_distance` and :ref:`linear_limit/upper_distance` is surpassed. + +---- + +.. _class_SliderJoint_property_linear_limit/lower_distance: + +- :ref:`float` **linear_limit/lower_distance** + ++-----------+------------------+ +| *Default* | ``-1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The minimum difference between the pivot points on their X axis before damping happens. + +---- + +.. _class_SliderJoint_property_linear_limit/restitution: + +- :ref:`float` **linear_limit/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution once the limits are surpassed. The lower, the more velocity-energy gets lost. + +---- + +.. _class_SliderJoint_property_linear_limit/softness: + +- :ref:`float` **linear_limit/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the movement across the slider axis once the limits get surpassed. The lower, the slower the movement. + +---- + +.. _class_SliderJoint_property_linear_limit/upper_distance: + +- :ref:`float` **linear_limit/upper_distance** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The maximum difference between the pivot points on their X axis before damping happens. + +---- + +.. _class_SliderJoint_property_linear_motion/damping: + +- :ref:`float` **linear_motion/damping** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping inside the slider limits. + +---- + +.. _class_SliderJoint_property_linear_motion/restitution: + +- :ref:`float` **linear_motion/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution inside the slider limits. + +---- + +.. _class_SliderJoint_property_linear_motion/softness: + +- :ref:`float` **linear_motion/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the movement across the slider axis as long as the slider is in the limits. The lower, the slower the movement. + +---- + +.. _class_SliderJoint_property_linear_ortho/damping: + +- :ref:`float` **linear_ortho/damping** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of damping when movement is across axes orthogonal to the slider. + +---- + +.. _class_SliderJoint_property_linear_ortho/restitution: + +- :ref:`float` **linear_ortho/restitution** + ++-----------+------------------+ +| *Default* | ``0.7`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The amount of restitution when movement is across axes orthogonal to the slider. + +---- + +.. _class_SliderJoint_property_linear_ortho/softness: + +- :ref:`float` **linear_ortho/softness** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +A factor applied to the movement across axes orthogonal to the slider. + +Method Descriptions +------------------- + +.. _class_SliderJoint_method_get_param: + +- :ref:`float` **get_param** **(** :ref:`Param` param **)** |const| + +---- + +.. _class_SliderJoint_method_set_param: + +- void **set_param** **(** :ref:`Param` param, :ref:`float` value **)** + +.. |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.)` diff --git a/classes/class_softbody.rst b/classes/class_softbody.rst new file mode 100644 index 0000000..7ed5d80 --- /dev/null +++ b/classes/class_softbody.rst @@ -0,0 +1,384 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SoftBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SoftBody: + +SoftBody +======== + +**Inherits:** :ref:`MeshInstance` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A soft mesh physics body. + +Description +----------- + +A deformable physics body. Used to create elastic or deformable objects such as cloth, rubber, or other flexible materials. + +**Note:** There are many known bugs in ``SoftBody``. Therefore, it's not recommended to use them for things that can affect gameplay (such as a player character made entirely out of soft bodies). + +Tutorials +--------- + +- :doc:`../tutorials/physics/soft_body` + +Properties +---------- + ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`areaAngular_stiffness` | ``0.5`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`damping_coefficient` | ``0.01`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`drag_coefficient` | ``0.0`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`linear_stiffness` | ``0.5`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`NodePath` | :ref:`parent_collision_ignore` | ``NodePath("")`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`physics_enabled` | ``true`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`pose_matching_coefficient` | ``0.0`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`pressure_coefficient` | ``0.0`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`bool` | :ref:`ray_pickable` | ``true`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`int` | :ref:`simulation_precision` | ``5`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`total_mass` | ``1.0`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ +| :ref:`float` | :ref:`volume_stiffness` | ``0.5`` | ++---------------------------------+-------------------------------------------------------------------------------------+------------------+ + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_collision_exception_with` **(** :ref:`Node` body **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_collision_exceptions` **(** **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_point_transform` **(** :ref:`int` point_index **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_point_pinned` **(** :ref:`int` point_index **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_collision_exception_with` **(** :ref:`Node` body **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_point_pinned` **(** :ref:`int` point_index, :ref:`bool` pinned, :ref:`NodePath` attachment_path=NodePath("") **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SoftBody_property_areaAngular_stiffness: + +- :ref:`float` **areaAngular_stiffness** + ++-----------+----------------------------------+ +| *Default* | ``0.5`` | ++-----------+----------------------------------+ +| *Setter* | set_areaAngular_stiffness(value) | ++-----------+----------------------------------+ +| *Getter* | get_areaAngular_stiffness() | ++-----------+----------------------------------+ + +---- + +.. _class_SoftBody_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The physics layers this SoftBody is in. + +Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property. + +A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_SoftBody_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The physics layers this SoftBody scans for collisions. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_SoftBody_property_damping_coefficient: + +- :ref:`float` **damping_coefficient** + ++-----------+--------------------------------+ +| *Default* | ``0.01`` | ++-----------+--------------------------------+ +| *Setter* | set_damping_coefficient(value) | ++-----------+--------------------------------+ +| *Getter* | get_damping_coefficient() | ++-----------+--------------------------------+ + +---- + +.. _class_SoftBody_property_drag_coefficient: + +- :ref:`float` **drag_coefficient** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_drag_coefficient(value) | ++-----------+-----------------------------+ +| *Getter* | get_drag_coefficient() | ++-----------+-----------------------------+ + +---- + +.. _class_SoftBody_property_linear_stiffness: + +- :ref:`float` **linear_stiffness** + ++-----------+-----------------------------+ +| *Default* | ``0.5`` | ++-----------+-----------------------------+ +| *Setter* | set_linear_stiffness(value) | ++-----------+-----------------------------+ +| *Getter* | get_linear_stiffness() | ++-----------+-----------------------------+ + +---- + +.. _class_SoftBody_property_parent_collision_ignore: + +- :ref:`NodePath` **parent_collision_ignore** + ++-----------+------------------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+------------------------------------+ +| *Setter* | set_parent_collision_ignore(value) | ++-----------+------------------------------------+ +| *Getter* | get_parent_collision_ignore() | ++-----------+------------------------------------+ + +:ref:`NodePath` to a :ref:`CollisionObject` this SoftBody should avoid clipping. + +---- + +.. _class_SoftBody_property_physics_enabled: + +- :ref:`bool` **physics_enabled** + ++-----------+----------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------+ +| *Setter* | set_physics_enabled(value) | ++-----------+----------------------------+ +| *Getter* | is_physics_enabled() | ++-----------+----------------------------+ + +If ``true``, the ``SoftBody`` is simulated in physics. Can be set to ``false`` to pause the physics simulation. + +---- + +.. _class_SoftBody_property_pose_matching_coefficient: + +- :ref:`float` **pose_matching_coefficient** + ++-----------+--------------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------------+ +| *Setter* | set_pose_matching_coefficient(value) | ++-----------+--------------------------------------+ +| *Getter* | get_pose_matching_coefficient() | ++-----------+--------------------------------------+ + +---- + +.. _class_SoftBody_property_pressure_coefficient: + +- :ref:`float` **pressure_coefficient** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Setter* | set_pressure_coefficient(value) | ++-----------+---------------------------------+ +| *Getter* | get_pressure_coefficient() | ++-----------+---------------------------------+ + +---- + +.. _class_SoftBody_property_ray_pickable: + +- :ref:`bool` **ray_pickable** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_ray_pickable(value) | ++-----------+-------------------------+ +| *Getter* | is_ray_pickable() | ++-----------+-------------------------+ + +If ``true``, the ``SoftBody`` will respond to :ref:`RayCast`\ s. + +---- + +.. _class_SoftBody_property_simulation_precision: + +- :ref:`int` **simulation_precision** + ++-----------+---------------------------------+ +| *Default* | ``5`` | ++-----------+---------------------------------+ +| *Setter* | set_simulation_precision(value) | ++-----------+---------------------------------+ +| *Getter* | get_simulation_precision() | ++-----------+---------------------------------+ + +Increasing this value will improve the resulting simulation, but can affect performance. Use with care. + +---- + +.. _class_SoftBody_property_total_mass: + +- :ref:`float` **total_mass** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_total_mass(value) | ++-----------+-----------------------+ +| *Getter* | get_total_mass() | ++-----------+-----------------------+ + +The SoftBody's mass. + +---- + +.. _class_SoftBody_property_volume_stiffness: + +- :ref:`float` **volume_stiffness** + ++-----------+-----------------------------+ +| *Default* | ``0.5`` | ++-----------+-----------------------------+ +| *Setter* | set_volume_stiffness(value) | ++-----------+-----------------------------+ +| *Getter* | get_volume_stiffness() | ++-----------+-----------------------------+ + +Method Descriptions +------------------- + +.. _class_SoftBody_method_add_collision_exception_with: + +- void **add_collision_exception_with** **(** :ref:`Node` body **)** + +Adds a body to the list of bodies that this body can't collide with. + +---- + +.. _class_SoftBody_method_get_collision_exceptions: + +- :ref:`Array` **get_collision_exceptions** **(** **)** + +Returns an array of nodes that were added as collision exceptions for this body. + +---- + +.. _class_SoftBody_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the collision mask. + +---- + +.. _class_SoftBody_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns an individual bit on the collision mask. + +---- + +.. _class_SoftBody_method_get_point_transform: + +- :ref:`Vector3` **get_point_transform** **(** :ref:`int` point_index **)** + +Returns local translation of a vertex in the surface array. + +---- + +.. _class_SoftBody_method_is_point_pinned: + +- :ref:`bool` **is_point_pinned** **(** :ref:`int` point_index **)** |const| + +Returns ``true`` if vertex is set to pinned. + +---- + +.. _class_SoftBody_method_remove_collision_exception_with: + +- void **remove_collision_exception_with** **(** :ref:`Node` body **)** + +Removes a body from the list of bodies that this body can't collide with. + +---- + +.. _class_SoftBody_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets individual bits on the layer mask. Use this if you only need to change one layer's value. + +---- + +.. _class_SoftBody_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets individual bits on the collision mask. Use this if you only need to change one layer's value. + +---- + +.. _class_SoftBody_method_set_point_pinned: + +- void **set_point_pinned** **(** :ref:`int` point_index, :ref:`bool` pinned, :ref:`NodePath` attachment_path=NodePath("") **)** + +Sets the pinned state of a surface vertex. When set to ``true``, the optional ``attachment_path`` can define a :ref:`Spatial` the pinned vertex will be attached to. + +.. |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.)` diff --git a/classes/class_spatial.rst b/classes/class_spatial.rst new file mode 100644 index 0000000..fe6d261 --- /dev/null +++ b/classes/class_spatial.rst @@ -0,0 +1,580 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Spatial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Spatial: + +Spatial +======= + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`ARVRAnchor`, :ref:`ARVRController`, :ref:`ARVROrigin`, :ref:`AudioStreamPlayer3D`, :ref:`BoneAttachment`, :ref:`Camera`, :ref:`CollisionObject`, :ref:`CollisionPolygon`, :ref:`CollisionShape`, :ref:`CullInstance`, :ref:`GridMap`, :ref:`Joint`, :ref:`Listener`, :ref:`Navigation`, :ref:`NavigationMeshInstance`, :ref:`Occluder`, :ref:`Path`, :ref:`PathFollow`, :ref:`Portal`, :ref:`Position3D`, :ref:`ProximityGroup`, :ref:`RayCast`, :ref:`RemoteTransform`, :ref:`Room`, :ref:`RoomGroup`, :ref:`RoomManager`, :ref:`Skeleton`, :ref:`SpringArm`, :ref:`VehicleWheel` + +Most basic 3D game object, parent of all 3D-related nodes. + +Description +----------- + +Most basic 3D game object, with a 3D :ref:`Transform` and visibility settings. All other 3D game objects inherit from Spatial. Use ``Spatial`` as a parent node to move, scale, rotate and show/hide children in a 3D project. + +Affine operations (rotate, scale, translate) happen in parent's local coordinate system, unless the ``Spatial`` object is set as top-level. Affine operations in this coordinate system correspond to direct affine operations on the ``Spatial``'s transform. The word local below refers to this coordinate system. The coordinate system that is attached to the ``Spatial`` object itself is referred to as object-local coordinate system. + +**Note:** Unless otherwise specified, all methods that have angle parameters must have angles specified as *radians*. To convert degrees to radians, use :ref:`@GDScript.deg2rad`. + +Tutorials +--------- + +- :doc:`../tutorials/3d/introduction_to_3d` + +- `All 3D Demos `__ + +Properties +---------- + ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`SpatialGizmo` | :ref:`gizmo` | | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`global_transform` | | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`rotation` | | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`rotation_degrees` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`scale` | ``Vector3( 1, 1, 1 )`` | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`transform` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Vector3` | :ref:`translation` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`bool` | :ref:`visible` | ``true`` | ++-----------------------------------------+------------------------------------------------------------------+-----------------------------------------------------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_update_transform` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Spatial` | :ref:`get_parent_spatial` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`World` | :ref:`get_world` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_rotate` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_scale` **(** :ref:`Vector3` scale **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`global_translate` **(** :ref:`Vector3` offset **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`hide` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_local_transform_notification_enabled` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_scale_disabled` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_set_as_toplevel` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_transform_notification_enabled` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_visible_in_tree` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`look_at` **(** :ref:`Vector3` target, :ref:`Vector3` up **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`look_at_from_position` **(** :ref:`Vector3` position, :ref:`Vector3` target, :ref:`Vector3` up **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`orthonormalize` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_object_local` **(** :ref:`Vector3` axis, :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_x` **(** :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_y` **(** :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rotate_z` **(** :ref:`float` angle **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scale_object_local` **(** :ref:`Vector3` scale **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_as_toplevel` **(** :ref:`bool` enable **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_disable_scale` **(** :ref:`bool` disable **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_identity` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_ignore_transform_notification` **(** :ref:`bool` enabled **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_notify_local_transform` **(** :ref:`bool` enable **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_notify_transform` **(** :ref:`bool` enable **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`show` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`to_global` **(** :ref:`Vector3` local_point **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`to_local` **(** :ref:`Vector3` global_point **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`translate` **(** :ref:`Vector3` offset **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`translate_object_local` **(** :ref:`Vector3` offset **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_gizmo` **(** **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Spatial_signal_gameplay_entered: + +- **gameplay_entered** **(** **)** + +Emitted by portal system gameplay monitor when a node enters the gameplay area. + +---- + +.. _class_Spatial_signal_gameplay_exited: + +- **gameplay_exited** **(** **)** + +Emitted by portal system gameplay monitor when a node exits the gameplay area. + +---- + +.. _class_Spatial_signal_visibility_changed: + +- **visibility_changed** **(** **)** + +Emitted when node visibility changes. + +Constants +--------- + +.. _class_Spatial_constant_NOTIFICATION_TRANSFORM_CHANGED: + +.. _class_Spatial_constant_NOTIFICATION_ENTER_WORLD: + +.. _class_Spatial_constant_NOTIFICATION_EXIT_WORLD: + +.. _class_Spatial_constant_NOTIFICATION_VISIBILITY_CHANGED: + +.. _class_Spatial_constant_NOTIFICATION_ENTER_GAMEPLAY: + +.. _class_Spatial_constant_NOTIFICATION_EXIT_GAMEPLAY: + +- **NOTIFICATION_TRANSFORM_CHANGED** = **2000** --- Spatial nodes receives this notification when their global transform changes. This means that either the current or a parent node changed its transform. + +In order for :ref:`NOTIFICATION_TRANSFORM_CHANGED` to work, users first need to ask for it, with :ref:`set_notify_transform`. The notification is also sent if the node is in the editor context and it has a valid gizmo. + +- **NOTIFICATION_ENTER_WORLD** = **41** --- Spatial nodes receives this notification when they are registered to new :ref:`World` resource. + +- **NOTIFICATION_EXIT_WORLD** = **42** --- Spatial nodes receives this notification when they are unregistered from current :ref:`World` resource. + +- **NOTIFICATION_VISIBILITY_CHANGED** = **43** --- Spatial nodes receives this notification when their visibility changes. + +- **NOTIFICATION_ENTER_GAMEPLAY** = **45** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have entered the gameplay area. + +- **NOTIFICATION_EXIT_GAMEPLAY** = **46** --- Spatial nodes receives this notification if the portal system gameplay monitor detects they have exited the gameplay area. + +Property Descriptions +--------------------- + +.. _class_Spatial_property_gizmo: + +- :ref:`SpatialGizmo` **gizmo** + ++----------+------------------+ +| *Setter* | set_gizmo(value) | ++----------+------------------+ +| *Getter* | get_gizmo() | ++----------+------------------+ + +The :ref:`SpatialGizmo` for this node. Used for example in :ref:`EditorSpatialGizmo` as custom visualization and editing handles in Editor. + +---- + +.. _class_Spatial_property_global_transform: + +- :ref:`Transform` **global_transform** + ++----------+-----------------------------+ +| *Setter* | set_global_transform(value) | ++----------+-----------------------------+ +| *Getter* | get_global_transform() | ++----------+-----------------------------+ + +World space (global) :ref:`Transform` of this node. + +---- + +.. _class_Spatial_property_rotation: + +- :ref:`Vector3` **rotation** + ++----------+---------------------+ +| *Setter* | set_rotation(value) | ++----------+---------------------+ +| *Getter* | get_rotation() | ++----------+---------------------+ + +Rotation part of the local transformation in radians, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). + +**Note:** In the mathematical sense, rotation is a matrix and not a vector. The three Euler angles, which are the three independent parameters of the Euler-angle parametrization of the rotation matrix, are stored in a :ref:`Vector3` data structure not because the rotation is a vector, but only because :ref:`Vector3` exists as a convenient data-structure to store 3 floating-point numbers. Therefore, applying affine operations on the rotation "vector" is not meaningful. + +---- + +.. _class_Spatial_property_rotation_degrees: + +- :ref:`Vector3` **rotation_degrees** + ++-----------+-----------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-----------------------------+ +| *Setter* | set_rotation_degrees(value) | ++-----------+-----------------------------+ +| *Getter* | get_rotation_degrees() | ++-----------+-----------------------------+ + +Rotation part of the local transformation in degrees, specified in terms of YXZ-Euler angles in the format (X angle, Y angle, Z angle). + +---- + +.. _class_Spatial_property_scale: + +- :ref:`Vector3` **scale** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_scale(value) | ++-----------+------------------------+ +| *Getter* | get_scale() | ++-----------+------------------------+ + +Scale part of the local transformation. + +---- + +.. _class_Spatial_property_transform: + +- :ref:`Transform` **transform** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_transform(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_transform() | ++-----------+-----------------------------------------------------+ + +Local space :ref:`Transform` of this node, with respect to the parent node. + +---- + +.. _class_Spatial_property_translation: + +- :ref:`Vector3` **translation** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_translation(value) | ++-----------+------------------------+ +| *Getter* | get_translation() | ++-----------+------------------------+ + +Local translation of this node. + +---- + +.. _class_Spatial_property_visible: + +- :ref:`bool` **visible** + ++-----------+--------------------+ +| *Default* | ``true`` | ++-----------+--------------------+ +| *Setter* | set_visible(value) | ++-----------+--------------------+ +| *Getter* | is_visible() | ++-----------+--------------------+ + +If ``true``, this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, :ref:`is_visible_in_tree` must return ``true``). + +Method Descriptions +------------------- + +.. _class_Spatial_method_force_update_transform: + +- void **force_update_transform** **(** **)** + +Forces the transform to update. Transform changes in physics are not instant for performance reasons. Transforms are accumulated and then set. Use this if you need an up-to-date transform when doing physics operations. + +---- + +.. _class_Spatial_method_get_parent_spatial: + +- :ref:`Spatial` **get_parent_spatial** **(** **)** |const| + +Returns the parent ``Spatial``, or an empty :ref:`Object` if no parent exists or parent is not of type ``Spatial``. + +---- + +.. _class_Spatial_method_get_world: + +- :ref:`World` **get_world** **(** **)** |const| + +Returns the current :ref:`World` resource this ``Spatial`` node is registered to. + +---- + +.. _class_Spatial_method_global_rotate: + +- void **global_rotate** **(** :ref:`Vector3` axis, :ref:`float` angle **)** + +Rotates the global (world) transformation around axis, a unit :ref:`Vector3`, by specified angle in radians. The rotation axis is in global coordinate system. + +---- + +.. _class_Spatial_method_global_scale: + +- void **global_scale** **(** :ref:`Vector3` scale **)** + +Scales the global (world) transformation by the given :ref:`Vector3` scale factors. + +---- + +.. _class_Spatial_method_global_translate: + +- void **global_translate** **(** :ref:`Vector3` offset **)** + +Moves the global (world) transformation by :ref:`Vector3` offset. The offset is in global coordinate system. + +---- + +.. _class_Spatial_method_hide: + +- void **hide** **(** **)** + +Disables rendering of this node. Changes :ref:`visible` to ``false``. + +---- + +.. _class_Spatial_method_is_local_transform_notification_enabled: + +- :ref:`bool` **is_local_transform_notification_enabled** **(** **)** |const| + +Returns whether node notifies about its local transformation changes. ``Spatial`` will not propagate this by default. + +---- + +.. _class_Spatial_method_is_scale_disabled: + +- :ref:`bool` **is_scale_disabled** **(** **)** |const| + +Returns whether this node uses a scale of ``(1, 1, 1)`` or its local transformation scale. + +---- + +.. _class_Spatial_method_is_set_as_toplevel: + +- :ref:`bool` **is_set_as_toplevel** **(** **)** |const| + +Returns whether this node is set as Toplevel, that is whether it ignores its parent nodes transformations. + +---- + +.. _class_Spatial_method_is_transform_notification_enabled: + +- :ref:`bool` **is_transform_notification_enabled** **(** **)** |const| + +Returns whether the node notifies about its global and local transformation changes. ``Spatial`` will not propagate this by default. + +---- + +.. _class_Spatial_method_is_visible_in_tree: + +- :ref:`bool` **is_visible_in_tree** **(** **)** |const| + +Returns ``true`` if the node is present in the :ref:`SceneTree`, its :ref:`visible` property is ``true`` and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. + +---- + +.. _class_Spatial_method_look_at: + +- void **look_at** **(** :ref:`Vector3` target, :ref:`Vector3` up **)** + +Rotates the node so that the local forward axis (-Z) points toward the ``target`` position. + +The local up axis (+Y) points as close to the ``up`` vector as possible while staying perpendicular to the local forward axis. The resulting transform is orthogonal, and the scale is preserved. Non-uniform scaling may not work correctly. + +The ``target`` position cannot be the same as the node's position, the ``up`` vector cannot be zero, and the direction from the node's position to the ``target`` vector cannot be parallel to the ``up`` vector. + +Operations take place in global space. + +---- + +.. _class_Spatial_method_look_at_from_position: + +- void **look_at_from_position** **(** :ref:`Vector3` position, :ref:`Vector3` target, :ref:`Vector3` up **)** + +Moves the node to the specified ``position``, and then rotates itself to point toward the ``target`` as per :ref:`look_at`. Operations take place in global space. + +---- + +.. _class_Spatial_method_orthonormalize: + +- void **orthonormalize** **(** **)** + +Resets this node's transformations (like scale, skew and taper) preserving its rotation and translation by performing Gram-Schmidt orthonormalization on this node's :ref:`Transform`. + +---- + +.. _class_Spatial_method_rotate: + +- void **rotate** **(** :ref:`Vector3` axis, :ref:`float` angle **)** + +Rotates the local transformation around axis, a unit :ref:`Vector3`, by specified angle in radians. + +---- + +.. _class_Spatial_method_rotate_object_local: + +- void **rotate_object_local** **(** :ref:`Vector3` axis, :ref:`float` angle **)** + +Rotates the local transformation around axis, a unit :ref:`Vector3`, by specified angle in radians. The rotation axis is in object-local coordinate system. + +---- + +.. _class_Spatial_method_rotate_x: + +- void **rotate_x** **(** :ref:`float` angle **)** + +Rotates the local transformation around the X axis by angle in radians. + +---- + +.. _class_Spatial_method_rotate_y: + +- void **rotate_y** **(** :ref:`float` angle **)** + +Rotates the local transformation around the Y axis by angle in radians. + +---- + +.. _class_Spatial_method_rotate_z: + +- void **rotate_z** **(** :ref:`float` angle **)** + +Rotates the local transformation around the Z axis by angle in radians. + +---- + +.. _class_Spatial_method_scale_object_local: + +- void **scale_object_local** **(** :ref:`Vector3` scale **)** + +Scales the local transformation by given 3D scale factors in object-local coordinate system. + +---- + +.. _class_Spatial_method_set_as_toplevel: + +- void **set_as_toplevel** **(** :ref:`bool` enable **)** + +Makes the node ignore its parents transformations. Node transformations are only in global space. + +---- + +.. _class_Spatial_method_set_disable_scale: + +- void **set_disable_scale** **(** :ref:`bool` disable **)** + +Sets whether the node uses a scale of ``(1, 1, 1)`` or its local transformation scale. Changes to the local transformation scale are preserved. + +---- + +.. _class_Spatial_method_set_identity: + +- void **set_identity** **(** **)** + +Reset all transformations for this node (sets its :ref:`Transform` to the identity matrix). + +---- + +.. _class_Spatial_method_set_ignore_transform_notification: + +- void **set_ignore_transform_notification** **(** :ref:`bool` enabled **)** + +Sets whether the node ignores notification that its transformation (global or local) changed. + +---- + +.. _class_Spatial_method_set_notify_local_transform: + +- void **set_notify_local_transform** **(** :ref:`bool` enable **)** + +Sets whether the node notifies about its local transformation changes. ``Spatial`` will not propagate this by default. + +---- + +.. _class_Spatial_method_set_notify_transform: + +- void **set_notify_transform** **(** :ref:`bool` enable **)** + +Sets whether the node notifies about its global and local transformation changes. ``Spatial`` will not propagate this by default, unless it is in the editor context and it has a valid gizmo. + +---- + +.. _class_Spatial_method_show: + +- void **show** **(** **)** + +Enables rendering of this node. Changes :ref:`visible` to ``true``. + +---- + +.. _class_Spatial_method_to_global: + +- :ref:`Vector3` **to_global** **(** :ref:`Vector3` local_point **)** |const| + +Transforms ``local_point`` from this node's local space to world space. + +---- + +.. _class_Spatial_method_to_local: + +- :ref:`Vector3` **to_local** **(** :ref:`Vector3` global_point **)** |const| + +Transforms ``global_point`` from world space to this node's local space. + +---- + +.. _class_Spatial_method_translate: + +- void **translate** **(** :ref:`Vector3` offset **)** + +Changes the node's position by the given offset :ref:`Vector3`. + +Note that the translation ``offset`` is affected by the node's scale, so if scaled by e.g. ``(10, 1, 1)``, a translation by an offset of ``(2, 0, 0)`` would actually add 20 (``2 * 10``) to the X coordinate. + +---- + +.. _class_Spatial_method_translate_object_local: + +- void **translate_object_local** **(** :ref:`Vector3` offset **)** + +Changes the node's position by the given offset :ref:`Vector3` in local space. + +---- + +.. _class_Spatial_method_update_gizmo: + +- void **update_gizmo** **(** **)** + +Updates the :ref:`SpatialGizmo` of this 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.)` diff --git a/classes/class_spatialgizmo.rst b/classes/class_spatialgizmo.rst new file mode 100644 index 0000000..a369f2e --- /dev/null +++ b/classes/class_spatialgizmo.rst @@ -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 SpatialGizmo.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpatialGizmo: + +SpatialGizmo +============ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`EditorSpatialGizmo` + + + +.. |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.)` diff --git a/classes/class_spatialmaterial.rst b/classes/class_spatialmaterial.rst new file mode 100644 index 0000000..ab5b389 --- /dev/null +++ b/classes/class_spatialmaterial.rst @@ -0,0 +1,2283 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpatialMaterial.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpatialMaterial: + +SpatialMaterial +=============== + +**Inherits:** :ref:`Material` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Default 3D rendering material. + +Description +----------- + +This provides a default material with a wide variety of rendering features and properties without the need to write shader code. See the tutorial below for details. + +Tutorials +--------- + +- :doc:`../tutorials/3d/spatial_material` + +Properties +---------- + ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`albedo_color` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`albedo_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`anisotropy` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`anisotropy_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`anisotropy_flowmap` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`ao_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`ao_light_affect` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`ao_on_uv2` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`ao_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`TextureChannel` | :ref:`ao_texture_channel` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`clearcoat` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`clearcoat_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`clearcoat_gloss` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`clearcoat_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`depth_deep_parallax` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`depth_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`depth_flip_binormal` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`depth_flip_tangent` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`depth_max_layers` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`depth_min_layers` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`depth_scale` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`depth_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`detail_albedo` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`BlendMode` | :ref:`detail_blend_mode` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`detail_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`detail_mask` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`detail_normal` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`DetailUV` | :ref:`detail_uv_layer` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`distance_fade_max_distance` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`distance_fade_min_distance` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`DistanceFadeMode` | :ref:`distance_fade_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`emission` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`emission_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`emission_energy` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`emission_on_uv2` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`EmissionOperator` | :ref:`emission_operator` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`emission_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_albedo_tex_force_srgb` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_disable_ambient_light` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_do_not_receive_shadows` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_ensure_correct_normals` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_fixed_size` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_no_depth_test` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_transparent` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_unshaded` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_use_point_size` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_use_shadow_to_opacity` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_vertex_lighting` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flags_world_triplanar` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`metallic` | ``0.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`metallic_specular` | ``0.5`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`metallic_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`TextureChannel` | :ref:`metallic_texture_channel` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`normal_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`normal_scale` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`normal_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`params_alpha_scissor_threshold` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`params_billboard_keep_scale` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`BillboardMode` | :ref:`params_billboard_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`BlendMode` | :ref:`params_blend_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`CullMode` | :ref:`params_cull_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`DepthDrawMode` | :ref:`params_depth_draw_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`DiffuseMode` | :ref:`params_diffuse_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`params_grow` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`params_grow_amount` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`params_line_width` | ``1.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`params_point_size` | ``1.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`SpecularMode` | :ref:`params_specular_mode` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`params_use_alpha_scissor` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`particles_anim_h_frames` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`particles_anim_loop` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`particles_anim_v_frames` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`proximity_fade_distance` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`proximity_fade_enable` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`refraction_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`refraction_scale` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`refraction_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`TextureChannel` | :ref:`refraction_texture_channel` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`rim` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`rim_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`rim_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`rim_tint` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`roughness` | ``1.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`roughness_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`TextureChannel` | :ref:`roughness_texture_channel` | ``0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`subsurf_scatter_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`subsurf_scatter_strength` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`subsurf_scatter_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`transmission` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`transmission_enabled` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`transmission_texture` | | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`uv1_offset` | ``Vector3( 0, 0, 0 )`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`uv1_scale` | ``Vector3( 1, 1, 1 )`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`uv1_triplanar` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`uv1_triplanar_sharpness` | ``1.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`uv2_offset` | ``Vector3( 0, 0, 0 )`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Vector3` | :ref:`uv2_scale` | ``Vector3( 1, 1, 1 )`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`uv2_triplanar` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`uv2_triplanar_sharpness` | ``1.0`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`vertex_color_is_srgb` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`vertex_color_use_as_albedo` | ``false`` | ++----------------------------------------------------------------+------------------------------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_feature` **(** :ref:`Feature` feature **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_flag` **(** :ref:`Flags` flag **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_texture` **(** :ref:`TextureParam` param **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_feature` **(** :ref:`Feature` feature, :ref:`bool` enable **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_flag` **(** :ref:`Flags` flag, :ref:`bool` enable **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_texture` **(** :ref:`TextureParam` param, :ref:`Texture` texture **)** | ++-------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_SpatialMaterial_TextureParam: + +.. _class_SpatialMaterial_constant_TEXTURE_ALBEDO: + +.. _class_SpatialMaterial_constant_TEXTURE_METALLIC: + +.. _class_SpatialMaterial_constant_TEXTURE_ROUGHNESS: + +.. _class_SpatialMaterial_constant_TEXTURE_EMISSION: + +.. _class_SpatialMaterial_constant_TEXTURE_NORMAL: + +.. _class_SpatialMaterial_constant_TEXTURE_RIM: + +.. _class_SpatialMaterial_constant_TEXTURE_CLEARCOAT: + +.. _class_SpatialMaterial_constant_TEXTURE_FLOWMAP: + +.. _class_SpatialMaterial_constant_TEXTURE_AMBIENT_OCCLUSION: + +.. _class_SpatialMaterial_constant_TEXTURE_DEPTH: + +.. _class_SpatialMaterial_constant_TEXTURE_SUBSURFACE_SCATTERING: + +.. _class_SpatialMaterial_constant_TEXTURE_TRANSMISSION: + +.. _class_SpatialMaterial_constant_TEXTURE_REFRACTION: + +.. _class_SpatialMaterial_constant_TEXTURE_DETAIL_MASK: + +.. _class_SpatialMaterial_constant_TEXTURE_DETAIL_ALBEDO: + +.. _class_SpatialMaterial_constant_TEXTURE_DETAIL_NORMAL: + +.. _class_SpatialMaterial_constant_TEXTURE_MAX: + +enum **TextureParam**: + +- **TEXTURE_ALBEDO** = **0** --- Texture specifying per-pixel color. + +- **TEXTURE_METALLIC** = **1** --- Texture specifying per-pixel metallic value. + +- **TEXTURE_ROUGHNESS** = **2** --- Texture specifying per-pixel roughness value. + +- **TEXTURE_EMISSION** = **3** --- Texture specifying per-pixel emission color. + +- **TEXTURE_NORMAL** = **4** --- Texture specifying per-pixel normal vector. + +- **TEXTURE_RIM** = **5** --- Texture specifying per-pixel rim value. + +- **TEXTURE_CLEARCOAT** = **6** --- Texture specifying per-pixel clearcoat value. + +- **TEXTURE_FLOWMAP** = **7** --- Texture specifying per-pixel flowmap direction for use with :ref:`anisotropy`. + +- **TEXTURE_AMBIENT_OCCLUSION** = **8** --- Texture specifying per-pixel ambient occlusion value. + +- **TEXTURE_DEPTH** = **9** --- Texture specifying per-pixel depth. + +- **TEXTURE_SUBSURFACE_SCATTERING** = **10** --- Texture specifying per-pixel subsurface scattering. + +- **TEXTURE_TRANSMISSION** = **11** --- Texture specifying per-pixel transmission color. + +- **TEXTURE_REFRACTION** = **12** --- Texture specifying per-pixel refraction strength. + +- **TEXTURE_DETAIL_MASK** = **13** --- Texture specifying per-pixel detail mask blending value. + +- **TEXTURE_DETAIL_ALBEDO** = **14** --- Texture specifying per-pixel detail color. + +- **TEXTURE_DETAIL_NORMAL** = **15** --- Texture specifying per-pixel detail normal. + +- **TEXTURE_MAX** = **16** --- Represents the size of the :ref:`TextureParam` enum. + +---- + +.. _enum_SpatialMaterial_DetailUV: + +.. _class_SpatialMaterial_constant_DETAIL_UV_1: + +.. _class_SpatialMaterial_constant_DETAIL_UV_2: + +enum **DetailUV**: + +- **DETAIL_UV_1** = **0** --- Use ``UV`` with the detail texture. + +- **DETAIL_UV_2** = **1** --- Use ``UV2`` with the detail texture. + +---- + +.. _enum_SpatialMaterial_Feature: + +.. _class_SpatialMaterial_constant_FEATURE_TRANSPARENT: + +.. _class_SpatialMaterial_constant_FEATURE_EMISSION: + +.. _class_SpatialMaterial_constant_FEATURE_NORMAL_MAPPING: + +.. _class_SpatialMaterial_constant_FEATURE_RIM: + +.. _class_SpatialMaterial_constant_FEATURE_CLEARCOAT: + +.. _class_SpatialMaterial_constant_FEATURE_ANISOTROPY: + +.. _class_SpatialMaterial_constant_FEATURE_AMBIENT_OCCLUSION: + +.. _class_SpatialMaterial_constant_FEATURE_DEPTH_MAPPING: + +.. _class_SpatialMaterial_constant_FEATURE_SUBSURACE_SCATTERING: + +.. _class_SpatialMaterial_constant_FEATURE_TRANSMISSION: + +.. _class_SpatialMaterial_constant_FEATURE_REFRACTION: + +.. _class_SpatialMaterial_constant_FEATURE_DETAIL: + +.. _class_SpatialMaterial_constant_FEATURE_MAX: + +enum **Feature**: + +- **FEATURE_TRANSPARENT** = **0** --- Constant for setting :ref:`flags_transparent`. + +- **FEATURE_EMISSION** = **1** --- Constant for setting :ref:`emission_enabled`. + +- **FEATURE_NORMAL_MAPPING** = **2** --- Constant for setting :ref:`normal_enabled`. + +- **FEATURE_RIM** = **3** --- Constant for setting :ref:`rim_enabled`. + +- **FEATURE_CLEARCOAT** = **4** --- Constant for setting :ref:`clearcoat_enabled`. + +- **FEATURE_ANISOTROPY** = **5** --- Constant for setting :ref:`anisotropy_enabled`. + +- **FEATURE_AMBIENT_OCCLUSION** = **6** --- Constant for setting :ref:`ao_enabled`. + +- **FEATURE_DEPTH_MAPPING** = **7** --- Constant for setting :ref:`depth_enabled`. + +- **FEATURE_SUBSURACE_SCATTERING** = **8** --- Constant for setting :ref:`subsurf_scatter_enabled`. + +- **FEATURE_TRANSMISSION** = **9** --- Constant for setting :ref:`transmission_enabled`. + +- **FEATURE_REFRACTION** = **10** --- Constant for setting :ref:`refraction_enabled`. + +- **FEATURE_DETAIL** = **11** --- Constant for setting :ref:`detail_enabled`. + +- **FEATURE_MAX** = **12** --- Represents the size of the :ref:`Feature` enum. + +---- + +.. _enum_SpatialMaterial_BlendMode: + +.. _class_SpatialMaterial_constant_BLEND_MODE_MIX: + +.. _class_SpatialMaterial_constant_BLEND_MODE_ADD: + +.. _class_SpatialMaterial_constant_BLEND_MODE_SUB: + +.. _class_SpatialMaterial_constant_BLEND_MODE_MUL: + +enum **BlendMode**: + +- **BLEND_MODE_MIX** = **0** --- Default blend mode. The color of the object is blended over the background based on the object's alpha value. + +- **BLEND_MODE_ADD** = **1** --- The color of the object is added to the background. + +- **BLEND_MODE_SUB** = **2** --- The color of the object is subtracted from the background. + +- **BLEND_MODE_MUL** = **3** --- The color of the object is multiplied by the background. + +---- + +.. _enum_SpatialMaterial_DepthDrawMode: + +.. _class_SpatialMaterial_constant_DEPTH_DRAW_OPAQUE_ONLY: + +.. _class_SpatialMaterial_constant_DEPTH_DRAW_ALWAYS: + +.. _class_SpatialMaterial_constant_DEPTH_DRAW_DISABLED: + +.. _class_SpatialMaterial_constant_DEPTH_DRAW_ALPHA_OPAQUE_PREPASS: + +enum **DepthDrawMode**: + +- **DEPTH_DRAW_OPAQUE_ONLY** = **0** --- Default depth draw mode. Depth is drawn only for opaque objects. + +- **DEPTH_DRAW_ALWAYS** = **1** --- Depth draw is calculated for both opaque and transparent objects. + +- **DEPTH_DRAW_DISABLED** = **2** --- No depth draw. + +- **DEPTH_DRAW_ALPHA_OPAQUE_PREPASS** = **3** --- For transparent objects, an opaque pass is made first with the opaque parts, then transparency is drawn. + +---- + +.. _enum_SpatialMaterial_CullMode: + +.. _class_SpatialMaterial_constant_CULL_BACK: + +.. _class_SpatialMaterial_constant_CULL_FRONT: + +.. _class_SpatialMaterial_constant_CULL_DISABLED: + +enum **CullMode**: + +- **CULL_BACK** = **0** --- Default cull mode. The back of the object is culled when not visible. + +- **CULL_FRONT** = **1** --- The front of the object is culled when not visible. + +- **CULL_DISABLED** = **2** --- No culling is performed. + +---- + +.. _enum_SpatialMaterial_Flags: + +.. _class_SpatialMaterial_constant_FLAG_UNSHADED: + +.. _class_SpatialMaterial_constant_FLAG_USE_VERTEX_LIGHTING: + +.. _class_SpatialMaterial_constant_FLAG_DISABLE_DEPTH_TEST: + +.. _class_SpatialMaterial_constant_FLAG_ALBEDO_FROM_VERTEX_COLOR: + +.. _class_SpatialMaterial_constant_FLAG_SRGB_VERTEX_COLOR: + +.. _class_SpatialMaterial_constant_FLAG_USE_POINT_SIZE: + +.. _class_SpatialMaterial_constant_FLAG_FIXED_SIZE: + +.. _class_SpatialMaterial_constant_FLAG_BILLBOARD_KEEP_SCALE: + +.. _class_SpatialMaterial_constant_FLAG_UV1_USE_TRIPLANAR: + +.. _class_SpatialMaterial_constant_FLAG_UV2_USE_TRIPLANAR: + +.. _class_SpatialMaterial_constant_FLAG_AO_ON_UV2: + +.. _class_SpatialMaterial_constant_FLAG_EMISSION_ON_UV2: + +.. _class_SpatialMaterial_constant_FLAG_USE_ALPHA_SCISSOR: + +.. _class_SpatialMaterial_constant_FLAG_TRIPLANAR_USE_WORLD: + +.. _class_SpatialMaterial_constant_FLAG_ALBEDO_TEXTURE_FORCE_SRGB: + +.. _class_SpatialMaterial_constant_FLAG_DONT_RECEIVE_SHADOWS: + +.. _class_SpatialMaterial_constant_FLAG_DISABLE_AMBIENT_LIGHT: + +.. _class_SpatialMaterial_constant_FLAG_ENSURE_CORRECT_NORMALS: + +.. _class_SpatialMaterial_constant_FLAG_USE_SHADOW_TO_OPACITY: + +.. _class_SpatialMaterial_constant_FLAG_MAX: + +enum **Flags**: + +- **FLAG_UNSHADED** = **0** --- No lighting is used on the object. Color comes directly from ``ALBEDO``. + +- **FLAG_USE_VERTEX_LIGHTING** = **1** --- Lighting is calculated per-vertex rather than per-pixel. This can be used to increase the speed of the shader at the cost of quality. + +- **FLAG_DISABLE_DEPTH_TEST** = **2** --- Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. + +- **FLAG_ALBEDO_FROM_VERTEX_COLOR** = **3** --- Set ``ALBEDO`` to the per-vertex color specified in the mesh. + +- **FLAG_SRGB_VERTEX_COLOR** = **4** --- Vertex color is in sRGB space and needs to be converted to linear. Only applies in the GLES3 renderer. + +- **FLAG_USE_POINT_SIZE** = **5** --- Uses point size to alter the size of primitive points. Also changes the albedo texture lookup to use ``POINT_COORD`` instead of ``UV``. + +- **FLAG_FIXED_SIZE** = **6** --- Object is scaled by depth so that it always appears the same size on screen. + +- **FLAG_BILLBOARD_KEEP_SCALE** = **7** --- Shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when :ref:`params_billboard_mode` is :ref:`BILLBOARD_ENABLED`. + +- **FLAG_UV1_USE_TRIPLANAR** = **8** --- Use triplanar texture lookup for all texture lookups that would normally use ``UV``. + +- **FLAG_UV2_USE_TRIPLANAR** = **9** --- Use triplanar texture lookup for all texture lookups that would normally use ``UV2``. + +- **FLAG_AO_ON_UV2** = **11** --- Use ``UV2`` coordinates to look up from the :ref:`ao_texture`. + +- **FLAG_EMISSION_ON_UV2** = **12** --- Use ``UV2`` coordinates to look up from the :ref:`emission_texture`. + +- **FLAG_USE_ALPHA_SCISSOR** = **13** --- Use alpha scissor. Set by :ref:`params_use_alpha_scissor`. + +- **FLAG_TRIPLANAR_USE_WORLD** = **10** --- Use world coordinates in the triplanar texture lookup instead of local coordinates. + +- **FLAG_ALBEDO_TEXTURE_FORCE_SRGB** = **14** --- Forces the shader to convert albedo from sRGB space to linear space. + +- **FLAG_DONT_RECEIVE_SHADOWS** = **15** --- Disables receiving shadows from other objects. + +- **FLAG_DISABLE_AMBIENT_LIGHT** = **17** --- Disables receiving ambient light. + +- **FLAG_ENSURE_CORRECT_NORMALS** = **16** --- Ensures that normals appear correct, even with non-uniform scaling. + +- **FLAG_USE_SHADOW_TO_OPACITY** = **18** --- Enables the shadow to opacity feature. + +- **FLAG_MAX** = **19** --- Represents the size of the :ref:`Flags` enum. + +---- + +.. _enum_SpatialMaterial_DiffuseMode: + +.. _class_SpatialMaterial_constant_DIFFUSE_BURLEY: + +.. _class_SpatialMaterial_constant_DIFFUSE_LAMBERT: + +.. _class_SpatialMaterial_constant_DIFFUSE_LAMBERT_WRAP: + +.. _class_SpatialMaterial_constant_DIFFUSE_OREN_NAYAR: + +.. _class_SpatialMaterial_constant_DIFFUSE_TOON: + +enum **DiffuseMode**: + +- **DIFFUSE_BURLEY** = **0** --- Default diffuse scattering algorithm. + +- **DIFFUSE_LAMBERT** = **1** --- Diffuse scattering ignores roughness. + +- **DIFFUSE_LAMBERT_WRAP** = **2** --- Extends Lambert to cover more than 90 degrees when roughness increases. + +- **DIFFUSE_OREN_NAYAR** = **3** --- Attempts to use roughness to emulate microsurfacing. + +- **DIFFUSE_TOON** = **4** --- Uses a hard cut for lighting, with smoothing affected by roughness. + +---- + +.. _enum_SpatialMaterial_SpecularMode: + +.. _class_SpatialMaterial_constant_SPECULAR_SCHLICK_GGX: + +.. _class_SpatialMaterial_constant_SPECULAR_BLINN: + +.. _class_SpatialMaterial_constant_SPECULAR_PHONG: + +.. _class_SpatialMaterial_constant_SPECULAR_TOON: + +.. _class_SpatialMaterial_constant_SPECULAR_DISABLED: + +enum **SpecularMode**: + +- **SPECULAR_SCHLICK_GGX** = **0** --- Default specular blob. + +- **SPECULAR_BLINN** = **1** --- Older specular algorithm, included for compatibility. + +- **SPECULAR_PHONG** = **2** --- Older specular algorithm, included for compatibility. + +- **SPECULAR_TOON** = **3** --- Toon blob which changes size based on roughness. + +- **SPECULAR_DISABLED** = **4** --- No specular blob. + +---- + +.. _enum_SpatialMaterial_BillboardMode: + +.. _class_SpatialMaterial_constant_BILLBOARD_DISABLED: + +.. _class_SpatialMaterial_constant_BILLBOARD_ENABLED: + +.. _class_SpatialMaterial_constant_BILLBOARD_FIXED_Y: + +.. _class_SpatialMaterial_constant_BILLBOARD_PARTICLES: + +enum **BillboardMode**: + +- **BILLBOARD_DISABLED** = **0** --- Billboard mode is disabled. + +- **BILLBOARD_ENABLED** = **1** --- The object's Z axis will always face the camera. + +- **BILLBOARD_FIXED_Y** = **2** --- The object's X axis will always face the camera. + +- **BILLBOARD_PARTICLES** = **3** --- Used for particle systems when assigned to :ref:`Particles` and :ref:`CPUParticles` nodes. Enables ``particles_anim_*`` properties. + +The :ref:`ParticlesMaterial.anim_speed` or :ref:`CPUParticles.anim_speed` should also be set to a positive value for the animation to play. + +---- + +.. _enum_SpatialMaterial_TextureChannel: + +.. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_RED: + +.. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_GREEN: + +.. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_BLUE: + +.. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_ALPHA: + +.. _class_SpatialMaterial_constant_TEXTURE_CHANNEL_GRAYSCALE: + +enum **TextureChannel**: + +- **TEXTURE_CHANNEL_RED** = **0** --- Used to read from the red channel of a texture. + +- **TEXTURE_CHANNEL_GREEN** = **1** --- Used to read from the green channel of a texture. + +- **TEXTURE_CHANNEL_BLUE** = **2** --- Used to read from the blue channel of a texture. + +- **TEXTURE_CHANNEL_ALPHA** = **3** --- Used to read from the alpha channel of a texture. + +- **TEXTURE_CHANNEL_GRAYSCALE** = **4** --- Currently unused. + +---- + +.. _enum_SpatialMaterial_EmissionOperator: + +.. _class_SpatialMaterial_constant_EMISSION_OP_ADD: + +.. _class_SpatialMaterial_constant_EMISSION_OP_MULTIPLY: + +enum **EmissionOperator**: + +- **EMISSION_OP_ADD** = **0** --- Adds the emission color to the color from the emission texture. + +- **EMISSION_OP_MULTIPLY** = **1** --- Multiplies the emission color by the color from the emission texture. + +---- + +.. _enum_SpatialMaterial_DistanceFadeMode: + +.. _class_SpatialMaterial_constant_DISTANCE_FADE_DISABLED: + +.. _class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_ALPHA: + +.. _class_SpatialMaterial_constant_DISTANCE_FADE_PIXEL_DITHER: + +.. _class_SpatialMaterial_constant_DISTANCE_FADE_OBJECT_DITHER: + +enum **DistanceFadeMode**: + +- **DISTANCE_FADE_DISABLED** = **0** --- Do not use distance fade. + +- **DISTANCE_FADE_PIXEL_ALPHA** = **1** --- Smoothly fades the object out based on each pixel's distance from the camera using the alpha channel. + +- **DISTANCE_FADE_PIXEL_DITHER** = **2** --- Smoothly fades the object out based on each pixel's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than :ref:`DISTANCE_FADE_PIXEL_ALPHA`. + +- **DISTANCE_FADE_OBJECT_DITHER** = **3** --- Smoothly fades the object out based on the object's distance from the camera using a dither approach. Dithering discards pixels based on a set pattern to smoothly fade without enabling transparency. On certain hardware this can be faster than :ref:`DISTANCE_FADE_PIXEL_ALPHA`. + +Property Descriptions +--------------------- + +.. _class_SpatialMaterial_property_albedo_color: + +- :ref:`Color` **albedo_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_albedo(value) | ++-----------+-------------------------+ +| *Getter* | get_albedo() | ++-----------+-------------------------+ + +The material's base color. + +---- + +.. _class_SpatialMaterial_property_albedo_texture: + +- :ref:`Texture` **albedo_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture to multiply by :ref:`albedo_color`. Used for basic texturing of objects. + +---- + +.. _class_SpatialMaterial_property_anisotropy: + +- :ref:`float` **anisotropy** + ++----------+-----------------------+ +| *Setter* | set_anisotropy(value) | ++----------+-----------------------+ +| *Getter* | get_anisotropy() | ++----------+-----------------------+ + +The strength of the anisotropy effect. This is multiplied by :ref:`anisotropy_flowmap`'s alpha channel if a texture is defined there and the texture contains an alpha channel. + +---- + +.. _class_SpatialMaterial_property_anisotropy_enabled: + +- :ref:`bool` **anisotropy_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, anisotropy is enabled. Anisotropy changes the shape of the specular blob and aligns it to tangent space. This is useful for brushed aluminium and hair reflections. + +**Note:** Mesh tangents are needed for anisotropy to work. If the mesh does not contain tangents, the anisotropy effect will appear broken. + +**Note:** Material anisotropy should not to be confused with anisotropic texture filtering. Anisotropic texture filtering can be enabled by selecting a texture in the FileSystem dock, going to the Import dock, checking the **Anisotropic** checkbox then clicking **Reimport**. + +---- + +.. _class_SpatialMaterial_property_anisotropy_flowmap: + +- :ref:`Texture` **anisotropy_flowmap** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that offsets the tangent map for anisotropy calculations and optionally controls the anisotropy effect (if an alpha channel is present). The flowmap texture is expected to be a derivative map, with the red channel representing distortion on the X axis and green channel representing distortion on the Y axis. Values below 0.5 will result in negative distortion, whereas values above 0.5 will result in positive distortion. + +If present, the texture's alpha channel will be used to multiply the strength of the :ref:`anisotropy` effect. Fully opaque pixels will keep the anisotropy effect's original strength while fully transparent pixels will disable the anisotropy effect entirely. The flowmap texture's blue channel is ignored. + +---- + +.. _class_SpatialMaterial_property_ao_enabled: + +- :ref:`bool` **ao_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, ambient occlusion is enabled. Ambient occlusion darkens areas based on the :ref:`ao_texture`. + +---- + +.. _class_SpatialMaterial_property_ao_light_affect: + +- :ref:`float` **ao_light_affect** + ++----------+----------------------------+ +| *Setter* | set_ao_light_affect(value) | ++----------+----------------------------+ +| *Getter* | get_ao_light_affect() | ++----------+----------------------------+ + +Amount that ambient occlusion affects lighting from lights. If ``0``, ambient occlusion only affects ambient light. If ``1``, ambient occlusion affects lights just as much as it affects ambient light. This can be used to impact the strength of the ambient occlusion effect, but typically looks unrealistic. + +---- + +.. _class_SpatialMaterial_property_ao_on_uv2: + +- :ref:`bool` **ao_on_uv2** + ++----------+-----------------+ +| *Setter* | set_flag(value) | ++----------+-----------------+ +| *Getter* | get_flag() | ++----------+-----------------+ + +If ``true``, use ``UV2`` coordinates to look up from the :ref:`ao_texture`. + +---- + +.. _class_SpatialMaterial_property_ao_texture: + +- :ref:`Texture` **ao_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that defines the amount of ambient occlusion for a given point on the object. + +---- + +.. _class_SpatialMaterial_property_ao_texture_channel: + +- :ref:`TextureChannel` **ao_texture_channel** + ++----------+-------------------------------+ +| *Setter* | set_ao_texture_channel(value) | ++----------+-------------------------------+ +| *Getter* | get_ao_texture_channel() | ++----------+-------------------------------+ + +Specifies the channel of the :ref:`ao_texture` in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. + +---- + +.. _class_SpatialMaterial_property_clearcoat: + +- :ref:`float` **clearcoat** + ++----------+----------------------+ +| *Setter* | set_clearcoat(value) | ++----------+----------------------+ +| *Getter* | get_clearcoat() | ++----------+----------------------+ + +Sets the strength of the clearcoat effect. Setting to ``0`` looks the same as disabling the clearcoat effect. + +---- + +.. _class_SpatialMaterial_property_clearcoat_enabled: + +- :ref:`bool` **clearcoat_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, clearcoat rendering is enabled. Adds a secondary transparent pass to the lighting calculation resulting in an added specular blob. This makes materials appear as if they have a clear layer on them that can be either glossy or rough. + +**Note:** Clearcoat rendering is not visible if the material has :ref:`flags_unshaded` set to ``true``. + +---- + +.. _class_SpatialMaterial_property_clearcoat_gloss: + +- :ref:`float` **clearcoat_gloss** + ++----------+----------------------------+ +| *Setter* | set_clearcoat_gloss(value) | ++----------+----------------------------+ +| *Getter* | get_clearcoat_gloss() | ++----------+----------------------------+ + +Sets the roughness of the clearcoat pass. A higher value results in a smoother clearcoat while a lower value results in a rougher clearcoat. + +---- + +.. _class_SpatialMaterial_property_clearcoat_texture: + +- :ref:`Texture` **clearcoat_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that defines the strength of the clearcoat effect and the glossiness of the clearcoat. Strength is specified in the red channel while glossiness is specified in the green channel. + +---- + +.. _class_SpatialMaterial_property_depth_deep_parallax: + +- :ref:`bool` **depth_deep_parallax** + ++----------+----------------------------------+ +| *Setter* | set_depth_deep_parallax(value) | ++----------+----------------------------------+ +| *Getter* | is_depth_deep_parallax_enabled() | ++----------+----------------------------------+ + +If ``true``, the shader will read depth texture at multiple points along the view ray to determine occlusion and parrallax. This can be very performance demanding, but results in more realistic looking depth mapping. + +---- + +.. _class_SpatialMaterial_property_depth_enabled: + +- :ref:`bool` **depth_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, depth mapping is enabled (also called "parallax mapping" or "height mapping"). See also :ref:`normal_enabled`. + +**Note:** Depth mapping is not supported if triplanar mapping is used on the same material. The value of :ref:`depth_enabled` will be ignored if :ref:`uv1_triplanar` is enabled. + +---- + +.. _class_SpatialMaterial_property_depth_flip_binormal: + +- :ref:`bool` **depth_flip_binormal** + ++----------+----------------------------------------------+ +| *Setter* | set_depth_deep_parallax_flip_binormal(value) | ++----------+----------------------------------------------+ +| *Getter* | get_depth_deep_parallax_flip_binormal() | ++----------+----------------------------------------------+ + +If ``true``, direction of the binormal is flipped before using in the depth effect. This may be necessary if you have encoded your binormals in a way that is conflicting with the depth effect. + +---- + +.. _class_SpatialMaterial_property_depth_flip_tangent: + +- :ref:`bool` **depth_flip_tangent** + ++----------+---------------------------------------------+ +| *Setter* | set_depth_deep_parallax_flip_tangent(value) | ++----------+---------------------------------------------+ +| *Getter* | get_depth_deep_parallax_flip_tangent() | ++----------+---------------------------------------------+ + +If ``true``, direction of the tangent is flipped before using in the depth effect. This may be necessary if you have encoded your tangents in a way that is conflicting with the depth effect. + +---- + +.. _class_SpatialMaterial_property_depth_max_layers: + +- :ref:`int` **depth_max_layers** + ++----------+-------------------------------------------+ +| *Setter* | set_depth_deep_parallax_max_layers(value) | ++----------+-------------------------------------------+ +| *Getter* | get_depth_deep_parallax_max_layers() | ++----------+-------------------------------------------+ + +Number of layers to use when using :ref:`depth_deep_parallax` and the view direction is perpendicular to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp. + +---- + +.. _class_SpatialMaterial_property_depth_min_layers: + +- :ref:`int` **depth_min_layers** + ++----------+-------------------------------------------+ +| *Setter* | set_depth_deep_parallax_min_layers(value) | ++----------+-------------------------------------------+ +| *Getter* | get_depth_deep_parallax_min_layers() | ++----------+-------------------------------------------+ + +Number of layers to use when using :ref:`depth_deep_parallax` and the view direction is parallel to the surface of the object. A higher number will be more performance demanding while a lower number may not look as crisp. + +---- + +.. _class_SpatialMaterial_property_depth_scale: + +- :ref:`float` **depth_scale** + ++----------+------------------------+ +| *Setter* | set_depth_scale(value) | ++----------+------------------------+ +| *Getter* | get_depth_scale() | ++----------+------------------------+ + +Scales the depth offset effect. A higher number will create a larger depth. + +---- + +.. _class_SpatialMaterial_property_depth_texture: + +- :ref:`Texture` **depth_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to determine depth at a given pixel. Depth is always stored in the red channel. + +---- + +.. _class_SpatialMaterial_property_detail_albedo: + +- :ref:`Texture` **detail_albedo** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that specifies the color of the detail overlay. + +---- + +.. _class_SpatialMaterial_property_detail_blend_mode: + +- :ref:`BlendMode` **detail_blend_mode** + ++----------+------------------------------+ +| *Setter* | set_detail_blend_mode(value) | ++----------+------------------------------+ +| *Getter* | get_detail_blend_mode() | ++----------+------------------------------+ + +Specifies how the :ref:`detail_albedo` should blend with the current ``ALBEDO``. See :ref:`BlendMode` for options. + +---- + +.. _class_SpatialMaterial_property_detail_enabled: + +- :ref:`bool` **detail_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, enables the detail overlay. Detail is a second texture that gets mixed over the surface of the object based on :ref:`detail_mask`. This can be used to add variation to objects, or to blend between two different albedo/normal textures. + +---- + +.. _class_SpatialMaterial_property_detail_mask: + +- :ref:`Texture` **detail_mask** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to specify how the detail textures get blended with the base textures. + +---- + +.. _class_SpatialMaterial_property_detail_normal: + +- :ref:`Texture` **detail_normal** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that specifies the per-pixel normal of the detail overlay. + +**Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_SpatialMaterial_property_detail_uv_layer: + +- :ref:`DetailUV` **detail_uv_layer** + ++----------+----------------------+ +| *Setter* | set_detail_uv(value) | ++----------+----------------------+ +| *Getter* | get_detail_uv() | ++----------+----------------------+ + +Specifies whether to use ``UV`` or ``UV2`` for the detail layer. See :ref:`DetailUV` for options. + +---- + +.. _class_SpatialMaterial_property_distance_fade_max_distance: + +- :ref:`float` **distance_fade_max_distance** + ++----------+---------------------------------------+ +| *Setter* | set_distance_fade_max_distance(value) | ++----------+---------------------------------------+ +| *Getter* | get_distance_fade_max_distance() | ++----------+---------------------------------------+ + +Distance at which the object appears fully opaque. + +**Note:** If ``distance_fade_max_distance`` is less than ``distance_fade_min_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``. + +---- + +.. _class_SpatialMaterial_property_distance_fade_min_distance: + +- :ref:`float` **distance_fade_min_distance** + ++----------+---------------------------------------+ +| *Setter* | set_distance_fade_min_distance(value) | ++----------+---------------------------------------+ +| *Getter* | get_distance_fade_min_distance() | ++----------+---------------------------------------+ + +Distance at which the object starts to become visible. If the object is less than this distance away, it will be invisible. + +**Note:** If ``distance_fade_min_distance`` is greater than ``distance_fade_max_distance``, the behavior will be reversed. The object will start to fade away at ``distance_fade_max_distance`` and will fully disappear once it reaches ``distance_fade_min_distance``. + +---- + +.. _class_SpatialMaterial_property_distance_fade_mode: + +- :ref:`DistanceFadeMode` **distance_fade_mode** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_distance_fade(value) | ++-----------+--------------------------+ +| *Getter* | get_distance_fade() | ++-----------+--------------------------+ + +Specifies which type of fade to use. Can be any of the :ref:`DistanceFadeMode`\ s. + +---- + +.. _class_SpatialMaterial_property_emission: + +- :ref:`Color` **emission** + ++----------+---------------------+ +| *Setter* | set_emission(value) | ++----------+---------------------+ +| *Getter* | get_emission() | ++----------+---------------------+ + +The emitted light's color. See :ref:`emission_enabled`. + +---- + +.. _class_SpatialMaterial_property_emission_enabled: + +- :ref:`bool` **emission_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, the body emits light. Emitting light makes the object appear brighter. The object can also cast light on other objects if a :ref:`GIProbe` or :ref:`BakedLightmap` is used and this object is used in baked lighting. + +---- + +.. _class_SpatialMaterial_property_emission_energy: + +- :ref:`float` **emission_energy** + ++----------+----------------------------+ +| *Setter* | set_emission_energy(value) | ++----------+----------------------------+ +| *Getter* | get_emission_energy() | ++----------+----------------------------+ + +The emitted light's strength. See :ref:`emission_enabled`. + +---- + +.. _class_SpatialMaterial_property_emission_on_uv2: + +- :ref:`bool` **emission_on_uv2** + ++----------+-----------------+ +| *Setter* | set_flag(value) | ++----------+-----------------+ +| *Getter* | get_flag() | ++----------+-----------------+ + +Use ``UV2`` to read from the :ref:`emission_texture`. + +---- + +.. _class_SpatialMaterial_property_emission_operator: + +- :ref:`EmissionOperator` **emission_operator** + ++----------+------------------------------+ +| *Setter* | set_emission_operator(value) | ++----------+------------------------------+ +| *Getter* | get_emission_operator() | ++----------+------------------------------+ + +Sets how :ref:`emission` interacts with :ref:`emission_texture`. Can either add or multiply. See :ref:`EmissionOperator` for options. + +---- + +.. _class_SpatialMaterial_property_emission_texture: + +- :ref:`Texture` **emission_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that specifies how much surface emits light at a given point. + +---- + +.. _class_SpatialMaterial_property_flags_albedo_tex_force_srgb: + +- :ref:`bool` **flags_albedo_tex_force_srgb** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +Forces a conversion of the :ref:`albedo_texture` from sRGB space to linear space. + +---- + +.. _class_SpatialMaterial_property_flags_disable_ambient_light: + +- :ref:`bool` **flags_disable_ambient_light** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the object receives no ambient light. + +---- + +.. _class_SpatialMaterial_property_flags_do_not_receive_shadows: + +- :ref:`bool` **flags_do_not_receive_shadows** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the object receives no shadow that would otherwise be cast onto it. + +---- + +.. _class_SpatialMaterial_property_flags_ensure_correct_normals: + +- :ref:`bool` **flags_ensure_correct_normals** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the shader will compute extra operations to make sure the normal stays correct when using a non-uniform scale. Only enable if using non-uniform scaling. + +---- + +.. _class_SpatialMaterial_property_flags_fixed_size: + +- :ref:`bool` **flags_fixed_size** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the object is rendered at the same size regardless of distance. + +---- + +.. _class_SpatialMaterial_property_flags_no_depth_test: + +- :ref:`bool` **flags_no_depth_test** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, depth testing is disabled and the object will be drawn in render order. + +---- + +.. _class_SpatialMaterial_property_flags_transparent: + +- :ref:`bool` **flags_transparent** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, transparency is enabled on the body. See also :ref:`params_blend_mode`. + +---- + +.. _class_SpatialMaterial_property_flags_unshaded: + +- :ref:`bool` **flags_unshaded** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the object is unaffected by lighting. + +---- + +.. _class_SpatialMaterial_property_flags_use_point_size: + +- :ref:`bool` **flags_use_point_size** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, render point size can be changed. + +**Note:** This is only effective for objects whose geometry is point-based rather than triangle-based. See also :ref:`params_point_size`. + +---- + +.. _class_SpatialMaterial_property_flags_use_shadow_to_opacity: + +- :ref:`bool` **flags_use_shadow_to_opacity** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, enables the "shadow to opacity" render mode where lighting modifies the alpha so shadowed areas are opaque and non-shadowed areas are transparent. Useful for overlaying shadows onto a camera feed in AR. + +---- + +.. _class_SpatialMaterial_property_flags_vertex_lighting: + +- :ref:`bool` **flags_vertex_lighting** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, lighting is calculated per vertex rather than per pixel. This may increase performance on low-end devices. + +---- + +.. _class_SpatialMaterial_property_flags_world_triplanar: + +- :ref:`bool` **flags_world_triplanar** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, triplanar mapping is calculated in world space rather than object local space. See also :ref:`uv1_triplanar`. + +---- + +.. _class_SpatialMaterial_property_metallic: + +- :ref:`float` **metallic** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_metallic(value) | ++-----------+---------------------+ +| *Getter* | get_metallic() | ++-----------+---------------------+ + +A high value makes the material appear more like a metal. Non-metals use their albedo as the diffuse color and add diffuse to the specular reflection. With non-metals, the reflection appears on top of the albedo color. Metals use their albedo as a multiplier to the specular reflection and set the diffuse color to black resulting in a tinted reflection. Materials work better when fully metal or fully non-metal, values between ``0`` and ``1`` should only be used for blending between metal and non-metal sections. To alter the amount of reflection use :ref:`roughness`. + +---- + +.. _class_SpatialMaterial_property_metallic_specular: + +- :ref:`float` **metallic_specular** + ++-----------+---------------------+ +| *Default* | ``0.5`` | ++-----------+---------------------+ +| *Setter* | set_specular(value) | ++-----------+---------------------+ +| *Getter* | get_specular() | ++-----------+---------------------+ + +Sets the size of the specular lobe. The specular lobe is the bright spot that is reflected from light sources. + +**Note:** Unlike :ref:`metallic`, this is not energy-conserving, so it should be left at ``0.5`` in most cases. See also :ref:`roughness`. + +---- + +.. _class_SpatialMaterial_property_metallic_texture: + +- :ref:`Texture` **metallic_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to specify metallic for an object. This is multiplied by :ref:`metallic`. + +---- + +.. _class_SpatialMaterial_property_metallic_texture_channel: + +- :ref:`TextureChannel` **metallic_texture_channel** + ++-----------+-------------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------------+ +| *Setter* | set_metallic_texture_channel(value) | ++-----------+-------------------------------------+ +| *Getter* | get_metallic_texture_channel() | ++-----------+-------------------------------------+ + +Specifies the channel of the :ref:`metallic_texture` in which the metallic information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. + +---- + +.. _class_SpatialMaterial_property_normal_enabled: + +- :ref:`bool` **normal_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, normal mapping is enabled. + +---- + +.. _class_SpatialMaterial_property_normal_scale: + +- :ref:`float` **normal_scale** + ++----------+-------------------------+ +| *Setter* | set_normal_scale(value) | ++----------+-------------------------+ +| *Getter* | get_normal_scale() | ++----------+-------------------------+ + +The strength of the normal map's effect. + +---- + +.. _class_SpatialMaterial_property_normal_texture: + +- :ref:`Texture` **normal_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to specify the normal at a given pixel. The ``normal_texture`` only uses the red and green channels; the blue and alpha channels are ignored. The normal read from ``normal_texture`` is oriented around the surface normal provided by the :ref:`Mesh`. + +**Note:** The mesh must have both normals and tangents defined in its vertex data. Otherwise, the normal map won't render correctly and will only appear to darken the whole surface. If creating geometry with :ref:`SurfaceTool`, you can use :ref:`SurfaceTool.generate_normals` and :ref:`SurfaceTool.generate_tangents` to automatically generate normals and tangents respectively. + +**Note:** Godot expects the normal map to use X+, Y+, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_SpatialMaterial_property_params_alpha_scissor_threshold: + +- :ref:`float` **params_alpha_scissor_threshold** + ++----------+------------------------------------+ +| *Setter* | set_alpha_scissor_threshold(value) | ++----------+------------------------------------+ +| *Getter* | get_alpha_scissor_threshold() | ++----------+------------------------------------+ + +Threshold at which the alpha scissor will discard values. + +---- + +.. _class_SpatialMaterial_property_params_billboard_keep_scale: + +- :ref:`bool` **params_billboard_keep_scale** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the shader will keep the scale set for the mesh. Otherwise the scale is lost when billboarding. Only applies when :ref:`params_billboard_mode` is :ref:`BILLBOARD_ENABLED`. + +---- + +.. _class_SpatialMaterial_property_params_billboard_mode: + +- :ref:`BillboardMode` **params_billboard_mode** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_billboard_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_billboard_mode() | ++-----------+---------------------------+ + +Controls how the object faces the camera. See :ref:`BillboardMode`. + +**Note:** Billboard mode is not suitable for VR because the left-right vector of the camera is not horizontal when the screen is attached to your head instead of on the table. See `GitHub issue #41567 `__ for details. + +---- + +.. _class_SpatialMaterial_property_params_blend_mode: + +- :ref:`BlendMode` **params_blend_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_blend_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_blend_mode() | ++-----------+-----------------------+ + +The material's blend mode. + +**Note:** Values other than ``Mix`` force the object into the transparent pipeline. See :ref:`BlendMode`. + +---- + +.. _class_SpatialMaterial_property_params_cull_mode: + +- :ref:`CullMode` **params_cull_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_cull_mode(value) | ++-----------+----------------------+ +| *Getter* | get_cull_mode() | ++-----------+----------------------+ + +Which side of the object is not drawn when backfaces are rendered. See :ref:`CullMode`. + +---- + +.. _class_SpatialMaterial_property_params_depth_draw_mode: + +- :ref:`DepthDrawMode` **params_depth_draw_mode** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_depth_draw_mode(value) | ++-----------+----------------------------+ +| *Getter* | get_depth_draw_mode() | ++-----------+----------------------------+ + +Determines when depth rendering takes place. See :ref:`DepthDrawMode`. See also :ref:`flags_transparent`. + +---- + +.. _class_SpatialMaterial_property_params_diffuse_mode: + +- :ref:`DiffuseMode` **params_diffuse_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_diffuse_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_diffuse_mode() | ++-----------+-------------------------+ + +The algorithm used for diffuse light scattering. See :ref:`DiffuseMode`. + +---- + +.. _class_SpatialMaterial_property_params_grow: + +- :ref:`bool` **params_grow** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_grow_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_grow_enabled() | ++-----------+-------------------------+ + +If ``true``, enables the vertex grow setting. See :ref:`params_grow_amount`. + +---- + +.. _class_SpatialMaterial_property_params_grow_amount: + +- :ref:`float` **params_grow_amount** + ++----------+-----------------+ +| *Setter* | set_grow(value) | ++----------+-----------------+ +| *Getter* | get_grow() | ++----------+-----------------+ + +Grows object vertices in the direction of their normals. + +---- + +.. _class_SpatialMaterial_property_params_line_width: + +- :ref:`float` **params_line_width** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_line_width(value) | ++-----------+-----------------------+ +| *Getter* | get_line_width() | ++-----------+-----------------------+ + +Currently unimplemented in Godot. + +---- + +.. _class_SpatialMaterial_property_params_point_size: + +- :ref:`float` **params_point_size** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_point_size(value) | ++-----------+-----------------------+ +| *Getter* | get_point_size() | ++-----------+-----------------------+ + +The point size in pixels. See :ref:`flags_use_point_size`. + +---- + +.. _class_SpatialMaterial_property_params_specular_mode: + +- :ref:`SpecularMode` **params_specular_mode** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_specular_mode(value) | ++-----------+--------------------------+ +| *Getter* | get_specular_mode() | ++-----------+--------------------------+ + +The method for rendering the specular blob. See :ref:`SpecularMode`. + +---- + +.. _class_SpatialMaterial_property_params_use_alpha_scissor: + +- :ref:`bool` **params_use_alpha_scissor** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the shader will discard all pixels that have an alpha value less than :ref:`params_alpha_scissor_threshold`. + +---- + +.. _class_SpatialMaterial_property_particles_anim_h_frames: + +- :ref:`int` **particles_anim_h_frames** + ++----------+------------------------------------+ +| *Setter* | set_particles_anim_h_frames(value) | ++----------+------------------------------------+ +| *Getter* | get_particles_anim_h_frames() | ++----------+------------------------------------+ + +The number of horizontal frames in the particle sprite sheet. Only enabled when using :ref:`BILLBOARD_PARTICLES`. See :ref:`params_billboard_mode`. + +---- + +.. _class_SpatialMaterial_property_particles_anim_loop: + +- :ref:`bool` **particles_anim_loop** + ++----------+--------------------------------+ +| *Setter* | set_particles_anim_loop(value) | ++----------+--------------------------------+ +| *Getter* | get_particles_anim_loop() | ++----------+--------------------------------+ + +If ``true``, particle animations are looped. Only enabled when using :ref:`BILLBOARD_PARTICLES`. See :ref:`params_billboard_mode`. + +---- + +.. _class_SpatialMaterial_property_particles_anim_v_frames: + +- :ref:`int` **particles_anim_v_frames** + ++----------+------------------------------------+ +| *Setter* | set_particles_anim_v_frames(value) | ++----------+------------------------------------+ +| *Getter* | get_particles_anim_v_frames() | ++----------+------------------------------------+ + +The number of vertical frames in the particle sprite sheet. Only enabled when using :ref:`BILLBOARD_PARTICLES`. See :ref:`params_billboard_mode`. + +---- + +.. _class_SpatialMaterial_property_proximity_fade_distance: + +- :ref:`float` **proximity_fade_distance** + ++----------+------------------------------------+ +| *Setter* | set_proximity_fade_distance(value) | ++----------+------------------------------------+ +| *Getter* | get_proximity_fade_distance() | ++----------+------------------------------------+ + +Distance over which the fade effect takes place. The larger the distance the longer it takes for an object to fade. + +---- + +.. _class_SpatialMaterial_property_proximity_fade_enable: + +- :ref:`bool` **proximity_fade_enable** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_proximity_fade(value) | ++-----------+-----------------------------+ +| *Getter* | is_proximity_fade_enabled() | ++-----------+-----------------------------+ + +If ``true``, the proximity fade effect is enabled. The proximity fade effect fades out each pixel based on its distance to another object. + +---- + +.. _class_SpatialMaterial_property_refraction_enabled: + +- :ref:`bool` **refraction_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, the refraction effect is enabled. Refraction distorts transparency based on light from behind the object. When using the GLES3 backend, the material's roughness value will affect the blurriness of the refraction. Higher roughness values will make the refraction look blurrier. + +---- + +.. _class_SpatialMaterial_property_refraction_scale: + +- :ref:`float` **refraction_scale** + ++----------+-----------------------+ +| *Setter* | set_refraction(value) | ++----------+-----------------------+ +| *Getter* | get_refraction() | ++----------+-----------------------+ + +The strength of the refraction effect. Higher values result in a more distorted appearance for the refraction. + +---- + +.. _class_SpatialMaterial_property_refraction_texture: + +- :ref:`Texture` **refraction_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture that controls the strength of the refraction per-pixel. Multiplied by :ref:`refraction_scale`. + +---- + +.. _class_SpatialMaterial_property_refraction_texture_channel: + +- :ref:`TextureChannel` **refraction_texture_channel** + ++----------+---------------------------------------+ +| *Setter* | set_refraction_texture_channel(value) | ++----------+---------------------------------------+ +| *Getter* | get_refraction_texture_channel() | ++----------+---------------------------------------+ + +Specifies the channel of the :ref:`refraction_texture` in which the refraction information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. + +---- + +.. _class_SpatialMaterial_property_rim: + +- :ref:`float` **rim** + ++----------+----------------+ +| *Setter* | set_rim(value) | ++----------+----------------+ +| *Getter* | get_rim() | ++----------+----------------+ + +Sets the strength of the rim lighting effect. + +---- + +.. _class_SpatialMaterial_property_rim_enabled: + +- :ref:`bool` **rim_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, rim effect is enabled. Rim lighting increases the brightness at glancing angles on an object. + +**Note:** Rim lighting is not visible if the material has :ref:`flags_unshaded` set to ``true``. + +---- + +.. _class_SpatialMaterial_property_rim_texture: + +- :ref:`Texture` **rim_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to set the strength of the rim lighting effect per-pixel. Multiplied by :ref:`rim`. + +---- + +.. _class_SpatialMaterial_property_rim_tint: + +- :ref:`float` **rim_tint** + ++----------+---------------------+ +| *Setter* | set_rim_tint(value) | ++----------+---------------------+ +| *Getter* | get_rim_tint() | ++----------+---------------------+ + +The amount of to blend light and albedo color when rendering rim effect. If ``0`` the light color is used, while ``1`` means albedo color is used. An intermediate value generally works best. + +---- + +.. _class_SpatialMaterial_property_roughness: + +- :ref:`float` **roughness** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_roughness(value) | ++-----------+----------------------+ +| *Getter* | get_roughness() | ++-----------+----------------------+ + +Surface reflection. A value of ``0`` represents a perfect mirror while a value of ``1`` completely blurs the reflection. See also :ref:`metallic`. + +---- + +.. _class_SpatialMaterial_property_roughness_texture: + +- :ref:`Texture` **roughness_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to control the roughness per-pixel. Multiplied by :ref:`roughness`. + +---- + +.. _class_SpatialMaterial_property_roughness_texture_channel: + +- :ref:`TextureChannel` **roughness_texture_channel** + ++-----------+--------------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------------+ +| *Setter* | set_roughness_texture_channel(value) | ++-----------+--------------------------------------+ +| *Getter* | get_roughness_texture_channel() | ++-----------+--------------------------------------+ + +Specifies the channel of the :ref:`ao_texture` in which the ambient occlusion information is stored. This is useful when you store the information for multiple effects in a single texture. For example if you stored metallic in the red channel, roughness in the blue, and ambient occlusion in the green you could reduce the number of textures you use. + +---- + +.. _class_SpatialMaterial_property_subsurf_scatter_enabled: + +- :ref:`bool` **subsurf_scatter_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. + +---- + +.. _class_SpatialMaterial_property_subsurf_scatter_strength: + +- :ref:`float` **subsurf_scatter_strength** + ++----------+-------------------------------------------+ +| *Setter* | set_subsurface_scattering_strength(value) | ++----------+-------------------------------------------+ +| *Getter* | get_subsurface_scattering_strength() | ++----------+-------------------------------------------+ + +The strength of the subsurface scattering effect. + +---- + +.. _class_SpatialMaterial_property_subsurf_scatter_texture: + +- :ref:`Texture` **subsurf_scatter_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by :ref:`subsurf_scatter_strength`. + +---- + +.. _class_SpatialMaterial_property_transmission: + +- :ref:`Color` **transmission** + ++----------+-------------------------+ +| *Setter* | set_transmission(value) | ++----------+-------------------------+ +| *Getter* | get_transmission() | ++----------+-------------------------+ + +The color used by the transmission effect. Represents the light passing through an object. + +---- + +.. _class_SpatialMaterial_property_transmission_enabled: + +- :ref:`bool` **transmission_enabled** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_feature(value) | ++-----------+--------------------+ +| *Getter* | get_feature() | ++-----------+--------------------+ + +If ``true``, the transmission effect is enabled. + +---- + +.. _class_SpatialMaterial_property_transmission_texture: + +- :ref:`Texture` **transmission_texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +Texture used to control the transmission effect per-pixel. Added to :ref:`transmission`. + +---- + +.. _class_SpatialMaterial_property_uv1_offset: + +- :ref:`Vector3` **uv1_offset** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_uv1_offset(value) | ++-----------+------------------------+ +| *Getter* | get_uv1_offset() | ++-----------+------------------------+ + +How much to offset the ``UV`` coordinates. This amount will be added to ``UV`` in the vertex function. This can be used to offset a texture. + +---- + +.. _class_SpatialMaterial_property_uv1_scale: + +- :ref:`Vector3` **uv1_scale** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_uv1_scale(value) | ++-----------+------------------------+ +| *Getter* | get_uv1_scale() | ++-----------+------------------------+ + +How much to scale the ``UV`` coordinates. This is multiplied by ``UV`` in the vertex function. + +---- + +.. _class_SpatialMaterial_property_uv1_triplanar: + +- :ref:`bool` **uv1_triplanar** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, instead of using ``UV`` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. + +---- + +.. _class_SpatialMaterial_property_uv1_triplanar_sharpness: + +- :ref:`float` **uv1_triplanar_sharpness** + ++-----------+------------------------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------------------------+ +| *Setter* | set_uv1_triplanar_blend_sharpness(value) | ++-----------+------------------------------------------+ +| *Getter* | get_uv1_triplanar_blend_sharpness() | ++-----------+------------------------------------------+ + +A lower number blends the texture more softly while a higher number blends the texture more sharply. + +---- + +.. _class_SpatialMaterial_property_uv2_offset: + +- :ref:`Vector3` **uv2_offset** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_uv2_offset(value) | ++-----------+------------------------+ +| *Getter* | get_uv2_offset() | ++-----------+------------------------+ + +How much to offset the ``UV2`` coordinates. This amount will be added to ``UV2`` in the vertex function. This can be used to offset a texture. + +---- + +.. _class_SpatialMaterial_property_uv2_scale: + +- :ref:`Vector3` **uv2_scale** + ++-----------+------------------------+ +| *Default* | ``Vector3( 1, 1, 1 )`` | ++-----------+------------------------+ +| *Setter* | set_uv2_scale(value) | ++-----------+------------------------+ +| *Getter* | get_uv2_scale() | ++-----------+------------------------+ + +How much to scale the ``UV2`` coordinates. This is multiplied by ``UV2`` in the vertex function. + +---- + +.. _class_SpatialMaterial_property_uv2_triplanar: + +- :ref:`bool` **uv2_triplanar** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, instead of using ``UV2`` textures will use a triplanar texture lookup to determine how to apply textures. Triplanar uses the orientation of the object's surface to blend between texture coordinates. It reads from the source texture 3 times, once for each axis and then blends between the results based on how closely the pixel aligns with each axis. This is often used for natural features to get a realistic blend of materials. Because triplanar texturing requires many more texture reads per-pixel it is much slower than normal UV texturing. Additionally, because it is blending the texture between the three axes, it is unsuitable when you are trying to achieve crisp texturing. + +---- + +.. _class_SpatialMaterial_property_uv2_triplanar_sharpness: + +- :ref:`float` **uv2_triplanar_sharpness** + ++-----------+------------------------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------------------------+ +| *Setter* | set_uv2_triplanar_blend_sharpness(value) | ++-----------+------------------------------------------+ +| *Getter* | get_uv2_triplanar_blend_sharpness() | ++-----------+------------------------------------------+ + +A lower number blends the texture more softly while a higher number blends the texture more sharply. + +---- + +.. _class_SpatialMaterial_property_vertex_color_is_srgb: + +- :ref:`bool` **vertex_color_is_srgb** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the model's vertex colors are processed as sRGB mode. + +---- + +.. _class_SpatialMaterial_property_vertex_color_use_as_albedo: + +- :ref:`bool` **vertex_color_use_as_albedo** + ++-----------+-----------------+ +| *Default* | ``false`` | ++-----------+-----------------+ +| *Setter* | set_flag(value) | ++-----------+-----------------+ +| *Getter* | get_flag() | ++-----------+-----------------+ + +If ``true``, the vertex color is used as albedo color. + +Method Descriptions +------------------- + +.. _class_SpatialMaterial_method_get_feature: + +- :ref:`bool` **get_feature** **(** :ref:`Feature` feature **)** |const| + +Returns ``true``, if the specified :ref:`Feature` is enabled. + +---- + +.. _class_SpatialMaterial_method_get_flag: + +- :ref:`bool` **get_flag** **(** :ref:`Flags` flag **)** |const| + +Returns ``true``, if the specified flag is enabled. See :ref:`Flags` enumerator for options. + +---- + +.. _class_SpatialMaterial_method_get_texture: + +- :ref:`Texture` **get_texture** **(** :ref:`TextureParam` param **)** |const| + +Returns the :ref:`Texture` associated with the specified :ref:`TextureParam`. + +---- + +.. _class_SpatialMaterial_method_set_feature: + +- void **set_feature** **(** :ref:`Feature` feature, :ref:`bool` enable **)** + +If ``true``, enables the specified :ref:`Feature`. Many features that are available in ``SpatialMaterial``\ s need to be enabled before use. This way the cost for using the feature is only incurred when specified. Features can also be enabled by setting the corresponding member to ``true``. + +---- + +.. _class_SpatialMaterial_method_set_flag: + +- void **set_flag** **(** :ref:`Flags` flag, :ref:`bool` enable **)** + +If ``true``, enables the specified flag. Flags are optional behaviour that can be turned on and off. Only one flag can be enabled at a time with this function, the flag enumerators cannot be bit-masked together to enable or disable multiple flags at once. Flags can also be enabled by setting the corresponding member to ``true``. See :ref:`Flags` enumerator for options. + +---- + +.. _class_SpatialMaterial_method_set_texture: + +- void **set_texture** **(** :ref:`TextureParam` param, :ref:`Texture` texture **)** + +Sets the :ref:`Texture` to be used by the specified :ref:`TextureParam`. This function is called when setting members ending in ``*_texture``. + +.. |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.)` diff --git a/classes/class_spatialvelocitytracker.rst b/classes/class_spatialvelocitytracker.rst new file mode 100644 index 0000000..aff3920 --- /dev/null +++ b/classes/class_spatialvelocitytracker.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpatialVelocityTracker.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpatialVelocityTracker: + +SpatialVelocityTracker +====================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------+-------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`track_physics_step` | ``false`` | ++-------------------------+-------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`get_tracked_linear_velocity` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reset` **(** :ref:`Vector3` position **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_position` **(** :ref:`Vector3` position **)** | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SpatialVelocityTracker_property_track_physics_step: + +- :ref:`bool` **track_physics_step** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_track_physics_step(value) | ++-----------+-------------------------------+ +| *Getter* | is_tracking_physics_step() | ++-----------+-------------------------------+ + +Method Descriptions +------------------- + +.. _class_SpatialVelocityTracker_method_get_tracked_linear_velocity: + +- :ref:`Vector3` **get_tracked_linear_velocity** **(** **)** |const| + +---- + +.. _class_SpatialVelocityTracker_method_reset: + +- void **reset** **(** :ref:`Vector3` position **)** + +---- + +.. _class_SpatialVelocityTracker_method_update_position: + +- void **update_position** **(** :ref:`Vector3` position **)** + +.. |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.)` diff --git a/classes/class_spheremesh.rst b/classes/class_spheremesh.rst new file mode 100644 index 0000000..68bda0a --- /dev/null +++ b/classes/class_spheremesh.rst @@ -0,0 +1,121 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SphereMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SphereMesh: + +SphereMesh +========== + +**Inherits:** :ref:`PrimitiveMesh` **<** :ref:`Mesh` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class representing a spherical :ref:`PrimitiveMesh`. + +Description +----------- + +Class representing a spherical :ref:`PrimitiveMesh`. + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`height` | ``2.0`` | ++---------------------------+-------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`is_hemisphere` | ``false`` | ++---------------------------+-------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`radial_segments` | ``64`` | ++---------------------------+-------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+-------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`rings` | ``32`` | ++---------------------------+-------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_SphereMesh_property_height: + +- :ref:`float` **height** + ++-----------+-------------------+ +| *Default* | ``2.0`` | ++-----------+-------------------+ +| *Setter* | set_height(value) | ++-----------+-------------------+ +| *Getter* | get_height() | ++-----------+-------------------+ + +Full height of the sphere. + +---- + +.. _class_SphereMesh_property_is_hemisphere: + +- :ref:`bool` **is_hemisphere** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_is_hemisphere(value) | ++-----------+--------------------------+ +| *Getter* | get_is_hemisphere() | ++-----------+--------------------------+ + +If ``true``, a hemisphere is created rather than a full sphere. + +**Note:** To get a regular hemisphere, the height and radius of the sphere must be equal. + +---- + +.. _class_SphereMesh_property_radial_segments: + +- :ref:`int` **radial_segments** + ++-----------+----------------------------+ +| *Default* | ``64`` | ++-----------+----------------------------+ +| *Setter* | set_radial_segments(value) | ++-----------+----------------------------+ +| *Getter* | get_radial_segments() | ++-----------+----------------------------+ + +Number of radial segments on the sphere. + +---- + +.. _class_SphereMesh_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +Radius of sphere. + +---- + +.. _class_SphereMesh_property_rings: + +- :ref:`int` **rings** + ++-----------+------------------+ +| *Default* | ``32`` | ++-----------+------------------+ +| *Setter* | set_rings(value) | ++-----------+------------------+ +| *Getter* | get_rings() | ++-----------+------------------+ + +Number of segments along the height of the sphere. + +.. |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.)` diff --git a/classes/class_sphereshape.rst b/classes/class_sphereshape.rst new file mode 100644 index 0000000..25b2253 --- /dev/null +++ b/classes/class_sphereshape.rst @@ -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 SphereShape.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SphereShape: + +SphereShape +=========== + +**Inherits:** :ref:`Shape` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Sphere shape for 3D collisions. + +Description +----------- + +Sphere shape for 3D collisions, which can be set into a :ref:`PhysicsBody` or :ref:`Area`. This shape is useful for modeling sphere-like 3D objects. + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +Properties +---------- + ++---------------------------+--------------------------------------------------+---------+ +| :ref:`float` | :ref:`radius` | ``1.0`` | ++---------------------------+--------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_SphereShape_property_radius: + +- :ref:`float` **radius** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The sphere's radius. The shape's diameter is double the radius. + +.. |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.)` diff --git a/classes/class_spinbox.rst b/classes/class_spinbox.rst new file mode 100644 index 0000000..74218a7 --- /dev/null +++ b/classes/class_spinbox.rst @@ -0,0 +1,161 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpinBox.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpinBox: + +SpinBox +======= + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Numerical input text field. + +Description +----------- + +SpinBox is a numerical input text field. It allows entering integers and floats. + +**Example:** + +:: + + var spin_box = SpinBox.new() + add_child(spin_box) + var line_edit = spin_box.get_line_edit() + line_edit.context_menu_enabled = false + spin_box.align = LineEdit.ALIGN_RIGHT + +The above code will create a ``SpinBox``, disable context menu on it and set the text alignment to right. + +See :ref:`Range` class for more options over the ``SpinBox``. + +**Note:** ``SpinBox`` relies on an underlying :ref:`LineEdit` node. To theme a ``SpinBox``'s background, add theme items for :ref:`LineEdit` and customize them. + +Properties +---------- + ++-----------------------------------+--------------------------------------------------+----------+ +| :ref:`Align` | :ref:`align` | ``0`` | ++-----------------------------------+--------------------------------------------------+----------+ +| :ref:`bool` | :ref:`editable` | ``true`` | ++-----------------------------------+--------------------------------------------------+----------+ +| :ref:`String` | :ref:`prefix` | ``""`` | ++-----------------------------------+--------------------------------------------------+----------+ +| :ref:`String` | :ref:`suffix` | ``""`` | ++-----------------------------------+--------------------------------------------------+----------+ + +Methods +------- + ++---------------------------------+----------------------------------------------------------------------+ +| void | :ref:`apply` **(** **)** | ++---------------------------------+----------------------------------------------------------------------+ +| :ref:`LineEdit` | :ref:`get_line_edit` **(** **)** | ++---------------------------------+----------------------------------------------------------------------+ + +Theme Properties +---------------- + ++-------------------------------+------------------------------------------------+ +| :ref:`Texture` | :ref:`updown` | ++-------------------------------+------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SpinBox_property_align: + +- :ref:`Align` **align** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_align(value) | ++-----------+------------------+ +| *Getter* | get_align() | ++-----------+------------------+ + +Sets the text alignment of the ``SpinBox``. + +---- + +.. _class_SpinBox_property_editable: + +- :ref:`bool` **editable** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_editable(value) | ++-----------+---------------------+ +| *Getter* | is_editable() | ++-----------+---------------------+ + +If ``true``, the ``SpinBox`` will be editable. Otherwise, it will be read only. + +---- + +.. _class_SpinBox_property_prefix: + +- :ref:`String` **prefix** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_prefix(value) | ++-----------+-------------------+ +| *Getter* | get_prefix() | ++-----------+-------------------+ + +Adds the specified ``prefix`` string before the numerical value of the ``SpinBox``. + +---- + +.. _class_SpinBox_property_suffix: + +- :ref:`String` **suffix** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_suffix(value) | ++-----------+-------------------+ +| *Getter* | get_suffix() | ++-----------+-------------------+ + +Adds the specified ``suffix`` string after the numerical value of the ``SpinBox``. + +Method Descriptions +------------------- + +.. _class_SpinBox_method_apply: + +- void **apply** **(** **)** + +Applies the current value of this ``SpinBox``. + +---- + +.. _class_SpinBox_method_get_line_edit: + +- :ref:`LineEdit` **get_line_edit** **(** **)** + +Returns the :ref:`LineEdit` instance from this ``SpinBox``. You can use it to access properties and methods of :ref:`LineEdit`. + +**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` property. + +Theme Property Descriptions +--------------------------- + +.. _class_SpinBox_theme_icon_updown: + +- :ref:`Texture` **updown** + +Sets a custom :ref:`Texture` for up and down arrows of the ``SpinBox``. + +.. |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.)` diff --git a/classes/class_splitcontainer.rst b/classes/class_splitcontainer.rst new file mode 100644 index 0000000..d1f0bfb --- /dev/null +++ b/classes/class_splitcontainer.rst @@ -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 SplitContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SplitContainer: + +SplitContainer +============== + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`HSplitContainer`, :ref:`VSplitContainer` + +Container for splitting and adjusting. + +Description +----------- + +Container for splitting two :ref:`Control`\ s vertically or horizontally, with a grabber that allows adjusting the split offset or ratio. + +Properties +---------- + ++-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`collapsed` | ``false`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`DraggerVisibility` | :ref:`dragger_visibility` | ``0`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`split_offset` | ``0`` | ++-----------------------------------------------------------------+-----------------------------------------------------------------------------+-----------+ + +Methods +------- + ++------+---------------------------------------------------------------------------------------+ +| void | :ref:`clamp_split_offset` **(** **)** | ++------+---------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_SplitContainer_signal_dragged: + +- **dragged** **(** :ref:`int` offset **)** + +Emitted when the dragger is dragged by user. + +Enumerations +------------ + +.. _enum_SplitContainer_DraggerVisibility: + +.. _class_SplitContainer_constant_DRAGGER_VISIBLE: + +.. _class_SplitContainer_constant_DRAGGER_HIDDEN: + +.. _class_SplitContainer_constant_DRAGGER_HIDDEN_COLLAPSED: + +enum **DraggerVisibility**: + +- **DRAGGER_VISIBLE** = **0** --- The split dragger is visible when the cursor hovers it. + +- **DRAGGER_HIDDEN** = **1** --- The split dragger is never visible. + +- **DRAGGER_HIDDEN_COLLAPSED** = **2** --- The split dragger is never visible and its space collapsed. + +Property Descriptions +--------------------- + +.. _class_SplitContainer_property_collapsed: + +- :ref:`bool` **collapsed** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_collapsed(value) | ++-----------+----------------------+ +| *Getter* | is_collapsed() | ++-----------+----------------------+ + +If ``true``, the area of the first :ref:`Control` will be collapsed and the dragger will be disabled. + +---- + +.. _class_SplitContainer_property_dragger_visibility: + +- :ref:`DraggerVisibility` **dragger_visibility** + ++-----------+-------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------+ +| *Setter* | set_dragger_visibility(value) | ++-----------+-------------------------------+ +| *Getter* | get_dragger_visibility() | ++-----------+-------------------------------+ + +Determines the dragger's visibility. See :ref:`DraggerVisibility` for details. + +---- + +.. _class_SplitContainer_property_split_offset: + +- :ref:`int` **split_offset** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_split_offset(value) | ++-----------+-------------------------+ +| *Getter* | get_split_offset() | ++-----------+-------------------------+ + +The initial offset of the splitting between the two :ref:`Control`\ s, with ``0`` being at the end of the first :ref:`Control`. + +Method Descriptions +------------------- + +.. _class_SplitContainer_method_clamp_split_offset: + +- void **clamp_split_offset** **(** **)** + +Clamps the :ref:`split_offset` value to not go outside the currently possible minimal and maximum values. + +.. |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.)` diff --git a/classes/class_spotlight.rst b/classes/class_spotlight.rst new file mode 100644 index 0000000..c2e5a00 --- /dev/null +++ b/classes/class_spotlight.rst @@ -0,0 +1,110 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpotLight.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpotLight: + +SpotLight +========= + +**Inherits:** :ref:`Light` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A spotlight, such as a reflector spotlight or a lantern. + +Description +----------- + +A Spotlight is a type of :ref:`Light` node that emits lights in a specific direction, in the shape of a cone. The light is attenuated through the distance. This attenuation can be configured by changing the energy, radius and attenuation parameters of :ref:`Light`. + +**Note:** By default, only 32 SpotLights may affect a single mesh *resource* at once. Consider splitting your level into several meshes to decrease the likelihood that more than 32 lights will affect the same mesh resource. Splitting the level mesh will also improve frustum culling effectiveness, leading to greater performance. If you need to use more lights per mesh, you can increase :ref:`ProjectSettings.rendering/limits/rendering/max_lights_per_object` at the cost of shader compilation times. + +Tutorials +--------- + +- :doc:`../tutorials/3d/lights_and_shadows` + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`spot_angle` | ``45.0`` | ++---------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`spot_angle_attenuation` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`spot_attenuation` | ``1.0`` | ++---------------------------+--------------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`spot_range` | ``5.0`` | ++---------------------------+--------------------------------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_SpotLight_property_spot_angle: + +- :ref:`float` **spot_angle** + ++-----------+------------------+ +| *Default* | ``45.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The spotlight's angle in degrees. + +---- + +.. _class_SpotLight_property_spot_angle_attenuation: + +- :ref:`float` **spot_angle_attenuation** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The spotlight's angular attenuation curve. + +---- + +.. _class_SpotLight_property_spot_attenuation: + +- :ref:`float` **spot_attenuation** + ++-----------+------------------+ +| *Default* | ``1.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The spotlight's light energy attenuation curve. + +---- + +.. _class_SpotLight_property_spot_range: + +- :ref:`float` **spot_range** + ++-----------+------------------+ +| *Default* | ``5.0`` | ++-----------+------------------+ +| *Setter* | set_param(value) | ++-----------+------------------+ +| *Getter* | get_param() | ++-----------+------------------+ + +The maximal range that can be reached by the spotlight. Note that the effectively lit area may appear to be smaller depending on the :ref:`spot_attenuation` in use. No matter the :ref:`spot_attenuation` in use, the light will never reach anything outside this range. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_springarm.rst b/classes/class_springarm.rst new file mode 100644 index 0000000..eaa4d29 --- /dev/null +++ b/classes/class_springarm.rst @@ -0,0 +1,159 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpringArm.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpringArm: + +SpringArm +========= + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +A helper node, mostly used in 3rd person cameras. + +Description +----------- + +The SpringArm node is a node that casts a ray (or collision shape) along its z axis and moves all its direct children to the collision point, minus a margin. + +The most common use case for this is to make a 3rd person camera that reacts to collisions in the environment. + +The SpringArm will either cast a ray, or if a shape is given, it will cast the shape in the direction of its z axis. + +If you use the SpringArm as a camera controller for your player, you might need to exclude the player's collider from the SpringArm's collision check. + +Properties +---------- + ++---------------------------+----------------------------------------------------------------+----------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++---------------------------+----------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`margin` | ``0.01`` | ++---------------------------+----------------------------------------------------------------+----------+ +| :ref:`Shape` | :ref:`shape` | | ++---------------------------+----------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`spring_length` | ``1.0`` | ++---------------------------+----------------------------------------------------------------+----------+ + +Methods +------- + ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_excluded_object` **(** :ref:`RID` RID **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_excluded_objects` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_hit_length` **(** **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`remove_excluded_object` **(** :ref:`RID` RID **)** | ++---------------------------+--------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SpringArm_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The layers against which the collision check shall be done. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_SpringArm_property_margin: + +- :ref:`float` **margin** + ++-----------+-------------------+ +| *Default* | ``0.01`` | ++-----------+-------------------+ +| *Setter* | set_margin(value) | ++-----------+-------------------+ +| *Getter* | get_margin() | ++-----------+-------------------+ + +When the collision check is made, a candidate length for the SpringArm is given. + +The margin is then subtracted to this length and the translation is applied to the child objects of the SpringArm. + +This margin is useful for when the SpringArm has a :ref:`Camera` as a child node: without the margin, the :ref:`Camera` would be placed on the exact point of collision, while with the margin the :ref:`Camera` would be placed close to the point of collision. + +---- + +.. _class_SpringArm_property_shape: + +- :ref:`Shape` **shape** + ++----------+------------------+ +| *Setter* | set_shape(value) | ++----------+------------------+ +| *Getter* | get_shape() | ++----------+------------------+ + +The :ref:`Shape` to use for the SpringArm. + +When the shape is set, the SpringArm will cast the :ref:`Shape` on its z axis instead of performing a ray cast. + +---- + +.. _class_SpringArm_property_spring_length: + +- :ref:`float` **spring_length** + ++-----------+-------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------+ +| *Setter* | set_length(value) | ++-----------+-------------------+ +| *Getter* | get_length() | ++-----------+-------------------+ + +The maximum extent of the SpringArm. This is used as a length for both the ray and the shape cast used internally to calculate the desired position of the SpringArm's child nodes. + +To know more about how to perform a shape cast or a ray cast, please consult the :ref:`PhysicsDirectSpaceState` documentation. + +Method Descriptions +------------------- + +.. _class_SpringArm_method_add_excluded_object: + +- void **add_excluded_object** **(** :ref:`RID` RID **)** + +Adds the :ref:`PhysicsBody` object with the given :ref:`RID` to the list of :ref:`PhysicsBody` objects excluded from the collision check. + +---- + +.. _class_SpringArm_method_clear_excluded_objects: + +- void **clear_excluded_objects** **(** **)** + +Clears the list of :ref:`PhysicsBody` objects excluded from the collision check. + +---- + +.. _class_SpringArm_method_get_hit_length: + +- :ref:`float` **get_hit_length** **(** **)** + +Returns the spring arm's current length. + +---- + +.. _class_SpringArm_method_remove_excluded_object: + +- :ref:`bool` **remove_excluded_object** **(** :ref:`RID` RID **)** + +Removes the given :ref:`RID` from the list of :ref:`PhysicsBody` objects excluded from the collision check. + +.. |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.)` diff --git a/classes/class_sprite.rst b/classes/class_sprite.rst new file mode 100644 index 0000000..df6bc5d --- /dev/null +++ b/classes/class_sprite.rst @@ -0,0 +1,318 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Sprite.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Sprite: + +Sprite +====== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +General-purpose sprite node. + +Description +----------- + +A node that displays a 2D texture. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. + +Tutorials +--------- + +- `Instancing Demo `__ + +Properties +---------- + ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`centered` | ``true`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`frame` | ``0`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`frame_coords` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`hframes` | ``1`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`normal_map` | | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`region_enabled` | ``false`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`region_filter_clip` | ``false`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Rect2` | :ref:`region_rect` | ``Rect2( 0, 0, 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`vframes` | ``1`` | ++-------------------------------+---------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------+-------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_rect` **(** **)** |const| | ++---------------------------+-------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_pixel_opaque` **(** :ref:`Vector2` pos **)** |const| | ++---------------------------+-------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Sprite_signal_frame_changed: + +- **frame_changed** **(** **)** + +Emitted when the :ref:`frame` changes. + +---- + +.. _class_Sprite_signal_texture_changed: + +- **texture_changed** **(** **)** + +Emitted when the :ref:`texture` changes. + +Property Descriptions +--------------------- + +.. _class_Sprite_property_centered: + +- :ref:`bool` **centered** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_centered(value) | ++-----------+---------------------+ +| *Getter* | is_centered() | ++-----------+---------------------+ + +If ``true``, texture is centered. + +---- + +.. _class_Sprite_property_flip_h: + +- :ref:`bool` **flip_h** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_h(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_h() | ++-----------+-------------------+ + +If ``true``, texture is flipped horizontally. + +---- + +.. _class_Sprite_property_flip_v: + +- :ref:`bool` **flip_v** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_v(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_v() | ++-----------+-------------------+ + +If ``true``, texture is flipped vertically. + +---- + +.. _class_Sprite_property_frame: + +- :ref:`int` **frame** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_frame(value) | ++-----------+------------------+ +| *Getter* | get_frame() | ++-----------+------------------+ + +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. + +---- + +.. _class_Sprite_property_frame_coords: + +- :ref:`Vector2` **frame_coords** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_frame_coords(value) | ++-----------+-------------------------+ +| *Getter* | get_frame_coords() | ++-----------+-------------------------+ + +Coordinates of the frame to display from sprite sheet. This is as an alias for the :ref:`frame` property. :ref:`hframes` or :ref:`vframes` must be greater than 1. + +---- + +.. _class_Sprite_property_hframes: + +- :ref:`int` **hframes** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_hframes(value) | ++-----------+--------------------+ +| *Getter* | get_hframes() | ++-----------+--------------------+ + +The number of columns in the sprite sheet. + +---- + +.. _class_Sprite_property_normal_map: + +- :ref:`Texture` **normal_map** + ++----------+-----------------------+ +| *Setter* | set_normal_map(value) | ++----------+-----------------------+ +| *Getter* | get_normal_map() | ++----------+-----------------------+ + +The normal map gives depth to the Sprite. + +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_Sprite_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The texture's drawing offset. + +---- + +.. _class_Sprite_property_region_enabled: + +- :ref:`bool` **region_enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_region(value) | ++-----------+-------------------+ +| *Getter* | is_region() | ++-----------+-------------------+ + +If ``true``, texture is cut from a larger atlas texture. See :ref:`region_rect`. + +---- + +.. _class_Sprite_property_region_filter_clip: + +- :ref:`bool` **region_filter_clip** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_region_filter_clip(value) | ++-----------+---------------------------------+ +| *Getter* | is_region_filter_clip_enabled() | ++-----------+---------------------------------+ + +If ``true``, the outermost pixels get blurred out. + +---- + +.. _class_Sprite_property_region_rect: + +- :ref:`Rect2` **region_rect** + ++-----------+-------------------------+ +| *Default* | ``Rect2( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_region_rect(value) | ++-----------+-------------------------+ +| *Getter* | get_region_rect() | ++-----------+-------------------------+ + +The region of the atlas texture to display. :ref:`region_enabled` must be ``true``. + +---- + +.. _class_Sprite_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +:ref:`Texture` object to draw. + +---- + +.. _class_Sprite_property_vframes: + +- :ref:`int` **vframes** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_vframes(value) | ++-----------+--------------------+ +| *Getter* | get_vframes() | ++-----------+--------------------+ + +The number of rows in the sprite sheet. + +Method Descriptions +------------------- + +.. _class_Sprite_method_get_rect: + +- :ref:`Rect2` **get_rect** **(** **)** |const| + +Returns a :ref:`Rect2` representing the Sprite's boundary in local coordinates. Can be used to detect if the Sprite was clicked. Example: + +:: + + func _input(event): + if event is InputEventMouseButton and event.pressed and event.button_index == BUTTON_LEFT: + if get_rect().has_point(to_local(event.position)): + print("A click!") + +---- + +.. _class_Sprite_method_is_pixel_opaque: + +- :ref:`bool` **is_pixel_opaque** **(** :ref:`Vector2` pos **)** |const| + +Returns ``true``, if the pixel at the given position is opaque and ``false`` in other case. + +**Note:** It also returns ``false``, if the sprite's texture is ``null`` or if the given position is invalid. + +.. |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.)` diff --git a/classes/class_sprite3d.rst b/classes/class_sprite3d.rst new file mode 100644 index 0000000..0369c65 --- /dev/null +++ b/classes/class_sprite3d.rst @@ -0,0 +1,162 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Sprite3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Sprite3D: + +Sprite3D +======== + +**Inherits:** :ref:`SpriteBase3D` **<** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +2D sprite node in a 3D world. + +Description +----------- + +A node that displays a 2D texture in a 3D environment. The texture displayed can be a region from a larger atlas texture, or a frame from a sprite sheet animation. + +Properties +---------- + ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`frame` | ``0`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`frame_coords` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`hframes` | ``1`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`region_enabled` | ``false`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`Rect2` | :ref:`region_rect` | ``Rect2( 0, 0, 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++-------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`vframes` | ``1`` | ++-------------------------------+---------------------------------------------------------------+-------------------------+ + +Signals +------- + +.. _class_Sprite3D_signal_frame_changed: + +- **frame_changed** **(** **)** + +Emitted when the :ref:`frame` changes. + +Property Descriptions +--------------------- + +.. _class_Sprite3D_property_frame: + +- :ref:`int` **frame** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_frame(value) | ++-----------+------------------+ +| *Getter* | get_frame() | ++-----------+------------------+ + +Current frame to display from sprite sheet. :ref:`hframes` or :ref:`vframes` must be greater than 1. + +---- + +.. _class_Sprite3D_property_frame_coords: + +- :ref:`Vector2` **frame_coords** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_frame_coords(value) | ++-----------+-------------------------+ +| *Getter* | get_frame_coords() | ++-----------+-------------------------+ + +Coordinates of the frame to display from sprite sheet. This is as an alias for the :ref:`frame` property. :ref:`hframes` or :ref:`vframes` must be greater than 1. + +---- + +.. _class_Sprite3D_property_hframes: + +- :ref:`int` **hframes** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_hframes(value) | ++-----------+--------------------+ +| *Getter* | get_hframes() | ++-----------+--------------------+ + +The number of columns in the sprite sheet. + +---- + +.. _class_Sprite3D_property_region_enabled: + +- :ref:`bool` **region_enabled** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_region(value) | ++-----------+-------------------+ +| *Getter* | is_region() | ++-----------+-------------------+ + +If ``true``, texture will be cut from a larger atlas texture. See :ref:`region_rect`. + +---- + +.. _class_Sprite3D_property_region_rect: + +- :ref:`Rect2` **region_rect** + ++-----------+-------------------------+ +| *Default* | ``Rect2( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_region_rect(value) | ++-----------+-------------------------+ +| *Getter* | get_region_rect() | ++-----------+-------------------------+ + +The region of the atlas texture to display. :ref:`region_enabled` must be ``true``. + +---- + +.. _class_Sprite3D_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +:ref:`Texture` object to draw. If :ref:`GeometryInstance.material_override` is used, this will be overridden. + +---- + +.. _class_Sprite3D_property_vframes: + +- :ref:`int` **vframes** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_vframes(value) | ++-----------+--------------------+ +| *Getter* | get_vframes() | ++-----------+--------------------+ + +The number of rows in the sprite sheet. + +.. |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.)` diff --git a/classes/class_spritebase3d.rst b/classes/class_spritebase3d.rst new file mode 100644 index 0000000..eb7d87c --- /dev/null +++ b/classes/class_spritebase3d.rst @@ -0,0 +1,350 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpriteBase3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpriteBase3D: + +SpriteBase3D +============ + +**Inherits:** :ref:`GeometryInstance` **<** :ref:`VisualInstance` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`AnimatedSprite3D`, :ref:`Sprite3D` + +2D sprite node in 3D environment. + +Description +----------- + +A node that displays 2D texture information in a 3D environment. + +Properties +---------- + ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`AlphaCutMode` | :ref:`alpha_cut` | ``0`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| Vector3.Axis | :ref:`axis` | ``2`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`BillboardMode` | :ref:`billboard` | ``0`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`centered` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`double_sided` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`modulate` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`opacity` | ``1.0`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`pixel_size` | ``0.01`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`shaded` | ``false`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`transparent` | ``true`` | ++----------------------------------------------------------+---------------------------------------------------------------+-------------------------+ + +Methods +------- + ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TriangleMesh` | :ref:`generate_triangle_mesh` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_draw_flag` **(** :ref:`DrawFlags` flag **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_item_rect` **(** **)** |const| | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_draw_flag` **(** :ref:`DrawFlags` flag, :ref:`bool` enabled **)** | ++-----------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_SpriteBase3D_DrawFlags: + +.. _class_SpriteBase3D_constant_FLAG_TRANSPARENT: + +.. _class_SpriteBase3D_constant_FLAG_SHADED: + +.. _class_SpriteBase3D_constant_FLAG_DOUBLE_SIDED: + +.. _class_SpriteBase3D_constant_FLAG_MAX: + +enum **DrawFlags**: + +- **FLAG_TRANSPARENT** = **0** --- If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible. + +- **FLAG_SHADED** = **1** --- If set, lights in the environment affect the sprite. + +- **FLAG_DOUBLE_SIDED** = **2** --- If set, texture can be seen from the back as well, if not, it is invisible when looking at it from behind. + +- **FLAG_MAX** = **3** --- Represents the size of the :ref:`DrawFlags` enum. + +---- + +.. _enum_SpriteBase3D_AlphaCutMode: + +.. _class_SpriteBase3D_constant_ALPHA_CUT_DISABLED: + +.. _class_SpriteBase3D_constant_ALPHA_CUT_DISCARD: + +.. _class_SpriteBase3D_constant_ALPHA_CUT_OPAQUE_PREPASS: + +enum **AlphaCutMode**: + +- **ALPHA_CUT_DISABLED** = **0** + +- **ALPHA_CUT_DISCARD** = **1** + +- **ALPHA_CUT_OPAQUE_PREPASS** = **2** + +Property Descriptions +--------------------- + +.. _class_SpriteBase3D_property_alpha_cut: + +- :ref:`AlphaCutMode` **alpha_cut** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_alpha_cut_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_alpha_cut_mode() | ++-----------+---------------------------+ + +---- + +.. _class_SpriteBase3D_property_axis: + +- Vector3.Axis **axis** + ++-----------+-----------------+ +| *Default* | ``2`` | ++-----------+-----------------+ +| *Setter* | set_axis(value) | ++-----------+-----------------+ +| *Getter* | get_axis() | ++-----------+-----------------+ + +The direction in which the front of the texture faces. + +---- + +.. _class_SpriteBase3D_property_billboard: + +- :ref:`BillboardMode` **billboard** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_billboard_mode(value) | ++-----------+---------------------------+ +| *Getter* | get_billboard_mode() | ++-----------+---------------------------+ + +---- + +.. _class_SpriteBase3D_property_centered: + +- :ref:`bool` **centered** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_centered(value) | ++-----------+---------------------+ +| *Getter* | is_centered() | ++-----------+---------------------+ + +If ``true``, texture will be centered. + +---- + +.. _class_SpriteBase3D_property_double_sided: + +- :ref:`bool` **double_sided** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, texture can be seen from the back as well, if ``false``, it is invisible when looking at it from behind. + +---- + +.. _class_SpriteBase3D_property_flip_h: + +- :ref:`bool` **flip_h** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_h(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_h() | ++-----------+-------------------+ + +If ``true``, texture is flipped horizontally. + +---- + +.. _class_SpriteBase3D_property_flip_v: + +- :ref:`bool` **flip_v** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_v(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_v() | ++-----------+-------------------+ + +If ``true``, texture is flipped vertically. + +---- + +.. _class_SpriteBase3D_property_modulate: + +- :ref:`Color` **modulate** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_modulate(value) | ++-----------+-------------------------+ +| *Getter* | get_modulate() | ++-----------+-------------------------+ + +A color value used to *multiply* the texture's colors. Can be used for mood-coloring or to simulate the color of light. + +**Note:** If a :ref:`GeometryInstance.material_override` is defined on the ``SpriteBase3D``, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in :ref:`modulate` will be ignored. For a :ref:`SpatialMaterial`, :ref:`SpatialMaterial.vertex_color_use_as_albedo` must be ``true``. For a :ref:`ShaderMaterial`, ``ALBEDO *= COLOR.rgb;[/color] must be inserted in the shader's [code]fragment()`` function. + +---- + +.. _class_SpriteBase3D_property_offset: + +- :ref:`Vector2` **offset** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_offset(value) | ++-----------+---------------------+ +| *Getter* | get_offset() | ++-----------+---------------------+ + +The texture's drawing offset. + +---- + +.. _class_SpriteBase3D_property_opacity: + +- :ref:`float` **opacity** + ++-----------+--------------------+ +| *Default* | ``1.0`` | ++-----------+--------------------+ +| *Setter* | set_opacity(value) | ++-----------+--------------------+ +| *Getter* | get_opacity() | ++-----------+--------------------+ + +The texture's visibility on a scale from ``0`` (fully invisible) to ``1`` (fully visible). :ref:`opacity` is a multiplier for the :ref:`modulate` color's alpha channel. + +**Note:** If a :ref:`GeometryInstance.material_override` is defined on the ``SpriteBase3D``, the material override must be configured to take vertex colors into account for albedo. Otherwise, the opacity defined in :ref:`opacity` will be ignored. For a :ref:`SpatialMaterial`, :ref:`SpatialMaterial.vertex_color_use_as_albedo` must be ``true``. For a :ref:`ShaderMaterial`, ``ALPHA *= COLOR.a;[/color] must be inserted in the shader's [code]fragment()`` function. + +---- + +.. _class_SpriteBase3D_property_pixel_size: + +- :ref:`float` **pixel_size** + ++-----------+-----------------------+ +| *Default* | ``0.01`` | ++-----------+-----------------------+ +| *Setter* | set_pixel_size(value) | ++-----------+-----------------------+ +| *Getter* | get_pixel_size() | ++-----------+-----------------------+ + +The size of one pixel's width on the sprite to scale it in 3D. + +---- + +.. _class_SpriteBase3D_property_shaded: + +- :ref:`bool` **shaded** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, the :ref:`Light` in the :ref:`Environment` has effects on the sprite. + +---- + +.. _class_SpriteBase3D_property_transparent: + +- :ref:`bool` **transparent** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_draw_flag(value) | ++-----------+----------------------+ +| *Getter* | get_draw_flag() | ++-----------+----------------------+ + +If ``true``, the texture's transparency and the opacity are used to make those parts of the sprite invisible. + +Method Descriptions +------------------- + +.. _class_SpriteBase3D_method_generate_triangle_mesh: + +- :ref:`TriangleMesh` **generate_triangle_mesh** **(** **)** |const| + +---- + +.. _class_SpriteBase3D_method_get_draw_flag: + +- :ref:`bool` **get_draw_flag** **(** :ref:`DrawFlags` flag **)** |const| + +Returns the value of the specified flag. + +---- + +.. _class_SpriteBase3D_method_get_item_rect: + +- :ref:`Rect2` **get_item_rect** **(** **)** |const| + +Returns the rectangle representing this sprite. + +---- + +.. _class_SpriteBase3D_method_set_draw_flag: + +- void **set_draw_flag** **(** :ref:`DrawFlags` flag, :ref:`bool` enabled **)** + +If ``true``, the specified flag will be enabled. + +.. |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.)` diff --git a/classes/class_spriteframes.rst b/classes/class_spriteframes.rst new file mode 100644 index 0000000..69a0247 --- /dev/null +++ b/classes/class_spriteframes.rst @@ -0,0 +1,207 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SpriteFrames.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SpriteFrames: + +SpriteFrames +============ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Sprite frame library for AnimatedSprite and AnimatedSprite3D. + +Description +----------- + +Sprite frame library for an :ref:`AnimatedSprite` or :ref:`AnimatedSprite3D` node. Contains frames and animation data for playback. + +**Note:** You can associate a set of normal maps by creating additional ``SpriteFrames`` resources with a ``_normal`` suffix. For example, having 2 ``SpriteFrames`` resources ``run`` and ``run_normal`` will make it so the ``run`` animation uses the normal map. + +Properties +---------- + ++---------------------------+---------------------------------------------------+ +| :ref:`Array` | :ref:`frames` | ++---------------------------+---------------------------------------------------+ + +Methods +------- + ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_animation` **(** :ref:`String` anim **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_frame` **(** :ref:`String` anim, :ref:`Texture` frame, :ref:`int` at_position=-1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** :ref:`String` anim **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_all` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_animation_loop` **(** :ref:`String` anim **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_animation_names` **(** **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_animation_speed` **(** :ref:`String` anim **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_frame` **(** :ref:`String` anim, :ref:`int` idx **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_frame_count` **(** :ref:`String` anim **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_animation` **(** :ref:`String` anim **)** |const| | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_animation` **(** :ref:`String` anim **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_frame` **(** :ref:`String` anim, :ref:`int` idx **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_animation` **(** :ref:`String` anim, :ref:`String` newname **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_animation_loop` **(** :ref:`String` anim, :ref:`bool` loop **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_animation_speed` **(** :ref:`String` anim, :ref:`float` speed **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_frame` **(** :ref:`String` anim, :ref:`int` idx, :ref:`Texture` txt **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_SpriteFrames_property_frames: + +- :ref:`Array` **frames** + +Compatibility property, always equals to an empty array. + +Method Descriptions +------------------- + +.. _class_SpriteFrames_method_add_animation: + +- void **add_animation** **(** :ref:`String` anim **)** + +Adds a new animation to the library. + +---- + +.. _class_SpriteFrames_method_add_frame: + +- void **add_frame** **(** :ref:`String` anim, :ref:`Texture` frame, :ref:`int` at_position=-1 **)** + +Adds a frame to the given animation. + +---- + +.. _class_SpriteFrames_method_clear: + +- void **clear** **(** :ref:`String` anim **)** + +Removes all frames from the given animation. + +---- + +.. _class_SpriteFrames_method_clear_all: + +- void **clear_all** **(** **)** + +Removes all animations. A "default" animation will be created. + +---- + +.. _class_SpriteFrames_method_get_animation_loop: + +- :ref:`bool` **get_animation_loop** **(** :ref:`String` anim **)** |const| + +Returns ``true`` if the given animation is configured to loop when it finishes playing. Otherwise, returns ``false``. + +---- + +.. _class_SpriteFrames_method_get_animation_names: + +- :ref:`PoolStringArray` **get_animation_names** **(** **)** |const| + +Returns an array containing the names associated to each animation. Values are placed in alphabetical order. + +---- + +.. _class_SpriteFrames_method_get_animation_speed: + +- :ref:`float` **get_animation_speed** **(** :ref:`String` anim **)** |const| + +The animation's speed in frames per second. + +---- + +.. _class_SpriteFrames_method_get_frame: + +- :ref:`Texture` **get_frame** **(** :ref:`String` anim, :ref:`int` idx **)** |const| + +Returns the animation's selected frame. + +---- + +.. _class_SpriteFrames_method_get_frame_count: + +- :ref:`int` **get_frame_count** **(** :ref:`String` anim **)** |const| + +Returns the number of frames in the animation. + +---- + +.. _class_SpriteFrames_method_has_animation: + +- :ref:`bool` **has_animation** **(** :ref:`String` anim **)** |const| + +If ``true``, the named animation exists. + +---- + +.. _class_SpriteFrames_method_remove_animation: + +- void **remove_animation** **(** :ref:`String` anim **)** + +Removes the given animation. + +---- + +.. _class_SpriteFrames_method_remove_frame: + +- void **remove_frame** **(** :ref:`String` anim, :ref:`int` idx **)** + +Removes the animation's selected frame. + +---- + +.. _class_SpriteFrames_method_rename_animation: + +- void **rename_animation** **(** :ref:`String` anim, :ref:`String` newname **)** + +Changes the animation's name to ``newname``. + +---- + +.. _class_SpriteFrames_method_set_animation_loop: + +- void **set_animation_loop** **(** :ref:`String` anim, :ref:`bool` loop **)** + +If ``true``, the animation will loop. + +---- + +.. _class_SpriteFrames_method_set_animation_speed: + +- void **set_animation_speed** **(** :ref:`String` anim, :ref:`float` speed **)** + +The animation's speed in frames per second. + +---- + +.. _class_SpriteFrames_method_set_frame: + +- void **set_frame** **(** :ref:`String` anim, :ref:`int` idx, :ref:`Texture` txt **)** + +Sets the texture of the given 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.)` diff --git a/classes/class_staticbody.rst b/classes/class_staticbody.rst new file mode 100644 index 0000000..83c12ac --- /dev/null +++ b/classes/class_staticbody.rst @@ -0,0 +1,130 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StaticBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StaticBody: + +StaticBody +========== + +**Inherits:** :ref:`PhysicsBody` **<** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Static body for 3D physics. + +Description +----------- + +Static body for 3D physics. A static body is a simple body that is not intended to move. In contrast to :ref:`RigidBody`, they don't consume any CPU resources as long as they don't move. + +Additionally, a constant linear or angular velocity can be set for the static body, so even if it doesn't move, it affects other bodies as if it was moving (this is useful for simulating conveyor belts or conveyor wheels). + +Tutorials +--------- + +- `3D Physics Tests Demo `__ + +- `Third Person Shooter Demo `__ + +- `3D Voxel Demo `__ + +Properties +---------- + ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`bounce` | | ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`constant_angular_velocity` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`constant_linear_velocity` | ``Vector3( 0, 0, 0 )`` | ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ +| :ref:`float` | :ref:`friction` | | ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ +| :ref:`PhysicsMaterial` | :ref:`physics_material_override` | | ++-----------------------------------------------+---------------------------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_StaticBody_property_bounce: + +- :ref:`float` **bounce** + ++----------+-------------------+ +| *Setter* | set_bounce(value) | ++----------+-------------------+ +| *Getter* | get_bounce() | ++----------+-------------------+ + +The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness). + +Deprecated, use :ref:`PhysicsMaterial.bounce` instead via :ref:`physics_material_override`. + +---- + +.. _class_StaticBody_property_constant_angular_velocity: + +- :ref:`Vector3` **constant_angular_velocity** + ++-----------+--------------------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+--------------------------------------+ +| *Setter* | set_constant_angular_velocity(value) | ++-----------+--------------------------------------+ +| *Getter* | get_constant_angular_velocity() | ++-----------+--------------------------------------+ + +The body's constant angular velocity. This does not rotate the body, but affects other bodies that touch it, as if it was in a state of rotation. + +---- + +.. _class_StaticBody_property_constant_linear_velocity: + +- :ref:`Vector3` **constant_linear_velocity** + ++-----------+-------------------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_constant_linear_velocity(value) | ++-----------+-------------------------------------+ +| *Getter* | get_constant_linear_velocity() | ++-----------+-------------------------------------+ + +The body's constant linear velocity. This does not move the body, but affects other bodies that touch it, as if it was in a state of movement. + +---- + +.. _class_StaticBody_property_friction: + +- :ref:`float` **friction** + ++----------+---------------------+ +| *Setter* | set_friction(value) | ++----------+---------------------+ +| *Getter* | get_friction() | ++----------+---------------------+ + +The body's friction, from 0 (frictionless) to 1 (full friction). + +Deprecated, use :ref:`PhysicsMaterial.friction` instead via :ref:`physics_material_override`. + +---- + +.. _class_StaticBody_property_physics_material_override: + +- :ref:`PhysicsMaterial` **physics_material_override** + ++----------+--------------------------------------+ +| *Setter* | set_physics_material_override(value) | ++----------+--------------------------------------+ +| *Getter* | get_physics_material_override() | ++----------+--------------------------------------+ + +The physics material override for the body. + +If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + +.. |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.)` diff --git a/classes/class_staticbody2d.rst b/classes/class_staticbody2d.rst new file mode 100644 index 0000000..eca24d6 --- /dev/null +++ b/classes/class_staticbody2d.rst @@ -0,0 +1,121 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StaticBody2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StaticBody2D: + +StaticBody2D +============ + +**Inherits:** :ref:`PhysicsBody2D` **<** :ref:`CollisionObject2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Static body for 2D physics. + +Description +----------- + +Static body for 2D physics. A StaticBody2D is a body that is not intended to move. It is ideal for implementing objects in the environment, such as walls or platforms. + +Additionally, a constant linear or angular velocity can be set for the static body, which will affect colliding bodies as if it were moving (for example, a conveyor belt). + +Properties +---------- + ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`bounce` | | ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`constant_angular_velocity` | ``0.0`` | ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`constant_linear_velocity` | ``Vector2( 0, 0 )`` | ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`friction` | | ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`PhysicsMaterial` | :ref:`physics_material_override` | | ++-----------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ + +Property Descriptions +--------------------- + +.. _class_StaticBody2D_property_bounce: + +- :ref:`float` **bounce** + ++----------+-------------------+ +| *Setter* | set_bounce(value) | ++----------+-------------------+ +| *Getter* | get_bounce() | ++----------+-------------------+ + +The body's bounciness. Values range from ``0`` (no bounce) to ``1`` (full bounciness). + +Deprecated, use :ref:`PhysicsMaterial.bounce` instead via :ref:`physics_material_override`. + +---- + +.. _class_StaticBody2D_property_constant_angular_velocity: + +- :ref:`float` **constant_angular_velocity** + ++-----------+--------------------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------------------+ +| *Setter* | set_constant_angular_velocity(value) | ++-----------+--------------------------------------+ +| *Getter* | get_constant_angular_velocity() | ++-----------+--------------------------------------+ + +The body's constant angular velocity. This does not rotate the body, but affects colliding bodies, as if it were rotating. + +---- + +.. _class_StaticBody2D_property_constant_linear_velocity: + +- :ref:`Vector2` **constant_linear_velocity** + ++-----------+-------------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------------------+ +| *Setter* | set_constant_linear_velocity(value) | ++-----------+-------------------------------------+ +| *Getter* | get_constant_linear_velocity() | ++-----------+-------------------------------------+ + +The body's constant linear velocity. This does not move the body, but affects colliding bodies, as if it were moving. + +---- + +.. _class_StaticBody2D_property_friction: + +- :ref:`float` **friction** + ++----------+---------------------+ +| *Setter* | set_friction(value) | ++----------+---------------------+ +| *Getter* | get_friction() | ++----------+---------------------+ + +The body's friction. Values range from ``0`` (no friction) to ``1`` (full friction). + +Deprecated, use :ref:`PhysicsMaterial.friction` instead via :ref:`physics_material_override`. + +---- + +.. _class_StaticBody2D_property_physics_material_override: + +- :ref:`PhysicsMaterial` **physics_material_override** + ++----------+--------------------------------------+ +| *Setter* | set_physics_material_override(value) | ++----------+--------------------------------------+ +| *Getter* | get_physics_material_override() | ++----------+--------------------------------------+ + +The physics material override for the body. + +If a material is assigned to this property, it will be used instead of any other physics material, such as an inherited one. + +.. |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.)` diff --git a/classes/class_streampeer.rst b/classes/class_streampeer.rst new file mode 100644 index 0000000..f9a56cd --- /dev/null +++ b/classes/class_streampeer.rst @@ -0,0 +1,379 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StreamPeer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamPeer: + +StreamPeer +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`StreamPeerBuffer`, :ref:`StreamPeerGDNative`, :ref:`StreamPeerSSL`, :ref:`StreamPeerTCP` + +Abstraction and base class for stream-based protocols. + +Description +----------- + +StreamPeer is an abstraction and base class for stream-based protocols (such as TCP). It provides an API for sending and receiving data through streams as raw data or strings. + +Properties +---------- + ++-------------------------+---------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`big_endian` | ``false`` | ++-------------------------+---------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_16` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_32` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_64` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_8` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_available_bytes` **(** **)** |const| | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_data` **(** :ref:`int` bytes **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_double` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_float` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_partial_data` **(** :ref:`int` bytes **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_string` **(** :ref:`int` bytes=-1 **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_u16` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_u32` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_u64` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_u8` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_utf8_string` **(** :ref:`int` bytes=-1 **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_var` **(** :ref:`bool` allow_objects=false **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_16` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_32` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_64` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_8` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`put_data` **(** :ref:`PoolByteArray` data **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_double` **(** :ref:`float` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_float` **(** :ref:`float` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`put_partial_data` **(** :ref:`PoolByteArray` data **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_string` **(** :ref:`String` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_u16` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_u32` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_u64` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_u8` **(** :ref:`int` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_utf8_string` **(** :ref:`String` value **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`put_var` **(** :ref:`Variant` value, :ref:`bool` full_objects=false **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_StreamPeer_property_big_endian: + +- :ref:`bool` **big_endian** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_big_endian(value) | ++-----------+-------------------------+ +| *Getter* | is_big_endian_enabled() | ++-----------+-------------------------+ + +If ``true``, this ``StreamPeer`` will using big-endian format for encoding and decoding. + +Method Descriptions +------------------- + +.. _class_StreamPeer_method_get_16: + +- :ref:`int` **get_16** **(** **)** + +Gets a signed 16-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_32: + +- :ref:`int` **get_32** **(** **)** + +Gets a signed 32-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_64: + +- :ref:`int` **get_64** **(** **)** + +Gets a signed 64-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_8: + +- :ref:`int` **get_8** **(** **)** + +Gets a signed byte from the stream. + +---- + +.. _class_StreamPeer_method_get_available_bytes: + +- :ref:`int` **get_available_bytes** **(** **)** |const| + +Returns the amount of bytes this ``StreamPeer`` has available. + +---- + +.. _class_StreamPeer_method_get_data: + +- :ref:`Array` **get_data** **(** :ref:`int` bytes **)** + +Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the ``bytes`` argument. If not enough bytes are available, the function will block until the desired amount is received. This function returns two values, an :ref:`Error` code and a data array. + +---- + +.. _class_StreamPeer_method_get_double: + +- :ref:`float` **get_double** **(** **)** + +Gets a double-precision float from the stream. + +---- + +.. _class_StreamPeer_method_get_float: + +- :ref:`float` **get_float** **(** **)** + +Gets a single-precision float from the stream. + +---- + +.. _class_StreamPeer_method_get_partial_data: + +- :ref:`Array` **get_partial_data** **(** :ref:`int` bytes **)** + +Returns a chunk data with the received bytes. The amount of bytes to be received can be requested in the "bytes" argument. If not enough bytes are available, the function will return how many were actually received. This function returns two values, an :ref:`Error` code, and a data array. + +---- + +.. _class_StreamPeer_method_get_string: + +- :ref:`String` **get_string** **(** :ref:`int` bytes=-1 **)** + +Gets an ASCII string with byte-length ``bytes`` from the stream. If ``bytes`` is negative (default) the length will be read from the stream using the reverse process of :ref:`put_string`. + +---- + +.. _class_StreamPeer_method_get_u16: + +- :ref:`int` **get_u16** **(** **)** + +Gets an unsigned 16-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_u32: + +- :ref:`int` **get_u32** **(** **)** + +Gets an unsigned 32-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_u64: + +- :ref:`int` **get_u64** **(** **)** + +Gets an unsigned 64-bit value from the stream. + +---- + +.. _class_StreamPeer_method_get_u8: + +- :ref:`int` **get_u8** **(** **)** + +Gets an unsigned byte from the stream. + +---- + +.. _class_StreamPeer_method_get_utf8_string: + +- :ref:`String` **get_utf8_string** **(** :ref:`int` bytes=-1 **)** + +Gets an UTF-8 string with byte-length ``bytes`` from the stream (this decodes the string sent as UTF-8). If ``bytes`` is negative (default) the length will be read from the stream using the reverse process of :ref:`put_utf8_string`. + +---- + +.. _class_StreamPeer_method_get_var: + +- :ref:`Variant` **get_var** **(** :ref:`bool` allow_objects=false **)** + +Gets a Variant from the stream. If ``allow_objects`` is ``true``, decoding objects is allowed. + +**Warning:** Deserialized objects can contain code which gets executed. Do not use this option if the serialized object comes from untrusted sources to avoid potential security threats such as remote code execution. + +---- + +.. _class_StreamPeer_method_put_16: + +- void **put_16** **(** :ref:`int` value **)** + +Puts a signed 16-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_32: + +- void **put_32** **(** :ref:`int` value **)** + +Puts a signed 32-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_64: + +- void **put_64** **(** :ref:`int` value **)** + +Puts a signed 64-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_8: + +- void **put_8** **(** :ref:`int` value **)** + +Puts a signed byte into the stream. + +---- + +.. _class_StreamPeer_method_put_data: + +- :ref:`Error` **put_data** **(** :ref:`PoolByteArray` data **)** + +Sends a chunk of data through the connection, blocking if necessary until the data is done sending. This function returns an :ref:`Error` code. + +---- + +.. _class_StreamPeer_method_put_double: + +- void **put_double** **(** :ref:`float` value **)** + +Puts a double-precision float into the stream. + +---- + +.. _class_StreamPeer_method_put_float: + +- void **put_float** **(** :ref:`float` value **)** + +Puts a single-precision float into the stream. + +---- + +.. _class_StreamPeer_method_put_partial_data: + +- :ref:`Array` **put_partial_data** **(** :ref:`PoolByteArray` data **)** + +Sends a chunk of data through the connection. If all the data could not be sent at once, only part of it will. This function returns two values, an :ref:`Error` code and an integer, describing how much data was actually sent. + +---- + +.. _class_StreamPeer_method_put_string: + +- void **put_string** **(** :ref:`String` value **)** + +Puts a zero-terminated ASCII string into the stream prepended by a 32-bit unsigned integer representing its size. + +**Note:** To put an ASCII string without prepending its size, you can use :ref:`put_data`: + +:: + + put_data("Hello world".to_ascii()) + +---- + +.. _class_StreamPeer_method_put_u16: + +- void **put_u16** **(** :ref:`int` value **)** + +Puts an unsigned 16-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_u32: + +- void **put_u32** **(** :ref:`int` value **)** + +Puts an unsigned 32-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_u64: + +- void **put_u64** **(** :ref:`int` value **)** + +Puts an unsigned 64-bit value into the stream. + +---- + +.. _class_StreamPeer_method_put_u8: + +- void **put_u8** **(** :ref:`int` value **)** + +Puts an unsigned byte into the stream. + +---- + +.. _class_StreamPeer_method_put_utf8_string: + +- void **put_utf8_string** **(** :ref:`String` value **)** + +Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits unsigned integer representing its size. + +**Note:** To put an UTF-8 string without prepending its size, you can use :ref:`put_data`: + +:: + + put_data("Hello world".to_utf8()) + +---- + +.. _class_StreamPeer_method_put_var: + +- void **put_var** **(** :ref:`Variant` value, :ref:`bool` full_objects=false **)** + +Puts a Variant into the stream. If ``full_objects`` is ``true`` encoding objects is allowed (and can potentially include code). + +.. |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.)` diff --git a/classes/class_streampeerbuffer.rst b/classes/class_streampeerbuffer.rst new file mode 100644 index 0000000..5adeb13 --- /dev/null +++ b/classes/class_streampeerbuffer.rst @@ -0,0 +1,94 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StreamPeerBuffer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamPeerBuffer: + +StreamPeerBuffer +================ + +**Inherits:** :ref:`StreamPeer` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ +| :ref:`PoolByteArray` | :ref:`data_array` | ``PoolByteArray( )`` | ++-------------------------------------------+---------------------------------------------------------------+-----------------------+ + +Methods +------- + ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`StreamPeerBuffer` | :ref:`duplicate` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_position` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_size` **(** **)** |const| | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| void | :ref:`resize` **(** :ref:`int` size **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ +| void | :ref:`seek` **(** :ref:`int` position **)** | ++-------------------------------------------------+--------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_StreamPeerBuffer_property_data_array: + +- :ref:`PoolByteArray` **data_array** + ++-----------+-----------------------+ +| *Default* | ``PoolByteArray( )`` | ++-----------+-----------------------+ +| *Setter* | set_data_array(value) | ++-----------+-----------------------+ +| *Getter* | get_data_array() | ++-----------+-----------------------+ + +Method Descriptions +------------------- + +.. _class_StreamPeerBuffer_method_clear: + +- void **clear** **(** **)** + +---- + +.. _class_StreamPeerBuffer_method_duplicate: + +- :ref:`StreamPeerBuffer` **duplicate** **(** **)** |const| + +---- + +.. _class_StreamPeerBuffer_method_get_position: + +- :ref:`int` **get_position** **(** **)** |const| + +---- + +.. _class_StreamPeerBuffer_method_get_size: + +- :ref:`int` **get_size** **(** **)** |const| + +---- + +.. _class_StreamPeerBuffer_method_resize: + +- void **resize** **(** :ref:`int` size **)** + +---- + +.. _class_StreamPeerBuffer_method_seek: + +- void **seek** **(** :ref:`int` position **)** + +.. |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.)` diff --git a/classes/class_streampeergdnative.rst b/classes/class_streampeergdnative.rst new file mode 100644 index 0000000..5322ed3 --- /dev/null +++ b/classes/class_streampeergdnative.rst @@ -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 StreamPeerGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamPeerGDNative: + +StreamPeerGDNative +================== + +**Inherits:** :ref:`StreamPeer` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_streampeerssl.rst b/classes/class_streampeerssl.rst new file mode 100644 index 0000000..c135182 --- /dev/null +++ b/classes/class_streampeerssl.rst @@ -0,0 +1,135 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StreamPeerSSL.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamPeerSSL: + +StreamPeerSSL +============= + +**Inherits:** :ref:`StreamPeer` **<** :ref:`Reference` **<** :ref:`Object` + +SSL stream peer. + +Description +----------- + +SSL stream peer. This object can be used to connect to an SSL server or accept a single SSL client connection. + +Tutorials +--------- + +- :doc:`../tutorials/networking/ssl_certificates` + +Properties +---------- + ++-------------------------+----------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`blocking_handshake` | ``true`` | ++-------------------------+----------------------------------------------------------------------------+----------+ + +Methods +------- + ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`accept_stream` **(** :ref:`StreamPeer` stream, :ref:`CryptoKey` private_key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_stream` **(** :ref:`StreamPeer` stream, :ref:`bool` validate_certs=false, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_from_stream` **(** **)** | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_status` **(** **)** |const| | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`poll` **(** **)** | ++------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_StreamPeerSSL_Status: + +.. _class_StreamPeerSSL_constant_STATUS_DISCONNECTED: + +.. _class_StreamPeerSSL_constant_STATUS_HANDSHAKING: + +.. _class_StreamPeerSSL_constant_STATUS_CONNECTED: + +.. _class_StreamPeerSSL_constant_STATUS_ERROR: + +.. _class_StreamPeerSSL_constant_STATUS_ERROR_HOSTNAME_MISMATCH: + +enum **Status**: + +- **STATUS_DISCONNECTED** = **0** --- A status representing a ``StreamPeerSSL`` that is disconnected. + +- **STATUS_HANDSHAKING** = **1** --- A status representing a ``StreamPeerSSL`` during handshaking. + +- **STATUS_CONNECTED** = **2** --- A status representing a ``StreamPeerSSL`` that is connected to a host. + +- **STATUS_ERROR** = **3** --- A status representing a ``StreamPeerSSL`` in error state. + +- **STATUS_ERROR_HOSTNAME_MISMATCH** = **4** --- An error status that shows a mismatch in the SSL certificate domain presented by the host and the domain requested for validation. + +Property Descriptions +--------------------- + +.. _class_StreamPeerSSL_property_blocking_handshake: + +- :ref:`bool` **blocking_handshake** + ++-----------+---------------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------------+ +| *Setter* | set_blocking_handshake_enabled(value) | ++-----------+---------------------------------------+ +| *Getter* | is_blocking_handshake_enabled() | ++-----------+---------------------------------------+ + +Method Descriptions +------------------- + +.. _class_StreamPeerSSL_method_accept_stream: + +- :ref:`Error` **accept_stream** **(** :ref:`StreamPeer` stream, :ref:`CryptoKey` private_key, :ref:`X509Certificate` certificate, :ref:`X509Certificate` chain=null **)** + +Accepts a peer connection as a server using the given ``private_key`` and providing the given ``certificate`` to the client. You can pass the optional ``chain`` parameter to provide additional CA chain information along with the certificate. + +---- + +.. _class_StreamPeerSSL_method_connect_to_stream: + +- :ref:`Error` **connect_to_stream** **(** :ref:`StreamPeer` stream, :ref:`bool` validate_certs=false, :ref:`String` for_hostname="", :ref:`X509Certificate` valid_certificate=null **)** + +Connects to a peer using an underlying :ref:`StreamPeer` ``stream``. If ``validate_certs`` is ``true``, ``StreamPeerSSL`` will validate that the certificate presented by the peer matches the ``for_hostname``. + +**Note:** Specifying a custom ``valid_certificate`` is not supported in HTML5 exports due to browsers restrictions. + +---- + +.. _class_StreamPeerSSL_method_disconnect_from_stream: + +- void **disconnect_from_stream** **(** **)** + +Disconnects from host. + +---- + +.. _class_StreamPeerSSL_method_get_status: + +- :ref:`Status` **get_status** **(** **)** |const| + +Returns the status of the connection. See :ref:`Status` for values. + +---- + +.. _class_StreamPeerSSL_method_poll: + +- void **poll** **(** **)** + +Poll the connection to check for incoming bytes. Call this right before :ref:`StreamPeer.get_available_bytes` for it to work properly. + +.. |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.)` diff --git a/classes/class_streampeertcp.rst b/classes/class_streampeertcp.rst new file mode 100644 index 0000000..004d512 --- /dev/null +++ b/classes/class_streampeertcp.rst @@ -0,0 +1,124 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StreamPeerTCP.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamPeerTCP: + +StreamPeerTCP +============= + +**Inherits:** :ref:`StreamPeer` **<** :ref:`Reference` **<** :ref:`Object` + +TCP stream peer. + +Description +----------- + +TCP stream peer. This object can be used to connect to TCP servers, or also is returned by a TCP server. + +Methods +------- + ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_host` **(** :ref:`String` host, :ref:`int` port **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_from_host` **(** **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Status` | :ref:`get_status` **(** **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connected_to_host` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_no_delay` **(** :ref:`bool` enabled **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_StreamPeerTCP_Status: + +.. _class_StreamPeerTCP_constant_STATUS_NONE: + +.. _class_StreamPeerTCP_constant_STATUS_CONNECTING: + +.. _class_StreamPeerTCP_constant_STATUS_CONNECTED: + +.. _class_StreamPeerTCP_constant_STATUS_ERROR: + +enum **Status**: + +- **STATUS_NONE** = **0** --- The initial status of the ``StreamPeerTCP``. This is also the status after disconnecting. + +- **STATUS_CONNECTING** = **1** --- A status representing a ``StreamPeerTCP`` that is connecting to a host. + +- **STATUS_CONNECTED** = **2** --- A status representing a ``StreamPeerTCP`` that is connected to a host. + +- **STATUS_ERROR** = **3** --- A status representing a ``StreamPeerTCP`` in error state. + +Method Descriptions +------------------- + +.. _class_StreamPeerTCP_method_connect_to_host: + +- :ref:`Error` **connect_to_host** **(** :ref:`String` host, :ref:`int` port **)** + +Connects to the specified ``host:port`` pair. A hostname will be resolved if valid. Returns :ref:`@GlobalScope.OK` on success or :ref:`@GlobalScope.FAILED` on failure. + +---- + +.. _class_StreamPeerTCP_method_disconnect_from_host: + +- void **disconnect_from_host** **(** **)** + +Disconnects from host. + +---- + +.. _class_StreamPeerTCP_method_get_connected_host: + +- :ref:`String` **get_connected_host** **(** **)** |const| + +Returns the IP of this peer. + +---- + +.. _class_StreamPeerTCP_method_get_connected_port: + +- :ref:`int` **get_connected_port** **(** **)** |const| + +Returns the port of this peer. + +---- + +.. _class_StreamPeerTCP_method_get_status: + +- :ref:`Status` **get_status** **(** **)** + +Returns the status of the connection, see :ref:`Status`. + +---- + +.. _class_StreamPeerTCP_method_is_connected_to_host: + +- :ref:`bool` **is_connected_to_host** **(** **)** |const| + +Returns ``true`` if this peer is currently connected or is connecting to a host, ``false`` otherwise. + +---- + +.. _class_StreamPeerTCP_method_set_no_delay: + +- void **set_no_delay** **(** :ref:`bool` enabled **)** + +If ``enabled`` is ``true``, packets will be sent immediately. If ``enabled`` is ``false`` (the default), packet transfers will be delayed and combined using `Nagle's algorithm `__. + +**Note:** It's recommended to leave this disabled for applications that send large packets or need to transfer a lot of data, as enabling this can decrease the total available bandwidth. + +.. |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.)` diff --git a/classes/class_streamtexture.rst b/classes/class_streamtexture.rst new file mode 100644 index 0000000..26a8ffa --- /dev/null +++ b/classes/class_streamtexture.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StreamTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StreamTexture: + +StreamTexture +============= + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A ``.stex`` texture. + +Description +----------- + +A texture that is loaded from a ``.stex`` file. + +Properties +---------- + ++-----------------------------+----------------------------------------------------------+---------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++-----------------------------+----------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`load_path` | ``""`` | ++-----------------------------+----------------------------------------------------------+---------------------------+ + +Methods +------- + ++---------------------------------------+-------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++---------------------------------------+-------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_StreamTexture_property_load_path: + +- :ref:`String` **load_path** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | load(value) | ++-----------+-----------------+ +| *Getter* | get_load_path() | ++-----------+-----------------+ + +The StreamTexture's file path to a ``.stex`` file. + +Method Descriptions +------------------- + +.. _class_StreamTexture_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path **)** + +Loads the texture from the given 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.)` diff --git a/classes/class_string.rst b/classes/class_string.rst new file mode 100644 index 0000000..e6f2b03 --- /dev/null +++ b/classes/class_string.rst @@ -0,0 +1,1190 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the String.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_String: + +String +====== + +Built-in string class. + +Description +----------- + +This is the built-in string class (and the one used by GDScript). It supports Unicode and provides all necessary means for string handling. Strings are reference-counted and use a copy-on-write approach, so passing them around is cheap in resources. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/gdscript/gdscript_format_string` + +Methods +------- + ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`bool` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`int` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`float` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Vector2` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Rect2` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Vector3` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Transform2D` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Plane` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Quat` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`AABB` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Basis` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Transform` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Color` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`NodePath` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`RID` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Dictionary` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`Array` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolByteArray` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolIntArray` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolRealArray` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolStringArray` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolVector2Array` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolVector3Array` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`String` **(** :ref:`PoolColorArray` from **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`begins_with` **(** :ref:`String` text **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`bigrams` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`c_escape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`c_unescape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`capitalize` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`casecmp_to` **(** :ref:`String` to **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`count` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`countn` **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`dedent` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`empty` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`ends_with` **(** :ref:`String` text **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase` **(** :ref:`int` position, :ref:`int` chars **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find` **(** :ref:`String` what, :ref:`int` from=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_last` **(** :ref:`String` what **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`findn` **(** :ref:`String` what, :ref:`int` from=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`format` **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_base_dir` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_basename` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_extension` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hash` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`hex_to_int` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`http_escape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`http_unescape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`humanize_size` **(** :ref:`int` size **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`indent` **(** :ref:`String` prefix **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`insert` **(** :ref:`int` position, :ref:`String` what **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_abs_path` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_rel_path` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_subsequence_of` **(** :ref:`String` text **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_subsequence_ofi` **(** :ref:`String` text **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_filename` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_float` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_hex_number` **(** :ref:`bool` with_prefix=false **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_html_color` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_identifier` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_integer` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_ip_address` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`json_escape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`left` **(** :ref:`int` position **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`length` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`lstrip` **(** :ref:`String` chars **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`match` **(** :ref:`String` expr **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`matchn` **(** :ref:`String` expr **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`md5_buffer` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`md5_text` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`naturalnocasecmp_to` **(** :ref:`String` to **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`nocasecmp_to` **(** :ref:`String` to **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`ord_at` **(** :ref:`int` at **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`pad_decimals` **(** :ref:`int` digits **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`pad_zeros` **(** :ref:`int` digits **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`percent_decode` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`percent_encode` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`plus_file` **(** :ref:`String` file **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`repeat` **(** :ref:`int` count **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`replace` **(** :ref:`String` what, :ref:`String` forwhat **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`replacen` **(** :ref:`String` what, :ref:`String` forwhat **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfind` **(** :ref:`String` what, :ref:`int` from=-1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`rfindn` **(** :ref:`String` what, :ref:`int` from=-1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`right` **(** :ref:`int` position **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`rsplit` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`rstrip` **(** :ref:`String` chars **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`sha1_buffer` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`sha1_text` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`sha256_buffer` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`sha256_text` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`similarity` **(** :ref:`String` text **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`simplify_path` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`split` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolRealArray` | :ref:`split_floats` **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`strip_edges` **(** :ref:`bool` left=true, :ref:`bool` right=true **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`strip_escapes` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`substr` **(** :ref:`int` from, :ref:`int` len=-1 **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`to_ascii` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`to_float` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`to_int` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_lower` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`to_upper` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`to_utf8` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`to_wchar` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`trim_prefix` **(** :ref:`String` prefix **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`trim_suffix` **(** :ref:`String` suffix **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`validate_node_name` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`xml_escape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`xml_unescape` **(** **)** | ++-----------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_String_method_String: + +- :ref:`String` **String** **(** :ref:`bool` from **)** + +Constructs a new String from the given :ref:`bool`. + +---- + +- :ref:`String` **String** **(** :ref:`int` from **)** + +Constructs a new String from the given :ref:`int`. + +---- + +- :ref:`String` **String** **(** :ref:`float` from **)** + +Constructs a new String from the given :ref:`float`. + +---- + +- :ref:`String` **String** **(** :ref:`Vector2` from **)** + +Constructs a new String from the given :ref:`Vector2`. + +---- + +- :ref:`String` **String** **(** :ref:`Rect2` from **)** + +Constructs a new String from the given :ref:`Rect2`. + +---- + +- :ref:`String` **String** **(** :ref:`Vector3` from **)** + +Constructs a new String from the given :ref:`Vector3`. + +---- + +- :ref:`String` **String** **(** :ref:`Transform2D` from **)** + +Constructs a new String from the given :ref:`Transform2D`. + +---- + +- :ref:`String` **String** **(** :ref:`Plane` from **)** + +Constructs a new String from the given :ref:`Plane`. + +---- + +- :ref:`String` **String** **(** :ref:`Quat` from **)** + +Constructs a new String from the given :ref:`Quat`. + +---- + +- :ref:`String` **String** **(** :ref:`AABB` from **)** + +Constructs a new String from the given :ref:`AABB`. + +---- + +- :ref:`String` **String** **(** :ref:`Basis` from **)** + +Constructs a new String from the given :ref:`Basis`. + +---- + +- :ref:`String` **String** **(** :ref:`Transform` from **)** + +Constructs a new String from the given :ref:`Transform`. + +---- + +- :ref:`String` **String** **(** :ref:`Color` from **)** + +Constructs a new String from the given :ref:`Color`. + +---- + +- :ref:`String` **String** **(** :ref:`NodePath` from **)** + +Constructs a new String from the given :ref:`NodePath`. + +---- + +- :ref:`String` **String** **(** :ref:`RID` from **)** + +Constructs a new String from the given :ref:`RID`. + +---- + +- :ref:`String` **String** **(** :ref:`Dictionary` from **)** + +Constructs a new String from the given :ref:`Dictionary`. + +---- + +- :ref:`String` **String** **(** :ref:`Array` from **)** + +Constructs a new String from the given :ref:`Array`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolByteArray` from **)** + +Constructs a new String from the given :ref:`PoolByteArray`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolIntArray` from **)** + +Constructs a new String from the given :ref:`PoolIntArray`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolRealArray` from **)** + +Constructs a new String from the given :ref:`PoolRealArray`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolStringArray` from **)** + +Constructs a new String from the given :ref:`PoolStringArray`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolVector2Array` from **)** + +Constructs a new String from the given :ref:`PoolVector2Array`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolVector3Array` from **)** + +Constructs a new String from the given :ref:`PoolVector3Array`. + +---- + +- :ref:`String` **String** **(** :ref:`PoolColorArray` from **)** + +Constructs a new String from the given :ref:`PoolColorArray`. + +---- + +.. _class_String_method_begins_with: + +- :ref:`bool` **begins_with** **(** :ref:`String` text **)** + +Returns ``true`` if the string begins with the given string. + +---- + +.. _class_String_method_bigrams: + +- :ref:`PoolStringArray` **bigrams** **(** **)** + +Returns the bigrams (pairs of consecutive letters) of this string. + +---- + +.. _class_String_method_c_escape: + +- :ref:`String` **c_escape** **(** **)** + +Returns a copy of the string with special characters escaped using the C language standard. + +---- + +.. _class_String_method_c_unescape: + +- :ref:`String` **c_unescape** **(** **)** + +Returns a copy of the string with escaped characters replaced by their meanings. Supported escape sequences are ``\'``, ``\"``, ``\?``, ``\\``, ``\a``, ``\b``, ``\f``, ``\n``, ``\r``, ``\t``, ``\v``. + +**Note:** Unlike the GDScript parser, this method doesn't support the ``\uXXXX`` escape sequence. + +---- + +.. _class_String_method_capitalize: + +- :ref:`String` **capitalize** **(** **)** + +Changes the case of some letters. Replaces underscores with spaces, adds spaces before in-word uppercase characters, converts all letters to lowercase, then capitalizes the first letter and every letter following a space character. For ``capitalize camelCase mixed_with_underscores``, it will return ``Capitalize Camel Case Mixed With Underscores``. + +---- + +.. _class_String_method_casecmp_to: + +- :ref:`int` **casecmp_to** **(** :ref:`String` to **)** + +Performs a case-sensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. + +**Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. + +**Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. + +To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to`. + +---- + +.. _class_String_method_count: + +- :ref:`int` **count** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** + +Returns the number of occurrences of substring ``what`` between ``from`` and ``to`` positions. If ``from`` and ``to`` equals 0 the whole string will be used. If only ``to`` equals 0 the remained substring will be used. + +---- + +.. _class_String_method_countn: + +- :ref:`int` **countn** **(** :ref:`String` what, :ref:`int` from=0, :ref:`int` to=0 **)** + +Returns the number of occurrences of substring ``what`` (ignoring case) between ``from`` and ``to`` positions. If ``from`` and ``to`` equals 0 the whole string will be used. If only ``to`` equals 0 the remained substring will be used. + +---- + +.. _class_String_method_dedent: + +- :ref:`String` **dedent** **(** **)** + +Returns a copy of the string with indentation (leading tabs and spaces) removed. See also :ref:`indent` to add indentation. + +---- + +.. _class_String_method_empty: + +- :ref:`bool` **empty** **(** **)** + +Returns ``true`` if the length of the string equals ``0``. + +---- + +.. _class_String_method_ends_with: + +- :ref:`bool` **ends_with** **(** :ref:`String` text **)** + +Returns ``true`` if the string ends with the given string. + +---- + +.. _class_String_method_erase: + +- void **erase** **(** :ref:`int` position, :ref:`int` chars **)** + +Erases ``chars`` characters from the string starting from ``position``. + +---- + +.. _class_String_method_find: + +- :ref:`int` **find** **(** :ref:`String` what, :ref:`int` from=0 **)** + +Finds the first occurrence of a substring. Returns the starting position of the substring or ``-1`` if not found. Optionally, the initial search index can be passed. + +**Note:** If you just want to know whether a string contains a substring, use the ``in`` operator as follows: + +:: + + # Will evaluate to `false`. + if "i" in "team": + pass + +---- + +.. _class_String_method_find_last: + +- :ref:`int` **find_last** **(** :ref:`String` what **)** + +Finds the last occurrence of a substring. Returns the starting position of the substring or ``-1`` if not found. + +---- + +.. _class_String_method_findn: + +- :ref:`int` **findn** **(** :ref:`String` what, :ref:`int` from=0 **)** + +Finds the first occurrence of a substring, ignoring case. Returns the starting position of the substring or ``-1`` if not found. Optionally, the initial search index can be passed. + +---- + +.. _class_String_method_format: + +- :ref:`String` **format** **(** :ref:`Variant` values, :ref:`String` placeholder="{_}" **)** + +Formats the string by replacing all occurrences of ``placeholder`` with ``values``. + +---- + +.. _class_String_method_get_base_dir: + +- :ref:`String` **get_base_dir** **(** **)** + +If the string is a valid file path, returns the base directory name. + +---- + +.. _class_String_method_get_basename: + +- :ref:`String` **get_basename** **(** **)** + +If the string is a valid file path, returns the full file path without the extension. + +---- + +.. _class_String_method_get_extension: + +- :ref:`String` **get_extension** **(** **)** + +Returns the extension without the leading period character (``.``) if the string is a valid file name or path. If the string does not contain an extension, returns an empty string instead. + +:: + + print("/path/to/file.txt".get_extension()) # "txt" + print("file.txt".get_extension()) # "txt" + print("file.sample.txt".get_extension()) # "txt" + print(".txt".get_extension()) # "txt" + print("file.txt.".get_extension()) # "" (empty string) + print("file.txt..".get_extension()) # "" (empty string) + print("txt".get_extension()) # "" (empty string) + print("".get_extension()) # "" (empty string) + +---- + +.. _class_String_method_get_file: + +- :ref:`String` **get_file** **(** **)** + +If the string is a valid file path, returns the filename. + +---- + +.. _class_String_method_hash: + +- :ref:`int` **hash** **(** **)** + +Returns the 32-bit hash value representing the string's contents. + +**Note:** ``String``\ s with equal content will always produce identical hash values. However, the reverse is not true. Returning identical hash values does *not* imply the strings are equal, because different strings can have identical hash values due to hash collisions. + +---- + +.. _class_String_method_hex_to_int: + +- :ref:`int` **hex_to_int** **(** **)** + +Converts a string containing a hexadecimal number into an integer. Hexadecimal strings are expected to be prefixed with "``0x``" otherwise ``0`` is returned. + +:: + + print("0xff".hex_to_int()) # Print "255" + +---- + +.. _class_String_method_http_escape: + +- :ref:`String` **http_escape** **(** **)** + +Escapes (encodes) a string to URL friendly format. Also referred to as 'URL encode'. + +:: + + print("https://example.org/?escaped=" + "Godot Engine:'docs'".http_escape()) + +---- + +.. _class_String_method_http_unescape: + +- :ref:`String` **http_unescape** **(** **)** + +Unescapes (decodes) a string in URL encoded format. Also referred to as 'URL decode'. + +:: + + print("https://example.org/?escaped=" + "Godot%20Engine%3A%27docs%27".http_unescape()) + +---- + +.. _class_String_method_humanize_size: + +- :ref:`String` **humanize_size** **(** :ref:`int` size **)** + +Converts ``size`` represented as number of bytes to human-readable format using internationalized set of data size units, namely: B, KiB, MiB, GiB, TiB, PiB, EiB. Note that the next smallest unit is picked automatically to hold at most 1024 units. + +:: + + var bytes = 133790307 + var size = String.humanize_size(bytes) + print(size) # prints "127.5 MiB" + +---- + +.. _class_String_method_indent: + +- :ref:`String` **indent** **(** :ref:`String` prefix **)** + +Returns a copy of the string with lines indented with ``prefix``. + +For example, the string can be indented with two tabs using ``"\t\t"``, or four spaces using ``" "``. The prefix can be any string so it can also be used to comment out strings with e.g. ``"# "``. See also :ref:`dedent` to remove indentation. + +**Note:** Empty lines are kept empty. + +---- + +.. _class_String_method_insert: + +- :ref:`String` **insert** **(** :ref:`int` position, :ref:`String` what **)** + +Returns a copy of the string with the substring ``what`` inserted at the given position. + +---- + +.. _class_String_method_is_abs_path: + +- :ref:`bool` **is_abs_path** **(** **)** + +If the string is a path to a file or directory, returns ``true`` if the path is absolute. + +---- + +.. _class_String_method_is_rel_path: + +- :ref:`bool` **is_rel_path** **(** **)** + +If the string is a path to a file or directory, returns ``true`` if the path is relative. + +---- + +.. _class_String_method_is_subsequence_of: + +- :ref:`bool` **is_subsequence_of** **(** :ref:`String` text **)** + +Returns ``true`` if this string is a subsequence of the given string. + +---- + +.. _class_String_method_is_subsequence_ofi: + +- :ref:`bool` **is_subsequence_ofi** **(** :ref:`String` text **)** + +Returns ``true`` if this string is a subsequence of the given string, without considering case. + +---- + +.. _class_String_method_is_valid_filename: + +- :ref:`bool` **is_valid_filename** **(** **)** + +Returns ``true`` if this string is free from characters that aren't allowed in file names, those being: + +``: / \ ? * " | % < >`` + +---- + +.. _class_String_method_is_valid_float: + +- :ref:`bool` **is_valid_float** **(** **)** + +Returns ``true`` if this string contains a valid float. + +---- + +.. _class_String_method_is_valid_hex_number: + +- :ref:`bool` **is_valid_hex_number** **(** :ref:`bool` with_prefix=false **)** + +Returns ``true`` if this string contains a valid hexadecimal number. If ``with_prefix`` is ``true``, then a validity of the hexadecimal number is determined by ``0x`` prefix, for instance: ``0xDEADC0DE``. + +---- + +.. _class_String_method_is_valid_html_color: + +- :ref:`bool` **is_valid_html_color** **(** **)** + +Returns ``true`` if this string contains a valid color in hexadecimal HTML notation. Other HTML notations such as named colors or ``hsl()`` colors aren't considered valid by this method and will return ``false``. + +---- + +.. _class_String_method_is_valid_identifier: + +- :ref:`bool` **is_valid_identifier** **(** **)** + +Returns ``true`` if this string is a valid identifier. A valid identifier may contain only letters, digits and underscores (``_``) and the first character may not be a digit. + +---- + +.. _class_String_method_is_valid_integer: + +- :ref:`bool` **is_valid_integer** **(** **)** + +Returns ``true`` if this string contains a valid integer. + +---- + +.. _class_String_method_is_valid_ip_address: + +- :ref:`bool` **is_valid_ip_address** **(** **)** + +Returns ``true`` if this string contains only a well-formatted IPv4 or IPv6 address. This method considers `reserved IP addresses `__ such as ``0.0.0.0`` as valid. + +---- + +.. _class_String_method_json_escape: + +- :ref:`String` **json_escape** **(** **)** + +Returns a copy of the string with special characters escaped using the JSON standard. + +---- + +.. _class_String_method_left: + +- :ref:`String` **left** **(** :ref:`int` position **)** + +Returns a number of characters from the left of the string. + +---- + +.. _class_String_method_length: + +- :ref:`int` **length** **(** **)** + +Returns the string's amount of characters. + +---- + +.. _class_String_method_lstrip: + +- :ref:`String` **lstrip** **(** :ref:`String` chars **)** + +Returns a copy of the string with characters removed from the left. The ``chars`` argument is a string specifying the set of characters to be removed. + +**Note:** The ``chars`` is not a prefix. See :ref:`trim_prefix` method that will remove a single prefix string rather than a set of characters. + +---- + +.. _class_String_method_match: + +- :ref:`bool` **match** **(** :ref:`String` expr **)** + +Does a simple case-sensitive expression match, where ``"*"`` matches zero or more arbitrary characters and ``"?"`` matches any single character except a period (``"."``). + +---- + +.. _class_String_method_matchn: + +- :ref:`bool` **matchn** **(** :ref:`String` expr **)** + +Does a simple case-insensitive expression match, where ``"*"`` matches zero or more arbitrary characters and ``"?"`` matches any single character except a period (``"."``). + +---- + +.. _class_String_method_md5_buffer: + +- :ref:`PoolByteArray` **md5_buffer** **(** **)** + +Returns the MD5 hash of the string as an array of bytes. + +---- + +.. _class_String_method_md5_text: + +- :ref:`String` **md5_text** **(** **)** + +Returns the MD5 hash of the string as a string. + +---- + +.. _class_String_method_naturalnocasecmp_to: + +- :ref:`int` **naturalnocasecmp_to** **(** :ref:`String` to **)** + +Performs a case-insensitive *natural order* comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. + +When used for sorting, natural order comparison will order suites of numbers as expected by most people. If you sort the numbers from 1 to 10 using natural order, you will get ``[1, 2, 3, ...]`` instead of ``[1, 10, 2, 3, ...]``. + +**Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. + +**Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. + +To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`nocasecmp_to` and :ref:`casecmp_to`. + +---- + +.. _class_String_method_nocasecmp_to: + +- :ref:`int` **nocasecmp_to** **(** :ref:`String` to **)** + +Performs a case-insensitive comparison to another string. Returns ``-1`` if less than, ``1`` if greater than, or ``0`` if equal. "less than" or "greater than" are determined by the `Unicode code points `__ of each string, which roughly matches the alphabetical order. Internally, lowercase characters will be converted to uppercase during the comparison. + +**Behavior with different string lengths:** Returns ``1`` if the "base" string is longer than the ``to`` string or ``-1`` if the "base" string is shorter than the ``to`` string. Keep in mind this length is determined by the number of Unicode codepoints, *not* the actual visible characters. + +**Behavior with empty strings:** Returns ``-1`` if the "base" string is empty, ``1`` if the ``to`` string is empty or ``0`` if both strings are empty. + +To get a boolean result from a string comparison, use the ``==`` operator instead. See also :ref:`casecmp_to`. + +---- + +.. _class_String_method_ord_at: + +- :ref:`int` **ord_at** **(** :ref:`int` at **)** + +Returns the character code at position ``at``. + +---- + +.. _class_String_method_pad_decimals: + +- :ref:`String` **pad_decimals** **(** :ref:`int` digits **)** + +Formats a number to have an exact number of ``digits`` after the decimal point. + +---- + +.. _class_String_method_pad_zeros: + +- :ref:`String` **pad_zeros** **(** :ref:`int` digits **)** + +Formats a number to have an exact number of ``digits`` before the decimal point. + +---- + +.. _class_String_method_percent_decode: + +- :ref:`String` **percent_decode** **(** **)** + +Decode a percent-encoded string. See :ref:`percent_encode`. + +---- + +.. _class_String_method_percent_encode: + +- :ref:`String` **percent_encode** **(** **)** + +Percent-encodes a string. Encodes parameters in a URL when sending a HTTP GET request (and bodies of form-urlencoded POST requests). + +---- + +.. _class_String_method_plus_file: + +- :ref:`String` **plus_file** **(** :ref:`String` file **)** + +If the string is a path, this concatenates ``file`` at the end of the string as a subpath. E.g. ``"this/is".plus_file("path") == "this/is/path"``. + +---- + +.. _class_String_method_repeat: + +- :ref:`String` **repeat** **(** :ref:`int` count **)** + +Returns original string repeated a number of times. The number of repetitions is given by the argument. + +---- + +.. _class_String_method_replace: + +- :ref:`String` **replace** **(** :ref:`String` what, :ref:`String` forwhat **)** + +Replaces occurrences of a case-sensitive substring with the given one inside the string. + +---- + +.. _class_String_method_replacen: + +- :ref:`String` **replacen** **(** :ref:`String` what, :ref:`String` forwhat **)** + +Replaces occurrences of a case-insensitive substring with the given one inside the string. + +---- + +.. _class_String_method_rfind: + +- :ref:`int` **rfind** **(** :ref:`String` what, :ref:`int` from=-1 **)** + +Performs a case-sensitive search for a substring, but starts from the end of the string instead of the beginning. + +---- + +.. _class_String_method_rfindn: + +- :ref:`int` **rfindn** **(** :ref:`String` what, :ref:`int` from=-1 **)** + +Performs a case-insensitive search for a substring, but starts from the end of the string instead of the beginning. + +---- + +.. _class_String_method_right: + +- :ref:`String` **right** **(** :ref:`int` position **)** + +Returns the right side of the string from a given position. + +---- + +.. _class_String_method_rsplit: + +- :ref:`PoolStringArray` **rsplit** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** + +Splits the string by a ``delimiter`` string and returns an array of the substrings, starting from right. + +The splits in the returned array are sorted in the same order as the original string, from left to right. + +If ``maxsplit`` is specified, it defines the number of splits to do from the right up to ``maxsplit``. The default value of 0 means that all items are split, thus giving the same result as :ref:`split`. + +Example: + +:: + + var some_string = "One,Two,Three,Four" + var some_array = some_string.rsplit(",", true, 1) + print(some_array.size()) # Prints 2 + print(some_array[0]) # Prints "Four" + print(some_array[1]) # Prints "Three,Two,One" + +---- + +.. _class_String_method_rstrip: + +- :ref:`String` **rstrip** **(** :ref:`String` chars **)** + +Returns a copy of the string with characters removed from the right. The ``chars`` argument is a string specifying the set of characters to be removed. + +**Note:** The ``chars`` is not a suffix. See :ref:`trim_suffix` method that will remove a single suffix string rather than a set of characters. + +---- + +.. _class_String_method_sha1_buffer: + +- :ref:`PoolByteArray` **sha1_buffer** **(** **)** + +Returns the SHA-1 hash of the string as an array of bytes. + +---- + +.. _class_String_method_sha1_text: + +- :ref:`String` **sha1_text** **(** **)** + +Returns the SHA-1 hash of the string as a string. + +---- + +.. _class_String_method_sha256_buffer: + +- :ref:`PoolByteArray` **sha256_buffer** **(** **)** + +Returns the SHA-256 hash of the string as an array of bytes. + +---- + +.. _class_String_method_sha256_text: + +- :ref:`String` **sha256_text** **(** **)** + +Returns the SHA-256 hash of the string as a string. + +---- + +.. _class_String_method_similarity: + +- :ref:`float` **similarity** **(** :ref:`String` text **)** + +Returns the similarity index of the text compared to this string. 1 means totally similar and 0 means totally dissimilar. + +---- + +.. _class_String_method_simplify_path: + +- :ref:`String` **simplify_path** **(** **)** + +Returns a simplified canonical path. + +---- + +.. _class_String_method_split: + +- :ref:`PoolStringArray` **split** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true, :ref:`int` maxsplit=0 **)** + +Splits the string by a ``delimiter`` string and returns an array of the substrings. The ``delimiter`` can be of any length. + +If ``maxsplit`` is specified, it defines the number of splits to do from the left up to ``maxsplit``. The default value of ``0`` means that all items are split. + +Example: + +:: + + var some_string = "One,Two,Three,Four" + var some_array = some_string.split(",", true, 1) + print(some_array.size()) # Prints 2 + print(some_array[0]) # Prints "One" + print(some_array[1]) # Prints "Two,Three,Four" + +If you need to split strings with more complex rules, use the :ref:`RegEx` class instead. + +---- + +.. _class_String_method_split_floats: + +- :ref:`PoolRealArray` **split_floats** **(** :ref:`String` delimiter, :ref:`bool` allow_empty=true **)** + +Splits the string in floats by using a delimiter string and returns an array of the substrings. + +For example, ``"1,2.5,3"`` will return ``[1,2.5,3]`` if split by ``","``. + +---- + +.. _class_String_method_strip_edges: + +- :ref:`String` **strip_edges** **(** :ref:`bool` left=true, :ref:`bool` right=true **)** + +Returns a copy of the string stripped of any non-printable character (including tabulations, spaces and line breaks) at the beginning and the end. The optional arguments are used to toggle stripping on the left and right edges respectively. + +---- + +.. _class_String_method_strip_escapes: + +- :ref:`String` **strip_escapes** **(** **)** + +Returns a copy of the string stripped of any escape character. These include all non-printable control characters of the first page of the ASCII table (< 32), such as tabulation (``\t`` in C) and newline (``\n`` and ``\r``) characters, but not spaces. + +---- + +.. _class_String_method_substr: + +- :ref:`String` **substr** **(** :ref:`int` from, :ref:`int` len=-1 **)** + +Returns part of the string from the position ``from`` with length ``len``. Argument ``len`` is optional and using ``-1`` will return remaining characters from given position. + +---- + +.. _class_String_method_to_ascii: + +- :ref:`PoolByteArray` **to_ascii** **(** **)** + +Converts the String (which is a character array) to :ref:`PoolByteArray` (which is an array of bytes). The conversion is faster compared to :ref:`to_utf8`, as this method assumes that all the characters in the String are ASCII characters. + +---- + +.. _class_String_method_to_float: + +- :ref:`float` **to_float** **(** **)** + +Converts a string containing a decimal number into a ``float``. The method will stop on the first non-number character except the first ``.`` (decimal point), and ``e`` which is used for exponential. + +:: + + print("12.3".to_float()) # 12.3 + print("1.2.3".to_float()) # 1.2 + print("12ab3".to_float()) # 12 + print("1e3".to_float()) # 1000 + +---- + +.. _class_String_method_to_int: + +- :ref:`int` **to_int** **(** **)** + +Converts a string containing an integer number into an ``int``. The method will remove any non-number character and stop if it encounters a ``.``. + +:: + + print("123".to_int()) # 123 + print("a1b2c3".to_int()) # 123 + print("1.2.3".to_int()) # 1 + +---- + +.. _class_String_method_to_lower: + +- :ref:`String` **to_lower** **(** **)** + +Returns the string converted to lowercase. + +---- + +.. _class_String_method_to_upper: + +- :ref:`String` **to_upper** **(** **)** + +Returns the string converted to uppercase. + +---- + +.. _class_String_method_to_utf8: + +- :ref:`PoolByteArray` **to_utf8** **(** **)** + +Converts the String (which is an array of characters) to :ref:`PoolByteArray` (which is an array of bytes). The conversion is a bit slower than :ref:`to_ascii`, but supports all UTF-8 characters. Therefore, you should prefer this function over :ref:`to_ascii`. + +---- + +.. _class_String_method_to_wchar: + +- :ref:`PoolByteArray` **to_wchar** **(** **)** + +Converts the String (which is an array of characters) to :ref:`PoolByteArray` (which is an array of bytes). + +---- + +.. _class_String_method_trim_prefix: + +- :ref:`String` **trim_prefix** **(** :ref:`String` prefix **)** + +Removes a given string from the start if it starts with it or leaves the string unchanged. + +---- + +.. _class_String_method_trim_suffix: + +- :ref:`String` **trim_suffix** **(** :ref:`String` suffix **)** + +Removes a given string from the end if it ends with it or leaves the string unchanged. + +---- + +.. _class_String_method_validate_node_name: + +- :ref:`String` **validate_node_name** **(** **)** + +Removes any characters from the string that are prohibited in :ref:`Node` names (``.`` ``:`` ``@`` ``/`` ``"``). + +---- + +.. _class_String_method_xml_escape: + +- :ref:`String` **xml_escape** **(** **)** + +Returns a copy of the string with special characters escaped using the XML standard. + +---- + +.. _class_String_method_xml_unescape: + +- :ref:`String` **xml_unescape** **(** **)** + +Returns a copy of the string with escaped characters replaced by their meanings according to the XML standard. + +.. |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.)` diff --git a/classes/class_stylebox.rst b/classes/class_stylebox.rst new file mode 100644 index 0000000..9435ecc --- /dev/null +++ b/classes/class_stylebox.rst @@ -0,0 +1,217 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StyleBox.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StyleBox: + +StyleBox +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`StyleBoxEmpty`, :ref:`StyleBoxFlat`, :ref:`StyleBoxLine`, :ref:`StyleBoxTexture` + +Base class for drawing stylized boxes for the UI. + +Description +----------- + +StyleBox is :ref:`Resource` that provides an abstract base class for drawing stylized boxes for the UI. StyleBoxes are used for drawing the styles of buttons, line edit backgrounds, tree backgrounds, etc. and also for testing a transparency mask for pointer signals. If mask test fails on a StyleBox assigned as mask to a control, clicks and motion signals will go through it to the one below. + +**Note:** For children of :ref:`Control` that have *Theme Properties*, the ``focus`` ``StyleBox`` is displayed over the ``normal``, ``hover`` or ``pressed`` ``StyleBox``. This makes the ``focus`` ``StyleBox`` more reusable across different nodes. + +Properties +---------- + ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_bottom` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_left` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_right` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ +| :ref:`float` | :ref:`content_margin_top` | ``-1.0`` | ++---------------------------+-----------------------------------------------------------------------------+----------+ + +Methods +------- + ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Rect2` rect **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_center_size` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`CanvasItem` | :ref:`get_current_item_drawn` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_default_margin` **(** :ref:`Margin` margin **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_margin` **(** :ref:`Margin` margin **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_minimum_size` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_offset` **(** **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_margin` **(** :ref:`Margin` margin, :ref:`float` offset **)** | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`test_mask` **(** :ref:`Vector2` point, :ref:`Rect2` rect **)** |const| | ++-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_StyleBox_property_content_margin_bottom: + +- :ref:`float` **content_margin_bottom** + ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_default_margin() | ++-----------+---------------------------+ + +The bottom margin for the contents of this style box. Increasing this value reduces the space available to the contents from the bottom. + +If this value is negative, it is ignored and a child-specific margin is used instead. For example for :ref:`StyleBoxFlat` the border thickness (if any) is used instead. + +It is up to the code using this style box to decide what these contents are: for example, a :ref:`Button` respects this content margin for the textual contents of the button. + +:ref:`get_margin` should be used to fetch this value as consumer instead of reading these properties directly. This is because it correctly respects negative values and the fallback mentioned above. + +---- + +.. _class_StyleBox_property_content_margin_left: + +- :ref:`float` **content_margin_left** + ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_default_margin() | ++-----------+---------------------------+ + +The left margin for the contents of this style box. Increasing this value reduces the space available to the contents from the left. + +Refer to :ref:`content_margin_bottom` for extra considerations. + +---- + +.. _class_StyleBox_property_content_margin_right: + +- :ref:`float` **content_margin_right** + ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_default_margin() | ++-----------+---------------------------+ + +The right margin for the contents of this style box. Increasing this value reduces the space available to the contents from the right. + +Refer to :ref:`content_margin_bottom` for extra considerations. + +---- + +.. _class_StyleBox_property_content_margin_top: + +- :ref:`float` **content_margin_top** + ++-----------+---------------------------+ +| *Default* | ``-1.0`` | ++-----------+---------------------------+ +| *Setter* | set_default_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_default_margin() | ++-----------+---------------------------+ + +The top margin for the contents of this style box. Increasing this value reduces the space available to the contents from the top. + +Refer to :ref:`content_margin_bottom` for extra considerations. + +Method Descriptions +------------------- + +.. _class_StyleBox_method_draw: + +- void **draw** **(** :ref:`RID` canvas_item, :ref:`Rect2` rect **)** |const| + +Draws this stylebox using a :ref:`CanvasItem` with given :ref:`RID`. + +You can get a :ref:`RID` value using :ref:`Object.get_instance_id` on a :ref:`CanvasItem`-derived node. + +---- + +.. _class_StyleBox_method_get_center_size: + +- :ref:`Vector2` **get_center_size** **(** **)** |const| + +Returns the size of this ``StyleBox`` without the margins. + +---- + +.. _class_StyleBox_method_get_current_item_drawn: + +- :ref:`CanvasItem` **get_current_item_drawn** **(** **)** |const| + +Returns the :ref:`CanvasItem` that handles its :ref:`CanvasItem.NOTIFICATION_DRAW` or :ref:`CanvasItem._draw` callback at this moment. + +---- + +.. _class_StyleBox_method_get_default_margin: + +- :ref:`float` **get_default_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the default value of the specified :ref:`Margin`. + +---- + +.. _class_StyleBox_method_get_margin: + +- :ref:`float` **get_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the content margin offset for the specified :ref:`Margin`. + +Positive values reduce size inwards, unlike :ref:`Control`'s margin values. + +---- + +.. _class_StyleBox_method_get_minimum_size: + +- :ref:`Vector2` **get_minimum_size** **(** **)** |const| + +Returns the minimum size that this stylebox can be shrunk to. + +---- + +.. _class_StyleBox_method_get_offset: + +- :ref:`Vector2` **get_offset** **(** **)** |const| + +Returns the "offset" of a stylebox. This helper function returns a value equivalent to ``Vector2(style.get_margin(MARGIN_LEFT), style.get_margin(MARGIN_TOP))``. + +---- + +.. _class_StyleBox_method_set_default_margin: + +- void **set_default_margin** **(** :ref:`Margin` margin, :ref:`float` offset **)** + +Sets the default value of the specified :ref:`Margin` to given ``offset`` in pixels. + +---- + +.. _class_StyleBox_method_test_mask: + +- :ref:`bool` **test_mask** **(** :ref:`Vector2` point, :ref:`Rect2` rect **)** |const| + +Test a position in a rectangle, return whether it passes the mask test. + +.. |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.)` diff --git a/classes/class_styleboxempty.rst b/classes/class_styleboxempty.rst new file mode 100644 index 0000000..b23ddb5 --- /dev/null +++ b/classes/class_styleboxempty.rst @@ -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 StyleBoxEmpty.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StyleBoxEmpty: + +StyleBoxEmpty +============= + +**Inherits:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Empty stylebox (does not display anything). + +Description +----------- + +Empty stylebox (really does not display anything). + +.. |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.)` diff --git a/classes/class_styleboxflat.rst b/classes/class_styleboxflat.rst new file mode 100644 index 0000000..a77e7b2 --- /dev/null +++ b/classes/class_styleboxflat.rst @@ -0,0 +1,580 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StyleBoxFlat.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StyleBoxFlat: + +StyleBoxFlat +============ + +**Inherits:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Customizable :ref:`StyleBox` with a given set of parameters (no texture required). + +Description +----------- + +This :ref:`StyleBox` can be used to achieve all kinds of looks without the need of a texture. The following properties are customizable: + +- Color + +- Border width (individual width for each border) + +- Rounded corners (individual radius for each corner) + +- Shadow (with blur and offset) + +Setting corner radius to high values is allowed. As soon as corners overlap, the stylebox will switch to a relative system. Example: + +:: + + height = 30 + corner_radius_top_left = 50 + corner_radius_bottom_left = 100 + +The relative system now would take the 1:2 ratio of the two left corners to calculate the actual corner width. Both corners added will **never** be more than the height. Result: + +:: + + corner_radius_top_left: 10 + corner_radius_bottom_left: 20 + +Properties +---------- + ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`anti_aliasing` | ``true`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`anti_aliasing_size` | ``0.625`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`Color` | :ref:`bg_color` | ``Color( 0.6, 0.6, 0.6, 1 )`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`border_blend` | ``false`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`Color` | :ref:`border_color` | ``Color( 0.8, 0.8, 0.8, 1 )`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`border_width_bottom` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`border_width_left` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`border_width_right` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`border_width_top` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`corner_detail` | ``8`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`corner_radius_bottom_left` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`corner_radius_bottom_right` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`corner_radius_top_left` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`corner_radius_top_right` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`bool` | :ref:`draw_center` | ``true`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`expand_margin_bottom` | ``0.0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`expand_margin_left` | ``0.0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`expand_margin_right` | ``0.0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`expand_margin_top` | ``0.0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`Color` | :ref:`shadow_color` | ``Color( 0, 0, 0, 0.6 )`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`Vector2` | :ref:`shadow_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ +| :ref:`int` | :ref:`shadow_size` | ``0`` | ++-------------------------------+-------------------------------------------------------------------------------------------+-------------------------------+ + +Methods +------- + ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_border_width` **(** :ref:`Margin` margin **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_border_width_min` **(** **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_corner_radius` **(** :ref:`Corner` corner **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_expand_margin` **(** :ref:`Margin` margin **)** |const| | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_border_width` **(** :ref:`Margin` margin, :ref:`int` width **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_border_width_all` **(** :ref:`int` width **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_corner_radius` **(** :ref:`Corner` corner, :ref:`int` radius **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_corner_radius_all` **(** :ref:`int` radius **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_corner_radius_individual` **(** :ref:`int` radius_top_left, :ref:`int` radius_top_right, :ref:`int` radius_bottom_right, :ref:`int` radius_bottom_left **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin` **(** :ref:`Margin` margin, :ref:`float` size **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin_all` **(** :ref:`float` size **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin_individual` **(** :ref:`float` size_left, :ref:`float` size_top, :ref:`float` size_right, :ref:`float` size_bottom **)** | ++---------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_StyleBoxFlat_property_anti_aliasing: + +- :ref:`bool` **anti_aliasing** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_anti_aliased(value) | ++-----------+-------------------------+ +| *Getter* | is_anti_aliased() | ++-----------+-------------------------+ + +Antialiasing draws a small ring around the edges, which fades to transparency. As a result, edges look much smoother. This is only noticeable when using rounded corners. + +**Note:** When using beveled corners with 45-degree angles (:ref:`corner_detail` = 1), it is recommended to set :ref:`anti_aliasing` to ``false`` to ensure crisp visuals and avoid possible visual glitches. + +---- + +.. _class_StyleBoxFlat_property_anti_aliasing_size: + +- :ref:`float` **anti_aliasing_size** + ++-----------+--------------------+ +| *Default* | ``0.625`` | ++-----------+--------------------+ +| *Setter* | set_aa_size(value) | ++-----------+--------------------+ +| *Getter* | get_aa_size() | ++-----------+--------------------+ + +This changes the size of the faded ring. Higher values can be used to achieve a "blurry" effect. + +---- + +.. _class_StyleBoxFlat_property_bg_color: + +- :ref:`Color` **bg_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.6, 0.6, 0.6, 1 )`` | ++-----------+-------------------------------+ +| *Setter* | set_bg_color(value) | ++-----------+-------------------------------+ +| *Getter* | get_bg_color() | ++-----------+-------------------------------+ + +The background color of the stylebox. + +---- + +.. _class_StyleBoxFlat_property_border_blend: + +- :ref:`bool` **border_blend** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_border_blend(value) | ++-----------+-------------------------+ +| *Getter* | get_border_blend() | ++-----------+-------------------------+ + +If ``true``, the border will fade into the background color. + +---- + +.. _class_StyleBoxFlat_property_border_color: + +- :ref:`Color` **border_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 0.8, 0.8, 0.8, 1 )`` | ++-----------+-------------------------------+ +| *Setter* | set_border_color(value) | ++-----------+-------------------------------+ +| *Getter* | get_border_color() | ++-----------+-------------------------------+ + +Sets the color of the border. + +---- + +.. _class_StyleBoxFlat_property_border_width_bottom: + +- :ref:`int` **border_width_bottom** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Border width for the bottom border. + +---- + +.. _class_StyleBoxFlat_property_border_width_left: + +- :ref:`int` **border_width_left** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Border width for the left border. + +---- + +.. _class_StyleBoxFlat_property_border_width_right: + +- :ref:`int` **border_width_right** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Border width for the right border. + +---- + +.. _class_StyleBoxFlat_property_border_width_top: + +- :ref:`int` **border_width_top** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_border_width(value) | ++-----------+-------------------------+ +| *Getter* | get_border_width() | ++-----------+-------------------------+ + +Border width for the top border. + +---- + +.. _class_StyleBoxFlat_property_corner_detail: + +- :ref:`int` **corner_detail** + ++-----------+--------------------------+ +| *Default* | ``8`` | ++-----------+--------------------------+ +| *Setter* | set_corner_detail(value) | ++-----------+--------------------------+ +| *Getter* | get_corner_detail() | ++-----------+--------------------------+ + +This sets the number of vertices used for each corner. Higher values result in rounder corners but take more processing power to compute. When choosing a value, you should take the corner radius (:ref:`set_corner_radius_all`) into account. + +For corner radii less than 10, ``4`` or ``5`` should be enough. For corner radii less than 30, values between ``8`` and ``12`` should be enough. + +A corner detail of ``1`` will result in chamfered corners instead of rounded corners, which is useful for some artistic effects. + +---- + +.. _class_StyleBoxFlat_property_corner_radius_bottom_left: + +- :ref:`int` **corner_radius_bottom_left** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_corner_radius(value) | ++-----------+--------------------------+ +| *Getter* | get_corner_radius() | ++-----------+--------------------------+ + +The bottom-left corner's radius. If ``0``, the corner is not rounded. + +---- + +.. _class_StyleBoxFlat_property_corner_radius_bottom_right: + +- :ref:`int` **corner_radius_bottom_right** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_corner_radius(value) | ++-----------+--------------------------+ +| *Getter* | get_corner_radius() | ++-----------+--------------------------+ + +The bottom-right corner's radius. If ``0``, the corner is not rounded. + +---- + +.. _class_StyleBoxFlat_property_corner_radius_top_left: + +- :ref:`int` **corner_radius_top_left** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_corner_radius(value) | ++-----------+--------------------------+ +| *Getter* | get_corner_radius() | ++-----------+--------------------------+ + +The top-left corner's radius. If ``0``, the corner is not rounded. + +---- + +.. _class_StyleBoxFlat_property_corner_radius_top_right: + +- :ref:`int` **corner_radius_top_right** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_corner_radius(value) | ++-----------+--------------------------+ +| *Getter* | get_corner_radius() | ++-----------+--------------------------+ + +The top-right corner's radius. If ``0``, the corner is not rounded. + +---- + +.. _class_StyleBoxFlat_property_draw_center: + +- :ref:`bool` **draw_center** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_draw_center(value) | ++-----------+--------------------------+ +| *Getter* | is_draw_center_enabled() | ++-----------+--------------------------+ + +Toggles drawing of the inner part of the stylebox. + +---- + +.. _class_StyleBoxFlat_property_expand_margin_bottom: + +- :ref:`float` **expand_margin_bottom** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_expand_margin(value) | ++-----------+--------------------------+ +| *Getter* | get_expand_margin() | ++-----------+--------------------------+ + +Expands the stylebox outside of the control rect on the bottom edge. Useful in combination with :ref:`border_width_bottom` to draw a border outside the control rect. + +---- + +.. _class_StyleBoxFlat_property_expand_margin_left: + +- :ref:`float` **expand_margin_left** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_expand_margin(value) | ++-----------+--------------------------+ +| *Getter* | get_expand_margin() | ++-----------+--------------------------+ + +Expands the stylebox outside of the control rect on the left edge. Useful in combination with :ref:`border_width_left` to draw a border outside the control rect. + +---- + +.. _class_StyleBoxFlat_property_expand_margin_right: + +- :ref:`float` **expand_margin_right** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_expand_margin(value) | ++-----------+--------------------------+ +| *Getter* | get_expand_margin() | ++-----------+--------------------------+ + +Expands the stylebox outside of the control rect on the right edge. Useful in combination with :ref:`border_width_right` to draw a border outside the control rect. + +---- + +.. _class_StyleBoxFlat_property_expand_margin_top: + +- :ref:`float` **expand_margin_top** + ++-----------+--------------------------+ +| *Default* | ``0.0`` | ++-----------+--------------------------+ +| *Setter* | set_expand_margin(value) | ++-----------+--------------------------+ +| *Getter* | get_expand_margin() | ++-----------+--------------------------+ + +Expands the stylebox outside of the control rect on the top edge. Useful in combination with :ref:`border_width_top` to draw a border outside the control rect. + +---- + +.. _class_StyleBoxFlat_property_shadow_color: + +- :ref:`Color` **shadow_color** + ++-----------+---------------------------+ +| *Default* | ``Color( 0, 0, 0, 0.6 )`` | ++-----------+---------------------------+ +| *Setter* | set_shadow_color(value) | ++-----------+---------------------------+ +| *Getter* | get_shadow_color() | ++-----------+---------------------------+ + +The color of the shadow. This has no effect if :ref:`shadow_size` is lower than 1. + +---- + +.. _class_StyleBoxFlat_property_shadow_offset: + +- :ref:`Vector2` **shadow_offset** + ++-----------+--------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+--------------------------+ +| *Setter* | set_shadow_offset(value) | ++-----------+--------------------------+ +| *Getter* | get_shadow_offset() | ++-----------+--------------------------+ + +The shadow offset in pixels. Adjusts the position of the shadow relatively to the stylebox. + +---- + +.. _class_StyleBoxFlat_property_shadow_size: + +- :ref:`int` **shadow_size** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_shadow_size(value) | ++-----------+------------------------+ +| *Getter* | get_shadow_size() | ++-----------+------------------------+ + +The shadow size in pixels. + +Method Descriptions +------------------- + +.. _class_StyleBoxFlat_method_get_border_width: + +- :ref:`int` **get_border_width** **(** :ref:`Margin` margin **)** |const| + +Returns the given ``margin``'s border width. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxFlat_method_get_border_width_min: + +- :ref:`int` **get_border_width_min** **(** **)** |const| + +Returns the smallest border width out of all four borders. + +---- + +.. _class_StyleBoxFlat_method_get_corner_radius: + +- :ref:`int` **get_corner_radius** **(** :ref:`Corner` corner **)** |const| + +Returns the given ``corner``'s radius. See :ref:`Corner` for possible values. + +---- + +.. _class_StyleBoxFlat_method_get_expand_margin: + +- :ref:`float` **get_expand_margin** **(** :ref:`Margin` margin **)** |const| + +Returns the size of the given ``margin``'s expand margin. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxFlat_method_set_border_width: + +- void **set_border_width** **(** :ref:`Margin` margin, :ref:`int` width **)** + +Sets the border width to ``width`` pixels for the given ``margin``. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxFlat_method_set_border_width_all: + +- void **set_border_width_all** **(** :ref:`int` width **)** + +Sets the border width to ``width`` pixels for all margins. + +---- + +.. _class_StyleBoxFlat_method_set_corner_radius: + +- void **set_corner_radius** **(** :ref:`Corner` corner, :ref:`int` radius **)** + +Sets the corner radius to ``radius`` pixels for the given ``corner``. See :ref:`Corner` for possible values. + +---- + +.. _class_StyleBoxFlat_method_set_corner_radius_all: + +- void **set_corner_radius_all** **(** :ref:`int` radius **)** + +Sets the corner radius to ``radius`` pixels for all corners. + +---- + +.. _class_StyleBoxFlat_method_set_corner_radius_individual: + +- void **set_corner_radius_individual** **(** :ref:`int` radius_top_left, :ref:`int` radius_top_right, :ref:`int` radius_bottom_right, :ref:`int` radius_bottom_left **)** + +Sets the corner radius for each corner to ``radius_top_left``, ``radius_top_right``, ``radius_bottom_right``, and ``radius_bottom_left`` pixels. + +---- + +.. _class_StyleBoxFlat_method_set_expand_margin: + +- void **set_expand_margin** **(** :ref:`Margin` margin, :ref:`float` size **)** + +Sets the expand margin to ``size`` pixels for the given ``margin``. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxFlat_method_set_expand_margin_all: + +- void **set_expand_margin_all** **(** :ref:`float` size **)** + +Sets the expand margin to ``size`` pixels for all margins. + +---- + +.. _class_StyleBoxFlat_method_set_expand_margin_individual: + +- void **set_expand_margin_individual** **(** :ref:`float` size_left, :ref:`float` size_top, :ref:`float` size_right, :ref:`float` size_bottom **)** + +Sets the expand margin for each margin to ``size_left``, ``size_top``, ``size_right``, and ``size_bottom`` pixels. + +.. |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.)` diff --git a/classes/class_styleboxline.rst b/classes/class_styleboxline.rst new file mode 100644 index 0000000..fbf3081 --- /dev/null +++ b/classes/class_styleboxline.rst @@ -0,0 +1,119 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StyleBoxLine.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StyleBoxLine: + +StyleBoxLine +============ + +**Inherits:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`StyleBox` that displays a single line. + +Description +----------- + +:ref:`StyleBox` that displays a single line of a given color and thickness. It can be used to draw things like separators. + +Properties +---------- + ++---------------------------+-----------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------+-----------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`grow_begin` | ``1.0`` | ++---------------------------+-----------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`grow_end` | ``1.0`` | ++---------------------------+-----------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`thickness` | ``1`` | ++---------------------------+-----------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`vertical` | ``false`` | ++---------------------------+-----------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_StyleBoxLine_property_color: + +- :ref:`Color` **color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_color(value) | ++-----------+-------------------------+ +| *Getter* | get_color() | ++-----------+-------------------------+ + +The line's color. + +---- + +.. _class_StyleBoxLine_property_grow_begin: + +- :ref:`float` **grow_begin** + ++-----------+-----------------------+ +| *Default* | ``1.0`` | ++-----------+-----------------------+ +| *Setter* | set_grow_begin(value) | ++-----------+-----------------------+ +| *Getter* | get_grow_begin() | ++-----------+-----------------------+ + +The number of pixels the line will extend before the ``StyleBoxLine``'s bounds. If set to a negative value, the line will begin inside the ``StyleBoxLine``'s bounds. + +---- + +.. _class_StyleBoxLine_property_grow_end: + +- :ref:`float` **grow_end** + ++-----------+---------------------+ +| *Default* | ``1.0`` | ++-----------+---------------------+ +| *Setter* | set_grow_end(value) | ++-----------+---------------------+ +| *Getter* | get_grow_end() | ++-----------+---------------------+ + +The number of pixels the line will extend past the ``StyleBoxLine``'s bounds. If set to a negative value, the line will end inside the ``StyleBoxLine``'s bounds. + +---- + +.. _class_StyleBoxLine_property_thickness: + +- :ref:`int` **thickness** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_thickness(value) | ++-----------+----------------------+ +| *Getter* | get_thickness() | ++-----------+----------------------+ + +The line's thickness in pixels. + +---- + +.. _class_StyleBoxLine_property_vertical: + +- :ref:`bool` **vertical** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_vertical(value) | ++-----------+---------------------+ +| *Getter* | is_vertical() | ++-----------+---------------------+ + +If ``true``, the line will be vertical. If ``false``, the line will be horizontal. + +.. |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.)` diff --git a/classes/class_styleboxtexture.rst b/classes/class_styleboxtexture.rst new file mode 100644 index 0000000..d91fd54 --- /dev/null +++ b/classes/class_styleboxtexture.rst @@ -0,0 +1,409 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the StyleBoxTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_StyleBoxTexture: + +StyleBoxTexture +=============== + +**Inherits:** :ref:`StyleBox` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Texture-based nine-patch :ref:`StyleBox`. + +Description +----------- + +Texture-based nine-patch :ref:`StyleBox`, in a way similar to :ref:`NinePatchRect`. This stylebox performs a 3×3 scaling of a texture, where only the center cell is fully stretched. This makes it possible to design bordered styles regardless of the stylebox's size. + +Properties +---------- + ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`AxisStretchMode` | :ref:`axis_stretch_horizontal` | ``0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`AxisStretchMode` | :ref:`axis_stretch_vertical` | ``0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`bool` | :ref:`draw_center` | ``true`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`expand_margin_bottom` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`expand_margin_left` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`expand_margin_right` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`expand_margin_top` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`margin_bottom` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`margin_left` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`margin_right` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`float` | :ref:`margin_top` | ``0.0`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`modulate_color` | ``Color( 1, 1, 1, 1 )`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`normal_map` | | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Rect2` | :ref:`region_rect` | ``Rect2( 0, 0, 0, 0 )`` | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++--------------------------------------------------------------+----------------------------------------------------------------------------------------+-------------------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_expand_margin_size` **(** :ref:`Margin` margin **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_margin_size` **(** :ref:`Margin` margin **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin_all` **(** :ref:`float` size **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin_individual` **(** :ref:`float` size_left, :ref:`float` size_top, :ref:`float` size_right, :ref:`float` size_bottom **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_margin_size` **(** :ref:`Margin` margin, :ref:`float` size **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_margin_size` **(** :ref:`Margin` margin, :ref:`float` size **)** | ++---------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_StyleBoxTexture_signal_texture_changed: + +- **texture_changed** **(** **)** + +Emitted when the stylebox's texture is changed. + +Enumerations +------------ + +.. _enum_StyleBoxTexture_AxisStretchMode: + +.. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_STRETCH: + +.. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE: + +.. _class_StyleBoxTexture_constant_AXIS_STRETCH_MODE_TILE_FIT: + +enum **AxisStretchMode**: + +- **AXIS_STRETCH_MODE_STRETCH** = **0** --- Stretch the stylebox's texture. This results in visible distortion unless the texture size matches the stylebox's size perfectly. + +- **AXIS_STRETCH_MODE_TILE** = **1** --- Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. + +- **AXIS_STRETCH_MODE_TILE_FIT** = **2** --- Repeats the stylebox's texture to match the stylebox's size according to the nine-patch system. Unlike :ref:`AXIS_STRETCH_MODE_TILE`, the texture may be slightly stretched to make the nine-patch texture tile seamlessly. + +Property Descriptions +--------------------- + +.. _class_StyleBoxTexture_property_axis_stretch_horizontal: + +- :ref:`AxisStretchMode` **axis_stretch_horizontal** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_h_axis_stretch_mode(value) | ++-----------+--------------------------------+ +| *Getter* | get_h_axis_stretch_mode() | ++-----------+--------------------------------+ + +Controls how the stylebox's texture will be stretched or tiled horizontally. See :ref:`AxisStretchMode` for possible values. + +---- + +.. _class_StyleBoxTexture_property_axis_stretch_vertical: + +- :ref:`AxisStretchMode` **axis_stretch_vertical** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_v_axis_stretch_mode(value) | ++-----------+--------------------------------+ +| *Getter* | get_v_axis_stretch_mode() | ++-----------+--------------------------------+ + +Controls how the stylebox's texture will be stretched or tiled vertically. See :ref:`AxisStretchMode` for possible values. + +---- + +.. _class_StyleBoxTexture_property_draw_center: + +- :ref:`bool` **draw_center** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_draw_center(value) | ++-----------+--------------------------+ +| *Getter* | is_draw_center_enabled() | ++-----------+--------------------------+ + +If ``true``, the nine-patch texture's center tile will be drawn. + +---- + +.. _class_StyleBoxTexture_property_expand_margin_bottom: + +- :ref:`float` **expand_margin_bottom** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_expand_margin_size(value) | ++-----------+-------------------------------+ +| *Getter* | get_expand_margin_size() | ++-----------+-------------------------------+ + +Expands the bottom margin of this style box when drawing, causing it to be drawn larger than requested. + +---- + +.. _class_StyleBoxTexture_property_expand_margin_left: + +- :ref:`float` **expand_margin_left** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_expand_margin_size(value) | ++-----------+-------------------------------+ +| *Getter* | get_expand_margin_size() | ++-----------+-------------------------------+ + +Expands the left margin of this style box when drawing, causing it to be drawn larger than requested. + +---- + +.. _class_StyleBoxTexture_property_expand_margin_right: + +- :ref:`float` **expand_margin_right** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_expand_margin_size(value) | ++-----------+-------------------------------+ +| *Getter* | get_expand_margin_size() | ++-----------+-------------------------------+ + +Expands the right margin of this style box when drawing, causing it to be drawn larger than requested. + +---- + +.. _class_StyleBoxTexture_property_expand_margin_top: + +- :ref:`float` **expand_margin_top** + ++-----------+-------------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------------+ +| *Setter* | set_expand_margin_size(value) | ++-----------+-------------------------------+ +| *Getter* | get_expand_margin_size() | ++-----------+-------------------------------+ + +Expands the top margin of this style box when drawing, causing it to be drawn larger than requested. + +---- + +.. _class_StyleBoxTexture_property_margin_bottom: + +- :ref:`float` **margin_bottom** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_margin_size(value) | ++-----------+------------------------+ +| *Getter* | get_margin_size() | ++-----------+------------------------+ + +Increases the bottom margin of the 3×3 texture box. + +A higher value means more of the source texture is considered to be part of the bottom border of the 3×3 box. + +This is also the value used as fallback for :ref:`StyleBox.content_margin_bottom` if it is negative. + +---- + +.. _class_StyleBoxTexture_property_margin_left: + +- :ref:`float` **margin_left** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_margin_size(value) | ++-----------+------------------------+ +| *Getter* | get_margin_size() | ++-----------+------------------------+ + +Increases the left margin of the 3×3 texture box. + +A higher value means more of the source texture is considered to be part of the left border of the 3×3 box. + +This is also the value used as fallback for :ref:`StyleBox.content_margin_left` if it is negative. + +---- + +.. _class_StyleBoxTexture_property_margin_right: + +- :ref:`float` **margin_right** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_margin_size(value) | ++-----------+------------------------+ +| *Getter* | get_margin_size() | ++-----------+------------------------+ + +Increases the right margin of the 3×3 texture box. + +A higher value means more of the source texture is considered to be part of the right border of the 3×3 box. + +This is also the value used as fallback for :ref:`StyleBox.content_margin_right` if it is negative. + +---- + +.. _class_StyleBoxTexture_property_margin_top: + +- :ref:`float` **margin_top** + ++-----------+------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------+ +| *Setter* | set_margin_size(value) | ++-----------+------------------------+ +| *Getter* | get_margin_size() | ++-----------+------------------------+ + +Increases the top margin of the 3×3 texture box. + +A higher value means more of the source texture is considered to be part of the top border of the 3×3 box. + +This is also the value used as fallback for :ref:`StyleBox.content_margin_top` if it is negative. + +---- + +.. _class_StyleBoxTexture_property_modulate_color: + +- :ref:`Color` **modulate_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_modulate(value) | ++-----------+-------------------------+ +| *Getter* | get_modulate() | ++-----------+-------------------------+ + +Modulates the color of the texture when this style box is drawn. + +---- + +.. _class_StyleBoxTexture_property_normal_map: + +- :ref:`Texture` **normal_map** + ++----------+-----------------------+ +| *Setter* | set_normal_map(value) | ++----------+-----------------------+ +| *Getter* | get_normal_map() | ++----------+-----------------------+ + +The normal map to use when drawing this style box. + +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_StyleBoxTexture_property_region_rect: + +- :ref:`Rect2` **region_rect** + ++-----------+-------------------------+ +| *Default* | ``Rect2( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_region_rect(value) | ++-----------+-------------------------+ +| *Getter* | get_region_rect() | ++-----------+-------------------------+ + +Species a sub-region of the texture to use. + +This is equivalent to first wrapping the texture in an :ref:`AtlasTexture` with the same region. + +---- + +.. _class_StyleBoxTexture_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The texture to use when drawing this style box. + +Method Descriptions +------------------- + +.. _class_StyleBoxTexture_method_get_expand_margin_size: + +- :ref:`float` **get_expand_margin_size** **(** :ref:`Margin` margin **)** |const| + +Returns the size of the given ``margin``'s expand margin. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxTexture_method_get_margin_size: + +- :ref:`float` **get_margin_size** **(** :ref:`Margin` margin **)** |const| + +Returns the size of the given ``margin``. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxTexture_method_set_expand_margin_all: + +- void **set_expand_margin_all** **(** :ref:`float` size **)** + +Sets the expand margin to ``size`` pixels for all margins. + +---- + +.. _class_StyleBoxTexture_method_set_expand_margin_individual: + +- void **set_expand_margin_individual** **(** :ref:`float` size_left, :ref:`float` size_top, :ref:`float` size_right, :ref:`float` size_bottom **)** + +Sets the expand margin for each margin to ``size_left``, ``size_top``, ``size_right``, and ``size_bottom`` pixels. + +---- + +.. _class_StyleBoxTexture_method_set_expand_margin_size: + +- void **set_expand_margin_size** **(** :ref:`Margin` margin, :ref:`float` size **)** + +Sets the expand margin to ``size`` pixels for the given ``margin``. See :ref:`Margin` for possible values. + +---- + +.. _class_StyleBoxTexture_method_set_margin_size: + +- void **set_margin_size** **(** :ref:`Margin` margin, :ref:`float` size **)** + +Sets the margin to ``size`` pixels for the given ``margin``. See :ref:`Margin` for possible values. + +.. |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.)` diff --git a/classes/class_surfacetool.rst b/classes/class_surfacetool.rst new file mode 100644 index 0000000..e522afb --- /dev/null +++ b/classes/class_surfacetool.rst @@ -0,0 +1,292 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the SurfaceTool.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_SurfaceTool: + +SurfaceTool +=========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper tool to create geometry. + +Description +----------- + +The ``SurfaceTool`` is used to construct a :ref:`Mesh` by specifying vertex attributes individually. It can be used to construct a :ref:`Mesh` from a script. All properties except indices need to be added before calling :ref:`add_vertex`. For example, to add vertex colors and UVs: + +:: + + var st = SurfaceTool.new() + st.begin(Mesh.PRIMITIVE_TRIANGLES) + st.add_color(Color(1, 0, 0)) + st.add_uv(Vector2(0, 0)) + st.add_vertex(Vector3(0, 0, 0)) + +The above ``SurfaceTool`` now contains one vertex of a triangle which has a UV coordinate and a specified :ref:`Color`. If another vertex were added without calling :ref:`add_uv` or :ref:`add_color`, then the last values would be used. + +Vertex attributes must be passed **before** calling :ref:`add_vertex`. Failure to do so will result in an error when committing the vertex information to a mesh. + +Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices. + +See also :ref:`ArrayMesh`, :ref:`ImmediateGeometry` and :ref:`MeshDataTool` for procedural geometry generation. + +**Note:** Godot uses clockwise `winding order `__ for front faces of triangle primitive modes. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Methods +------- + ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_bones` **(** :ref:`PoolIntArray` bones **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_color` **(** :ref:`Color` color **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_index` **(** :ref:`int` index **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_normal` **(** :ref:`Vector3` normal **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_smooth_group` **(** :ref:`bool` smooth **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_tangent` **(** :ref:`Plane` tangent **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_triangle_fan` **(** :ref:`PoolVector3Array` vertices, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`PoolColorArray` colors=PoolColorArray( ), :ref:`PoolVector2Array` uv2s=PoolVector2Array( ), :ref:`PoolVector3Array` normals=PoolVector3Array( ), :ref:`Array` tangents=[ ] **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_uv` **(** :ref:`Vector2` uv **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_uv2` **(** :ref:`Vector2` uv2 **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_vertex` **(** :ref:`Vector3` vertex **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_weights` **(** :ref:`PoolRealArray` weights **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`append_from` **(** :ref:`Mesh` existing, :ref:`int` surface, :ref:`Transform` transform **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`begin` **(** :ref:`PrimitiveType` primitive **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ArrayMesh` | :ref:`commit` **(** :ref:`ArrayMesh` existing=null, :ref:`int` flags=2194432 **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`commit_to_arrays` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from` **(** :ref:`Mesh` existing, :ref:`int` surface **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_from_blend_shape` **(** :ref:`Mesh` existing, :ref:`int` surface, :ref:`String` blend_shape **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`deindex` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`generate_normals` **(** :ref:`bool` flip=false **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`generate_tangents` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`index` **(** **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_material` **(** :ref:`Material` material **)** | ++-----------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_SurfaceTool_method_add_bones: + +- void **add_bones** **(** :ref:`PoolIntArray` bones **)** + +Specifies an array of bones to use for the *next* vertex. ``bones`` must contain 4 integers. + +---- + +.. _class_SurfaceTool_method_add_color: + +- void **add_color** **(** :ref:`Color` color **)** + +Specifies a :ref:`Color` to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +**Note:** The material must have :ref:`SpatialMaterial.vertex_color_use_as_albedo` enabled for the vertex color to be visible. + +---- + +.. _class_SurfaceTool_method_add_index: + +- void **add_index** **(** :ref:`int` index **)** + +Adds an index to index array if you are using indexed vertices. Does not need to be called before adding vertices. + +---- + +.. _class_SurfaceTool_method_add_normal: + +- void **add_normal** **(** :ref:`Vector3` normal **)** + +Specifies a normal to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +---- + +.. _class_SurfaceTool_method_add_smooth_group: + +- void **add_smooth_group** **(** :ref:`bool` smooth **)** + +Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation. + +---- + +.. _class_SurfaceTool_method_add_tangent: + +- void **add_tangent** **(** :ref:`Plane` tangent **)** + +Specifies a tangent to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +---- + +.. _class_SurfaceTool_method_add_triangle_fan: + +- void **add_triangle_fan** **(** :ref:`PoolVector3Array` vertices, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`PoolColorArray` colors=PoolColorArray( ), :ref:`PoolVector2Array` uv2s=PoolVector2Array( ), :ref:`PoolVector3Array` normals=PoolVector3Array( ), :ref:`Array` tangents=[ ] **)** + +Inserts a triangle fan made of array data into :ref:`Mesh` being constructed. + +Requires the primitive type be set to :ref:`Mesh.PRIMITIVE_TRIANGLES`. + +---- + +.. _class_SurfaceTool_method_add_uv: + +- void **add_uv** **(** :ref:`Vector2` uv **)** + +Specifies a set of UV coordinates to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +---- + +.. _class_SurfaceTool_method_add_uv2: + +- void **add_uv2** **(** :ref:`Vector2` uv2 **)** + +Specifies an optional second set of UV coordinates to use for the *next* vertex. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +---- + +.. _class_SurfaceTool_method_add_vertex: + +- void **add_vertex** **(** :ref:`Vector3` vertex **)** + +Specifies the position of current vertex. Should be called after specifying other vertex properties (e.g. Color, UV). + +---- + +.. _class_SurfaceTool_method_add_weights: + +- void **add_weights** **(** :ref:`PoolRealArray` weights **)** + +Specifies weight values to use for the *next* vertex. ``weights`` must contain 4 values. If every vertex needs to have this information set and you fail to submit it for the first vertex, this information may not be used at all. + +---- + +.. _class_SurfaceTool_method_append_from: + +- void **append_from** **(** :ref:`Mesh` existing, :ref:`int` surface, :ref:`Transform` transform **)** + +Append vertices from a given :ref:`Mesh` surface onto the current vertex array with specified :ref:`Transform`. + +**Note:** Using :ref:`append_from` on a :ref:`Thread` is much slower as the GPU must communicate data back to the CPU, while also causing the main thread to stall (as OpenGL is not thread-safe). Consider requesting a copy of the mesh, converting it to an :ref:`ArrayMesh` and adding vertices manually instead. + +---- + +.. _class_SurfaceTool_method_begin: + +- void **begin** **(** :ref:`PrimitiveType` primitive **)** + +Called before adding any vertices. Takes the primitive type as an argument (e.g. :ref:`Mesh.PRIMITIVE_TRIANGLES`). + +---- + +.. _class_SurfaceTool_method_clear: + +- void **clear** **(** **)** + +Clear all information passed into the surface tool so far. + +---- + +.. _class_SurfaceTool_method_commit: + +- :ref:`ArrayMesh` **commit** **(** :ref:`ArrayMesh` existing=null, :ref:`int` flags=2194432 **)** + +Returns a constructed :ref:`ArrayMesh` from current information passed in. If an existing :ref:`ArrayMesh` is passed in as an argument, will add an extra surface to the existing :ref:`ArrayMesh`. + +Default flag is :ref:`Mesh.ARRAY_COMPRESS_DEFAULT` if compression is enabled. If compression is disabled the default flag is :ref:`Mesh.ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION`. See ``ARRAY_COMPRESS_*`` constants in :ref:`ArrayFormat` for other flags. + +---- + +.. _class_SurfaceTool_method_commit_to_arrays: + +- :ref:`Array` **commit_to_arrays** **(** **)** + +Commits the data to the same format used by :ref:`ArrayMesh.add_surface_from_arrays`. This way you can further process the mesh data using the :ref:`ArrayMesh` API. + +---- + +.. _class_SurfaceTool_method_create_from: + +- void **create_from** **(** :ref:`Mesh` existing, :ref:`int` surface **)** + +Creates a vertex array from an existing :ref:`Mesh`. + +---- + +.. _class_SurfaceTool_method_create_from_blend_shape: + +- void **create_from_blend_shape** **(** :ref:`Mesh` existing, :ref:`int` surface, :ref:`String` blend_shape **)** + +Creates a vertex array from the specified blend shape of an existing :ref:`Mesh`. This can be used to extract a specific pose from a blend shape. + +---- + +.. _class_SurfaceTool_method_deindex: + +- void **deindex** **(** **)** + +Removes the index array by expanding the vertex array. + +---- + +.. _class_SurfaceTool_method_generate_normals: + +- void **generate_normals** **(** :ref:`bool` flip=false **)** + +Generates normals from vertices so you do not have to do it manually. If ``flip`` is ``true``, the resulting normals will be inverted. :ref:`generate_normals` should be called *after* generating geometry and *before* committing the mesh using :ref:`commit` or :ref:`commit_to_arrays`. For correct display of normal-mapped surfaces, you will also have to generate tangents using :ref:`generate_tangents`. + +**Note:** :ref:`generate_normals` only works if the primitive type to be set to :ref:`Mesh.PRIMITIVE_TRIANGLES`. + +---- + +.. _class_SurfaceTool_method_generate_tangents: + +- void **generate_tangents** **(** **)** + +Generates a tangent vector for each vertex. Requires that each vertex have UVs and normals set already (see :ref:`generate_normals`). + +---- + +.. _class_SurfaceTool_method_index: + +- void **index** **(** **)** + +Shrinks the vertex array by creating an index array. This can improve performance by avoiding vertex reuse. + +---- + +.. _class_SurfaceTool_method_set_material: + +- void **set_material** **(** :ref:`Material` material **)** + +Sets :ref:`Material` to be used by the :ref:`Mesh` you are constructing. + +.. |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.)` diff --git a/classes/class_tabcontainer.rst b/classes/class_tabcontainer.rst new file mode 100644 index 0000000..05f803e --- /dev/null +++ b/classes/class_tabcontainer.rst @@ -0,0 +1,585 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TabContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TabContainer: + +TabContainer +============ + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Tabbed container. + +Description +----------- + +Arranges :ref:`Control` children into a tabbed view, creating a tab for each one. The active tab's corresponding :ref:`Control` has its ``visible`` property set to ``true``, and all other children's to ``false``. + +Ignores non-:ref:`Control` children. + +**Note:** The drawing of the clickable tabs themselves is handled by this node. Adding :ref:`Tabs` as children is not needed. + +Properties +---------- + ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`all_tabs_in_front` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`current_tab` | ``0`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`drag_to_rearrange_enabled` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`TabAlign` | :ref:`tab_align` | ``1`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`tabs_visible` | ``true`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`use_hidden_tabs_for_min_size` | ``false`` | ++---------------------------------------------+-----------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_current_tab_control` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Popup` | :ref:`get_popup` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_previous_tab` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_tab_control` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tab_count` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_tab_disabled` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_tab_hidden` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_tab_icon` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tab_idx_at_point` **(** :ref:`Vector2` point **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tab_title` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tabs_rearrange_group` **(** **)** |const| | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_popup` **(** :ref:`Node` popup **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_disabled` **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_hidden` **(** :ref:`int` tab_idx, :ref:`bool` hidden **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_icon` **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_title` **(** :ref:`int` tab_idx, :ref:`String` title **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tabs_rearrange_group` **(** :ref:`int` group_id **)** | ++-------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_bg` | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_fg` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`label_valign_bg` | ``2`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`label_valign_fg` | ``0`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`side_margin` | ``8`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`top_margin` | ``24`` | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`decrement` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`decrement_highlight` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`increment` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`increment_highlight` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`menu` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`menu_highlight` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`panel` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_bg` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_disabled` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_fg` | | ++---------------------------------+--------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_TabContainer_signal_pre_popup_pressed: + +- **pre_popup_pressed** **(** **)** + +Emitted when the ``TabContainer``'s :ref:`Popup` button is clicked. See :ref:`set_popup` for details. + +---- + +.. _class_TabContainer_signal_tab_changed: + +- **tab_changed** **(** :ref:`int` tab **)** + +Emitted when switching to another tab. + +---- + +.. _class_TabContainer_signal_tab_selected: + +- **tab_selected** **(** :ref:`int` tab **)** + +Emitted when a tab is selected, even if it is the current tab. + +Enumerations +------------ + +.. _enum_TabContainer_TabAlign: + +.. _class_TabContainer_constant_ALIGN_LEFT: + +.. _class_TabContainer_constant_ALIGN_CENTER: + +.. _class_TabContainer_constant_ALIGN_RIGHT: + +enum **TabAlign**: + +- **ALIGN_LEFT** = **0** --- Align the tabs to the left. + +- **ALIGN_CENTER** = **1** --- Align the tabs to the center. + +- **ALIGN_RIGHT** = **2** --- Align the tabs to the right. + +Property Descriptions +--------------------- + +.. _class_TabContainer_property_all_tabs_in_front: + +- :ref:`bool` **all_tabs_in_front** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_all_tabs_in_front(value) | ++-----------+------------------------------+ +| *Getter* | is_all_tabs_in_front() | ++-----------+------------------------------+ + +If ``true``, all tabs are drawn in front of the panel. If ``false``, inactive tabs are drawn behind the panel. + +---- + +.. _class_TabContainer_property_current_tab: + +- :ref:`int` **current_tab** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_current_tab(value) | ++-----------+------------------------+ +| *Getter* | get_current_tab() | ++-----------+------------------------+ + +The current tab index. When set, this index's :ref:`Control` node's ``visible`` property is set to ``true`` and all others are set to ``false``. + +---- + +.. _class_TabContainer_property_drag_to_rearrange_enabled: + +- :ref:`bool` **drag_to_rearrange_enabled** + ++-----------+--------------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------------+ +| *Setter* | set_drag_to_rearrange_enabled(value) | ++-----------+--------------------------------------+ +| *Getter* | get_drag_to_rearrange_enabled() | ++-----------+--------------------------------------+ + +If ``true``, tabs can be rearranged with mouse drag. + +---- + +.. _class_TabContainer_property_tab_align: + +- :ref:`TabAlign` **tab_align** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_tab_align(value) | ++-----------+----------------------+ +| *Getter* | get_tab_align() | ++-----------+----------------------+ + +The alignment of all tabs in the tab container. See the :ref:`TabAlign` constants for details. + +---- + +.. _class_TabContainer_property_tabs_visible: + +- :ref:`bool` **tabs_visible** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_tabs_visible(value) | ++-----------+-------------------------+ +| *Getter* | are_tabs_visible() | ++-----------+-------------------------+ + +If ``true``, tabs are visible. If ``false``, tabs' content and titles are hidden. + +---- + +.. _class_TabContainer_property_use_hidden_tabs_for_min_size: + +- :ref:`bool` **use_hidden_tabs_for_min_size** + ++-----------+-----------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------+ +| *Setter* | set_use_hidden_tabs_for_min_size(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_use_hidden_tabs_for_min_size() | ++-----------+-----------------------------------------+ + +If ``true``, children :ref:`Control` nodes that are hidden have their minimum size take into account in the total, instead of only the currently visible one. + +Method Descriptions +------------------- + +.. _class_TabContainer_method_get_current_tab_control: + +- :ref:`Control` **get_current_tab_control** **(** **)** |const| + +Returns the child :ref:`Control` node located at the active tab index. + +---- + +.. _class_TabContainer_method_get_popup: + +- :ref:`Popup` **get_popup** **(** **)** |const| + +Returns the :ref:`Popup` node instance if one has been set already with :ref:`set_popup`. + +**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` property. + +---- + +.. _class_TabContainer_method_get_previous_tab: + +- :ref:`int` **get_previous_tab** **(** **)** |const| + +Returns the previously active tab index. + +---- + +.. _class_TabContainer_method_get_tab_control: + +- :ref:`Control` **get_tab_control** **(** :ref:`int` tab_idx **)** |const| + +Returns the :ref:`Control` node from the tab at index ``tab_idx``. + +---- + +.. _class_TabContainer_method_get_tab_count: + +- :ref:`int` **get_tab_count** **(** **)** |const| + +Returns the number of tabs. + +---- + +.. _class_TabContainer_method_get_tab_disabled: + +- :ref:`bool` **get_tab_disabled** **(** :ref:`int` tab_idx **)** |const| + +Returns ``true`` if the tab at index ``tab_idx`` is disabled. + +---- + +.. _class_TabContainer_method_get_tab_hidden: + +- :ref:`bool` **get_tab_hidden** **(** :ref:`int` tab_idx **)** |const| + +Returns ``true`` if the tab at index ``tab_idx`` is hidden. + +---- + +.. _class_TabContainer_method_get_tab_icon: + +- :ref:`Texture` **get_tab_icon** **(** :ref:`int` tab_idx **)** |const| + +Returns the :ref:`Texture` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture`. + +---- + +.. _class_TabContainer_method_get_tab_idx_at_point: + +- :ref:`int` **get_tab_idx_at_point** **(** :ref:`Vector2` point **)** |const| + +Returns the index of the tab at local coordinates ``point``. Returns ``-1`` if the point is outside the control boundaries or if there's no tab at the queried position. + +---- + +.. _class_TabContainer_method_get_tab_title: + +- :ref:`String` **get_tab_title** **(** :ref:`int` tab_idx **)** |const| + +Returns the title of the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node, but this can be overridden with :ref:`set_tab_title`. + +---- + +.. _class_TabContainer_method_get_tabs_rearrange_group: + +- :ref:`int` **get_tabs_rearrange_group** **(** **)** |const| + +Returns the ``TabContainer`` rearrange group id. + +---- + +.. _class_TabContainer_method_set_popup: + +- void **set_popup** **(** :ref:`Node` popup **)** + +If set on a :ref:`Popup` node instance, a popup menu icon appears in the top-right corner of the ``TabContainer``. Clicking it will expand the :ref:`Popup` node. + +---- + +.. _class_TabContainer_method_set_tab_disabled: + +- void **set_tab_disabled** **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** + +If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable. + +---- + +.. _class_TabContainer_method_set_tab_hidden: + +- void **set_tab_hidden** **(** :ref:`int` tab_idx, :ref:`bool` hidden **)** + +If ``hidden`` is ``true``, hides the tab at index ``tab_idx``, making it disappear from the tab area. + +---- + +.. _class_TabContainer_method_set_tab_icon: + +- void **set_tab_icon** **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** + +Sets an icon for the tab at index ``tab_idx``. + +---- + +.. _class_TabContainer_method_set_tab_title: + +- void **set_tab_title** **(** :ref:`int` tab_idx, :ref:`String` title **)** + +Sets a title for the tab at index ``tab_idx``. Tab titles default to the name of the indexed child node. + +---- + +.. _class_TabContainer_method_set_tabs_rearrange_group: + +- void **set_tabs_rearrange_group** **(** :ref:`int` group_id **)** + +Defines rearrange group id, choose for each ``TabContainer`` the same value to enable tab drag between ``TabContainer``. Enable drag with :ref:`drag_to_rearrange_enabled`. + +Theme Property Descriptions +--------------------------- + +.. _class_TabContainer_theme_color_font_color_bg: + +- :ref:`Color` **font_color_bg** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++-----------+----------------------------------+ + +Font color of inactive tabs. + +---- + +.. _class_TabContainer_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +Font color of disabled tabs. + +---- + +.. _class_TabContainer_theme_color_font_color_fg: + +- :ref:`Color` **font_color_fg** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Font color of the currently selected tab. + +---- + +.. _class_TabContainer_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +Horizontal separation between tabs. + +---- + +.. _class_TabContainer_theme_constant_label_valign_bg: + +- :ref:`int` **label_valign_bg** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +---- + +.. _class_TabContainer_theme_constant_label_valign_fg: + +- :ref:`int` **label_valign_fg** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +---- + +.. _class_TabContainer_theme_constant_side_margin: + +- :ref:`int` **side_margin** + ++-----------+-------+ +| *Default* | ``8`` | ++-----------+-------+ + +The space at the left and right edges of the tab bar. + +---- + +.. _class_TabContainer_theme_constant_top_margin: + +- :ref:`int` **top_margin** + ++-----------+--------+ +| *Default* | ``24`` | ++-----------+--------+ + +---- + +.. _class_TabContainer_theme_font_font: + +- :ref:`Font` **font** + +The font used to draw tab names. + +---- + +.. _class_TabContainer_theme_icon_decrement: + +- :ref:`Texture` **decrement** + +Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. + +---- + +.. _class_TabContainer_theme_icon_decrement_highlight: + +- :ref:`Texture` **decrement_highlight** + +Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + +---- + +.. _class_TabContainer_theme_icon_increment: + +- :ref:`Texture` **increment** + +Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. + +---- + +.. _class_TabContainer_theme_icon_increment_highlight: + +- :ref:`Texture` **increment_highlight** + +Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + +---- + +.. _class_TabContainer_theme_icon_menu: + +- :ref:`Texture` **menu** + +The icon for the menu button (see :ref:`set_popup`). + +---- + +.. _class_TabContainer_theme_icon_menu_highlight: + +- :ref:`Texture` **menu_highlight** + +The icon for the menu button (see :ref:`set_popup`) when it's being hovered with the cursor. + +---- + +.. _class_TabContainer_theme_style_panel: + +- :ref:`StyleBox` **panel** + +The style for the background fill. + +---- + +.. _class_TabContainer_theme_style_tab_bg: + +- :ref:`StyleBox` **tab_bg** + +The style of inactive tabs. + +---- + +.. _class_TabContainer_theme_style_tab_disabled: + +- :ref:`StyleBox` **tab_disabled** + +The style of disabled tabs. + +---- + +.. _class_TabContainer_theme_style_tab_fg: + +- :ref:`StyleBox` **tab_fg** + +The style of the currently selected tab. + +.. |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.)` diff --git a/classes/class_tabs.rst b/classes/class_tabs.rst new file mode 100644 index 0000000..428cd67 --- /dev/null +++ b/classes/class_tabs.rst @@ -0,0 +1,617 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Tabs.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Tabs: + +Tabs +==== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Tabs control. + +Description +----------- + +Simple tabs control, similar to :ref:`TabContainer` but is only in charge of drawing tabs, not interacting with children. + +Properties +---------- + ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`current_tab` | ``0`` | ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`drag_to_rearrange_enabled` | ``false`` | ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`scrolling_enabled` | ``true`` | ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`TabAlign` | :ref:`tab_align` | ``1`` | ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ +| :ref:`CloseButtonDisplayPolicy` | :ref:`tab_close_display_policy` | ``0`` | ++---------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_tab` **(** :ref:`String` title="", :ref:`Texture` icon=null **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`ensure_tab_visible` **(** :ref:`int` idx **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_offset_buttons_visible` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_previous_tab` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_select_with_rmb` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tab_count` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_tab_disabled` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_tab_icon` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tab_offset` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_tab_rect` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tab_title` **(** :ref:`int` tab_idx **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_tabs_rearrange_group` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_tab` **(** :ref:`int` from, :ref:`int` to **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_tab` **(** :ref:`int` tab_idx **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_select_with_rmb` **(** :ref:`bool` enabled **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_disabled` **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_icon` **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tab_title` **(** :ref:`int` tab_idx, :ref:`String` title **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tabs_rearrange_group` **(** :ref:`int` group_id **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_bg` | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_fg` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`label_valign_bg` | ``2`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`label_valign_fg` | ``0`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`top_margin` | ``24`` | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`close` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`decrement` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`decrement_highlight` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`increment` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`increment_highlight` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`button` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`button_pressed` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_bg` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_disabled` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`tab_fg` | | ++---------------------------------+------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_Tabs_signal_reposition_active_tab_request: + +- **reposition_active_tab_request** **(** :ref:`int` idx_to **)** + +Emitted when the active tab is rearranged via mouse drag. See :ref:`drag_to_rearrange_enabled`. + +---- + +.. _class_Tabs_signal_right_button_pressed: + +- **right_button_pressed** **(** :ref:`int` tab **)** + +Emitted when a tab is right-clicked. + +---- + +.. _class_Tabs_signal_tab_changed: + +- **tab_changed** **(** :ref:`int` tab **)** + +Emitted when switching to another tab. + +---- + +.. _class_Tabs_signal_tab_clicked: + +- **tab_clicked** **(** :ref:`int` tab **)** + +Emitted when a tab is clicked, even if it is the current tab. + +---- + +.. _class_Tabs_signal_tab_close: + +- **tab_close** **(** :ref:`int` tab **)** + +Emitted when a tab is closed. + +---- + +.. _class_Tabs_signal_tab_hover: + +- **tab_hover** **(** :ref:`int` tab **)** + +Emitted when a tab is hovered by the mouse. + +Enumerations +------------ + +.. _enum_Tabs_TabAlign: + +.. _class_Tabs_constant_ALIGN_LEFT: + +.. _class_Tabs_constant_ALIGN_CENTER: + +.. _class_Tabs_constant_ALIGN_RIGHT: + +.. _class_Tabs_constant_ALIGN_MAX: + +enum **TabAlign**: + +- **ALIGN_LEFT** = **0** --- Align the tabs to the left. + +- **ALIGN_CENTER** = **1** --- Align the tabs to the center. + +- **ALIGN_RIGHT** = **2** --- Align the tabs to the right. + +- **ALIGN_MAX** = **3** --- Represents the size of the :ref:`TabAlign` enum. + +---- + +.. _enum_Tabs_CloseButtonDisplayPolicy: + +.. _class_Tabs_constant_CLOSE_BUTTON_SHOW_NEVER: + +.. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ACTIVE_ONLY: + +.. _class_Tabs_constant_CLOSE_BUTTON_SHOW_ALWAYS: + +.. _class_Tabs_constant_CLOSE_BUTTON_MAX: + +enum **CloseButtonDisplayPolicy**: + +- **CLOSE_BUTTON_SHOW_NEVER** = **0** --- Never show the close buttons. + +- **CLOSE_BUTTON_SHOW_ACTIVE_ONLY** = **1** --- Only show the close button on the currently active tab. + +- **CLOSE_BUTTON_SHOW_ALWAYS** = **2** --- Show the close button on all tabs. + +- **CLOSE_BUTTON_MAX** = **3** --- Represents the size of the :ref:`CloseButtonDisplayPolicy` enum. + +Property Descriptions +--------------------- + +.. _class_Tabs_property_current_tab: + +- :ref:`int` **current_tab** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_current_tab(value) | ++-----------+------------------------+ +| *Getter* | get_current_tab() | ++-----------+------------------------+ + +Select tab at index ``tab_idx``. + +---- + +.. _class_Tabs_property_drag_to_rearrange_enabled: + +- :ref:`bool` **drag_to_rearrange_enabled** + ++-----------+--------------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------------+ +| *Setter* | set_drag_to_rearrange_enabled(value) | ++-----------+--------------------------------------+ +| *Getter* | get_drag_to_rearrange_enabled() | ++-----------+--------------------------------------+ + +If ``true``, tabs can be rearranged with mouse drag. + +---- + +.. _class_Tabs_property_scrolling_enabled: + +- :ref:`bool` **scrolling_enabled** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_scrolling_enabled(value) | ++-----------+------------------------------+ +| *Getter* | get_scrolling_enabled() | ++-----------+------------------------------+ + +if ``true``, the mouse's scroll wheel can be used to navigate the scroll view. + +---- + +.. _class_Tabs_property_tab_align: + +- :ref:`TabAlign` **tab_align** + ++-----------+----------------------+ +| *Default* | ``1`` | ++-----------+----------------------+ +| *Setter* | set_tab_align(value) | ++-----------+----------------------+ +| *Getter* | get_tab_align() | ++-----------+----------------------+ + +The alignment of all tabs. See :ref:`TabAlign` for details. + +---- + +.. _class_Tabs_property_tab_close_display_policy: + +- :ref:`CloseButtonDisplayPolicy` **tab_close_display_policy** + ++-----------+-------------------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------------------+ +| *Setter* | set_tab_close_display_policy(value) | ++-----------+-------------------------------------+ +| *Getter* | get_tab_close_display_policy() | ++-----------+-------------------------------------+ + +Sets when the close button will appear on the tabs. See :ref:`CloseButtonDisplayPolicy` for details. + +Method Descriptions +------------------- + +.. _class_Tabs_method_add_tab: + +- void **add_tab** **(** :ref:`String` title="", :ref:`Texture` icon=null **)** + +Adds a new tab. + +---- + +.. _class_Tabs_method_ensure_tab_visible: + +- void **ensure_tab_visible** **(** :ref:`int` idx **)** + +Moves the scroll view to make the tab visible. + +---- + +.. _class_Tabs_method_get_offset_buttons_visible: + +- :ref:`bool` **get_offset_buttons_visible** **(** **)** |const| + +Returns ``true`` if the offset buttons (the ones that appear when there's not enough space for all tabs) are visible. + +---- + +.. _class_Tabs_method_get_previous_tab: + +- :ref:`int` **get_previous_tab** **(** **)** |const| + +Returns the previously active tab index. + +---- + +.. _class_Tabs_method_get_select_with_rmb: + +- :ref:`bool` **get_select_with_rmb** **(** **)** |const| + +Returns ``true`` if select with right mouse button is enabled. + +---- + +.. _class_Tabs_method_get_tab_count: + +- :ref:`int` **get_tab_count** **(** **)** |const| + +Returns the number of tabs. + +---- + +.. _class_Tabs_method_get_tab_disabled: + +- :ref:`bool` **get_tab_disabled** **(** :ref:`int` tab_idx **)** |const| + +Returns ``true`` if the tab at index ``tab_idx`` is disabled. + +---- + +.. _class_Tabs_method_get_tab_icon: + +- :ref:`Texture` **get_tab_icon** **(** :ref:`int` tab_idx **)** |const| + +Returns the :ref:`Texture` for the tab at index ``tab_idx`` or ``null`` if the tab has no :ref:`Texture`. + +---- + +.. _class_Tabs_method_get_tab_offset: + +- :ref:`int` **get_tab_offset** **(** **)** |const| + +Returns the number of hidden tabs offsetted to the left. + +---- + +.. _class_Tabs_method_get_tab_rect: + +- :ref:`Rect2` **get_tab_rect** **(** :ref:`int` tab_idx **)** |const| + +Returns tab :ref:`Rect2` with local position and size. + +---- + +.. _class_Tabs_method_get_tab_title: + +- :ref:`String` **get_tab_title** **(** :ref:`int` tab_idx **)** |const| + +Returns the title of the tab at index ``tab_idx``. + +---- + +.. _class_Tabs_method_get_tabs_rearrange_group: + +- :ref:`int` **get_tabs_rearrange_group** **(** **)** |const| + +Returns the ``Tabs``' rearrange group ID. + +---- + +.. _class_Tabs_method_move_tab: + +- void **move_tab** **(** :ref:`int` from, :ref:`int` to **)** + +Moves a tab from ``from`` to ``to``. + +---- + +.. _class_Tabs_method_remove_tab: + +- void **remove_tab** **(** :ref:`int` tab_idx **)** + +Removes the tab at index ``tab_idx``. + +---- + +.. _class_Tabs_method_set_select_with_rmb: + +- void **set_select_with_rmb** **(** :ref:`bool` enabled **)** + +If ``true``, enables selecting a tab with the right mouse button. + +---- + +.. _class_Tabs_method_set_tab_disabled: + +- void **set_tab_disabled** **(** :ref:`int` tab_idx, :ref:`bool` disabled **)** + +If ``disabled`` is ``true``, disables the tab at index ``tab_idx``, making it non-interactable. + +---- + +.. _class_Tabs_method_set_tab_icon: + +- void **set_tab_icon** **(** :ref:`int` tab_idx, :ref:`Texture` icon **)** + +Sets an ``icon`` for the tab at index ``tab_idx``. + +---- + +.. _class_Tabs_method_set_tab_title: + +- void **set_tab_title** **(** :ref:`int` tab_idx, :ref:`String` title **)** + +Sets a ``title`` for the tab at index ``tab_idx``. + +---- + +.. _class_Tabs_method_set_tabs_rearrange_group: + +- void **set_tabs_rearrange_group** **(** :ref:`int` group_id **)** + +Defines the rearrange group ID. Choose for each ``Tabs`` the same value to dragging tabs between ``Tabs``. Enable drag with :ref:`drag_to_rearrange_enabled`. + +Theme Property Descriptions +--------------------------- + +.. _class_Tabs_theme_color_font_color_bg: + +- :ref:`Color` **font_color_bg** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++-----------+----------------------------------+ + +Font color of inactive tabs. + +---- + +.. _class_Tabs_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.9, 0.9, 0.2 )`` | ++-----------+---------------------------------+ + +Font color of disabled tabs. + +---- + +.. _class_Tabs_theme_color_font_color_fg: + +- :ref:`Color` **font_color_fg** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Font color of the currently selected tab. + +---- + +.. _class_Tabs_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal separation between the tabs. + +---- + +.. _class_Tabs_theme_constant_label_valign_bg: + +- :ref:`int` **label_valign_bg** + ++-----------+-------+ +| *Default* | ``2`` | ++-----------+-------+ + +---- + +.. _class_Tabs_theme_constant_label_valign_fg: + +- :ref:`int` **label_valign_fg** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +---- + +.. _class_Tabs_theme_constant_top_margin: + +- :ref:`int` **top_margin** + ++-----------+--------+ +| *Default* | ``24`` | ++-----------+--------+ + +---- + +.. _class_Tabs_theme_font_font: + +- :ref:`Font` **font** + +The font used to draw tab names. + +---- + +.. _class_Tabs_theme_icon_close: + +- :ref:`Texture` **close** + +The icon for the close button (see :ref:`tab_close_display_policy`). + +---- + +.. _class_Tabs_theme_icon_decrement: + +- :ref:`Texture` **decrement** + +Icon for the left arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the first tab is visible), it appears semi-transparent. + +---- + +.. _class_Tabs_theme_icon_decrement_highlight: + +- :ref:`Texture` **decrement_highlight** + +Icon for the left arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + +---- + +.. _class_Tabs_theme_icon_increment: + +- :ref:`Texture` **increment** + +Icon for the right arrow button that appears when there are too many tabs to fit in the container width. When the button is disabled (i.e. the last tab is visible) it appears semi-transparent. + +---- + +.. _class_Tabs_theme_icon_increment_highlight: + +- :ref:`Texture` **increment_highlight** + +Icon for the right arrow button that appears when there are too many tabs to fit in the container width. Used when the button is being hovered with the cursor. + +---- + +.. _class_Tabs_theme_style_button: + +- :ref:`StyleBox` **button** + +Background of the close button when it's being hovered with the cursor. + +---- + +.. _class_Tabs_theme_style_button_pressed: + +- :ref:`StyleBox` **button_pressed** + +Background of the close button when it's being pressed. + +---- + +.. _class_Tabs_theme_style_tab_bg: + +- :ref:`StyleBox` **tab_bg** + +The style of an inactive tab. + +---- + +.. _class_Tabs_theme_style_tab_disabled: + +- :ref:`StyleBox` **tab_disabled** + +The style of a disabled tab + +---- + +.. _class_Tabs_theme_style_tab_fg: + +- :ref:`StyleBox` **tab_fg** + +The style of the currently selected tab. + +.. |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.)` diff --git a/classes/class_tcp_server.rst b/classes/class_tcp_server.rst new file mode 100644 index 0000000..59d9241 --- /dev/null +++ b/classes/class_tcp_server.rst @@ -0,0 +1,85 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TCP_Server.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TCP_Server: + +TCP_Server +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A TCP server. + +Description +----------- + +A TCP server. Listens to connections on a port and returns a :ref:`StreamPeerTCP` when it gets an incoming connection. + +Methods +------- + ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connection_available` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_listening` **(** **)** |const| | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`String` bind_address="*" **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StreamPeerTCP` | :ref:`take_connection` **(** **)** | ++-------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_TCP_Server_method_is_connection_available: + +- :ref:`bool` **is_connection_available** **(** **)** |const| + +Returns ``true`` if a connection is available for taking. + +---- + +.. _class_TCP_Server_method_is_listening: + +- :ref:`bool` **is_listening** **(** **)** |const| + +Returns ``true`` if the server is currently listening for connections. + +---- + +.. _class_TCP_Server_method_listen: + +- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`String` bind_address="*" **)** + +Listen on the ``port`` binding to ``bind_address``. + +If ``bind_address`` is set as ``"*"`` (default), the server will listen on all available addresses (both IPv4 and IPv6). + +If ``bind_address`` is set as ``"0.0.0.0"`` (for IPv4) or ``"::"`` (for IPv6), the server will listen on all available addresses matching that IP type. + +If ``bind_address`` is set to any valid address (e.g. ``"192.168.1.101"``, ``"::1"``, etc), the server will only listen on the interface with that addresses (or fail if no interface with the given address exists). + +---- + +.. _class_TCP_Server_method_stop: + +- void **stop** **(** **)** + +Stops listening. + +---- + +.. _class_TCP_Server_method_take_connection: + +- :ref:`StreamPeerTCP` **take_connection** **(** **)** + +If a connection is available, returns a StreamPeerTCP with the connection. + +.. |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.)` diff --git a/classes/class_textedit.rst b/classes/class_textedit.rst new file mode 100644 index 0000000..8a6baba --- /dev/null +++ b/classes/class_textedit.rst @@ -0,0 +1,1775 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextEdit.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextEdit: + +TextEdit +======== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Multiline text editing control. + +Description +----------- + +TextEdit is meant for editing large, multiline text. It also has facilities for editing code, such as syntax highlighting support and multiple levels of undo/redo. + +**Note:** When holding down ``Alt``, the vertical scroll wheel will scroll 5 times as fast as it would normally do. This also works in the Godot script editor. + +Properties +---------- + ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`bookmark_gutter` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`breakpoint_gutter` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`caret_blink` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`caret_blink_speed` | ``0.65`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`caret_block_mode` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`caret_moving_by_right_click` | ``true`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`context_menu_enabled` | ``true`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`draw_spaces` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`draw_tabs` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`fold_gutter` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`hiding_enabled` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`highlight_all_occurrences` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`highlight_current_line` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`minimap_draw` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`minimap_width` | ``80`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`CursorShape` | mouse_default_cursor_shape | ``1`` *(parent override)* | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`override_selected_font_color` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`readonly` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`scroll_horizontal` | ``0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`scroll_vertical` | ``0.0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`selecting_enabled` | ``true`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`shortcut_keys_enabled` | ``true`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`show_line_numbers` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`smooth_scrolling` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`syntax_highlighting` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`String` | :ref:`text` | ``""`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`v_scroll_speed` | ``80.0`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`virtual_keyboard_enabled` | ``true`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`wrap_enabled` | ``false`` | ++----------------------------------------------+-------------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_color_region` **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=false **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_keyword_color` **(** :ref:`String` keyword, :ref:`Color` color **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_fold` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`center_viewport_to_cursor` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_colors` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_undo_history` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`cursor_get_column` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`cursor_get_line` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`cursor_set_column` **(** :ref:`int` column, :ref:`bool` adjust_viewport=true **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`cursor_set_line` **(** :ref:`int` line, :ref:`bool` adjust_viewport=true, :ref:`bool` can_be_hidden=true, :ref:`int` wrap_index=0 **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`cut` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`deselect` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fold_all_lines` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fold_line` **(** :ref:`int` line **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_breakpoints` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_keyword_color` **(** :ref:`String` keyword **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_line` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_line_column_at_pos` **(** :ref:`Vector2` position **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_count` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_height` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_width` **(** :ref:`int` line, :ref:`int` wrap_index=-1 **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_line_wrap_count` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_line_wrapped_text` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PopupMenu` | :ref:`get_menu` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_pos_at_line_column` **(** :ref:`int` line, :ref:`int` column **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_rect_at_line_column` **(** :ref:`int` line, :ref:`int` column **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selection_from_column` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selection_from_line` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_selection_text` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selection_to_column` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selection_to_line` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_total_gutter_width` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_word_under_cursor` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_keyword_color` **(** :ref:`String` keyword **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_redo` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_undo` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`insert_text_at_cursor` **(** :ref:`String` text **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_folded` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_line_hidden` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_line_set_as_bookmark` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_line_set_as_breakpoint` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_line_set_as_safe` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_line_wrapped` **(** :ref:`int` line **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_selection_active` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`menu_option` **(** :ref:`int` option **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`paste` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`redo` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_breakpoints` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`search` **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select_all` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line` **(** :ref:`int` line, :ref:`String` new_text **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line_as_bookmark` **(** :ref:`int` line, :ref:`bool` bookmark **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line_as_breakpoint` **(** :ref:`int` line, :ref:`bool` breakpoint **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line_as_hidden` **(** :ref:`int` line, :ref:`bool` enable **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_line_as_safe` **(** :ref:`int` line, :ref:`bool` safe **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`toggle_fold_line` **(** :ref:`int` line **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`undo` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unfold_line` **(** :ref:`int` line **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unhide_all_lines` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`background_color` | ``Color( 0, 0, 0, 0 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`bookmark_color` | ``Color( 0.08, 0.49, 0.98, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`brace_mismatch_color` | ``Color( 1, 0.2, 0.2, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`breakpoint_color` | ``Color( 0.8, 0.8, 0.4, 0.2 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`caret_background_color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`caret_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`code_folding_color` | ``Color( 0.8, 0.8, 0.8, 0.8 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`completion_background_color` | ``Color( 0.17, 0.16, 0.2, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`completion_existing_color` | ``Color( 0.87, 0.87, 0.87, 0.13 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`completion_font_color` | ``Color( 0.67, 0.67, 0.67, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`completion_scroll_color` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`completion_selected_color` | ``Color( 0.26, 0.26, 0.27, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`current_line_color` | ``Color( 0.25, 0.25, 0.26, 0.8 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`executing_line_color` | ``Color( 0.2, 0.8, 0.2, 0.4 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`font_color_readonly` | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`font_color_selected` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`function_color` | ``Color( 0.4, 0.64, 0.81, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`line_number_color` | ``Color( 0.67, 0.67, 0.67, 0.4 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`mark_color` | ``Color( 1, 0.4, 0.4, 0.4 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`member_variable_color` | ``Color( 0.9, 0.31, 0.35, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`number_color` | ``Color( 0.92, 0.58, 0.2, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`safe_line_number_color` | ``Color( 0.67, 0.78, 0.67, 0.6 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`selection_color` | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`symbol_color` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Color` | :ref:`word_highlighted_color` | ``Color( 0.8, 0.9, 0.9, 0.15 )`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`completion_lines` | ``7`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`completion_max_width` | ``50`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`completion_scroll_width` | ``3`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`int` | :ref:`line_spacing` | ``4`` | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Texture` | :ref:`fold` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Texture` | :ref:`folded` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Texture` | :ref:`space` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`Texture` | :ref:`tab` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`StyleBox` | :ref:`completion` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ +| :ref:`StyleBox` | :ref:`read_only` | | ++---------------------------------+--------------------------------------------------------------------------------------------+-------------------------------------+ + +Signals +------- + +.. _class_TextEdit_signal_breakpoint_toggled: + +- **breakpoint_toggled** **(** :ref:`int` row **)** + +Emitted when a breakpoint is placed via the breakpoint gutter. + +---- + +.. _class_TextEdit_signal_cursor_changed: + +- **cursor_changed** **(** **)** + +Emitted when the cursor changes. + +---- + +.. _class_TextEdit_signal_info_clicked: + +- **info_clicked** **(** :ref:`int` row, :ref:`String` info **)** + +Emitted when the info icon is clicked. + +---- + +.. _class_TextEdit_signal_request_completion: + +- **request_completion** **(** **)** + +---- + +.. _class_TextEdit_signal_symbol_lookup: + +- **symbol_lookup** **(** :ref:`String` symbol, :ref:`int` row, :ref:`int` column **)** + +---- + +.. _class_TextEdit_signal_text_changed: + +- **text_changed** **(** **)** + +Emitted when the text changes. + +Enumerations +------------ + +.. _enum_TextEdit_SearchFlags: + +.. _class_TextEdit_constant_SEARCH_MATCH_CASE: + +.. _class_TextEdit_constant_SEARCH_WHOLE_WORDS: + +.. _class_TextEdit_constant_SEARCH_BACKWARDS: + +enum **SearchFlags**: + +- **SEARCH_MATCH_CASE** = **1** --- Match case when searching. + +- **SEARCH_WHOLE_WORDS** = **2** --- Match whole words when searching. + +- **SEARCH_BACKWARDS** = **4** --- Search from end to beginning. + +---- + +.. _enum_TextEdit_SearchResult: + +.. _class_TextEdit_constant_SEARCH_RESULT_COLUMN: + +.. _class_TextEdit_constant_SEARCH_RESULT_LINE: + +enum **SearchResult**: + +- **SEARCH_RESULT_COLUMN** = **0** --- Used to access the result column from :ref:`search`. + +- **SEARCH_RESULT_LINE** = **1** --- Used to access the result line from :ref:`search`. + +---- + +.. _enum_TextEdit_MenuItems: + +.. _class_TextEdit_constant_MENU_CUT: + +.. _class_TextEdit_constant_MENU_COPY: + +.. _class_TextEdit_constant_MENU_PASTE: + +.. _class_TextEdit_constant_MENU_CLEAR: + +.. _class_TextEdit_constant_MENU_SELECT_ALL: + +.. _class_TextEdit_constant_MENU_UNDO: + +.. _class_TextEdit_constant_MENU_REDO: + +.. _class_TextEdit_constant_MENU_MAX: + +enum **MenuItems**: + +- **MENU_CUT** = **0** --- Cuts (copies and clears) the selected text. + +- **MENU_COPY** = **1** --- Copies the selected text. + +- **MENU_PASTE** = **2** --- Pastes the clipboard text over the selected text (or at the cursor's position). + +- **MENU_CLEAR** = **3** --- Erases the whole ``TextEdit`` text. + +- **MENU_SELECT_ALL** = **4** --- Selects the whole ``TextEdit`` text. + +- **MENU_UNDO** = **5** --- Undoes the previous action. + +- **MENU_REDO** = **6** --- Redoes the previous action. + +- **MENU_MAX** = **7** --- Represents the size of the :ref:`MenuItems` enum. + +Property Descriptions +--------------------- + +.. _class_TextEdit_property_bookmark_gutter: + +- :ref:`bool` **bookmark_gutter** + ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Setter* | set_bookmark_gutter_enabled(value) | ++-----------+------------------------------------+ +| *Getter* | is_bookmark_gutter_enabled() | ++-----------+------------------------------------+ + +If ``true``, the bookmark gutter is visible. + +---- + +.. _class_TextEdit_property_breakpoint_gutter: + +- :ref:`bool` **breakpoint_gutter** + ++-----------+--------------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------------+ +| *Setter* | set_breakpoint_gutter_enabled(value) | ++-----------+--------------------------------------+ +| *Getter* | is_breakpoint_gutter_enabled() | ++-----------+--------------------------------------+ + +If ``true``, the breakpoint gutter is visible. + +---- + +.. _class_TextEdit_property_caret_blink: + +- :ref:`bool` **caret_blink** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | cursor_set_blink_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | cursor_get_blink_enabled() | ++-----------+---------------------------------+ + +If ``true``, the caret (visual cursor) blinks. + +---- + +.. _class_TextEdit_property_caret_blink_speed: + +- :ref:`float` **caret_blink_speed** + ++-----------+-------------------------------+ +| *Default* | ``0.65`` | ++-----------+-------------------------------+ +| *Setter* | cursor_set_blink_speed(value) | ++-----------+-------------------------------+ +| *Getter* | cursor_get_blink_speed() | ++-----------+-------------------------------+ + +Duration (in seconds) of a caret's blinking cycle. + +---- + +.. _class_TextEdit_property_caret_block_mode: + +- :ref:`bool` **caret_block_mode** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | cursor_set_block_mode(value) | ++-----------+------------------------------+ +| *Getter* | cursor_is_block_mode() | ++-----------+------------------------------+ + +If ``true``, the caret displays as a rectangle. + +If ``false``, the caret displays as a bar. + +---- + +.. _class_TextEdit_property_caret_moving_by_right_click: + +- :ref:`bool` **caret_moving_by_right_click** + ++-----------+------------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------------+ +| *Setter* | set_right_click_moves_caret(value) | ++-----------+------------------------------------+ +| *Getter* | is_right_click_moving_caret() | ++-----------+------------------------------------+ + +If ``true``, a right-click moves the cursor at the mouse position before displaying the context menu. + +If ``false``, the context menu disregards mouse location. + +---- + +.. _class_TextEdit_property_context_menu_enabled: + +- :ref:`bool` **context_menu_enabled** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_context_menu_enabled(value) | ++-----------+---------------------------------+ +| *Getter* | is_context_menu_enabled() | ++-----------+---------------------------------+ + +If ``true``, a right-click displays the context menu. + +---- + +.. _class_TextEdit_property_draw_spaces: + +- :ref:`bool` **draw_spaces** + ++-----------+------------------------+ +| *Default* | ``false`` | ++-----------+------------------------+ +| *Setter* | set_draw_spaces(value) | ++-----------+------------------------+ +| *Getter* | is_drawing_spaces() | ++-----------+------------------------+ + +If ``true``, the "space" character will have a visible representation. + +---- + +.. _class_TextEdit_property_draw_tabs: + +- :ref:`bool` **draw_tabs** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_draw_tabs(value) | ++-----------+----------------------+ +| *Getter* | is_drawing_tabs() | ++-----------+----------------------+ + +If ``true``, the "tab" character will have a visible representation. + +---- + +.. _class_TextEdit_property_fold_gutter: + +- :ref:`bool` **fold_gutter** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_draw_fold_gutter(value) | ++-----------+-----------------------------+ +| *Getter* | is_drawing_fold_gutter() | ++-----------+-----------------------------+ + +If ``true``, the fold gutter is visible. This enables folding groups of indented lines. + +---- + +.. _class_TextEdit_property_hiding_enabled: + +- :ref:`bool` **hiding_enabled** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_hiding_enabled(value) | ++-----------+---------------------------+ +| *Getter* | is_hiding_enabled() | ++-----------+---------------------------+ + +If ``true``, all lines that have been set to hidden by :ref:`set_line_as_hidden`, will not be visible. + +---- + +.. _class_TextEdit_property_highlight_all_occurrences: + +- :ref:`bool` **highlight_all_occurrences** + ++-----------+----------------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------------+ +| *Setter* | set_highlight_all_occurrences(value) | ++-----------+----------------------------------------+ +| *Getter* | is_highlight_all_occurrences_enabled() | ++-----------+----------------------------------------+ + +If ``true``, all occurrences of the selected text will be highlighted. + +---- + +.. _class_TextEdit_property_highlight_current_line: + +- :ref:`bool` **highlight_current_line** + ++-----------+-------------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------------+ +| *Setter* | set_highlight_current_line(value) | ++-----------+-------------------------------------+ +| *Getter* | is_highlight_current_line_enabled() | ++-----------+-------------------------------------+ + +If ``true``, the line containing the cursor is highlighted. + +---- + +.. _class_TextEdit_property_minimap_draw: + +- :ref:`bool` **minimap_draw** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | draw_minimap(value) | ++-----------+----------------------+ +| *Getter* | is_drawing_minimap() | ++-----------+----------------------+ + +If ``true``, a minimap is shown, providing an outline of your source code. + +---- + +.. _class_TextEdit_property_minimap_width: + +- :ref:`int` **minimap_width** + ++-----------+--------------------------+ +| *Default* | ``80`` | ++-----------+--------------------------+ +| *Setter* | set_minimap_width(value) | ++-----------+--------------------------+ +| *Getter* | get_minimap_width() | ++-----------+--------------------------+ + +The width, in pixels, of the minimap. + +---- + +.. _class_TextEdit_property_override_selected_font_color: + +- :ref:`bool` **override_selected_font_color** + ++-----------+-----------------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------------+ +| *Setter* | set_override_selected_font_color(value) | ++-----------+-----------------------------------------+ +| *Getter* | is_overriding_selected_font_color() | ++-----------+-----------------------------------------+ + +If ``true``, custom ``font_color_selected`` will be used for selected text. + +---- + +.. _class_TextEdit_property_readonly: + +- :ref:`bool` **readonly** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_readonly(value) | ++-----------+---------------------+ +| *Getter* | is_readonly() | ++-----------+---------------------+ + +If ``true``, read-only mode is enabled. Existing text cannot be modified and new text cannot be added. + +---- + +.. _class_TextEdit_property_scroll_horizontal: + +- :ref:`int` **scroll_horizontal** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_h_scroll(value) | ++-----------+---------------------+ +| *Getter* | get_h_scroll() | ++-----------+---------------------+ + +If there is a horizontal scrollbar, this determines the current horizontal scroll value in pixels. + +---- + +.. _class_TextEdit_property_scroll_vertical: + +- :ref:`float` **scroll_vertical** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_v_scroll(value) | ++-----------+---------------------+ +| *Getter* | get_v_scroll() | ++-----------+---------------------+ + +If there is a vertical scrollbar, this determines the current vertical scroll value in line numbers, starting at 0 for the top line. + +---- + +.. _class_TextEdit_property_selecting_enabled: + +- :ref:`bool` **selecting_enabled** + ++-----------+------------------------------+ +| *Default* | ``true`` | ++-----------+------------------------------+ +| *Setter* | set_selecting_enabled(value) | ++-----------+------------------------------+ +| *Getter* | is_selecting_enabled() | ++-----------+------------------------------+ + +If ``true``, text can be selected. + +If ``false``, text can not be selected by the user or by the :ref:`select` or :ref:`select_all` methods. + +---- + +.. _class_TextEdit_property_shortcut_keys_enabled: + +- :ref:`bool` **shortcut_keys_enabled** + ++-----------+----------------------------------+ +| *Default* | ``true`` | ++-----------+----------------------------------+ +| *Setter* | set_shortcut_keys_enabled(value) | ++-----------+----------------------------------+ +| *Getter* | is_shortcut_keys_enabled() | ++-----------+----------------------------------+ + +If ``true``, shortcut keys for context menu items are enabled, even if the context menu is disabled. + +---- + +.. _class_TextEdit_property_show_line_numbers: + +- :ref:`bool` **show_line_numbers** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_show_line_numbers(value) | ++-----------+--------------------------------+ +| *Getter* | is_show_line_numbers_enabled() | ++-----------+--------------------------------+ + +If ``true``, line numbers are displayed to the left of the text. + +---- + +.. _class_TextEdit_property_smooth_scrolling: + +- :ref:`bool` **smooth_scrolling** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_smooth_scroll_enable(value) | ++-----------+---------------------------------+ +| *Getter* | is_smooth_scroll_enabled() | ++-----------+---------------------------------+ + +If ``true``, sets the ``step`` of the scrollbars to ``0.25`` which results in smoother scrolling. + +---- + +.. _class_TextEdit_property_syntax_highlighting: + +- :ref:`bool` **syntax_highlighting** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_syntax_coloring(value) | ++-----------+------------------------------+ +| *Getter* | is_syntax_coloring_enabled() | ++-----------+------------------------------+ + +If ``true``, any custom color properties that have been set for this ``TextEdit`` will be visible. + +---- + +.. _class_TextEdit_property_text: + +- :ref:`String` **text** + ++-----------+-----------------+ +| *Default* | ``""`` | ++-----------+-----------------+ +| *Setter* | set_text(value) | ++-----------+-----------------+ +| *Getter* | get_text() | ++-----------+-----------------+ + +String value of the ``TextEdit``. + +---- + +.. _class_TextEdit_property_v_scroll_speed: + +- :ref:`float` **v_scroll_speed** + ++-----------+---------------------------+ +| *Default* | ``80.0`` | ++-----------+---------------------------+ +| *Setter* | set_v_scroll_speed(value) | ++-----------+---------------------------+ +| *Getter* | get_v_scroll_speed() | ++-----------+---------------------------+ + +Vertical scroll sensitivity. + +---- + +.. _class_TextEdit_property_virtual_keyboard_enabled: + +- :ref:`bool` **virtual_keyboard_enabled** + ++-----------+-------------------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------------------+ +| *Setter* | set_virtual_keyboard_enabled(value) | ++-----------+-------------------------------------+ +| *Getter* | is_virtual_keyboard_enabled() | ++-----------+-------------------------------------+ + +If ``true``, the native virtual keyboard is shown when focused on platforms that support it. + +---- + +.. _class_TextEdit_property_wrap_enabled: + +- :ref:`bool` **wrap_enabled** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_wrap_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_wrap_enabled() | ++-----------+-------------------------+ + +If ``true``, enables text wrapping when it goes beyond the edge of what is visible. + +Method Descriptions +------------------- + +.. _class_TextEdit_method_add_color_region: + +- void **add_color_region** **(** :ref:`String` begin_key, :ref:`String` end_key, :ref:`Color` color, :ref:`bool` line_only=false **)** + +Adds color region (given the delimiters) and its colors. + +---- + +.. _class_TextEdit_method_add_keyword_color: + +- void **add_keyword_color** **(** :ref:`String` keyword, :ref:`Color` color **)** + +Adds a ``keyword`` and its :ref:`Color`. + +---- + +.. _class_TextEdit_method_can_fold: + +- :ref:`bool` **can_fold** **(** :ref:`int` line **)** |const| + +Returns if the given line is foldable, that is, it has indented lines right below it. + +---- + +.. _class_TextEdit_method_center_viewport_to_cursor: + +- void **center_viewport_to_cursor** **(** **)** + +Centers the viewport on the line the editing cursor is at. This also resets the :ref:`scroll_horizontal` value to ``0``. + +---- + +.. _class_TextEdit_method_clear_colors: + +- void **clear_colors** **(** **)** + +Clears all custom syntax coloring information previously added with :ref:`add_color_region` or :ref:`add_keyword_color`. + +---- + +.. _class_TextEdit_method_clear_undo_history: + +- void **clear_undo_history** **(** **)** + +Clears the undo history. + +---- + +.. _class_TextEdit_method_copy: + +- void **copy** **(** **)** + +Copy's the current text selection. + +---- + +.. _class_TextEdit_method_cursor_get_column: + +- :ref:`int` **cursor_get_column** **(** **)** |const| + +Returns the column the editing cursor is at. + +---- + +.. _class_TextEdit_method_cursor_get_line: + +- :ref:`int` **cursor_get_line** **(** **)** |const| + +Returns the line the editing cursor is at. + +---- + +.. _class_TextEdit_method_cursor_set_column: + +- void **cursor_set_column** **(** :ref:`int` column, :ref:`bool` adjust_viewport=true **)** + +Moves the cursor at the specified ``column`` index. + +If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs. + +---- + +.. _class_TextEdit_method_cursor_set_line: + +- void **cursor_set_line** **(** :ref:`int` line, :ref:`bool` adjust_viewport=true, :ref:`bool` can_be_hidden=true, :ref:`int` wrap_index=0 **)** + +Moves the cursor at the specified ``line`` index. + +If ``adjust_viewport`` is set to ``true``, the viewport will center at the cursor position after the move occurs. + +If ``can_be_hidden`` is set to ``true``, the specified ``line`` can be hidden using :ref:`set_line_as_hidden`. + +---- + +.. _class_TextEdit_method_cut: + +- void **cut** **(** **)** + +Cut's the current selection. + +---- + +.. _class_TextEdit_method_deselect: + +- void **deselect** **(** **)** + +Deselects the current selection. + +---- + +.. _class_TextEdit_method_fold_all_lines: + +- void **fold_all_lines** **(** **)** + +Folds all lines that are possible to be folded (see :ref:`can_fold`). + +---- + +.. _class_TextEdit_method_fold_line: + +- void **fold_line** **(** :ref:`int` line **)** + +Folds the given line, if possible (see :ref:`can_fold`). + +---- + +.. _class_TextEdit_method_get_breakpoints: + +- :ref:`Array` **get_breakpoints** **(** **)** |const| + +Returns an array containing the line number of each breakpoint. + +---- + +.. _class_TextEdit_method_get_keyword_color: + +- :ref:`Color` **get_keyword_color** **(** :ref:`String` keyword **)** |const| + +Returns the :ref:`Color` of the specified ``keyword``. + +---- + +.. _class_TextEdit_method_get_line: + +- :ref:`String` **get_line** **(** :ref:`int` line **)** |const| + +Returns the text of a specific line. + +---- + +.. _class_TextEdit_method_get_line_column_at_pos: + +- :ref:`Vector2` **get_line_column_at_pos** **(** :ref:`Vector2` position **)** |const| + +Returns the line and column at the given position. In the returned vector, ``x`` is the column, ``y`` is the line. + +---- + +.. _class_TextEdit_method_get_line_count: + +- :ref:`int` **get_line_count** **(** **)** |const| + +Returns the amount of total lines in the text. + +---- + +.. _class_TextEdit_method_get_line_height: + +- :ref:`int` **get_line_height** **(** **)** |const| + +Returns the height of a largest line. + +---- + +.. _class_TextEdit_method_get_line_width: + +- :ref:`int` **get_line_width** **(** :ref:`int` line, :ref:`int` wrap_index=-1 **)** |const| + +Returns the width in pixels of the ``wrap_index`` on ``line``. + +---- + +.. _class_TextEdit_method_get_line_wrap_count: + +- :ref:`int` **get_line_wrap_count** **(** :ref:`int` line **)** |const| + +Returns the number of times the given line is wrapped. + +---- + +.. _class_TextEdit_method_get_line_wrapped_text: + +- :ref:`PoolStringArray` **get_line_wrapped_text** **(** :ref:`int` line **)** |const| + +Returns an array of :ref:`String`\ s representing each wrapped index. + +---- + +.. _class_TextEdit_method_get_menu: + +- :ref:`PopupMenu` **get_menu** **(** **)** |const| + +Returns the :ref:`PopupMenu` of this ``TextEdit``. By default, this menu is displayed when right-clicking on the ``TextEdit``. + +**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` property. + +---- + +.. _class_TextEdit_method_get_pos_at_line_column: + +- :ref:`Vector2` **get_pos_at_line_column** **(** :ref:`int` line, :ref:`int` column **)** |const| + +Returns the local position for the given ``line`` and ``column``. If ``x`` or ``y`` of the returned vector equal ``-1``, the position is outside of the viewable area of the control. + +**Note:** The Y position corresponds to the bottom side of the line. Use :ref:`get_rect_at_line_column` to get the top side position. + +---- + +.. _class_TextEdit_method_get_rect_at_line_column: + +- :ref:`Rect2` **get_rect_at_line_column** **(** :ref:`int` line, :ref:`int` column **)** |const| + +Returns the local position and size for the grapheme at the given ``line`` and ``column``. If ``x`` or ``y`` position of the returned rect equal ``-1``, the position is outside of the viewable area of the control. + +**Note:** The Y position of the returned rect corresponds to the top side of the line, unlike :ref:`get_pos_at_line_column` which returns the bottom side. + +---- + +.. _class_TextEdit_method_get_selection_from_column: + +- :ref:`int` **get_selection_from_column** **(** **)** |const| + +Returns the selection begin column. + +---- + +.. _class_TextEdit_method_get_selection_from_line: + +- :ref:`int` **get_selection_from_line** **(** **)** |const| + +Returns the selection begin line. + +---- + +.. _class_TextEdit_method_get_selection_text: + +- :ref:`String` **get_selection_text** **(** **)** |const| + +Returns the text inside the selection. + +---- + +.. _class_TextEdit_method_get_selection_to_column: + +- :ref:`int` **get_selection_to_column** **(** **)** |const| + +Returns the selection end column. + +---- + +.. _class_TextEdit_method_get_selection_to_line: + +- :ref:`int` **get_selection_to_line** **(** **)** |const| + +Returns the selection end line. + +---- + +.. _class_TextEdit_method_get_total_gutter_width: + +- :ref:`int` **get_total_gutter_width** **(** **)** |const| + +Returns the total width of all gutters and internal padding. + +---- + +.. _class_TextEdit_method_get_word_under_cursor: + +- :ref:`String` **get_word_under_cursor** **(** **)** |const| + +Returns a :ref:`String` text with the word under the caret (text cursor) location. + +---- + +.. _class_TextEdit_method_has_keyword_color: + +- :ref:`bool` **has_keyword_color** **(** :ref:`String` keyword **)** |const| + +Returns whether the specified ``keyword`` has a color set to it or not. + +---- + +.. _class_TextEdit_method_has_redo: + +- :ref:`bool` **has_redo** **(** **)** |const| + +Returns ``true`` if a "redo" action is available. + +---- + +.. _class_TextEdit_method_has_undo: + +- :ref:`bool` **has_undo** **(** **)** |const| + +Returns ``true`` if an "undo" action is available. + +---- + +.. _class_TextEdit_method_insert_text_at_cursor: + +- void **insert_text_at_cursor** **(** :ref:`String` text **)** + +Insert the specified text at the cursor position. + +---- + +.. _class_TextEdit_method_is_folded: + +- :ref:`bool` **is_folded** **(** :ref:`int` line **)** |const| + +Returns whether the line at the specified index is folded or not. + +---- + +.. _class_TextEdit_method_is_line_hidden: + +- :ref:`bool` **is_line_hidden** **(** :ref:`int` line **)** |const| + +Returns whether the line at the specified index is hidden or not. + +---- + +.. _class_TextEdit_method_is_line_set_as_bookmark: + +- :ref:`bool` **is_line_set_as_bookmark** **(** :ref:`int` line **)** |const| + +Returns ``true`` when the specified ``line`` is bookmarked. + +---- + +.. _class_TextEdit_method_is_line_set_as_breakpoint: + +- :ref:`bool` **is_line_set_as_breakpoint** **(** :ref:`int` line **)** |const| + +Returns ``true`` when the specified ``line`` has a breakpoint. + +---- + +.. _class_TextEdit_method_is_line_set_as_safe: + +- :ref:`bool` **is_line_set_as_safe** **(** :ref:`int` line **)** |const| + +Returns ``true`` when the specified ``line`` is marked as safe. + +---- + +.. _class_TextEdit_method_is_line_wrapped: + +- :ref:`bool` **is_line_wrapped** **(** :ref:`int` line **)** |const| + +Returns if the given line is wrapped. + +---- + +.. _class_TextEdit_method_is_selection_active: + +- :ref:`bool` **is_selection_active** **(** **)** |const| + +Returns ``true`` if the selection is active. + +---- + +.. _class_TextEdit_method_menu_option: + +- void **menu_option** **(** :ref:`int` option **)** + +Triggers a right-click menu action by the specified index. See :ref:`MenuItems` for a list of available indexes. + +---- + +.. _class_TextEdit_method_paste: + +- void **paste** **(** **)** + +Paste the current selection. + +---- + +.. _class_TextEdit_method_redo: + +- void **redo** **(** **)** + +Perform redo operation. + +---- + +.. _class_TextEdit_method_remove_breakpoints: + +- void **remove_breakpoints** **(** **)** + +Removes all the breakpoints. This will not fire the :ref:`breakpoint_toggled` signal. + +---- + +.. _class_TextEdit_method_search: + +- :ref:`PoolIntArray` **search** **(** :ref:`String` key, :ref:`int` flags, :ref:`int` from_line, :ref:`int` from_column **)** |const| + +Perform a search inside the text. Search flags can be specified in the :ref:`SearchFlags` enum. + +Returns an empty ``PoolIntArray`` if no result was found. Otherwise, the result line and column can be accessed at indices specified in the :ref:`SearchResult` enum, e.g: + +:: + + var result = search(key, flags, line, column) + if result.size() > 0: + # Result found. + var res_line = result[TextEdit.SEARCH_RESULT_LINE] + var res_column = result[TextEdit.SEARCH_RESULT_COLUMN] + +---- + +.. _class_TextEdit_method_select: + +- void **select** **(** :ref:`int` from_line, :ref:`int` from_column, :ref:`int` to_line, :ref:`int` to_column **)** + +Perform selection, from line/column to line/column. + +If :ref:`selecting_enabled` is ``false``, no selection will occur. + +---- + +.. _class_TextEdit_method_select_all: + +- void **select_all** **(** **)** + +Select all the text. + +If :ref:`selecting_enabled` is ``false``, no selection will occur. + +---- + +.. _class_TextEdit_method_set_line: + +- void **set_line** **(** :ref:`int` line, :ref:`String` new_text **)** + +Sets the text for a specific line. + +---- + +.. _class_TextEdit_method_set_line_as_bookmark: + +- void **set_line_as_bookmark** **(** :ref:`int` line, :ref:`bool` bookmark **)** + +Bookmarks the ``line`` if ``bookmark`` is true. Deletes the bookmark if ``bookmark`` is false. + +Bookmarks are shown in the :ref:`breakpoint_gutter`. + +---- + +.. _class_TextEdit_method_set_line_as_breakpoint: + +- void **set_line_as_breakpoint** **(** :ref:`int` line, :ref:`bool` breakpoint **)** + +Adds or removes the breakpoint in ``line``. Breakpoints are shown in the :ref:`breakpoint_gutter`. + +---- + +.. _class_TextEdit_method_set_line_as_hidden: + +- void **set_line_as_hidden** **(** :ref:`int` line, :ref:`bool` enable **)** + +If ``true``, hides the line of the specified index. + +---- + +.. _class_TextEdit_method_set_line_as_safe: + +- void **set_line_as_safe** **(** :ref:`int` line, :ref:`bool` safe **)** + +If ``true``, marks the ``line`` as safe. + +This will show the line number with the color provided in the ``safe_line_number_color`` theme property. + +---- + +.. _class_TextEdit_method_toggle_fold_line: + +- void **toggle_fold_line** **(** :ref:`int` line **)** + +Toggle the folding of the code block at the given line. + +---- + +.. _class_TextEdit_method_undo: + +- void **undo** **(** **)** + +Perform undo operation. + +---- + +.. _class_TextEdit_method_unfold_line: + +- void **unfold_line** **(** :ref:`int` line **)** + +Unfolds the given line, if folded. + +---- + +.. _class_TextEdit_method_unhide_all_lines: + +- void **unhide_all_lines** **(** **)** + +Unhide all lines that were previously set to hidden by :ref:`set_line_as_hidden`. + +Theme Property Descriptions +--------------------------- + +.. _class_TextEdit_theme_color_background_color: + +- :ref:`Color` **background_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 0 )`` | ++-----------+-------------------------+ + +Sets the background :ref:`Color` of this ``TextEdit``. :ref:`syntax_highlighting` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_bookmark_color: + +- :ref:`Color` **bookmark_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.08, 0.49, 0.98, 1 )`` | ++-----------+----------------------------------+ + +Sets the :ref:`Color` of the bookmark marker. :ref:`syntax_highlighting` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_brace_mismatch_color: + +- :ref:`Color` **brace_mismatch_color** + ++-----------+-----------------------------+ +| *Default* | ``Color( 1, 0.2, 0.2, 1 )`` | ++-----------+-----------------------------+ + +---- + +.. _class_TextEdit_theme_color_breakpoint_color: + +- :ref:`Color` **breakpoint_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.8, 0.8, 0.4, 0.2 )`` | ++-----------+---------------------------------+ + +Sets the :ref:`Color` of the breakpoints. :ref:`breakpoint_gutter` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_caret_background_color: + +- :ref:`Color` **caret_background_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +---- + +.. _class_TextEdit_theme_color_caret_color: + +- :ref:`Color` **caret_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +---- + +.. _class_TextEdit_theme_color_code_folding_color: + +- :ref:`Color` **code_folding_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.8, 0.8, 0.8, 0.8 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_completion_background_color: + +- :ref:`Color` **completion_background_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.17, 0.16, 0.2, 1 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_completion_existing_color: + +- :ref:`Color` **completion_existing_color** + ++-----------+-------------------------------------+ +| *Default* | ``Color( 0.87, 0.87, 0.87, 0.13 )`` | ++-----------+-------------------------------------+ + +---- + +.. _class_TextEdit_theme_color_completion_font_color: + +- :ref:`Color` **completion_font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.67, 0.67, 0.67, 1 )`` | ++-----------+----------------------------------+ + +---- + +.. _class_TextEdit_theme_color_completion_scroll_color: + +- :ref:`Color` **completion_scroll_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +---- + +.. _class_TextEdit_theme_color_completion_selected_color: + +- :ref:`Color` **completion_selected_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.26, 0.26, 0.27, 1 )`` | ++-----------+----------------------------------+ + +---- + +.. _class_TextEdit_theme_color_current_line_color: + +- :ref:`Color` **current_line_color** + ++-----------+------------------------------------+ +| *Default* | ``Color( 0.25, 0.25, 0.26, 0.8 )`` | ++-----------+------------------------------------+ + +Sets the :ref:`Color` of the breakpoints. :ref:`breakpoint_gutter` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_executing_line_color: + +- :ref:`Color` **executing_line_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.2, 0.8, 0.2, 0.4 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Sets the font :ref:`Color`. + +---- + +.. _class_TextEdit_theme_color_font_color_readonly: + +- :ref:`Color` **font_color_readonly** + ++-----------+------------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 0.5 )`` | ++-----------+------------------------------------+ + +---- + +.. _class_TextEdit_theme_color_font_color_selected: + +- :ref:`Color` **font_color_selected** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +Sets the :ref:`Color` of the selected text. :ref:`override_selected_font_color` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_function_color: + +- :ref:`Color` **function_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.4, 0.64, 0.81, 1 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_line_number_color: + +- :ref:`Color` **line_number_color** + ++-----------+------------------------------------+ +| *Default* | ``Color( 0.67, 0.67, 0.67, 0.4 )`` | ++-----------+------------------------------------+ + +Sets the :ref:`Color` of the line numbers. :ref:`show_line_numbers` has to be enabled. + +---- + +.. _class_TextEdit_theme_color_mark_color: + +- :ref:`Color` **mark_color** + ++-----------+-------------------------------+ +| *Default* | ``Color( 1, 0.4, 0.4, 0.4 )`` | ++-----------+-------------------------------+ + +Sets the :ref:`Color` of marked text. + +---- + +.. _class_TextEdit_theme_color_member_variable_color: + +- :ref:`Color` **member_variable_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.9, 0.31, 0.35, 1 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_number_color: + +- :ref:`Color` **number_color** + ++-----------+---------------------------------+ +| *Default* | ``Color( 0.92, 0.58, 0.2, 1 )`` | ++-----------+---------------------------------+ + +---- + +.. _class_TextEdit_theme_color_safe_line_number_color: + +- :ref:`Color` **safe_line_number_color** + ++-----------+------------------------------------+ +| *Default* | ``Color( 0.67, 0.78, 0.67, 0.6 )`` | ++-----------+------------------------------------+ + +---- + +.. _class_TextEdit_theme_color_selection_color: + +- :ref:`Color` **selection_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.49, 0.49, 0.49, 1 )`` | ++-----------+----------------------------------+ + +Sets the highlight :ref:`Color` of text selections. + +---- + +.. _class_TextEdit_theme_color_symbol_color: + +- :ref:`Color` **symbol_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +---- + +.. _class_TextEdit_theme_color_word_highlighted_color: + +- :ref:`Color` **word_highlighted_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.8, 0.9, 0.9, 0.15 )`` | ++-----------+----------------------------------+ + +Sets the highlight :ref:`Color` of multiple occurrences. :ref:`highlight_all_occurrences` has to be enabled. + +---- + +.. _class_TextEdit_theme_constant_completion_lines: + +- :ref:`int` **completion_lines** + ++-----------+-------+ +| *Default* | ``7`` | ++-----------+-------+ + +---- + +.. _class_TextEdit_theme_constant_completion_max_width: + +- :ref:`int` **completion_max_width** + ++-----------+--------+ +| *Default* | ``50`` | ++-----------+--------+ + +---- + +.. _class_TextEdit_theme_constant_completion_scroll_width: + +- :ref:`int` **completion_scroll_width** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +---- + +.. _class_TextEdit_theme_constant_line_spacing: + +- :ref:`int` **line_spacing** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +Sets the spacing between the lines. + +---- + +.. _class_TextEdit_theme_font_font: + +- :ref:`Font` **font** + +Sets the default :ref:`Font`. + +---- + +.. _class_TextEdit_theme_icon_fold: + +- :ref:`Texture` **fold** + +---- + +.. _class_TextEdit_theme_icon_folded: + +- :ref:`Texture` **folded** + +---- + +.. _class_TextEdit_theme_icon_space: + +- :ref:`Texture` **space** + +---- + +.. _class_TextEdit_theme_icon_tab: + +- :ref:`Texture` **tab** + +Sets a custom :ref:`Texture` for tab text characters. + +---- + +.. _class_TextEdit_theme_style_completion: + +- :ref:`StyleBox` **completion** + +---- + +.. _class_TextEdit_theme_style_focus: + +- :ref:`StyleBox` **focus** + +---- + +.. _class_TextEdit_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Sets the :ref:`StyleBox` of this ``TextEdit``. + +---- + +.. _class_TextEdit_theme_style_read_only: + +- :ref:`StyleBox` **read_only** + +Sets the :ref:`StyleBox` of this ``TextEdit`` when :ref:`readonly` is enabled. + +.. |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.)` diff --git a/classes/class_textfile.rst b/classes/class_textfile.rst new file mode 100644 index 0000000..650056a --- /dev/null +++ b/classes/class_textfile.rst @@ -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 TextFile.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextFile: + +TextFile +======== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_texture.rst b/classes/class_texture.rst new file mode 100644 index 0000000..d237630 --- /dev/null +++ b/classes/class_texture.rst @@ -0,0 +1,186 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Texture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Texture: + +Texture +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`AnimatedTexture`, :ref:`AtlasTexture`, :ref:`CameraTexture`, :ref:`CurveTexture`, :ref:`ExternalTexture`, :ref:`GradientTexture`, :ref:`ImageTexture`, :ref:`LargeTexture`, :ref:`MeshTexture`, :ref:`NoiseTexture`, :ref:`ProxyTexture`, :ref:`StreamTexture`, :ref:`ViewportTexture` + +Texture for 2D and 3D. + +Description +----------- + +A texture works by registering an image in the video hardware, which then can be used in 3D models or 2D :ref:`Sprite` or GUI :ref:`Control`. + +Textures are often created by loading them from a file. See :ref:`@GDScript.load`. + +``Texture`` is a base for other resources. It cannot be used directly. + +**Note:** The maximum texture size is 16384×16384 pixels due to graphics hardware limitations. Larger textures may fail to import. + +Properties +---------- + ++-----------------------+--------------------------------------------+-------+ +| :ref:`int` | :ref:`flags` | ``4`` | ++-----------------------+--------------------------------------------+-------+ + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_rect` **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw_rect_region` **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=true **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_data` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_height` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_size` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_width` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_alpha` **(** **)** |const| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Texture_Flags: + +.. _class_Texture_constant_FLAGS_DEFAULT: + +.. _class_Texture_constant_FLAG_MIPMAPS: + +.. _class_Texture_constant_FLAG_REPEAT: + +.. _class_Texture_constant_FLAG_FILTER: + +.. _class_Texture_constant_FLAG_ANISOTROPIC_FILTER: + +.. _class_Texture_constant_FLAG_CONVERT_TO_LINEAR: + +.. _class_Texture_constant_FLAG_MIRRORED_REPEAT: + +.. _class_Texture_constant_FLAG_VIDEO_SURFACE: + +enum **Flags**: + +- **FLAGS_DEFAULT** = **7** --- Default flags. :ref:`FLAG_MIPMAPS`, :ref:`FLAG_REPEAT` and :ref:`FLAG_FILTER` are enabled. + +- **FLAG_MIPMAPS** = **1** --- Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio. + +- **FLAG_REPEAT** = **2** --- Repeats the texture (instead of clamp to edge). + +**Note:** Ignored when using an :ref:`AtlasTexture` as these don't support repetition. + +- **FLAG_FILTER** = **4** --- Uses a magnifying filter, to enable smooth zooming in of the texture. + +- **FLAG_ANISOTROPIC_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. + +This results in better-looking textures when viewed from oblique angles. + +- **FLAG_CONVERT_TO_LINEAR** = **16** --- Converts the texture to the sRGB color space. + +- **FLAG_MIRRORED_REPEAT** = **32** --- Repeats the texture with alternate sections mirrored. + +**Note:** Ignored when using an :ref:`AtlasTexture` as these don't support repetition. + +- **FLAG_VIDEO_SURFACE** = **2048** --- Texture is a video surface. + +Property Descriptions +--------------------- + +.. _class_Texture_property_flags: + +- :ref:`int` **flags** + ++-----------+------------------+ +| *Default* | ``4`` | ++-----------+------------------+ +| *Setter* | set_flags(value) | ++-----------+------------------+ +| *Getter* | get_flags() | ++-----------+------------------+ + +The texture's :ref:`Flags`. :ref:`Flags` are used to set various properties of the ``Texture``. + +Method Descriptions +------------------- + +.. _class_Texture_method_draw: + +- void **draw** **(** :ref:`RID` canvas_item, :ref:`Vector2` position, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** |const| + +Draws the texture using a :ref:`CanvasItem` with the :ref:`VisualServer` API at the specified ``position``. Equivalent to :ref:`VisualServer.canvas_item_add_texture_rect` with a rect at ``position`` and the size of this ``Texture``. + +---- + +.. _class_Texture_method_draw_rect: + +- void **draw_rect** **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`bool` tile, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null **)** |const| + +Draws the texture using a :ref:`CanvasItem` with the :ref:`VisualServer` API. Equivalent to :ref:`VisualServer.canvas_item_add_texture_rect`. + +---- + +.. _class_Texture_method_draw_rect_region: + +- void **draw_rect_region** **(** :ref:`RID` canvas_item, :ref:`Rect2` rect, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`Texture` normal_map=null, :ref:`bool` clip_uv=true **)** |const| + +Draws a part of the texture using a :ref:`CanvasItem` with the :ref:`VisualServer` API. Equivalent to :ref:`VisualServer.canvas_item_add_texture_rect_region`. + +---- + +.. _class_Texture_method_get_data: + +- :ref:`Image` **get_data** **(** **)** |const| + +Returns an :ref:`Image` that is a copy of data from this ``Texture``. :ref:`Image`\ s can be accessed and manipulated directly. + +---- + +.. _class_Texture_method_get_height: + +- :ref:`int` **get_height** **(** **)** |const| + +Returns the texture height. + +---- + +.. _class_Texture_method_get_size: + +- :ref:`Vector2` **get_size** **(** **)** |const| + +Returns the texture size. + +---- + +.. _class_Texture_method_get_width: + +- :ref:`int` **get_width** **(** **)** |const| + +Returns the texture width. + +---- + +.. _class_Texture_method_has_alpha: + +- :ref:`bool` **has_alpha** **(** **)** |const| + +Returns ``true`` if this ``Texture`` has an alpha channel. + +.. |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.)` diff --git a/classes/class_texture3d.rst b/classes/class_texture3d.rst new file mode 100644 index 0000000..005423e --- /dev/null +++ b/classes/class_texture3d.rst @@ -0,0 +1,50 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Texture3D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Texture3D: + +Texture3D +========= + +**Inherits:** :ref:`TextureLayered` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Texture with 3 dimensions. + +Description +----------- + +Texture3D is a 3-dimensional :ref:`Texture` that has a width, height, and depth. See also :ref:`TextureArray`. + +**Note:** ``Texture3D``\ s can only be sampled in shaders in the GLES3 backend. In GLES2, their data can be accessed via scripting, but there is no way to render them in a hardware-accelerated manner. + +Properties +---------- + ++-------------------------------------+-------+----------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | data | ``{"depth": 0,"flags": 4,"format": 37,"height": 0,"layers": [ ],"width": 0}`` *(parent override)* | ++-------------------------------------+-------+----------------------------------------------------------------------------------------------------+ +| :ref:`int` | flags | ``4`` *(parent override)* | ++-------------------------------------+-------+----------------------------------------------------------------------------------------------------+ + +Methods +------- + ++------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`int` depth, :ref:`Format` format, :ref:`int` flags=4 **)** | ++------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_Texture3D_method_create: + +- void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`int` depth, :ref:`Format` format, :ref:`int` flags=4 **)** + +Creates the Texture3D with specified ``width``, ``height``, and ``depth``. See :ref:`Format` for ``format`` options. See :ref:`Flags` enumerator for ``flags`` options. + +.. |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.)` diff --git a/classes/class_texturearray.rst b/classes/class_texturearray.rst new file mode 100644 index 0000000..9a62948 --- /dev/null +++ b/classes/class_texturearray.rst @@ -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 TextureArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextureArray: + +TextureArray +============ + +**Inherits:** :ref:`TextureLayered` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Array of textures stored in a single primitive. + +Description +----------- + +``TextureArray``\ s store an array of :ref:`Image`\ s in a single :ref:`Texture` primitive. Each layer of the texture array has its own mipmap chain. This makes it is a good alternative to texture atlases. See also :ref:`Texture3D`. + +``TextureArray``\ s must be displayed using shaders. After importing your file as a ``TextureArray`` and setting the appropriate Horizontal and Vertical Slices, display it by setting it as a uniform to a shader, for example (2D): + +:: + + shader_type canvas_item; + + uniform sampler2DArray tex; + uniform int index; + + void fragment() { + COLOR = texture(tex, vec3(UV.x, UV.y, float(index))); + } + +Set the integer uniform "index" to show a particular part of the texture as defined by the Horizontal and Vertical Slices in the importer. + +**Note:** When sampling an albedo texture from a texture array in 3D, the sRGB -> linear conversion hint (``hint_albedo``) should be used to prevent colors from looking washed out: + +:: + + shader_type spatial; + + uniform sampler2DArray tex : hint_albedo; + uniform int index; + + void fragment() { + ALBEDO = texture(tex, vec3(UV.x, UV.y, float(index))); + } + +**Note:** ``TextureArray``\ s can only be sampled in shaders in the GLES3 backend. In GLES2, their data can be accessed via scripting, but there is no way to render them in a hardware-accelerated manner. + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create` **(** :ref:`int` width, :ref:`int` height, :ref:`int` depth, :ref:`Format` format, :ref:`int` flags=7 **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_TextureArray_method_create: + +- void **create** **(** :ref:`int` width, :ref:`int` height, :ref:`int` depth, :ref:`Format` format, :ref:`int` flags=7 **)** + +Creates the TextureArray with specified ``width``, ``height``, and ``depth``. See :ref:`Format` for ``format`` options. See :ref:`Flags` enumerator for ``flags`` options. + +.. |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.)` diff --git a/classes/class_texturebutton.rst b/classes/class_texturebutton.rst new file mode 100644 index 0000000..93cdfa1 --- /dev/null +++ b/classes/class_texturebutton.rst @@ -0,0 +1,241 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextureButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextureButton: + +TextureButton +============= + +**Inherits:** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Texture-based button. Supports Pressed, Hover, Disabled and Focused states. + +Description +----------- + +``TextureButton`` has the same functionality as :ref:`Button`, except it uses sprites instead of Godot's :ref:`Theme` resource. It is faster to create, but it doesn't support localization like more complex :ref:`Control`\ s. + +The "normal" state must contain a texture (:ref:`texture_normal`); other textures are optional. + +See also :ref:`BaseButton` which contains common properties and methods associated with this node. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Properties +---------- + ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`expand` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`StretchMode` | :ref:`stretch_mode` | ``0`` | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`BitMap` | :ref:`texture_click_mask` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`texture_disabled` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`texture_focused` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`texture_hover` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`texture_normal` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`texture_pressed` | | ++----------------------------------------------------+----------------------------------------------------------------------------+-----------+ + +Enumerations +------------ + +.. _enum_TextureButton_StretchMode: + +.. _class_TextureButton_constant_STRETCH_SCALE: + +.. _class_TextureButton_constant_STRETCH_TILE: + +.. _class_TextureButton_constant_STRETCH_KEEP: + +.. _class_TextureButton_constant_STRETCH_KEEP_CENTERED: + +.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT: + +.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT_CENTERED: + +.. _class_TextureButton_constant_STRETCH_KEEP_ASPECT_COVERED: + +enum **StretchMode**: + +- **STRETCH_SCALE** = **0** --- Scale to fit the node's bounding rectangle. + +- **STRETCH_TILE** = **1** --- Tile inside the node's bounding rectangle. + +- **STRETCH_KEEP** = **2** --- The texture keeps its original size and stays in the bounding rectangle's top-left corner. + +- **STRETCH_KEEP_CENTERED** = **3** --- The texture keeps its original size and stays centered in the node's bounding rectangle. + +- **STRETCH_KEEP_ASPECT** = **4** --- Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. + +- **STRETCH_KEEP_ASPECT_CENTERED** = **5** --- Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio. + +- **STRETCH_KEEP_ASPECT_COVERED** = **6** --- Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. + +Property Descriptions +--------------------- + +.. _class_TextureButton_property_expand: + +- :ref:`bool` **expand** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_expand(value) | ++-----------+-------------------+ +| *Getter* | get_expand() | ++-----------+-------------------+ + +If ``true``, the texture stretches to the edges of the node's bounding rectangle using the :ref:`stretch_mode`. If ``false``, the texture will not scale with the node. + +---- + +.. _class_TextureButton_property_flip_h: + +- :ref:`bool` **flip_h** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_h(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_h() | ++-----------+-------------------+ + +If ``true``, texture is flipped horizontally. + +---- + +.. _class_TextureButton_property_flip_v: + +- :ref:`bool` **flip_v** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_v(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_v() | ++-----------+-------------------+ + +If ``true``, texture is flipped vertically. + +---- + +.. _class_TextureButton_property_stretch_mode: + +- :ref:`StretchMode` **stretch_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_stretch_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_stretch_mode() | ++-----------+-------------------------+ + +Controls the texture's behavior when you resize the node's bounding rectangle, **only if** :ref:`expand` is ``true``. Set it to one of the :ref:`StretchMode` constants. See the constants to learn more. + +---- + +.. _class_TextureButton_property_texture_click_mask: + +- :ref:`BitMap` **texture_click_mask** + ++----------+-----------------------+ +| *Setter* | set_click_mask(value) | ++----------+-----------------------+ +| *Getter* | get_click_mask() | ++----------+-----------------------+ + +Pure black and white :ref:`BitMap` image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes. + +---- + +.. _class_TextureButton_property_texture_disabled: + +- :ref:`Texture` **texture_disabled** + ++----------+-----------------------------+ +| *Setter* | set_disabled_texture(value) | ++----------+-----------------------------+ +| *Getter* | get_disabled_texture() | ++----------+-----------------------------+ + +Texture to display when the node is disabled. See :ref:`BaseButton.disabled`. + +---- + +.. _class_TextureButton_property_texture_focused: + +- :ref:`Texture` **texture_focused** + ++----------+----------------------------+ +| *Setter* | set_focused_texture(value) | ++----------+----------------------------+ +| *Getter* | get_focused_texture() | ++----------+----------------------------+ + +Texture to display when the node has mouse or keyboard focus. + +---- + +.. _class_TextureButton_property_texture_hover: + +- :ref:`Texture` **texture_hover** + ++----------+--------------------------+ +| *Setter* | set_hover_texture(value) | ++----------+--------------------------+ +| *Getter* | get_hover_texture() | ++----------+--------------------------+ + +Texture to display when the mouse hovers the node. + +---- + +.. _class_TextureButton_property_texture_normal: + +- :ref:`Texture` **texture_normal** + ++----------+---------------------------+ +| *Setter* | set_normal_texture(value) | ++----------+---------------------------+ +| *Getter* | get_normal_texture() | ++----------+---------------------------+ + +Texture to display by default, when the node is **not** in the disabled, focused, hover or pressed state. + +---- + +.. _class_TextureButton_property_texture_pressed: + +- :ref:`Texture` **texture_pressed** + ++----------+----------------------------+ +| *Setter* | set_pressed_texture(value) | ++----------+----------------------------+ +| *Getter* | get_pressed_texture() | ++----------+----------------------------+ + +Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the Enter key or if the player presses the :ref:`BaseButton.shortcut` key. + +.. |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.)` diff --git a/classes/class_texturelayered.rst b/classes/class_texturelayered.rst new file mode 100644 index 0000000..f54ddef --- /dev/null +++ b/classes/class_texturelayered.rst @@ -0,0 +1,172 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextureLayered.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextureLayered: + +TextureLayered +============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`Texture3D`, :ref:`TextureArray` + +Base class for 3D texture types. + +Description +----------- + +Base class for :ref:`Texture3D` and :ref:`TextureArray`. Cannot be used directly, but contains all the functions necessary for accessing and using :ref:`Texture3D` and :ref:`TextureArray`. Data is set on a per-layer basis. For :ref:`Texture3D`\ s, the layer specifies the depth or Z-index, they can be treated as a bunch of 2D slices. Similarly, for :ref:`TextureArray`\ s, the layer specifies the array layer. + +Properties +---------- + ++-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`data` | ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}`` | ++-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`flags` | ``7`` | ++-------------------------------------+---------------------------------------------------+--------------------------------------------------------------------------------+ + +Methods +------- + ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_depth` **(** **)** |const| | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Format` | :ref:`get_format` **(** **)** |const| | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_height` **(** **)** |const| | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`get_layer_data` **(** :ref:`int` layer **)** |const| | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_width` **(** **)** |const| | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_data_partial` **(** :ref:`Image` image, :ref:`int` x_offset, :ref:`int` y_offset, :ref:`int` layer, :ref:`int` mipmap=0 **)** | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_layer_data` **(** :ref:`Image` image, :ref:`int` layer **)** | ++----------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_TextureLayered_Flags: + +.. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_ARRAY: + +.. _class_TextureLayered_constant_FLAGS_DEFAULT_TEXTURE_3D: + +.. _class_TextureLayered_constant_FLAG_MIPMAPS: + +.. _class_TextureLayered_constant_FLAG_REPEAT: + +.. _class_TextureLayered_constant_FLAG_FILTER: + +.. _class_TextureLayered_constant_FLAG_ANISOTROPIC_FILTER: + +enum **Flags**: + +- **FLAGS_DEFAULT_TEXTURE_ARRAY** = **7** --- Default flags for :ref:`TextureArray`. :ref:`FLAG_MIPMAPS`, :ref:`FLAG_REPEAT` and :ref:`FLAG_FILTER` are enabled. + +- **FLAGS_DEFAULT_TEXTURE_3D** = **4** --- Default flags for :ref:`Texture3D`. :ref:`FLAG_FILTER` is enabled. + +- **FLAG_MIPMAPS** = **1** --- Texture will generate mipmaps on creation. + +- **FLAG_REPEAT** = **2** --- Texture will repeat when UV used is outside the 0-1 range. + +- **FLAG_FILTER** = **4** --- Use filtering when reading from texture. Filtering smooths out pixels. Turning filtering off is slightly faster and more appropriate when you need access to individual pixels. + +- **FLAG_ANISOTROPIC_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. + +This results in better-looking textures when viewed from oblique angles. + +Property Descriptions +--------------------- + +.. _class_TextureLayered_property_data: + +- :ref:`Dictionary` **data** + ++-----------+--------------------------------------------------------------------------------+ +| *Default* | ``{"depth": 0,"flags": 7,"format": 37,"height": 0,"layers": [ ],"width": 0}`` | ++-----------+--------------------------------------------------------------------------------+ + +Returns a dictionary with all the data used by this texture. + +---- + +.. _class_TextureLayered_property_flags: + +- :ref:`int` **flags** + ++-----------+------------------+ +| *Default* | ``7`` | ++-----------+------------------+ +| *Setter* | set_flags(value) | ++-----------+------------------+ +| *Getter* | get_flags() | ++-----------+------------------+ + +Specifies which :ref:`Flags` apply to this texture. + +Method Descriptions +------------------- + +.. _class_TextureLayered_method_get_depth: + +- :ref:`int` **get_depth** **(** **)** |const| + +Returns the depth of the texture. Depth is the 3rd dimension (typically Z-axis). + +---- + +.. _class_TextureLayered_method_get_format: + +- :ref:`Format` **get_format** **(** **)** |const| + +Returns the current format being used by this texture. See :ref:`Format` for details. + +---- + +.. _class_TextureLayered_method_get_height: + +- :ref:`int` **get_height** **(** **)** |const| + +Returns the height of the texture. Height is typically represented by the Y-axis. + +---- + +.. _class_TextureLayered_method_get_layer_data: + +- :ref:`Image` **get_layer_data** **(** :ref:`int` layer **)** |const| + +Returns an :ref:`Image` resource with the data from specified ``layer``. + +---- + +.. _class_TextureLayered_method_get_width: + +- :ref:`int` **get_width** **(** **)** |const| + +Returns the width of the texture. Width is typically represented by the X-axis. + +---- + +.. _class_TextureLayered_method_set_data_partial: + +- void **set_data_partial** **(** :ref:`Image` image, :ref:`int` x_offset, :ref:`int` y_offset, :ref:`int` layer, :ref:`int` mipmap=0 **)** + +Partially sets the data for a specified ``layer`` by overwriting using the data of the specified ``image``. ``x_offset`` and ``y_offset`` determine where the :ref:`Image` is "stamped" over the texture. The ``image`` must fit within the texture. + +---- + +.. _class_TextureLayered_method_set_layer_data: + +- void **set_layer_data** **(** :ref:`Image` image, :ref:`int` layer **)** + +Sets the data for the specified layer. Data takes the form of a 2-dimensional :ref:`Image` resource. + +.. |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.)` diff --git a/classes/class_textureprogress.rst b/classes/class_textureprogress.rst new file mode 100644 index 0000000..51eb2f0 --- /dev/null +++ b/classes/class_textureprogress.rst @@ -0,0 +1,382 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextureProgress.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextureProgress: + +TextureProgress +=============== + +**Inherits:** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Texture-based progress bar. Useful for loading screens and life or stamina bars. + +Description +----------- + +TextureProgress works like :ref:`ProgressBar`, but uses up to 3 textures instead of Godot's :ref:`Theme` resource. It can be used to create horizontal, vertical and radial progress bars. + +Properties +---------- + ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`fill_mode` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``1`` *(parent override)* | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`nine_patch_stretch` | ``false`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector2` | :ref:`radial_center_offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_fill_degrees` | ``360.0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`float` | :ref:`radial_initial_angle` | ``0.0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`stretch_margin_bottom` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`stretch_margin_left` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`stretch_margin_right` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`int` | :ref:`stretch_margin_top` | ``0`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`texture_over` | | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`texture_progress` | | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Vector2` | :ref:`texture_progress_offset` | ``Vector2( 0, 0 )`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`texture_under` | | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`tint_over` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`tint_progress` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ +| :ref:`Color` | :ref:`tint_under` | ``Color( 1, 1, 1, 1 )`` | ++----------------------------------------------+----------------------------------------------------------------------------------------+---------------------------+ + +Methods +------- + ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_stretch_margin` **(** :ref:`Margin` margin **)** |const| | ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_stretch_margin` **(** :ref:`Margin` margin, :ref:`int` value **)** | ++-----------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_TextureProgress_FillMode: + +.. _class_TextureProgress_constant_FILL_LEFT_TO_RIGHT: + +.. _class_TextureProgress_constant_FILL_RIGHT_TO_LEFT: + +.. _class_TextureProgress_constant_FILL_TOP_TO_BOTTOM: + +.. _class_TextureProgress_constant_FILL_BOTTOM_TO_TOP: + +.. _class_TextureProgress_constant_FILL_CLOCKWISE: + +.. _class_TextureProgress_constant_FILL_COUNTER_CLOCKWISE: + +.. _class_TextureProgress_constant_FILL_BILINEAR_LEFT_AND_RIGHT: + +.. _class_TextureProgress_constant_FILL_BILINEAR_TOP_AND_BOTTOM: + +.. _class_TextureProgress_constant_FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE: + +enum **FillMode**: + +- **FILL_LEFT_TO_RIGHT** = **0** --- The :ref:`texture_progress` fills from left to right. + +- **FILL_RIGHT_TO_LEFT** = **1** --- The :ref:`texture_progress` fills from right to left. + +- **FILL_TOP_TO_BOTTOM** = **2** --- The :ref:`texture_progress` fills from top to bottom. + +- **FILL_BOTTOM_TO_TOP** = **3** --- The :ref:`texture_progress` fills from bottom to top. + +- **FILL_CLOCKWISE** = **4** --- Turns the node into a radial bar. The :ref:`texture_progress` fills clockwise. See :ref:`radial_center_offset`, :ref:`radial_initial_angle` and :ref:`radial_fill_degrees` to control the way the bar fills up. + +- **FILL_COUNTER_CLOCKWISE** = **5** --- Turns the node into a radial bar. The :ref:`texture_progress` fills counterclockwise. See :ref:`radial_center_offset`, :ref:`radial_initial_angle` and :ref:`radial_fill_degrees` to control the way the bar fills up. + +- **FILL_BILINEAR_LEFT_AND_RIGHT** = **6** --- The :ref:`texture_progress` fills from the center, expanding both towards the left and the right. + +- **FILL_BILINEAR_TOP_AND_BOTTOM** = **7** --- The :ref:`texture_progress` fills from the center, expanding both towards the top and the bottom. + +- **FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE** = **8** --- Turns the node into a radial bar. The :ref:`texture_progress` fills radially from the center, expanding both clockwise and counterclockwise. See :ref:`radial_center_offset`, :ref:`radial_initial_angle` and :ref:`radial_fill_degrees` to control the way the bar fills up. + +Property Descriptions +--------------------- + +.. _class_TextureProgress_property_fill_mode: + +- :ref:`int` **fill_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_fill_mode(value) | ++-----------+----------------------+ +| *Getter* | get_fill_mode() | ++-----------+----------------------+ + +The fill direction. See :ref:`FillMode` for possible values. + +---- + +.. _class_TextureProgress_property_nine_patch_stretch: + +- :ref:`bool` **nine_patch_stretch** + ++-----------+-------------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------------+ +| *Setter* | set_nine_patch_stretch(value) | ++-----------+-------------------------------+ +| *Getter* | get_nine_patch_stretch() | ++-----------+-------------------------------+ + +If ``true``, Godot treats the bar's textures like in :ref:`NinePatchRect`. Use the ``stretch_margin_*`` properties like :ref:`stretch_margin_bottom` to set up the nine patch's 3×3 grid. When using a radial :ref:`fill_mode`, this setting will enable stretching. + +---- + +.. _class_TextureProgress_property_radial_center_offset: + +- :ref:`Vector2` **radial_center_offset** + ++-----------+---------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------------------+ +| *Setter* | set_radial_center_offset(value) | ++-----------+---------------------------------+ +| *Getter* | get_radial_center_offset() | ++-----------+---------------------------------+ + +Offsets :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE` or :ref:`FILL_COUNTER_CLOCKWISE`. + +---- + +.. _class_TextureProgress_property_radial_fill_degrees: + +- :ref:`float` **radial_fill_degrees** + ++-----------+-------------------------+ +| *Default* | ``360.0`` | ++-----------+-------------------------+ +| *Setter* | set_fill_degrees(value) | ++-----------+-------------------------+ +| *Getter* | get_fill_degrees() | ++-----------+-------------------------+ + +Upper limit for the fill of :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE` or :ref:`FILL_COUNTER_CLOCKWISE`. When the node's ``value`` is equal to its ``max_value``, the texture fills up to this angle. + +See :ref:`Range.value`, :ref:`Range.max_value`. + +---- + +.. _class_TextureProgress_property_radial_initial_angle: + +- :ref:`float` **radial_initial_angle** + ++-----------+---------------------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------------------+ +| *Setter* | set_radial_initial_angle(value) | ++-----------+---------------------------------+ +| *Getter* | get_radial_initial_angle() | ++-----------+---------------------------------+ + +Starting angle for the fill of :ref:`texture_progress` if :ref:`fill_mode` is :ref:`FILL_CLOCKWISE` or :ref:`FILL_COUNTER_CLOCKWISE`. When the node's ``value`` is equal to its ``min_value``, the texture doesn't show up at all. When the ``value`` increases, the texture fills and tends towards :ref:`radial_fill_degrees`. + +---- + +.. _class_TextureProgress_property_stretch_margin_bottom: + +- :ref:`int` **stretch_margin_bottom** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_stretch_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_stretch_margin() | ++-----------+---------------------------+ + +The height of the 9-patch's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. + +---- + +.. _class_TextureProgress_property_stretch_margin_left: + +- :ref:`int` **stretch_margin_left** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_stretch_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_stretch_margin() | ++-----------+---------------------------+ + +The width of the 9-patch's left column. + +---- + +.. _class_TextureProgress_property_stretch_margin_right: + +- :ref:`int` **stretch_margin_right** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_stretch_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_stretch_margin() | ++-----------+---------------------------+ + +The width of the 9-patch's right column. + +---- + +.. _class_TextureProgress_property_stretch_margin_top: + +- :ref:`int` **stretch_margin_top** + ++-----------+---------------------------+ +| *Default* | ``0`` | ++-----------+---------------------------+ +| *Setter* | set_stretch_margin(value) | ++-----------+---------------------------+ +| *Getter* | get_stretch_margin() | ++-----------+---------------------------+ + +The height of the 9-patch's top row. + +---- + +.. _class_TextureProgress_property_texture_over: + +- :ref:`Texture` **texture_over** + ++----------+-------------------------+ +| *Setter* | set_over_texture(value) | ++----------+-------------------------+ +| *Getter* | get_over_texture() | ++----------+-------------------------+ + +:ref:`Texture` that draws over the progress bar. Use it to add highlights or an upper-frame that hides part of :ref:`texture_progress`. + +---- + +.. _class_TextureProgress_property_texture_progress: + +- :ref:`Texture` **texture_progress** + ++----------+-----------------------------+ +| *Setter* | set_progress_texture(value) | ++----------+-----------------------------+ +| *Getter* | get_progress_texture() | ++----------+-----------------------------+ + +:ref:`Texture` that clips based on the node's ``value`` and :ref:`fill_mode`. As ``value`` increased, the texture fills up. It shows entirely when ``value`` reaches ``max_value``. It doesn't show at all if ``value`` is equal to ``min_value``. + +The ``value`` property comes from :ref:`Range`. See :ref:`Range.value`, :ref:`Range.min_value`, :ref:`Range.max_value`. + +---- + +.. _class_TextureProgress_property_texture_progress_offset: + +- :ref:`Vector2` **texture_progress_offset** + ++-----------+------------------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+------------------------------------+ +| *Setter* | set_texture_progress_offset(value) | ++-----------+------------------------------------+ +| *Getter* | get_texture_progress_offset() | ++-----------+------------------------------------+ + +The offset of :ref:`texture_progress`. Useful for :ref:`texture_over` and :ref:`texture_under` with fancy borders, to avoid transparent margins in your progress texture. + +---- + +.. _class_TextureProgress_property_texture_under: + +- :ref:`Texture` **texture_under** + ++----------+--------------------------+ +| *Setter* | set_under_texture(value) | ++----------+--------------------------+ +| *Getter* | get_under_texture() | ++----------+--------------------------+ + +:ref:`Texture` that draws under the progress bar. The bar's background. + +---- + +.. _class_TextureProgress_property_tint_over: + +- :ref:`Color` **tint_over** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_tint_over(value) | ++-----------+-------------------------+ +| *Getter* | get_tint_over() | ++-----------+-------------------------+ + +Multiplies the color of the bar's ``texture_over`` texture. The effect is similar to :ref:`CanvasItem.modulate`, except it only affects this specific texture instead of the entire node. + +---- + +.. _class_TextureProgress_property_tint_progress: + +- :ref:`Color` **tint_progress** + ++-----------+--------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+--------------------------+ +| *Setter* | set_tint_progress(value) | ++-----------+--------------------------+ +| *Getter* | get_tint_progress() | ++-----------+--------------------------+ + +Multiplies the color of the bar's ``texture_progress`` texture. + +---- + +.. _class_TextureProgress_property_tint_under: + +- :ref:`Color` **tint_under** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_tint_under(value) | ++-----------+-------------------------+ +| *Getter* | get_tint_under() | ++-----------+-------------------------+ + +Multiplies the color of the bar's ``texture_under`` texture. + +Method Descriptions +------------------- + +.. _class_TextureProgress_method_get_stretch_margin: + +- :ref:`int` **get_stretch_margin** **(** :ref:`Margin` margin **)** |const| + +---- + +.. _class_TextureProgress_method_set_stretch_margin: + +- void **set_stretch_margin** **(** :ref:`Margin` margin, :ref:`int` value **)** + +.. |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.)` diff --git a/classes/class_texturerect.rst b/classes/class_texturerect.rst new file mode 100644 index 0000000..cfd6196 --- /dev/null +++ b/classes/class_texturerect.rst @@ -0,0 +1,165 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TextureRect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TextureRect: + +TextureRect +=========== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control for drawing textures. + +Description +----------- + +Used to draw icons and sprites in a user interface. The texture's placement can be controlled with the :ref:`stretch_mode` property. It can scale, tile, or stay centered inside its bounding rectangle. + +**Note:** You should enable :ref:`flip_v` when using a TextureRect to display a :ref:`ViewportTexture`. Alternatively, you can enable :ref:`Viewport.render_target_v_flip` on the Viewport. Otherwise, the image will appear upside down. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Properties +---------- + ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`expand` | ``false`` | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flip_h` | ``false`` | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`bool` | :ref:`flip_v` | ``false`` | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`MouseFilter` | mouse_filter | ``1`` *(parent override)* | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`StretchMode` | :ref:`stretch_mode` | ``0`` | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ +| :ref:`Texture` | :ref:`texture` | | ++--------------------------------------------------+--------------------------------------------------------------+---------------------------+ + +Enumerations +------------ + +.. _enum_TextureRect_StretchMode: + +.. _class_TextureRect_constant_STRETCH_SCALE_ON_EXPAND: + +.. _class_TextureRect_constant_STRETCH_SCALE: + +.. _class_TextureRect_constant_STRETCH_TILE: + +.. _class_TextureRect_constant_STRETCH_KEEP: + +.. _class_TextureRect_constant_STRETCH_KEEP_CENTERED: + +.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT: + +.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT_CENTERED: + +.. _class_TextureRect_constant_STRETCH_KEEP_ASPECT_COVERED: + +enum **StretchMode**: + +- **STRETCH_SCALE_ON_EXPAND** = **0** --- Scale to fit the node's bounding rectangle, only if ``expand`` is ``true``. Default ``stretch_mode``, for backwards compatibility. Until you set ``expand`` to ``true``, the texture will behave like :ref:`STRETCH_KEEP`. + +- **STRETCH_SCALE** = **1** --- Scale to fit the node's bounding rectangle. + +- **STRETCH_TILE** = **2** --- Tile inside the node's bounding rectangle. + +- **STRETCH_KEEP** = **3** --- The texture keeps its original size and stays in the bounding rectangle's top-left corner. + +- **STRETCH_KEEP_CENTERED** = **4** --- The texture keeps its original size and stays centered in the node's bounding rectangle. + +- **STRETCH_KEEP_ASPECT** = **5** --- Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio. + +- **STRETCH_KEEP_ASPECT_CENTERED** = **6** --- Scale the texture to fit the node's bounding rectangle, center it and maintain its aspect ratio. + +- **STRETCH_KEEP_ASPECT_COVERED** = **7** --- Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits. + +Property Descriptions +--------------------- + +.. _class_TextureRect_property_expand: + +- :ref:`bool` **expand** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_expand(value) | ++-----------+-------------------+ +| *Getter* | has_expand() | ++-----------+-------------------+ + +If ``true``, the texture scales to fit its bounding rectangle. + +---- + +.. _class_TextureRect_property_flip_h: + +- :ref:`bool` **flip_h** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_h(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_h() | ++-----------+-------------------+ + +If ``true``, texture is flipped horizontally. + +---- + +.. _class_TextureRect_property_flip_v: + +- :ref:`bool` **flip_v** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_flip_v(value) | ++-----------+-------------------+ +| *Getter* | is_flipped_v() | ++-----------+-------------------+ + +If ``true``, texture is flipped vertically. + +---- + +.. _class_TextureRect_property_stretch_mode: + +- :ref:`StretchMode` **stretch_mode** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_stretch_mode(value) | ++-----------+-------------------------+ +| *Getter* | get_stretch_mode() | ++-----------+-------------------------+ + +Controls the texture's behavior when resizing the node's bounding rectangle. See :ref:`StretchMode`. + +---- + +.. _class_TextureRect_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The node's :ref:`Texture` resource. + +.. |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.)` diff --git a/classes/class_theme.rst b/classes/class_theme.rst new file mode 100644 index 0000000..046bd98 --- /dev/null +++ b/classes/class_theme.rst @@ -0,0 +1,609 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Theme.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Theme: + +Theme +===== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Theme for controls. + +Description +----------- + +A theme for skinning controls. Controls can be skinned individually, but for complex applications, it's more practical to just create a global theme that defines everything. This theme can be applied to any :ref:`Control`; the Control and its children will automatically use it. + +Theme resources can alternatively be loaded by writing them in a ``.theme`` file, see the documentation for more information. + +Tutorials +--------- + +- :doc:`../tutorials/ui/gui_skinning` + +Properties +---------- + ++-------------------------+--------------------------------------------------------+ +| :ref:`Font` | :ref:`default_font` | ++-------------------------+--------------------------------------------------------+ + +Methods +------- + ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_color` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_constant` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_font` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_icon` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_theme_item` **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_default_theme` **(** **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`copy_theme` **(** :ref:`Theme` other **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_color` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_color_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_color_types` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_constant` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_constant_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_constant_types` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Font` | :ref:`get_font` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_font_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_font_types` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_icon` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_icon_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_icon_types` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`get_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_stylebox_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_stylebox_types` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_theme_item` **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_theme_item_list` **(** :ref:`DataType` data_type, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_theme_item_types` **(** :ref:`DataType` data_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_type_list` **(** :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_color` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_constant` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_default_font` **(** **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_font` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_icon` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_stylebox` **(** :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_theme_item` **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** |const| | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`merge_with` **(** :ref:`Theme` other **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_color` **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_constant` **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_font` **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_icon` **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_stylebox` **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_theme_item` **(** :ref:`DataType` data_type, :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_color` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Color` color **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_constant` **(** :ref:`String` name, :ref:`String` node_type, :ref:`int` constant **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_font` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Font` font **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon` **(** :ref:`String` name, :ref:`String` node_type, :ref:`Texture` texture **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_stylebox` **(** :ref:`String` name, :ref:`String` node_type, :ref:`StyleBox` texture **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_theme_item` **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type, :ref:`Variant` value **)** | ++-----------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Theme_DataType: + +.. _class_Theme_constant_DATA_TYPE_COLOR: + +.. _class_Theme_constant_DATA_TYPE_CONSTANT: + +.. _class_Theme_constant_DATA_TYPE_FONT: + +.. _class_Theme_constant_DATA_TYPE_ICON: + +.. _class_Theme_constant_DATA_TYPE_STYLEBOX: + +.. _class_Theme_constant_DATA_TYPE_MAX: + +enum **DataType**: + +- **DATA_TYPE_COLOR** = **0** --- Theme's :ref:`Color` item type. + +- **DATA_TYPE_CONSTANT** = **1** --- Theme's constant item type. + +- **DATA_TYPE_FONT** = **2** --- Theme's :ref:`Font` item type. + +- **DATA_TYPE_ICON** = **3** --- Theme's icon :ref:`Texture` item type. + +- **DATA_TYPE_STYLEBOX** = **4** --- Theme's :ref:`StyleBox` item type. + +- **DATA_TYPE_MAX** = **5** --- Maximum value for the DataType enum. + +Property Descriptions +--------------------- + +.. _class_Theme_property_default_font: + +- :ref:`Font` **default_font** + ++----------+-------------------------+ +| *Setter* | set_default_font(value) | ++----------+-------------------------+ +| *Getter* | get_default_font() | ++----------+-------------------------+ + +The default font of this ``Theme`` resource. Used as a fallback value for font items defined in this theme, but having invalid values. If this value is also invalid, the global default value is used. + +Use :ref:`has_default_font` to check if this value is valid. + +Method Descriptions +------------------- + +.. _class_Theme_method_clear: + +- void **clear** **(** **)** + +Clears all values on the theme. + +---- + +.. _class_Theme_method_clear_color: + +- void **clear_color** **(** :ref:`String` name, :ref:`String` node_type **)** + +Clears the :ref:`Color` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_clear_constant: + +- void **clear_constant** **(** :ref:`String` name, :ref:`String` node_type **)** + +Clears the constant at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_clear_font: + +- void **clear_font** **(** :ref:`String` name, :ref:`String` node_type **)** + +Clears the :ref:`Font` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_clear_icon: + +- void **clear_icon** **(** :ref:`String` name, :ref:`String` node_type **)** + +Clears the icon at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_clear_stylebox: + +- void **clear_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** + +Clears :ref:`StyleBox` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_clear_theme_item: + +- void **clear_theme_item** **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** + +Clears the theme item of ``data_type`` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_copy_default_theme: + +- void **copy_default_theme** **(** **)** + +Sets the theme's values to a copy of the default theme values. + +---- + +.. _class_Theme_method_copy_theme: + +- void **copy_theme** **(** :ref:`Theme` other **)** + +Sets the theme's values to a copy of a given theme. + +---- + +.. _class_Theme_method_get_color: + +- :ref:`Color` **get_color** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the :ref:`Color` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_color_list: + +- :ref:`PoolStringArray` **get_color_list** **(** :ref:`String` node_type **)** |const| + +Returns all the :ref:`Color`\ s as a :ref:`PoolStringArray` filled with each :ref:`Color`'s name, for use in :ref:`get_color`, if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_color_types: + +- :ref:`PoolStringArray` **get_color_types** **(** **)** |const| + +Returns all the :ref:`Color` types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_color` and/or :ref:`get_color_list`. + +---- + +.. _class_Theme_method_get_constant: + +- :ref:`int` **get_constant** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the constant at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_constant_list: + +- :ref:`PoolStringArray` **get_constant_list** **(** :ref:`String` node_type **)** |const| + +Returns all the constants as a :ref:`PoolStringArray` filled with each constant's name, for use in :ref:`get_constant`, if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_constant_types: + +- :ref:`PoolStringArray` **get_constant_types** **(** **)** |const| + +Returns all the constant types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_constant` and/or :ref:`get_constant_list`. + +---- + +.. _class_Theme_method_get_font: + +- :ref:`Font` **get_font** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the :ref:`Font` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_font_list: + +- :ref:`PoolStringArray` **get_font_list** **(** :ref:`String` node_type **)** |const| + +Returns all the :ref:`Font`\ s as a :ref:`PoolStringArray` filled with each :ref:`Font`'s name, for use in :ref:`get_font`, if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_font_types: + +- :ref:`PoolStringArray` **get_font_types** **(** **)** |const| + +Returns all the :ref:`Font` types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_font` and/or :ref:`get_font_list`. + +---- + +.. _class_Theme_method_get_icon: + +- :ref:`Texture` **get_icon** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the icon :ref:`Texture` at ``name`` if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_icon_list: + +- :ref:`PoolStringArray` **get_icon_list** **(** :ref:`String` node_type **)** |const| + +Returns all the icons as a :ref:`PoolStringArray` filled with each :ref:`Texture`'s name, for use in :ref:`get_icon`, if the theme has ``node_type``. + +---- + +.. _class_Theme_method_get_icon_types: + +- :ref:`PoolStringArray` **get_icon_types** **(** **)** |const| + +Returns all the icon types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_icon` and/or :ref:`get_icon_list`. + +---- + +.. _class_Theme_method_get_stylebox: + +- :ref:`StyleBox` **get_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the :ref:`StyleBox` at ``name`` if the theme has ``node_type``. + +Valid ``name``\ s may be found using :ref:`get_stylebox_list`. Valid ``node_type``\ s may be found using :ref:`get_stylebox_types`. + +---- + +.. _class_Theme_method_get_stylebox_list: + +- :ref:`PoolStringArray` **get_stylebox_list** **(** :ref:`String` node_type **)** |const| + +Returns all the :ref:`StyleBox`\ s as a :ref:`PoolStringArray` filled with each :ref:`StyleBox`'s name, for use in :ref:`get_stylebox`, if the theme has ``node_type``. + +Valid ``node_type``\ s may be found using :ref:`get_stylebox_types`. + +---- + +.. _class_Theme_method_get_stylebox_types: + +- :ref:`PoolStringArray` **get_stylebox_types** **(** **)** |const| + +Returns all the :ref:`StyleBox` types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_stylebox` and/or :ref:`get_stylebox_list`. + +---- + +.. _class_Theme_method_get_theme_item: + +- :ref:`Variant` **get_theme_item** **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns the theme item of ``data_type`` at ``name`` if the theme has ``node_type``. + +Valid ``name``\ s may be found using :ref:`get_theme_item_list` or a data type specific method. Valid ``node_type``\ s may be found using :ref:`get_theme_item_types` or a data type specific method. + +---- + +.. _class_Theme_method_get_theme_item_list: + +- :ref:`PoolStringArray` **get_theme_item_list** **(** :ref:`DataType` data_type, :ref:`String` node_type **)** |const| + +Returns all the theme items of ``data_type`` as a :ref:`PoolStringArray` filled with each theme items's name, for use in :ref:`get_theme_item` or a data type specific method, if the theme has ``node_type``. + +Valid ``node_type``\ s may be found using :ref:`get_theme_item_types` or a data type specific method. + +---- + +.. _class_Theme_method_get_theme_item_types: + +- :ref:`PoolStringArray` **get_theme_item_types** **(** :ref:`DataType` data_type **)** |const| + +Returns all the theme items of ``data_type`` types as a :ref:`PoolStringArray` filled with unique type names, for use in :ref:`get_theme_item`, :ref:`get_theme_item_list` or data type specific methods. + +---- + +.. _class_Theme_method_get_type_list: + +- :ref:`PoolStringArray` **get_type_list** **(** :ref:`String` node_type **)** |const| + +Returns all the theme types as a :ref:`PoolStringArray` filled with unique type names, for use in other ``get_*`` functions of this theme. + +**Note:** ``node_type`` has no effect and will be removed in future version. + +---- + +.. _class_Theme_method_has_color: + +- :ref:`bool` **has_color** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if :ref:`Color` with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_has_constant: + +- :ref:`bool` **has_constant** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if constant with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_has_default_font: + +- :ref:`bool` **has_default_font** **(** **)** |const| + +Returns ``true`` if this theme has a valid :ref:`default_font` value. + +---- + +.. _class_Theme_method_has_font: + +- :ref:`bool` **has_font** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if :ref:`Font` with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_has_icon: + +- :ref:`bool` **has_icon** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if icon :ref:`Texture` with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_has_stylebox: + +- :ref:`bool` **has_stylebox** **(** :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if :ref:`StyleBox` with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_has_theme_item: + +- :ref:`bool` **has_theme_item** **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type **)** |const| + +Returns ``true`` if a theme item of ``data_type`` with ``name`` is in ``node_type``. + +Returns ``false`` if the theme does not have ``node_type``. + +---- + +.. _class_Theme_method_merge_with: + +- void **merge_with** **(** :ref:`Theme` other **)** + +Adds missing and overrides existing definitions with values from the ``other`` ``Theme``. + +**Note:** This modifies the current theme. If you want to merge two themes together without modifying either one, create a new empty theme and merge the other two into it one after another. + +---- + +.. _class_Theme_method_rename_color: + +- void **rename_color** **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames the :ref:`Color` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_rename_constant: + +- void **rename_constant** **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames the constant at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_rename_font: + +- void **rename_font** **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames the :ref:`Font` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_rename_icon: + +- void **rename_icon** **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames the icon at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_rename_stylebox: + +- void **rename_stylebox** **(** :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames :ref:`StyleBox` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_rename_theme_item: + +- void **rename_theme_item** **(** :ref:`DataType` data_type, :ref:`String` old_name, :ref:`String` name, :ref:`String` node_type **)** + +Renames the theme item of ``data_type`` at ``old_name`` to ``name`` if the theme has ``node_type``. If ``name`` is already taken, this method fails. + +---- + +.. _class_Theme_method_set_color: + +- void **set_color** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Color` color **)** + +Sets the theme's :ref:`Color` to ``color`` at ``name`` in ``node_type``. + +Creates ``node_type`` if the theme does not have it. + +---- + +.. _class_Theme_method_set_constant: + +- void **set_constant** **(** :ref:`String` name, :ref:`String` node_type, :ref:`int` constant **)** + +Sets the theme's constant to ``constant`` at ``name`` in ``node_type``. + +Creates ``node_type`` if the theme does not have it. + +---- + +.. _class_Theme_method_set_font: + +- void **set_font** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Font` font **)** + +Sets the theme's :ref:`Font` to ``font`` at ``name`` in ``node_type``. + +Creates ``node_type`` if the theme does not have it. + +---- + +.. _class_Theme_method_set_icon: + +- void **set_icon** **(** :ref:`String` name, :ref:`String` node_type, :ref:`Texture` texture **)** + +Sets the theme's icon :ref:`Texture` to ``texture`` at ``name`` in ``node_type``. + +Creates ``node_type`` if the theme does not have it. + +---- + +.. _class_Theme_method_set_stylebox: + +- void **set_stylebox** **(** :ref:`String` name, :ref:`String` node_type, :ref:`StyleBox` texture **)** + +Sets theme's :ref:`StyleBox` to ``stylebox`` at ``name`` in ``node_type``. + +Creates ``node_type`` if the theme does not have it. + +---- + +.. _class_Theme_method_set_theme_item: + +- void **set_theme_item** **(** :ref:`DataType` data_type, :ref:`String` name, :ref:`String` node_type, :ref:`Variant` value **)** + +Sets the theme item of ``data_type`` to ``value`` at ``name`` in ``node_type``. + +Does nothing if the ``value`` type does not match ``data_type``. + +Creates ``node_type`` if the theme does not have it. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_thread.rst b/classes/class_thread.rst new file mode 100644 index 0000000..216e3f1 --- /dev/null +++ b/classes/class_thread.rst @@ -0,0 +1,119 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Thread.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Thread: + +Thread +====== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A unit of execution in a process. + +Description +----------- + +A unit of execution in a process. Can run methods on :ref:`Object`\ s simultaneously. The use of synchronization via :ref:`Mutex` or :ref:`Semaphore` is advised if working with shared objects. + +**Note:** Breakpoints won't break on code if it's running in a thread. This is a current limitation of the GDScript debugger. + +Tutorials +--------- + +- :doc:`../tutorials/performance/threads/using_multiple_threads` + +- :doc:`../tutorials/performance/threads/thread_safe_apis` + +- `3D Voxel Demo `__ + +Methods +------- + ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_id` **(** **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_active` **(** **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_alive` **(** **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`start` **(** :ref:`Object` instance, :ref:`String` method, :ref:`Variant` userdata=null, :ref:`Priority` priority=1 **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`wait_to_finish` **(** **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_Thread_Priority: + +.. _class_Thread_constant_PRIORITY_LOW: + +.. _class_Thread_constant_PRIORITY_NORMAL: + +.. _class_Thread_constant_PRIORITY_HIGH: + +enum **Priority**: + +- **PRIORITY_LOW** = **0** --- A thread running with lower priority than normally. + +- **PRIORITY_NORMAL** = **1** --- A thread with a standard priority. + +- **PRIORITY_HIGH** = **2** --- A thread running with higher priority than normally. + +Method Descriptions +------------------- + +.. _class_Thread_method_get_id: + +- :ref:`String` **get_id** **(** **)** |const| + +Returns the current ``Thread``'s ID, uniquely identifying it among all threads. If the ``Thread`` is not running this returns an empty string. + +---- + +.. _class_Thread_method_is_active: + +- :ref:`bool` **is_active** **(** **)** |const| + +Returns ``true`` if this ``Thread`` has been started. Once started, this will return ``true`` until it is joined using :ref:`wait_to_finish`. For checking if a ``Thread`` is still executing its task, use :ref:`is_alive`. + +---- + +.. _class_Thread_method_is_alive: + +- :ref:`bool` **is_alive** **(** **)** |const| + +Returns ``true`` if this ``Thread`` is currently running. This is useful for determining if :ref:`wait_to_finish` can be called without blocking the calling thread. + +To check if a ``Thread`` is joinable, use :ref:`is_active`. + +---- + +.. _class_Thread_method_start: + +- :ref:`Error` **start** **(** :ref:`Object` instance, :ref:`String` method, :ref:`Variant` userdata=null, :ref:`Priority` priority=1 **)** + +Starts a new ``Thread`` that runs ``method`` on object ``instance`` with ``userdata`` passed as an argument. Even if no userdata is passed, ``method`` must accept one argument and it will be null. The ``priority`` of the ``Thread`` can be changed by passing a value from the :ref:`Priority` enum. + +Returns :ref:`@GlobalScope.OK` on success, or :ref:`@GlobalScope.ERR_CANT_CREATE` on failure. + +---- + +.. _class_Thread_method_wait_to_finish: + +- :ref:`Variant` **wait_to_finish** **(** **)** + +Joins the ``Thread`` and waits for it to finish. Returns the output of the method passed to :ref:`start`. + +Should either be used when you want to retrieve the value returned from the method called by the ``Thread`` or before freeing the instance that contains the ``Thread``. + +To determine if this can be called without blocking the calling thread, check if :ref:`is_alive` is ``false``. + +**Note:** After the ``Thread`` finishes joining it will be disposed. If you want to use it again you will have to create a new instance of it. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_tilemap.rst b/classes/class_tilemap.rst new file mode 100644 index 0000000..2e5ab02 --- /dev/null +++ b/classes/class_tilemap.rst @@ -0,0 +1,742 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TileMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TileMap: + +TileMap +======= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Node for 2D tile-based maps. + +Description +----------- + +Node for 2D tile-based maps. Tilemaps use a :ref:`TileSet` which contain a list of tiles (textures plus optional collision, navigation, and/or occluder shapes) which are used to create grid-based maps. + +When doing physics queries against the tilemap, the cell coordinates are encoded as ``metadata`` for each detected collision shape returned by methods such as :ref:`Physics2DDirectSpaceState.intersect_shape`, :ref:`Physics2DDirectBodyState.get_contact_collider_shape_metadata`, etc. + +Tutorials +--------- + +- :doc:`../tutorials/2d/using_tilemaps` + +- `2D Platformer Demo `__ + +- `2D Isometric Demo `__ + +- `2D Hexagonal Demo `__ + +- `2D Navigation Astar Demo `__ + +- `2D Role Playing Game Demo `__ + +- `2D Kinematic Character Demo `__ + +Properties +---------- + ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`cell_clip_uv` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Transform2D` | :ref:`cell_custom_transform` | ``Transform2D( 64, 0, 0, 64, 0, 0 )`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`HalfOffset` | :ref:`cell_half_offset` | ``2`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`int` | :ref:`cell_quadrant_size` | ``16`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Vector2` | :ref:`cell_size` | ``Vector2( 64, 64 )`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`TileOrigin` | :ref:`cell_tile_origin` | ``0`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`cell_y_sort` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`centered_textures` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`float` | :ref:`collision_bounce` | ``0.0`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`float` | :ref:`collision_friction` | ``1.0`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`int` | :ref:`collision_layer` | ``1`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`int` | :ref:`collision_mask` | ``1`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`collision_use_kinematic` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`collision_use_parent` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`compatibility_mode` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`int` | :ref:`occluder_light_mask` | ``1`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`bool` | :ref:`show_collision` | ``false`` | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ +| :ref:`TileSet` | :ref:`tile_set` | | ++--------------------------------------------+--------------------------------------------------------------------------------+---------------------------------------+ + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`fix_invalid_tiles` **(** **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_cell` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_cell_autotile_coord` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_cellv` **(** :ref:`Vector2` position **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_layer_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_collision_mask_bit` **(** :ref:`int` bit **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_used_cells` **(** **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_used_cells_by_id` **(** :ref:`int` id **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_used_rect` **(** **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_cell_transposed` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_cell_x_flipped` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_cell_y_flipped` **(** :ref:`int` x, :ref:`int` y **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`map_to_world` **(** :ref:`Vector2` map_position, :ref:`bool` ignore_half_ofs=false **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cell` **(** :ref:`int` x, :ref:`int` y, :ref:`int` tile, :ref:`bool` flip_x=false, :ref:`bool` flip_y=false, :ref:`bool` transpose=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cellv` **(** :ref:`Vector2` position, :ref:`int` tile, :ref:`bool` flip_x=false, :ref:`bool` flip_y=false, :ref:`bool` transpose=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_layer_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_collision_mask_bit` **(** :ref:`int` bit, :ref:`bool` value **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_bitmask_area` **(** :ref:`Vector2` position **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_bitmask_region` **(** :ref:`Vector2` start=Vector2( 0, 0 ), :ref:`Vector2` end=Vector2( 0, 0 ) **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_dirty_quadrants` **(** **)** | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`world_to_map` **(** :ref:`Vector2` world_position **)** |const| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_TileMap_signal_settings_changed: + +- **settings_changed** **(** **)** + +Emitted when a tilemap setting has changed. + +Enumerations +------------ + +.. _enum_TileMap_Mode: + +.. _class_TileMap_constant_MODE_SQUARE: + +.. _class_TileMap_constant_MODE_ISOMETRIC: + +.. _class_TileMap_constant_MODE_CUSTOM: + +enum **Mode**: + +- **MODE_SQUARE** = **0** --- Orthogonal orientation mode. + +- **MODE_ISOMETRIC** = **1** --- Isometric orientation mode. + +- **MODE_CUSTOM** = **2** --- Custom orientation mode. + +---- + +.. _enum_TileMap_HalfOffset: + +.. _class_TileMap_constant_HALF_OFFSET_X: + +.. _class_TileMap_constant_HALF_OFFSET_Y: + +.. _class_TileMap_constant_HALF_OFFSET_DISABLED: + +.. _class_TileMap_constant_HALF_OFFSET_NEGATIVE_X: + +.. _class_TileMap_constant_HALF_OFFSET_NEGATIVE_Y: + +enum **HalfOffset**: + +- **HALF_OFFSET_X** = **0** --- Half offset on the X coordinate. + +- **HALF_OFFSET_Y** = **1** --- Half offset on the Y coordinate. + +- **HALF_OFFSET_DISABLED** = **2** --- Half offset disabled. + +- **HALF_OFFSET_NEGATIVE_X** = **3** --- Half offset on the X coordinate (negative). + +- **HALF_OFFSET_NEGATIVE_Y** = **4** --- Half offset on the Y coordinate (negative). + +---- + +.. _enum_TileMap_TileOrigin: + +.. _class_TileMap_constant_TILE_ORIGIN_TOP_LEFT: + +.. _class_TileMap_constant_TILE_ORIGIN_CENTER: + +.. _class_TileMap_constant_TILE_ORIGIN_BOTTOM_LEFT: + +enum **TileOrigin**: + +- **TILE_ORIGIN_TOP_LEFT** = **0** --- Tile origin at its top-left corner. + +- **TILE_ORIGIN_CENTER** = **1** --- Tile origin at its center. + +- **TILE_ORIGIN_BOTTOM_LEFT** = **2** --- Tile origin at its bottom-left corner. + +Constants +--------- + +.. _class_TileMap_constant_INVALID_CELL: + +- **INVALID_CELL** = **-1** --- Returned when a cell doesn't exist. + +Property Descriptions +--------------------- + +.. _class_TileMap_property_cell_clip_uv: + +- :ref:`bool` **cell_clip_uv** + ++-----------+--------------------+ +| *Default* | ``false`` | ++-----------+--------------------+ +| *Setter* | set_clip_uv(value) | ++-----------+--------------------+ +| *Getter* | get_clip_uv() | ++-----------+--------------------+ + +If ``true``, the cell's UVs will be clipped. + +---- + +.. _class_TileMap_property_cell_custom_transform: + +- :ref:`Transform2D` **cell_custom_transform** + ++-----------+---------------------------------------+ +| *Default* | ``Transform2D( 64, 0, 0, 64, 0, 0 )`` | ++-----------+---------------------------------------+ +| *Setter* | set_custom_transform(value) | ++-----------+---------------------------------------+ +| *Getter* | get_custom_transform() | ++-----------+---------------------------------------+ + +The custom :ref:`Transform2D` to be applied to the TileMap's cells. + +---- + +.. _class_TileMap_property_cell_half_offset: + +- :ref:`HalfOffset` **cell_half_offset** + ++-----------+------------------------+ +| *Default* | ``2`` | ++-----------+------------------------+ +| *Setter* | set_half_offset(value) | ++-----------+------------------------+ +| *Getter* | get_half_offset() | ++-----------+------------------------+ + +Amount to offset alternating tiles. See :ref:`HalfOffset` for possible values. + +---- + +.. _class_TileMap_property_cell_quadrant_size: + +- :ref:`int` **cell_quadrant_size** + ++-----------+--------------------------+ +| *Default* | ``16`` | ++-----------+--------------------------+ +| *Setter* | set_quadrant_size(value) | ++-----------+--------------------------+ +| *Getter* | get_quadrant_size() | ++-----------+--------------------------+ + +The TileMap's quadrant size. Optimizes drawing by batching, using chunks of this size. + +---- + +.. _class_TileMap_property_cell_size: + +- :ref:`Vector2` **cell_size** + ++-----------+-----------------------+ +| *Default* | ``Vector2( 64, 64 )`` | ++-----------+-----------------------+ +| *Setter* | set_cell_size(value) | ++-----------+-----------------------+ +| *Getter* | get_cell_size() | ++-----------+-----------------------+ + +The TileMap's cell size. + +---- + +.. _class_TileMap_property_cell_tile_origin: + +- :ref:`TileOrigin` **cell_tile_origin** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_tile_origin(value) | ++-----------+------------------------+ +| *Getter* | get_tile_origin() | ++-----------+------------------------+ + +Position for tile origin. See :ref:`TileOrigin` for possible values. + +---- + +.. _class_TileMap_property_cell_y_sort: + +- :ref:`bool` **cell_y_sort** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_y_sort_mode(value) | ++-----------+--------------------------+ +| *Getter* | is_y_sort_mode_enabled() | ++-----------+--------------------------+ + +If ``true``, the TileMap's direct children will be drawn in order of their Y coordinate. + +---- + +.. _class_TileMap_property_centered_textures: + +- :ref:`bool` **centered_textures** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_centered_textures(value) | ++-----------+--------------------------------+ +| *Getter* | is_centered_textures_enabled() | ++-----------+--------------------------------+ + +If ``true``, the textures will be centered in the middle of each tile. This is useful for certain isometric or top-down modes when textures are made larger or smaller than the tiles (e.g. to avoid flickering on tile edges). The offset is still applied, but from the center of the tile. If used, :ref:`compatibility_mode` is ignored. + +If ``false``, the texture position start in the top-left corner unless :ref:`compatibility_mode` is enabled. + +---- + +.. _class_TileMap_property_collision_bounce: + +- :ref:`float` **collision_bounce** + ++-----------+-----------------------------+ +| *Default* | ``0.0`` | ++-----------+-----------------------------+ +| *Setter* | set_collision_bounce(value) | ++-----------+-----------------------------+ +| *Getter* | get_collision_bounce() | ++-----------+-----------------------------+ + +Bounce value for static body collisions (see ``collision_use_kinematic``). + +---- + +.. _class_TileMap_property_collision_friction: + +- :ref:`float` **collision_friction** + ++-----------+-------------------------------+ +| *Default* | ``1.0`` | ++-----------+-------------------------------+ +| *Setter* | set_collision_friction(value) | ++-----------+-------------------------------+ +| *Getter* | get_collision_friction() | ++-----------+-------------------------------+ + +Friction value for static body collisions (see ``collision_use_kinematic``). + +---- + +.. _class_TileMap_property_collision_layer: + +- :ref:`int` **collision_layer** + ++-----------+----------------------------+ +| *Default* | ``1`` | ++-----------+----------------------------+ +| *Setter* | set_collision_layer(value) | ++-----------+----------------------------+ +| *Getter* | get_collision_layer() | ++-----------+----------------------------+ + +The collision layer(s) for all colliders in the TileMap. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_TileMap_property_collision_mask: + +- :ref:`int` **collision_mask** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_collision_mask(value) | ++-----------+---------------------------+ +| *Getter* | get_collision_mask() | ++-----------+---------------------------+ + +The collision mask(s) for all colliders in the TileMap. See `Collision layers and masks `__ in the documentation for more information. + +---- + +.. _class_TileMap_property_collision_use_kinematic: + +- :ref:`bool` **collision_use_kinematic** + ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Setter* | set_collision_use_kinematic(value) | ++-----------+------------------------------------+ +| *Getter* | get_collision_use_kinematic() | ++-----------+------------------------------------+ + +If ``true``, TileMap collisions will be handled as a kinematic body. If ``false``, collisions will be handled as static body. + +---- + +.. _class_TileMap_property_collision_use_parent: + +- :ref:`bool` **collision_use_parent** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_collision_use_parent(value) | ++-----------+---------------------------------+ +| *Getter* | get_collision_use_parent() | ++-----------+---------------------------------+ + +If ``true``, this tilemap's collision shape will be added to the collision shape of the parent. The parent has to be a :ref:`CollisionObject2D`. + +---- + +.. _class_TileMap_property_compatibility_mode: + +- :ref:`bool` **compatibility_mode** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_compatibility_mode(value) | ++-----------+---------------------------------+ +| *Getter* | is_compatibility_mode_enabled() | ++-----------+---------------------------------+ + +If ``true``, the compatibility with the tilemaps made in Godot 3.1 or earlier is maintained (textures move when the tile origin changes and rotate if the texture size is not homogeneous). This mode presents problems when doing ``flip_h``, ``flip_v`` and ``transpose`` tile operations on non-homogeneous isometric tiles (e.g. 2:1), in which the texture could not coincide with the collision, thus it is not recommended for isometric or non-square tiles. + +If ``false``, the textures do not move when doing ``flip_h``, ``flip_v`` operations if no offset is used, nor when changing the tile origin. + +The compatibility mode doesn't work with the :ref:`centered_textures` option, because displacing textures with the :ref:`cell_tile_origin` option or in irregular tiles is not relevant when centering those textures. + +---- + +.. _class_TileMap_property_mode: + +- :ref:`Mode` **mode** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_mode(value) | ++-----------+-----------------+ +| *Getter* | get_mode() | ++-----------+-----------------+ + +The TileMap orientation mode. See :ref:`Mode` for possible values. + +---- + +.. _class_TileMap_property_occluder_light_mask: + +- :ref:`int` **occluder_light_mask** + ++-----------+--------------------------------+ +| *Default* | ``1`` | ++-----------+--------------------------------+ +| *Setter* | set_occluder_light_mask(value) | ++-----------+--------------------------------+ +| *Getter* | get_occluder_light_mask() | ++-----------+--------------------------------+ + +The light mask assigned to all light occluders in the TileMap. The TileSet's light occluders will cast shadows only from Light2D(s) that have the same light mask(s). + +---- + +.. _class_TileMap_property_show_collision: + +- :ref:`bool` **show_collision** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_show_collision(value) | ++-----------+-----------------------------+ +| *Getter* | is_show_collision_enabled() | ++-----------+-----------------------------+ + +If ``true``, collision shapes are visible in the editor. Doesn't affect collision shapes visibility at runtime. To show collision shapes at runtime, enable **Visible Collision Shapes** in the **Debug** menu instead. + +---- + +.. _class_TileMap_property_tile_set: + +- :ref:`TileSet` **tile_set** + ++----------+--------------------+ +| *Setter* | set_tileset(value) | ++----------+--------------------+ +| *Getter* | get_tileset() | ++----------+--------------------+ + +The assigned :ref:`TileSet`. + +Method Descriptions +------------------- + +.. _class_TileMap_method_clear: + +- void **clear** **(** **)** + +Clears all cells. + +---- + +.. _class_TileMap_method_fix_invalid_tiles: + +- void **fix_invalid_tiles** **(** **)** + +Clears cells that do not exist in the tileset. + +---- + +.. _class_TileMap_method_get_cell: + +- :ref:`int` **get_cell** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns the tile index of the given cell. If no tile exists in the cell, returns :ref:`INVALID_CELL`. + +---- + +.. _class_TileMap_method_get_cell_autotile_coord: + +- :ref:`Vector2` **get_cell_autotile_coord** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns the coordinate (subtile column and row) of the autotile variation in the tileset. Returns a zero vector if the cell doesn't have autotiling. + +---- + +.. _class_TileMap_method_get_cellv: + +- :ref:`int` **get_cellv** **(** :ref:`Vector2` position **)** |const| + +Returns the tile index of the cell given by a Vector2. If no tile exists in the cell, returns :ref:`INVALID_CELL`. + +---- + +.. _class_TileMap_method_get_collision_layer_bit: + +- :ref:`bool` **get_collision_layer_bit** **(** :ref:`int` bit **)** |const| + +Returns ``true`` if the given collision layer bit is set. + +---- + +.. _class_TileMap_method_get_collision_mask_bit: + +- :ref:`bool` **get_collision_mask_bit** **(** :ref:`int` bit **)** |const| + +Returns ``true`` if the given collision mask bit is set. + +---- + +.. _class_TileMap_method_get_used_cells: + +- :ref:`Array` **get_used_cells** **(** **)** |const| + +Returns a :ref:`Vector2` array with the positions of all cells containing a tile from the tileset (i.e. a tile index different from ``-1``). + +---- + +.. _class_TileMap_method_get_used_cells_by_id: + +- :ref:`Array` **get_used_cells_by_id** **(** :ref:`int` id **)** |const| + +Returns an array of all cells with the given tile index specified in ``id``. + +---- + +.. _class_TileMap_method_get_used_rect: + +- :ref:`Rect2` **get_used_rect** **(** **)** + +Returns a rectangle enclosing the used (non-empty) tiles of the map. + +---- + +.. _class_TileMap_method_is_cell_transposed: + +- :ref:`bool` **is_cell_transposed** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns ``true`` if the given cell is transposed, i.e. the X and Y axes are swapped. + +---- + +.. _class_TileMap_method_is_cell_x_flipped: + +- :ref:`bool` **is_cell_x_flipped** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns ``true`` if the given cell is flipped in the X axis. + +---- + +.. _class_TileMap_method_is_cell_y_flipped: + +- :ref:`bool` **is_cell_y_flipped** **(** :ref:`int` x, :ref:`int` y **)** |const| + +Returns ``true`` if the given cell is flipped in the Y axis. + +---- + +.. _class_TileMap_method_map_to_world: + +- :ref:`Vector2` **map_to_world** **(** :ref:`Vector2` map_position, :ref:`bool` ignore_half_ofs=false **)** |const| + +Returns the local position of the top left corner of the cell corresponding to the given tilemap (grid-based) coordinates. + +To get the global position, use :ref:`Node2D.to_global`: + +:: + + var local_position = my_tilemap.map_to_world(map_position) + var global_position = my_tilemap.to_global(local_position) + +Optionally, the tilemap's half offset can be ignored. + +---- + +.. _class_TileMap_method_set_cell: + +- void **set_cell** **(** :ref:`int` x, :ref:`int` y, :ref:`int` tile, :ref:`bool` flip_x=false, :ref:`bool` flip_y=false, :ref:`bool` transpose=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** + +Sets the tile index for the given cell. + +An index of ``-1`` clears the cell. + +Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. + +**Note:** Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. + +If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants`. + +Overriding this method also overrides it internally, allowing custom logic to be implemented when tiles are placed/removed: + +:: + + func set_cell(x, y, tile, flip_x=false, flip_y=false, transpose=false, autotile_coord=Vector2()): + # Write your custom logic here. + # To call the default method: + .set_cell(x, y, tile, flip_x, flip_y, transpose, autotile_coord) + +---- + +.. _class_TileMap_method_set_cellv: + +- void **set_cellv** **(** :ref:`Vector2` position, :ref:`int` tile, :ref:`bool` flip_x=false, :ref:`bool` flip_y=false, :ref:`bool` transpose=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** + +Sets the tile index for the cell given by a Vector2. + +An index of ``-1`` clears the cell. + +Optionally, the tile can also be flipped, transposed, or given autotile coordinates. The autotile coordinate refers to the column and row of the subtile. + +**Note:** Data such as navigation polygons and collision shapes are not immediately updated for performance reasons. + +If you need these to be immediately updated, you can call :ref:`update_dirty_quadrants`. + +---- + +.. _class_TileMap_method_set_collision_layer_bit: + +- void **set_collision_layer_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets the given collision layer bit. + +---- + +.. _class_TileMap_method_set_collision_mask_bit: + +- void **set_collision_mask_bit** **(** :ref:`int` bit, :ref:`bool` value **)** + +Sets the given collision mask bit. + +---- + +.. _class_TileMap_method_update_bitmask_area: + +- void **update_bitmask_area** **(** :ref:`Vector2` position **)** + +Applies autotiling rules to the cell (and its adjacent cells) referenced by its grid-based X and Y coordinates. + +---- + +.. _class_TileMap_method_update_bitmask_region: + +- void **update_bitmask_region** **(** :ref:`Vector2` start=Vector2( 0, 0 ), :ref:`Vector2` end=Vector2( 0, 0 ) **)** + +Applies autotiling rules to the cells in the given region (specified by grid-based X and Y coordinates). + +Calling with invalid (or missing) parameters applies autotiling rules for the entire tilemap. + +---- + +.. _class_TileMap_method_update_dirty_quadrants: + +- void **update_dirty_quadrants** **(** **)** + +Updates the tile map's quadrants, allowing things such as navigation and collision shapes to be immediately used if modified. + +---- + +.. _class_TileMap_method_world_to_map: + +- :ref:`Vector2` **world_to_map** **(** :ref:`Vector2` world_position **)** |const| + +Returns the tilemap (grid-based) coordinates corresponding to the given local position. + +To use this with a global position, first determine the local position with :ref:`Node2D.to_local`: + +:: + + var local_position = my_tilemap.to_local(global_position) + var map_position = my_tilemap.world_to_map(local_position) + +.. |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.)` diff --git a/classes/class_tileset.rst b/classes/class_tileset.rst new file mode 100644 index 0000000..306fa50 --- /dev/null +++ b/classes/class_tileset.rst @@ -0,0 +1,829 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TileSet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TileSet: + +TileSet +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Tile library for tilemaps. + +Description +----------- + +A TileSet is a library of tiles for a :ref:`TileMap`. It contains a list of tiles, each consisting of a sprite and optional collision shapes. + +Tiles are referenced by a unique integer ID. + +Tutorials +--------- + +- :doc:`../tutorials/2d/using_tilemaps` + +- `2D Platformer Demo `__ + +- `2D Isometric Demo `__ + +- `2D Hexagonal Demo `__ + +- `2D Navigation Astar Demo `__ + +- `2D Role Playing Game Demo `__ + +- `2D Kinematic Character Demo `__ + +Methods +------- + ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`_forward_atlas_subtile_selection` **(** :ref:`int` atlastile_id, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`_forward_subtile_selection` **(** :ref:`int` autotile_id, :ref:`int` bitmask, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_is_tile_bound` **(** :ref:`int` drawn_id, :ref:`int` neighbor_id **)** |virtual| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_clear_bitmask_map` **(** :ref:`int` id **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`autotile_get_bitmask` **(** :ref:`int` id, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BitmaskMode` | :ref:`autotile_get_bitmask_mode` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`autotile_get_icon_coordinate` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`OccluderPolygon2D` | :ref:`autotile_get_light_occluder` **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NavigationPolygon` | :ref:`autotile_get_navigation_polygon` **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`autotile_get_size` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`autotile_get_spacing` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`autotile_get_subtile_priority` **(** :ref:`int` id, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`autotile_get_z_index` **(** :ref:`int` id, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_bitmask` **(** :ref:`int` id, :ref:`Vector2` bitmask, :ref:`int` flag **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_bitmask_mode` **(** :ref:`int` id, :ref:`BitmaskMode` mode **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_icon_coordinate` **(** :ref:`int` id, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_light_occluder` **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_navigation_polygon` **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon, :ref:`Vector2` coord **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_size` **(** :ref:`int` id, :ref:`Vector2` size **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_spacing` **(** :ref:`int` id, :ref:`int` spacing **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_subtile_priority` **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` priority **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`autotile_set_z_index` **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` z_index **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_tile` **(** :ref:`int` id **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`find_tile_by_name` **(** :ref:`String` name **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_last_unused_tile_id` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_tiles_ids` **(** **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_tile` **(** :ref:`int` id **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_add_shape` **(** :ref:`int` id, :ref:`Shape2D` shape, :ref:`Transform2D` shape_transform, :ref:`bool` one_way=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`OccluderPolygon2D` | :ref:`tile_get_light_occluder` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ShaderMaterial` | :ref:`tile_get_material` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`tile_get_modulate` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`tile_get_name` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NavigationPolygon` | :ref:`tile_get_navigation_polygon` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tile_get_navigation_polygon_offset` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`tile_get_normal_map` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tile_get_occluder_offset` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`tile_get_region` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Shape2D` | :ref:`tile_get_shape` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`tile_get_shape_count` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tile_get_shape_offset` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`tile_get_shape_one_way` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tile_get_shape_one_way_margin` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`tile_get_shape_transform` **(** :ref:`int` id, :ref:`int` shape_id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`tile_get_shapes` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`tile_get_texture` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tile_get_texture_offset` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TileMode` | :ref:`tile_get_tile_mode` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`tile_get_z_index` **(** :ref:`int` id **)** |const| | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_light_occluder` **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_material` **(** :ref:`int` id, :ref:`ShaderMaterial` material **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_modulate` **(** :ref:`int` id, :ref:`Color` color **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_name` **(** :ref:`int` id, :ref:`String` name **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_navigation_polygon` **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_navigation_polygon_offset` **(** :ref:`int` id, :ref:`Vector2` navigation_polygon_offset **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_normal_map` **(** :ref:`int` id, :ref:`Texture` normal_map **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_occluder_offset` **(** :ref:`int` id, :ref:`Vector2` occluder_offset **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_region` **(** :ref:`int` id, :ref:`Rect2` region **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shape` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Shape2D` shape **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shape_offset` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Vector2` shape_offset **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shape_one_way` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` one_way **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shape_one_way_margin` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`float` one_way **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shape_transform` **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Transform2D` shape_transform **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_shapes` **(** :ref:`int` id, :ref:`Array` shapes **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_texture` **(** :ref:`int` id, :ref:`Texture` texture **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_texture_offset` **(** :ref:`int` id, :ref:`Vector2` texture_offset **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_tile_mode` **(** :ref:`int` id, :ref:`TileMode` tilemode **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`tile_set_z_index` **(** :ref:`int` id, :ref:`int` z_index **)** | ++---------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_TileSet_BitmaskMode: + +.. _class_TileSet_constant_BITMASK_2X2: + +.. _class_TileSet_constant_BITMASK_3X3_MINIMAL: + +.. _class_TileSet_constant_BITMASK_3X3: + +enum **BitmaskMode**: + +- **BITMASK_2X2** = **0** + +- **BITMASK_3X3_MINIMAL** = **1** + +- **BITMASK_3X3** = **2** + +---- + +.. _enum_TileSet_AutotileBindings: + +.. _class_TileSet_constant_BIND_TOPLEFT: + +.. _class_TileSet_constant_BIND_TOP: + +.. _class_TileSet_constant_BIND_TOPRIGHT: + +.. _class_TileSet_constant_BIND_LEFT: + +.. _class_TileSet_constant_BIND_CENTER: + +.. _class_TileSet_constant_BIND_RIGHT: + +.. _class_TileSet_constant_BIND_BOTTOMLEFT: + +.. _class_TileSet_constant_BIND_BOTTOM: + +.. _class_TileSet_constant_BIND_BOTTOMRIGHT: + +enum **AutotileBindings**: + +- **BIND_TOPLEFT** = **1** + +- **BIND_TOP** = **2** + +- **BIND_TOPRIGHT** = **4** + +- **BIND_LEFT** = **8** + +- **BIND_CENTER** = **16** + +- **BIND_RIGHT** = **32** + +- **BIND_BOTTOMLEFT** = **64** + +- **BIND_BOTTOM** = **128** + +- **BIND_BOTTOMRIGHT** = **256** + +---- + +.. _enum_TileSet_TileMode: + +.. _class_TileSet_constant_SINGLE_TILE: + +.. _class_TileSet_constant_AUTO_TILE: + +.. _class_TileSet_constant_ATLAS_TILE: + +enum **TileMode**: + +- **SINGLE_TILE** = **0** + +- **AUTO_TILE** = **1** + +- **ATLAS_TILE** = **2** + +Method Descriptions +------------------- + +.. _class_TileSet_method__forward_atlas_subtile_selection: + +- :ref:`Vector2` **_forward_atlas_subtile_selection** **(** :ref:`int` atlastile_id, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| + +---- + +.. _class_TileSet_method__forward_subtile_selection: + +- :ref:`Vector2` **_forward_subtile_selection** **(** :ref:`int` autotile_id, :ref:`int` bitmask, :ref:`Object` tilemap, :ref:`Vector2` tile_location **)** |virtual| + +---- + +.. _class_TileSet_method__is_tile_bound: + +- :ref:`bool` **_is_tile_bound** **(** :ref:`int` drawn_id, :ref:`int` neighbor_id **)** |virtual| + +Determines when the auto-tiler should consider two different auto-tile IDs to be bound together. + +**Note:** ``neighbor_id`` will be ``-1`` (:ref:`TileMap.INVALID_CELL`) when checking a tile against an empty neighbor tile. + +---- + +.. _class_TileSet_method_autotile_clear_bitmask_map: + +- void **autotile_clear_bitmask_map** **(** :ref:`int` id **)** + +Clears all bitmask information of the autotile. + +---- + +.. _class_TileSet_method_autotile_get_bitmask: + +- :ref:`int` **autotile_get_bitmask** **(** :ref:`int` id, :ref:`Vector2` coord **)** + +Returns the bitmask of the subtile from an autotile given its coordinates. + +The value is the sum of the values in :ref:`AutotileBindings` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). + +---- + +.. _class_TileSet_method_autotile_get_bitmask_mode: + +- :ref:`BitmaskMode` **autotile_get_bitmask_mode** **(** :ref:`int` id **)** |const| + +Returns the :ref:`BitmaskMode` of the autotile. + +---- + +.. _class_TileSet_method_autotile_get_icon_coordinate: + +- :ref:`Vector2` **autotile_get_icon_coordinate** **(** :ref:`int` id **)** |const| + +Returns the subtile that's being used as an icon in an atlas/autotile given its coordinates. + +The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. + +---- + +.. _class_TileSet_method_autotile_get_light_occluder: + +- :ref:`OccluderPolygon2D` **autotile_get_light_occluder** **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| + +Returns the light occluder of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_autotile_get_navigation_polygon: + +- :ref:`NavigationPolygon` **autotile_get_navigation_polygon** **(** :ref:`int` id, :ref:`Vector2` coord **)** |const| + +Returns the navigation polygon of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_autotile_get_size: + +- :ref:`Vector2` **autotile_get_size** **(** :ref:`int` id **)** |const| + +Returns the size of the subtiles in an atlas/autotile. + +---- + +.. _class_TileSet_method_autotile_get_spacing: + +- :ref:`int` **autotile_get_spacing** **(** :ref:`int` id **)** |const| + +Returns the spacing between subtiles of the atlas/autotile. + +---- + +.. _class_TileSet_method_autotile_get_subtile_priority: + +- :ref:`int` **autotile_get_subtile_priority** **(** :ref:`int` id, :ref:`Vector2` coord **)** + +Returns the priority of the subtile from an autotile given its coordinates. + +When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. + +---- + +.. _class_TileSet_method_autotile_get_z_index: + +- :ref:`int` **autotile_get_z_index** **(** :ref:`int` id, :ref:`Vector2` coord **)** + +Returns the drawing index of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_autotile_set_bitmask: + +- void **autotile_set_bitmask** **(** :ref:`int` id, :ref:`Vector2` bitmask, :ref:`int` flag **)** + +Sets the bitmask of the subtile from an autotile given its coordinates. + +The value is the sum of the values in :ref:`AutotileBindings` present in the subtile (e.g. a value of 5 means the bitmask has bindings in both the top left and top right). + +---- + +.. _class_TileSet_method_autotile_set_bitmask_mode: + +- void **autotile_set_bitmask_mode** **(** :ref:`int` id, :ref:`BitmaskMode` mode **)** + +Sets the :ref:`BitmaskMode` of the autotile. + +---- + +.. _class_TileSet_method_autotile_set_icon_coordinate: + +- void **autotile_set_icon_coordinate** **(** :ref:`int` id, :ref:`Vector2` coord **)** + +Sets the subtile that will be used as an icon in an atlas/autotile given its coordinates. + +The subtile defined as the icon will be used as a fallback when the atlas/autotile's bitmask information is incomplete. It will also be used to represent it in the TileSet editor. + +---- + +.. _class_TileSet_method_autotile_set_light_occluder: + +- void **autotile_set_light_occluder** **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder, :ref:`Vector2` coord **)** + +Sets the light occluder of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_autotile_set_navigation_polygon: + +- void **autotile_set_navigation_polygon** **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon, :ref:`Vector2` coord **)** + +Sets the navigation polygon of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_autotile_set_size: + +- void **autotile_set_size** **(** :ref:`int` id, :ref:`Vector2` size **)** + +Sets the size of the subtiles in an atlas/autotile. + +---- + +.. _class_TileSet_method_autotile_set_spacing: + +- void **autotile_set_spacing** **(** :ref:`int` id, :ref:`int` spacing **)** + +Sets the spacing between subtiles of the atlas/autotile. + +---- + +.. _class_TileSet_method_autotile_set_subtile_priority: + +- void **autotile_set_subtile_priority** **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` priority **)** + +Sets the priority of the subtile from an autotile given its coordinates. + +When more than one subtile has the same bitmask value, one of them will be picked randomly for drawing. Its priority will define how often it will be picked. + +---- + +.. _class_TileSet_method_autotile_set_z_index: + +- void **autotile_set_z_index** **(** :ref:`int` id, :ref:`Vector2` coord, :ref:`int` z_index **)** + +Sets the drawing index of the subtile from an atlas/autotile given its coordinates. + +---- + +.. _class_TileSet_method_clear: + +- void **clear** **(** **)** + +Clears all tiles. + +---- + +.. _class_TileSet_method_create_tile: + +- void **create_tile** **(** :ref:`int` id **)** + +Creates a new tile with the given ID. + +---- + +.. _class_TileSet_method_find_tile_by_name: + +- :ref:`int` **find_tile_by_name** **(** :ref:`String` name **)** |const| + +Returns the first tile matching the given name. + +---- + +.. _class_TileSet_method_get_last_unused_tile_id: + +- :ref:`int` **get_last_unused_tile_id** **(** **)** |const| + +Returns the ID following the last currently used ID, useful when creating a new tile. + +---- + +.. _class_TileSet_method_get_tiles_ids: + +- :ref:`Array` **get_tiles_ids** **(** **)** |const| + +Returns an array of all currently used tile IDs. + +---- + +.. _class_TileSet_method_remove_tile: + +- void **remove_tile** **(** :ref:`int` id **)** + +Removes the given tile ID. + +---- + +.. _class_TileSet_method_tile_add_shape: + +- void **tile_add_shape** **(** :ref:`int` id, :ref:`Shape2D` shape, :ref:`Transform2D` shape_transform, :ref:`bool` one_way=false, :ref:`Vector2` autotile_coord=Vector2( 0, 0 ) **)** + +Adds a shape to the tile. + +---- + +.. _class_TileSet_method_tile_get_light_occluder: + +- :ref:`OccluderPolygon2D` **tile_get_light_occluder** **(** :ref:`int` id **)** |const| + +Returns the tile's light occluder. + +---- + +.. _class_TileSet_method_tile_get_material: + +- :ref:`ShaderMaterial` **tile_get_material** **(** :ref:`int` id **)** |const| + +Returns the tile's material. + +---- + +.. _class_TileSet_method_tile_get_modulate: + +- :ref:`Color` **tile_get_modulate** **(** :ref:`int` id **)** |const| + +Returns the tile's modulation color. + +---- + +.. _class_TileSet_method_tile_get_name: + +- :ref:`String` **tile_get_name** **(** :ref:`int` id **)** |const| + +Returns the tile's name. + +---- + +.. _class_TileSet_method_tile_get_navigation_polygon: + +- :ref:`NavigationPolygon` **tile_get_navigation_polygon** **(** :ref:`int` id **)** |const| + +Returns the navigation polygon of the tile. + +---- + +.. _class_TileSet_method_tile_get_navigation_polygon_offset: + +- :ref:`Vector2` **tile_get_navigation_polygon_offset** **(** :ref:`int` id **)** |const| + +Returns the offset of the tile's navigation polygon. + +---- + +.. _class_TileSet_method_tile_get_normal_map: + +- :ref:`Texture` **tile_get_normal_map** **(** :ref:`int` id **)** |const| + +Returns the tile's normal map texture. + +---- + +.. _class_TileSet_method_tile_get_occluder_offset: + +- :ref:`Vector2` **tile_get_occluder_offset** **(** :ref:`int` id **)** |const| + +Returns the offset of the tile's light occluder. + +---- + +.. _class_TileSet_method_tile_get_region: + +- :ref:`Rect2` **tile_get_region** **(** :ref:`int` id **)** |const| + +Returns the tile sub-region in the texture. + +---- + +.. _class_TileSet_method_tile_get_shape: + +- :ref:`Shape2D` **tile_get_shape** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| + +Returns a tile's given shape. + +---- + +.. _class_TileSet_method_tile_get_shape_count: + +- :ref:`int` **tile_get_shape_count** **(** :ref:`int` id **)** |const| + +Returns the number of shapes assigned to a tile. + +---- + +.. _class_TileSet_method_tile_get_shape_offset: + +- :ref:`Vector2` **tile_get_shape_offset** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| + +Returns the offset of a tile's shape. + +---- + +.. _class_TileSet_method_tile_get_shape_one_way: + +- :ref:`bool` **tile_get_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| + +Returns the one-way collision value of a tile's shape. + +---- + +.. _class_TileSet_method_tile_get_shape_one_way_margin: + +- :ref:`float` **tile_get_shape_one_way_margin** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| + +---- + +.. _class_TileSet_method_tile_get_shape_transform: + +- :ref:`Transform2D` **tile_get_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id **)** |const| + +Returns the :ref:`Transform2D` of a tile's shape. + +---- + +.. _class_TileSet_method_tile_get_shapes: + +- :ref:`Array` **tile_get_shapes** **(** :ref:`int` id **)** |const| + +Returns an array of dictionaries describing the tile's shapes. + +**Dictionary structure in the array returned by this method:** + +:: + + { + "autotile_coord": Vector2, + "one_way": bool, + "one_way_margin": int, + "shape": CollisionShape2D, + "shape_transform": Transform2D, + } + +---- + +.. _class_TileSet_method_tile_get_texture: + +- :ref:`Texture` **tile_get_texture** **(** :ref:`int` id **)** |const| + +Returns the tile's texture. + +---- + +.. _class_TileSet_method_tile_get_texture_offset: + +- :ref:`Vector2` **tile_get_texture_offset** **(** :ref:`int` id **)** |const| + +Returns the texture offset of the tile. + +---- + +.. _class_TileSet_method_tile_get_tile_mode: + +- :ref:`TileMode` **tile_get_tile_mode** **(** :ref:`int` id **)** |const| + +Returns the tile's :ref:`TileMode`. + +---- + +.. _class_TileSet_method_tile_get_z_index: + +- :ref:`int` **tile_get_z_index** **(** :ref:`int` id **)** |const| + +Returns the tile's Z index (drawing layer). + +---- + +.. _class_TileSet_method_tile_set_light_occluder: + +- void **tile_set_light_occluder** **(** :ref:`int` id, :ref:`OccluderPolygon2D` light_occluder **)** + +Sets a light occluder for the tile. + +---- + +.. _class_TileSet_method_tile_set_material: + +- void **tile_set_material** **(** :ref:`int` id, :ref:`ShaderMaterial` material **)** + +Sets the tile's material. + +---- + +.. _class_TileSet_method_tile_set_modulate: + +- void **tile_set_modulate** **(** :ref:`int` id, :ref:`Color` color **)** + +Sets the tile's modulation color. + +**Note:** Modulation is performed by setting the tile's vertex color. To access this in a shader, use ``COLOR`` rather than ``MODULATE`` (which instead accesses the :ref:`TileMap`'s :ref:`CanvasItem.modulate` property). + +---- + +.. _class_TileSet_method_tile_set_name: + +- void **tile_set_name** **(** :ref:`int` id, :ref:`String` name **)** + +Sets the tile's name. + +---- + +.. _class_TileSet_method_tile_set_navigation_polygon: + +- void **tile_set_navigation_polygon** **(** :ref:`int` id, :ref:`NavigationPolygon` navigation_polygon **)** + +Sets the tile's navigation polygon. + +---- + +.. _class_TileSet_method_tile_set_navigation_polygon_offset: + +- void **tile_set_navigation_polygon_offset** **(** :ref:`int` id, :ref:`Vector2` navigation_polygon_offset **)** + +Sets an offset for the tile's navigation polygon. + +---- + +.. _class_TileSet_method_tile_set_normal_map: + +- void **tile_set_normal_map** **(** :ref:`int` id, :ref:`Texture` normal_map **)** + +Sets the tile's normal map texture. + +**Note:** Godot expects the normal map to use X+, Y-, and Z+ coordinates. See `this page `__ for a comparison of normal map coordinates expected by popular engines. + +---- + +.. _class_TileSet_method_tile_set_occluder_offset: + +- void **tile_set_occluder_offset** **(** :ref:`int` id, :ref:`Vector2` occluder_offset **)** + +Sets an offset for the tile's light occluder. + +---- + +.. _class_TileSet_method_tile_set_region: + +- void **tile_set_region** **(** :ref:`int` id, :ref:`Rect2` region **)** + +Sets the tile's sub-region in the texture. This is common in texture atlases. + +---- + +.. _class_TileSet_method_tile_set_shape: + +- void **tile_set_shape** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Shape2D` shape **)** + +Sets a shape for the tile, enabling collision. + +---- + +.. _class_TileSet_method_tile_set_shape_offset: + +- void **tile_set_shape_offset** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Vector2` shape_offset **)** + +Sets the offset of a tile's shape. + +---- + +.. _class_TileSet_method_tile_set_shape_one_way: + +- void **tile_set_shape_one_way** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`bool` one_way **)** + +Enables one-way collision on a tile's shape. + +---- + +.. _class_TileSet_method_tile_set_shape_one_way_margin: + +- void **tile_set_shape_one_way_margin** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`float` one_way **)** + +---- + +.. _class_TileSet_method_tile_set_shape_transform: + +- void **tile_set_shape_transform** **(** :ref:`int` id, :ref:`int` shape_id, :ref:`Transform2D` shape_transform **)** + +Sets a :ref:`Transform2D` on a tile's shape. + +---- + +.. _class_TileSet_method_tile_set_shapes: + +- void **tile_set_shapes** **(** :ref:`int` id, :ref:`Array` shapes **)** + +Sets an array of shapes for the tile, enabling collision. + +---- + +.. _class_TileSet_method_tile_set_texture: + +- void **tile_set_texture** **(** :ref:`int` id, :ref:`Texture` texture **)** + +Sets the tile's texture. + +---- + +.. _class_TileSet_method_tile_set_texture_offset: + +- void **tile_set_texture_offset** **(** :ref:`int` id, :ref:`Vector2` texture_offset **)** + +Sets the tile's texture offset. + +---- + +.. _class_TileSet_method_tile_set_tile_mode: + +- void **tile_set_tile_mode** **(** :ref:`int` id, :ref:`TileMode` tilemode **)** + +Sets the tile's :ref:`TileMode`. + +---- + +.. _class_TileSet_method_tile_set_z_index: + +- void **tile_set_z_index** **(** :ref:`int` id, :ref:`int` z_index **)** + +Sets the tile's drawing 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.)` diff --git a/classes/class_timer.rst b/classes/class_timer.rst new file mode 100644 index 0000000..478268c --- /dev/null +++ b/classes/class_timer.rst @@ -0,0 +1,206 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Timer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Timer: + +Timer +===== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +A countdown timer. + +Description +----------- + +Counts down a specified interval and emits a signal on reaching 0. Can be set to repeat or "one-shot" mode. + +**Note:** To create a one-shot timer without instantiating a node, use :ref:`SceneTree.create_timer`. + +Tutorials +--------- + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`autostart` | ``false`` | ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`one_shot` | ``false`` | ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`paused` | | ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`TimerProcessMode` | :ref:`process_mode` | ``1`` | ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`time_left` | | ++------------------------------------------------------+--------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`wait_time` | ``1.0`` | ++------------------------------------------------------+--------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------+------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_stopped` **(** **)** |const| | ++-------------------------+------------------------------------------------------------------------------------------+ +| void | :ref:`start` **(** :ref:`float` time_sec=-1 **)** | ++-------------------------+------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------+------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Timer_signal_timeout: + +- **timeout** **(** **)** + +Emitted when the timer reaches 0. + +Enumerations +------------ + +.. _enum_Timer_TimerProcessMode: + +.. _class_Timer_constant_TIMER_PROCESS_PHYSICS: + +.. _class_Timer_constant_TIMER_PROCESS_IDLE: + +enum **TimerProcessMode**: + +- **TIMER_PROCESS_PHYSICS** = **0** --- Update the timer during the physics step at each frame (fixed framerate processing). + +- **TIMER_PROCESS_IDLE** = **1** --- Update the timer during the idle time at each frame. + +Property Descriptions +--------------------- + +.. _class_Timer_property_autostart: + +- :ref:`bool` **autostart** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_autostart(value) | ++-----------+----------------------+ +| *Getter* | has_autostart() | ++-----------+----------------------+ + +If ``true``, the timer will automatically start when entering the scene tree. + +**Note:** This property is automatically set to ``false`` after the timer enters the scene tree and starts. + +---- + +.. _class_Timer_property_one_shot: + +- :ref:`bool` **one_shot** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_one_shot(value) | ++-----------+---------------------+ +| *Getter* | is_one_shot() | ++-----------+---------------------+ + +If ``true``, the timer will stop when reaching 0. If ``false``, it will restart. + +---- + +.. _class_Timer_property_paused: + +- :ref:`bool` **paused** + ++----------+-------------------+ +| *Setter* | set_paused(value) | ++----------+-------------------+ +| *Getter* | is_paused() | ++----------+-------------------+ + +If ``true``, the timer is paused and will not process until it is unpaused again, even if :ref:`start` is called. + +---- + +.. _class_Timer_property_process_mode: + +- :ref:`TimerProcessMode` **process_mode** + ++-----------+-------------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------------+ +| *Setter* | set_timer_process_mode(value) | ++-----------+-------------------------------+ +| *Getter* | get_timer_process_mode() | ++-----------+-------------------------------+ + +Processing mode. See :ref:`TimerProcessMode`. + +---- + +.. _class_Timer_property_time_left: + +- :ref:`float` **time_left** + ++----------+-----------------+ +| *Getter* | get_time_left() | ++----------+-----------------+ + +The timer's remaining time in seconds. Returns 0 if the timer is inactive. + +**Note:** You cannot set this value. To change the timer's remaining time, use :ref:`start`. + +---- + +.. _class_Timer_property_wait_time: + +- :ref:`float` **wait_time** + ++-----------+----------------------+ +| *Default* | ``1.0`` | ++-----------+----------------------+ +| *Setter* | set_wait_time(value) | ++-----------+----------------------+ +| *Getter* | get_wait_time() | ++-----------+----------------------+ + +The wait time in seconds. + +**Note:** Timers can only emit once per rendered frame at most (or once per physics frame if :ref:`process_mode` is :ref:`TIMER_PROCESS_PHYSICS`). This means very low wait times (lower than 0.05 seconds) will behave in significantly different ways depending on the rendered framerate. For very low wait times, it is recommended to use a process loop in a script instead of using a Timer node. + +Method Descriptions +------------------- + +.. _class_Timer_method_is_stopped: + +- :ref:`bool` **is_stopped** **(** **)** |const| + +Returns ``true`` if the timer is stopped. + +---- + +.. _class_Timer_method_start: + +- void **start** **(** :ref:`float` time_sec=-1 **)** + +Starts the timer. Sets ``wait_time`` to ``time_sec`` if ``time_sec > 0``. This also resets the remaining time to ``wait_time``. + +**Note:** This method will not resume a paused timer. See :ref:`paused`. + +---- + +.. _class_Timer_method_stop: + +- void **stop** **(** **)** + +Stops the timer. + +.. |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.)` diff --git a/classes/class_toolbutton.rst b/classes/class_toolbutton.rst new file mode 100644 index 0000000..92676e6 --- /dev/null +++ b/classes/class_toolbutton.rst @@ -0,0 +1,185 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ToolButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ToolButton: + +ToolButton +========== + +**Inherits:** :ref:`Button` **<** :ref:`BaseButton` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Flat button helper class. + +Description +----------- + +This is a helper class to generate a flat :ref:`Button` (see :ref:`Button.flat`), creating a ``ToolButton`` is equivalent to: + +:: + + var btn = Button.new() + btn.flat = true + +Properties +---------- + ++-------------------------+------+------------------------------+ +| :ref:`bool` | flat | ``true`` *(parent override)* | ++-------------------------+------+------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_disabled` | ``Color( 0.9, 0.95, 1, 0.3 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_focus` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_hover` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_pressed` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``3`` | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`disabled` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`focus` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`hover` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`normal` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`pressed` | | ++---------------------------------+------------------------------------------------------------------------------+----------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_ToolButton_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the ``ToolButton``. + +---- + +.. _class_ToolButton_theme_color_font_color_disabled: + +- :ref:`Color` **font_color_disabled** + ++-----------+--------------------------------+ +| *Default* | ``Color( 0.9, 0.95, 1, 0.3 )`` | ++-----------+--------------------------------+ + +Text :ref:`Color` used when the ``ToolButton`` is disabled. + +---- + +.. _class_ToolButton_theme_color_font_color_focus: + +- :ref:`Color` **font_color_focus** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``ToolButton`` is focused. Only replaces the normal text color of the button. Disabled, hovered, and pressed states take precedence over this color. + +---- + +.. _class_ToolButton_theme_color_font_color_hover: + +- :ref:`Color` **font_color_hover** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` used when the ``ToolButton`` is being hovered. + +---- + +.. _class_ToolButton_theme_color_font_color_pressed: + +- :ref:`Color` **font_color_pressed** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the ``ToolButton`` is being pressed. + +---- + +.. _class_ToolButton_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``3`` | ++-----------+-------+ + +The horizontal space between ``ToolButton``'s icon and text. + +---- + +.. _class_ToolButton_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the ``ToolButton``'s text. + +---- + +.. _class_ToolButton_theme_style_disabled: + +- :ref:`StyleBox` **disabled** + +:ref:`StyleBox` used when the ``ToolButton`` is disabled. + +---- + +.. _class_ToolButton_theme_style_focus: + +- :ref:`StyleBox` **focus** + +:ref:`StyleBox` used when the ``ToolButton`` is focused. It is displayed over the current :ref:`StyleBox`, so using :ref:`StyleBoxEmpty` will just disable the focus visual effect. + +---- + +.. _class_ToolButton_theme_style_hover: + +- :ref:`StyleBox` **hover** + +:ref:`StyleBox` used when the ``ToolButton`` is being hovered. + +---- + +.. _class_ToolButton_theme_style_normal: + +- :ref:`StyleBox` **normal** + +Default :ref:`StyleBox` for the ``ToolButton``. + +---- + +.. _class_ToolButton_theme_style_pressed: + +- :ref:`StyleBox` **pressed** + +:ref:`StyleBox` used when the ``ToolButton`` is being pressed. + +.. |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.)` diff --git a/classes/class_touchscreenbutton.rst b/classes/class_touchscreenbutton.rst new file mode 100644 index 0000000..219eb39 --- /dev/null +++ b/classes/class_touchscreenbutton.rst @@ -0,0 +1,237 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TouchScreenButton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TouchScreenButton: + +TouchScreenButton +================= + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Button for touch screen devices for gameplay use. + +Description +----------- + +TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike :ref:`Button`, TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. + +This node inherits from :ref:`Node2D`. Unlike with :ref:`Control` nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use :ref:`Button` nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. + +You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices. + +Properties +---------- + ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`action` | ``""`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`BitMap` | :ref:`bitmask` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`normal` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`passby_press` | ``false`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`Texture` | :ref:`pressed` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`Shape2D` | :ref:`shape` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`shape_centered` | ``true`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`shape_visible` | ``true`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`VisibilityMode` | :ref:`visibility_mode` | ``0`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_pressed` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_TouchScreenButton_signal_pressed: + +- **pressed** **(** **)** + +Emitted when the button is pressed (down). + +---- + +.. _class_TouchScreenButton_signal_released: + +- **released** **(** **)** + +Emitted when the button is released (up). + +Enumerations +------------ + +.. _enum_TouchScreenButton_VisibilityMode: + +.. _class_TouchScreenButton_constant_VISIBILITY_ALWAYS: + +.. _class_TouchScreenButton_constant_VISIBILITY_TOUCHSCREEN_ONLY: + +enum **VisibilityMode**: + +- **VISIBILITY_ALWAYS** = **0** --- Always visible. + +- **VISIBILITY_TOUCHSCREEN_ONLY** = **1** --- Visible on touch screens only. + +Property Descriptions +--------------------- + +.. _class_TouchScreenButton_property_action: + +- :ref:`String` **action** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_action(value) | ++-----------+-------------------+ +| *Getter* | get_action() | ++-----------+-------------------+ + +The button's action. Actions can be handled with :ref:`InputEventAction`. + +---- + +.. _class_TouchScreenButton_property_bitmask: + +- :ref:`BitMap` **bitmask** + ++----------+--------------------+ +| *Setter* | set_bitmask(value) | ++----------+--------------------+ +| *Getter* | get_bitmask() | ++----------+--------------------+ + +The button's bitmask. + +---- + +.. _class_TouchScreenButton_property_normal: + +- :ref:`Texture` **normal** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The button's texture for the normal state. + +---- + +.. _class_TouchScreenButton_property_passby_press: + +- :ref:`bool` **passby_press** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_passby_press(value) | ++-----------+---------------------------+ +| *Getter* | is_passby_press_enabled() | ++-----------+---------------------------+ + +If ``true``, the :ref:`pressed` and :ref:`released` signals are emitted whenever a pressed finger goes in and out of the button, even if the pressure started outside the active area of the button. + +**Note:** This is a "pass-by" (not "bypass") press mode. + +---- + +.. _class_TouchScreenButton_property_pressed: + +- :ref:`Texture` **pressed** + ++----------+----------------------------+ +| *Setter* | set_texture_pressed(value) | ++----------+----------------------------+ +| *Getter* | get_texture_pressed() | ++----------+----------------------------+ + +The button's texture for the pressed state. + +---- + +.. _class_TouchScreenButton_property_shape: + +- :ref:`Shape2D` **shape** + ++----------+------------------+ +| *Setter* | set_shape(value) | ++----------+------------------+ +| *Getter* | get_shape() | ++----------+------------------+ + +The button's shape. + +---- + +.. _class_TouchScreenButton_property_shape_centered: + +- :ref:`bool` **shape_centered** + ++-----------+---------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------+ +| *Setter* | set_shape_centered(value) | ++-----------+---------------------------+ +| *Getter* | is_shape_centered() | ++-----------+---------------------------+ + +If ``true``, the button's shape is centered in the provided texture. If no texture is used, this property has no effect. + +---- + +.. _class_TouchScreenButton_property_shape_visible: + +- :ref:`bool` **shape_visible** + ++-----------+--------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------+ +| *Setter* | set_shape_visible(value) | ++-----------+--------------------------+ +| *Getter* | is_shape_visible() | ++-----------+--------------------------+ + +If ``true``, the button's shape is visible. + +---- + +.. _class_TouchScreenButton_property_visibility_mode: + +- :ref:`VisibilityMode` **visibility_mode** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_visibility_mode(value) | ++-----------+----------------------------+ +| *Getter* | get_visibility_mode() | ++-----------+----------------------------+ + +The button's visibility mode. See :ref:`VisibilityMode` for possible values. + +Method Descriptions +------------------- + +.. _class_TouchScreenButton_method_is_pressed: + +- :ref:`bool` **is_pressed** **(** **)** |const| + +Returns ``true`` if this button is currently pressed. + +.. |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.)` diff --git a/classes/class_transform.rst b/classes/class_transform.rst new file mode 100644 index 0000000..8a8c7e0 --- /dev/null +++ b/classes/class_transform.rst @@ -0,0 +1,255 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Transform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Transform: + +Transform +========= + +3D transformation (3×4 matrix). + +Description +----------- + +3×4 matrix (3 rows, 4 columns) used for 3D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of a :ref:`basis` (first 3 columns) and a :ref:`Vector3` for the :ref:`origin` (last column). + +For more information, read the "Matrices and transforms" documentation article. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/matrices_and_transforms` + +- :doc:`../tutorials/3d/using_transforms` + +- `Matrix Transform Demo `__ + +- `3D Platformer Demo `__ + +- `2.5D Demo `__ + +Properties +---------- + ++-------------------------------+------------------------------------------------+----------------------------------------+ +| :ref:`Basis` | :ref:`basis` | ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )`` | ++-------------------------------+------------------------------------------------+----------------------------------------+ +| :ref:`Vector3` | :ref:`origin` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+------------------------------------------------+----------------------------------------+ + +Methods +------- + ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`Transform` **(** :ref:`Vector3` x_axis, :ref:`Vector3` y_axis, :ref:`Vector3` z_axis, :ref:`Vector3` origin **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`Transform` **(** :ref:`Basis` basis, :ref:`Vector3` origin **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`Transform` **(** :ref:`Transform2D` from **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`Transform` **(** :ref:`Quat` from **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`Transform` **(** :ref:`Basis` from **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`affine_inverse` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`interpolate_with` **(** :ref:`Transform` transform, :ref:`float` weight **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`inverse` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Transform` transform **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`looking_at` **(** :ref:`Vector3` target, :ref:`Vector3` up **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`orthonormalized` **(** **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`scaled` **(** :ref:`Vector3` scale **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`translated` **(** :ref:`Vector3` offset **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`xform` **(** :ref:`Variant` v **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`xform_inv` **(** :ref:`Variant` v **)** | ++-----------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Transform_constant_IDENTITY: + +.. _class_Transform_constant_FLIP_X: + +.. _class_Transform_constant_FLIP_Y: + +.. _class_Transform_constant_FLIP_Z: + +- **IDENTITY** = **Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )** --- ``Transform`` with no translation, rotation or scaling applied. When applied to other data structures, :ref:`IDENTITY` performs no transformation. + +- **FLIP_X** = **Transform( -1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )** --- ``Transform`` with mirroring applied perpendicular to the YZ plane. + +- **FLIP_Y** = **Transform( 1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0, 0 )** --- ``Transform`` with mirroring applied perpendicular to the XZ plane. + +- **FLIP_Z** = **Transform( 1, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0 )** --- ``Transform`` with mirroring applied perpendicular to the XY plane. + +Property Descriptions +--------------------- + +.. _class_Transform_property_basis: + +- :ref:`Basis` **basis** + ++-----------+----------------------------------------+ +| *Default* | ``Basis( 1, 0, 0, 0, 1, 0, 0, 0, 1 )`` | ++-----------+----------------------------------------+ + +The basis is a matrix containing 3 :ref:`Vector3` as its columns: X axis, Y axis, and Z axis. These vectors can be interpreted as the basis vectors of local coordinate system traveling with the object. + +---- + +.. _class_Transform_property_origin: + +- :ref:`Vector3` **origin** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ + +The translation offset of the transform (column 3, the fourth column). Equivalent to array index ``3``. + +Method Descriptions +------------------- + +.. _class_Transform_method_Transform: + +- :ref:`Transform` **Transform** **(** :ref:`Vector3` x_axis, :ref:`Vector3` y_axis, :ref:`Vector3` z_axis, :ref:`Vector3` origin **)** + +Constructs a Transform from four :ref:`Vector3` values (matrix columns). Each axis corresponds to local basis vectors (some of which may be scaled). + +---- + +- :ref:`Transform` **Transform** **(** :ref:`Basis` basis, :ref:`Vector3` origin **)** + +Constructs a Transform from a :ref:`Basis` and :ref:`Vector3`. + +---- + +- :ref:`Transform` **Transform** **(** :ref:`Transform2D` from **)** + +Constructs a Transform from a :ref:`Transform2D`. + +---- + +- :ref:`Transform` **Transform** **(** :ref:`Quat` from **)** + +Constructs a Transform from a :ref:`Quat`. The origin will be ``Vector3(0, 0, 0)``. + +---- + +- :ref:`Transform` **Transform** **(** :ref:`Basis` from **)** + +Constructs the Transform from a :ref:`Basis`. The origin will be Vector3(0, 0, 0). + +---- + +.. _class_Transform_method_affine_inverse: + +- :ref:`Transform` **affine_inverse** **(** **)** + +Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation. + +---- + +.. _class_Transform_method_interpolate_with: + +- :ref:`Transform` **interpolate_with** **(** :ref:`Transform` transform, :ref:`float` weight **)** + +Interpolates the transform to other Transform by weight amount (on the range of 0.0 to 1.0). + +---- + +.. _class_Transform_method_inverse: + +- :ref:`Transform` **inverse** **(** **)** + +Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use affine_inverse for transforms with scaling). + +---- + +.. _class_Transform_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Transform` transform **)** + +Returns ``true`` if this transform and ``transform`` are approximately equal, by calling ``is_equal_approx`` on each component. + +---- + +.. _class_Transform_method_looking_at: + +- :ref:`Transform` **looking_at** **(** :ref:`Vector3` target, :ref:`Vector3` up **)** + +Returns a copy of the transform rotated such that its -Z axis points towards the ``target`` position. + +The transform will first be rotated around the given ``up`` vector, and then fully aligned to the target by a further rotation around an axis perpendicular to both the ``target`` and ``up`` vectors. + +Operations take place in global space. + +---- + +.. _class_Transform_method_orthonormalized: + +- :ref:`Transform` **orthonormalized** **(** **)** + +Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors. + +---- + +.. _class_Transform_method_rotated: + +- :ref:`Transform` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** + +Rotates the transform around the given axis by the given angle (in radians), using matrix multiplication. The axis must be a normalized vector. + +---- + +.. _class_Transform_method_scaled: + +- :ref:`Transform` **scaled** **(** :ref:`Vector3` scale **)** + +Scales basis and origin of the transform by the given scale factor, using matrix multiplication. + +---- + +.. _class_Transform_method_translated: + +- :ref:`Transform` **translated** **(** :ref:`Vector3` offset **)** + +Translates the transform by the given offset, relative to the transform's basis vectors. + +Unlike :ref:`rotated` and :ref:`scaled`, this does not use matrix multiplication. + +---- + +.. _class_Transform_method_xform: + +- :ref:`Variant` **xform** **(** :ref:`Variant` v **)** + +Transforms the given :ref:`Vector3`, :ref:`Plane`, :ref:`AABB`, or :ref:`PoolVector3Array` by this transform. + +---- + +.. _class_Transform_method_xform_inv: + +- :ref:`Variant` **xform_inv** **(** :ref:`Variant` v **)** + +Inverse-transforms the given :ref:`Vector3`, :ref:`Plane`, :ref:`AABB`, or :ref:`PoolVector3Array` by this transform, under the assumption that the transformation is composed of rotation and translation (no scaling). Equivalent to calling ``inverse().xform(v)`` on this transform. For affine transformations (e.g. with scaling) see :ref:`affine_inverse` method. + +.. |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.)` diff --git a/classes/class_transform2d.rst b/classes/class_transform2d.rst new file mode 100644 index 0000000..42792d7 --- /dev/null +++ b/classes/class_transform2d.rst @@ -0,0 +1,285 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Transform2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Transform2D: + +Transform2D +=========== + +2D transformation (2×3 matrix). + +Description +----------- + +2×3 matrix (2 rows, 3 columns) used for 2D linear transformations. It can represent transformations such as translation, rotation, or scaling. It consists of three :ref:`Vector2` values: :ref:`x`, :ref:`y`, and the :ref:`origin`. + +For more information, read the "Matrices and transforms" documentation article. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/matrices_and_transforms` + +- `Matrix Transform Demo `__ + +- `2.5D Demo `__ + +Properties +---------- + ++-------------------------------+--------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`origin` | ``Vector2( 0, 0 )`` | ++-------------------------------+--------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`x` | ``Vector2( 1, 0 )`` | ++-------------------------------+--------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`y` | ``Vector2( 0, 1 )`` | ++-------------------------------+--------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`Transform2D` **(** :ref:`Transform` from **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`Transform2D` **(** :ref:`Vector2` x_axis, :ref:`Vector2` y_axis, :ref:`Vector2` origin **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`Transform2D` **(** :ref:`float` rotation, :ref:`Vector2` position **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`affine_inverse` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`basis_xform` **(** :ref:`Vector2` v **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`basis_xform_inv` **(** :ref:`Vector2` v **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_origin` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_rotation` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_scale` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`interpolate_with` **(** :ref:`Transform2D` transform, :ref:`float` weight **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`inverse` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Transform2D` transform **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`orthonormalized` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`rotated` **(** :ref:`float` phi **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`scaled` **(** :ref:`Vector2` scale **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`translated` **(** :ref:`Vector2` offset **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`xform` **(** :ref:`Variant` v **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`xform_inv` **(** :ref:`Variant` v **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Transform2D_constant_IDENTITY: + +.. _class_Transform2D_constant_FLIP_X: + +.. _class_Transform2D_constant_FLIP_Y: + +- **IDENTITY** = **Transform2D( 1, 0, 0, 1, 0, 0 )** --- The identity ``Transform2D`` with no translation, rotation or scaling applied. When applied to other data structures, :ref:`IDENTITY` performs no transformation. + +- **FLIP_X** = **Transform2D( -1, 0, 0, 1, 0, 0 )** --- The ``Transform2D`` that will flip something along the X axis. + +- **FLIP_Y** = **Transform2D( 1, 0, 0, -1, 0, 0 )** --- The ``Transform2D`` that will flip something along the Y axis. + +Property Descriptions +--------------------- + +.. _class_Transform2D_property_origin: + +- :ref:`Vector2` **origin** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ + +The origin vector (column 2, the third column). Equivalent to array index ``2``. The origin vector represents translation. + +---- + +.. _class_Transform2D_property_x: + +- :ref:`Vector2` **x** + ++-----------+---------------------+ +| *Default* | ``Vector2( 1, 0 )`` | ++-----------+---------------------+ + +The basis matrix's X vector (column 0). Equivalent to array index ``0``. + +---- + +.. _class_Transform2D_property_y: + +- :ref:`Vector2` **y** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 1 )`` | ++-----------+---------------------+ + +The basis matrix's Y vector (column 1). Equivalent to array index ``1``. + +Method Descriptions +------------------- + +.. _class_Transform2D_method_Transform2D: + +- :ref:`Transform2D` **Transform2D** **(** :ref:`Transform` from **)** + +Constructs the transform from a 3D :ref:`Transform`. + +---- + +- :ref:`Transform2D` **Transform2D** **(** :ref:`Vector2` x_axis, :ref:`Vector2` y_axis, :ref:`Vector2` origin **)** + +Constructs the transform from 3 :ref:`Vector2` values representing :ref:`x`, :ref:`y`, and the :ref:`origin` (the three column vectors). + +---- + +- :ref:`Transform2D` **Transform2D** **(** :ref:`float` rotation, :ref:`Vector2` position **)** + +Constructs the transform from a given angle (in radians) and position. + +---- + +.. _class_Transform2D_method_affine_inverse: + +- :ref:`Transform2D` **affine_inverse** **(** **)** + +Returns the inverse of the transform, under the assumption that the transformation is composed of rotation, scaling and translation. + +---- + +.. _class_Transform2D_method_basis_xform: + +- :ref:`Vector2` **basis_xform** **(** :ref:`Vector2` v **)** + +Returns a vector transformed (multiplied) by the basis matrix. + +This method does not account for translation (the origin vector). + +---- + +.. _class_Transform2D_method_basis_xform_inv: + +- :ref:`Vector2` **basis_xform_inv** **(** :ref:`Vector2` v **)** + +Returns a vector transformed (multiplied) by the inverse basis matrix. + +This method does not account for translation (the origin vector). + +---- + +.. _class_Transform2D_method_get_origin: + +- :ref:`Vector2` **get_origin** **(** **)** + +Returns the transform's origin (translation). + +---- + +.. _class_Transform2D_method_get_rotation: + +- :ref:`float` **get_rotation** **(** **)** + +Returns the transform's rotation (in radians). + +---- + +.. _class_Transform2D_method_get_scale: + +- :ref:`Vector2` **get_scale** **(** **)** + +Returns the scale. + +---- + +.. _class_Transform2D_method_interpolate_with: + +- :ref:`Transform2D` **interpolate_with** **(** :ref:`Transform2D` transform, :ref:`float` weight **)** + +Returns a transform interpolated between this transform and another by a given ``weight`` (on the range of 0.0 to 1.0). + +---- + +.. _class_Transform2D_method_inverse: + +- :ref:`Transform2D` **inverse** **(** **)** + +Returns the inverse of the transform, under the assumption that the transformation is composed of rotation and translation (no scaling, use :ref:`affine_inverse` for transforms with scaling). + +---- + +.. _class_Transform2D_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Transform2D` transform **)** + +Returns ``true`` if this transform and ``transform`` are approximately equal, by calling ``is_equal_approx`` on each component. + +---- + +.. _class_Transform2D_method_orthonormalized: + +- :ref:`Transform2D` **orthonormalized** **(** **)** + +Returns the transform with the basis orthogonal (90 degrees), and normalized axis vectors (scale of 1 or -1). + +---- + +.. _class_Transform2D_method_rotated: + +- :ref:`Transform2D` **rotated** **(** :ref:`float` phi **)** + +Rotates the transform by the given angle (in radians), using matrix multiplication. + +---- + +.. _class_Transform2D_method_scaled: + +- :ref:`Transform2D` **scaled** **(** :ref:`Vector2` scale **)** + +Scales the transform by the given scale factor, using matrix multiplication. + +---- + +.. _class_Transform2D_method_translated: + +- :ref:`Transform2D` **translated** **(** :ref:`Vector2` offset **)** + +Translates the transform by the given offset, relative to the transform's basis vectors. + +Unlike :ref:`rotated` and :ref:`scaled`, this does not use matrix multiplication. + +---- + +.. _class_Transform2D_method_xform: + +- :ref:`Variant` **xform** **(** :ref:`Variant` v **)** + +Transforms the given :ref:`Vector2`, :ref:`Rect2`, or :ref:`PoolVector2Array` by this transform. + +---- + +.. _class_Transform2D_method_xform_inv: + +- :ref:`Variant` **xform_inv** **(** :ref:`Variant` v **)** + +Inverse-transforms the given :ref:`Vector2`, :ref:`Rect2`, or :ref:`PoolVector2Array` by this transform, under the assumption that the transformation is composed of rotation and translation (no scaling). Equivalent to calling ``inverse().xform(v)`` on this transform. For affine transformations (e.g. with scaling) see :ref:`affine_inverse` method. + +.. |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.)` diff --git a/classes/class_translation.rst b/classes/class_translation.rst new file mode 100644 index 0000000..d6bca18 --- /dev/null +++ b/classes/class_translation.rst @@ -0,0 +1,122 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Translation.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Translation: + +Translation +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`PHashTranslation` + +Language Translation. + +Description +----------- + +Translations are resources that can be loaded and unloaded on demand. They map a string to another string. + +Tutorials +--------- + +- :doc:`../tutorials/i18n/internationalizing_games` + +- :doc:`../tutorials/i18n/locales` + +Properties +---------- + ++-----------------------------+--------------------------------------------------+----------+ +| :ref:`String` | :ref:`locale` | ``"en"`` | ++-----------------------------+--------------------------------------------------+----------+ + +Methods +------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_message` **(** :ref:`String` src_message **)** |virtual| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_message` **(** :ref:`String` src_message, :ref:`String` xlated_message **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_message` **(** :ref:`String` src_message **)** | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_message` **(** :ref:`String` src_message **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_message_count` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolStringArray` | :ref:`get_message_list` **(** **)** |const| | ++-----------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_Translation_property_locale: + +- :ref:`String` **locale** + ++-----------+-------------------+ +| *Default* | ``"en"`` | ++-----------+-------------------+ +| *Setter* | set_locale(value) | ++-----------+-------------------+ +| *Getter* | get_locale() | ++-----------+-------------------+ + +The locale of the translation. + +Method Descriptions +------------------- + +.. _class_Translation_method__get_message: + +- :ref:`String` **_get_message** **(** :ref:`String` src_message **)** |virtual| + +Virtual method to override :ref:`get_message`. + +---- + +.. _class_Translation_method_add_message: + +- void **add_message** **(** :ref:`String` src_message, :ref:`String` xlated_message **)** + +Adds a message if nonexistent, followed by its translation. + +---- + +.. _class_Translation_method_erase_message: + +- void **erase_message** **(** :ref:`String` src_message **)** + +Erases a message. + +---- + +.. _class_Translation_method_get_message: + +- :ref:`String` **get_message** **(** :ref:`String` src_message **)** |const| + +Returns a message's translation. + +---- + +.. _class_Translation_method_get_message_count: + +- :ref:`int` **get_message_count** **(** **)** |const| + +Returns the number of existing messages. + +---- + +.. _class_Translation_method_get_message_list: + +- :ref:`PoolStringArray` **get_message_list** **(** **)** |const| + +Returns all the messages (keys). + +.. |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.)` diff --git a/classes/class_translationserver.rst b/classes/class_translationserver.rst new file mode 100644 index 0000000..45249e1 --- /dev/null +++ b/classes/class_translationserver.rst @@ -0,0 +1,120 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TranslationServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TranslationServer: + +TranslationServer +================= + +**Inherits:** :ref:`Object` + +Server that manages all translations. + +Description +----------- + +Server that manages all translations. Translations can be set to it and removed from it. + +Tutorials +--------- + +- :doc:`../tutorials/i18n/internationalizing_games` + +- :doc:`../tutorials/i18n/locales` + +Methods +------- + ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_translation` **(** :ref:`Translation` translation **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_loaded_locales` **(** **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_locale` **(** **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_locale_name` **(** :ref:`String` locale **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_translation` **(** :ref:`Translation` translation **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_locale` **(** :ref:`String` locale **)** | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`translate` **(** :ref:`String` message **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_TranslationServer_method_add_translation: + +- void **add_translation** **(** :ref:`Translation` translation **)** + +Adds a :ref:`Translation` resource. + +---- + +.. _class_TranslationServer_method_clear: + +- void **clear** **(** **)** + +Clears the server from all translations. + +---- + +.. _class_TranslationServer_method_get_loaded_locales: + +- :ref:`Array` **get_loaded_locales** **(** **)** |const| + +Returns an array of all loaded locales of the project. + +---- + +.. _class_TranslationServer_method_get_locale: + +- :ref:`String` **get_locale** **(** **)** |const| + +Returns the current locale of the project. + +See also :ref:`OS.get_locale` and :ref:`OS.get_locale_language` to query the locale of the user system. + +---- + +.. _class_TranslationServer_method_get_locale_name: + +- :ref:`String` **get_locale_name** **(** :ref:`String` locale **)** |const| + +Returns a locale's language and its variant (e.g. ``"en_US"`` would return ``"English (United States)"``). + +---- + +.. _class_TranslationServer_method_remove_translation: + +- void **remove_translation** **(** :ref:`Translation` translation **)** + +Removes the given translation from the server. + +---- + +.. _class_TranslationServer_method_set_locale: + +- void **set_locale** **(** :ref:`String` locale **)** + +Sets the locale of the project. The ``locale`` string will be standardized to match known locales (e.g. ``en-US`` would be matched to ``en_US``). + +If translations have been loaded beforehand for the new locale, they will be applied. + +---- + +.. _class_TranslationServer_method_translate: + +- :ref:`String` **translate** **(** :ref:`String` message **)** |const| + +Returns the current locale's translation for the given message (key). + +.. |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.)` diff --git a/classes/class_tree.rst b/classes/class_tree.rst new file mode 100644 index 0000000..7fc5863 --- /dev/null +++ b/classes/class_tree.rst @@ -0,0 +1,1066 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Tree.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Tree: + +Tree +==== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control to show a tree of items. + +Description +----------- + +This shows a tree of items that can be selected, expanded and collapsed. The tree can have multiple columns with custom controls like text editing, buttons and popups. It can be useful for structured displays and interactions. + +Trees are built via code, using :ref:`TreeItem` objects to create the structure. They have a single root but multiple roots can be simulated if a dummy hidden root is added. + +:: + + func _ready(): + var tree = Tree.new() + var root = tree.create_item() + tree.set_hide_root(true) + var child1 = tree.create_item(root) + var child2 = tree.create_item(root) + var subchild1 = tree.create_item(child1) + subchild1.set_text(0, "Subchild1") + +To iterate over all the :ref:`TreeItem` objects in a ``Tree`` object, use :ref:`TreeItem.get_next` and :ref:`TreeItem.get_children` after getting the root through :ref:`get_root`. You can use :ref:`Object.free` on a :ref:`TreeItem` to remove it from the ``Tree``. + +Properties +---------- + ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`allow_reselect` | ``false`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`allow_rmb_select` | ``false`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`columns` | ``1`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`int` | :ref:`drop_mode_flags` | ``0`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`FocusMode` | focus_mode | ``2`` *(parent override)* | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`hide_folding` | ``false`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`bool` | :ref:`hide_root` | ``false`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`bool` | rect_clip_content | ``true`` *(parent override)* | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ +| :ref:`SelectMode` | :ref:`select_mode` | ``0`` | ++------------------------------------------+---------------------------------------------------------------+------------------------------+ + +Methods +------- + ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`are_column_titles_visible` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear` **(** **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`create_item` **(** :ref:`Object` parent=null, :ref:`int` idx=-1 **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`edit_selected` **(** **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`ensure_cursor_is_visible` **(** **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_column_at_position` **(** :ref:`Vector2` position **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_column_title` **(** :ref:`int` column **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_column_width` **(** :ref:`int` column **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_custom_popup_rect` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_drop_section_at_position` **(** :ref:`Vector2` position **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_edited` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_edited_column` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_item_area_rect` **(** :ref:`Object` item, :ref:`int` column=-1 **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_item_at_position` **(** :ref:`Vector2` position **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_next_selected` **(** :ref:`Object` from **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_pressed_button` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_root` **(** **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_scroll` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_selected` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_selected_column` **(** **)** |const| | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scroll_to_item` **(** :ref:`Object` item **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_column_expand` **(** :ref:`int` column, :ref:`bool` expand **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_column_min_width` **(** :ref:`int` column, :ref:`int` min_width **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_column_title` **(** :ref:`int` column, :ref:`String` title **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_column_titles_visible` **(** :ref:`bool` visible **)** | ++---------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`custom_button_font_highlight` | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`drop_position_color` | ``Color( 1, 0.3, 0.2, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color` | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`font_color_selected` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`guide_color` | ``Color( 0, 0, 0, 0.1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`relationship_line_color` | ``Color( 0.27, 0.27, 0.27, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Color` | :ref:`title_button_color` | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`button_margin` | ``4`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`draw_guides` | ``1`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`draw_relationship_lines` | ``0`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`hseparation` | ``4`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`item_margin` | ``12`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`scroll_border` | ``4`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`scroll_speed` | ``12`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`int` | :ref:`vseparation` | ``4`` | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`font` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Font` | :ref:`title_button_font` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`arrow` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`arrow_collapsed` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`checked` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`select_arrow` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`unchecked` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`Texture` | :ref:`updown` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`bg_focus` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`button_pressed` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`cursor` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`cursor_unfocused` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`custom_button` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`custom_button_hover` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`custom_button_pressed` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`selected` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`selected_focus` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`title_button_hover` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`title_button_normal` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ +| :ref:`StyleBox` | :ref:`title_button_pressed` | | ++---------------------------------+------------------------------------------------------------------------------------------+----------------------------------+ + +Signals +------- + +.. _class_Tree_signal_button_pressed: + +- **button_pressed** **(** :ref:`TreeItem` item, :ref:`int` column, :ref:`int` id **)** + +Emitted when a button on the tree was pressed (see :ref:`TreeItem.add_button`). + +---- + +.. _class_Tree_signal_cell_selected: + +- **cell_selected** **(** **)** + +Emitted when a cell is selected. + +---- + +.. _class_Tree_signal_column_title_pressed: + +- **column_title_pressed** **(** :ref:`int` column **)** + +Emitted when a column's title is pressed. + +---- + +.. _class_Tree_signal_custom_popup_edited: + +- **custom_popup_edited** **(** :ref:`bool` arrow_clicked **)** + +Emitted when a cell with the :ref:`TreeItem.CELL_MODE_CUSTOM` is clicked to be edited. + +---- + +.. _class_Tree_signal_empty_rmb: + +- **empty_rmb** **(** :ref:`Vector2` position **)** + +Emitted when the right mouse button is pressed in the empty space of the tree. + +---- + +.. _class_Tree_signal_empty_tree_rmb_selected: + +- **empty_tree_rmb_selected** **(** :ref:`Vector2` position **)** + +Emitted when the right mouse button is pressed if right mouse button selection is active and the tree is empty. + +---- + +.. _class_Tree_signal_item_activated: + +- **item_activated** **(** **)** + +Emitted when an item's label is double-clicked. + +---- + +.. _class_Tree_signal_item_collapsed: + +- **item_collapsed** **(** :ref:`TreeItem` item **)** + +Emitted when an item is collapsed by a click on the folding arrow. + +---- + +.. _class_Tree_signal_item_custom_button_pressed: + +- **item_custom_button_pressed** **(** **)** + +Emitted when a custom button is pressed (i.e. in a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell). + +---- + +.. _class_Tree_signal_item_double_clicked: + +- **item_double_clicked** **(** **)** + +Emitted when an item's icon is double-clicked. + +---- + +.. _class_Tree_signal_item_edited: + +- **item_edited** **(** **)** + +Emitted when an item is edited. + +---- + +.. _class_Tree_signal_item_rmb_edited: + +- **item_rmb_edited** **(** **)** + +Emitted when an item is edited using the right mouse button. + +---- + +.. _class_Tree_signal_item_rmb_selected: + +- **item_rmb_selected** **(** :ref:`Vector2` position **)** + +Emitted when an item is selected with the right mouse button. + +---- + +.. _class_Tree_signal_item_selected: + +- **item_selected** **(** **)** + +Emitted when an item is selected. + +---- + +.. _class_Tree_signal_multi_selected: + +- **multi_selected** **(** :ref:`TreeItem` item, :ref:`int` column, :ref:`bool` selected **)** + +Emitted instead of ``item_selected`` if ``select_mode`` is :ref:`SELECT_MULTI`. + +---- + +.. _class_Tree_signal_nothing_selected: + +- **nothing_selected** **(** **)** + +Emitted when a left mouse button click does not select any item. + +Enumerations +------------ + +.. _enum_Tree_SelectMode: + +.. _class_Tree_constant_SELECT_SINGLE: + +.. _class_Tree_constant_SELECT_ROW: + +.. _class_Tree_constant_SELECT_MULTI: + +enum **SelectMode**: + +- **SELECT_SINGLE** = **0** --- Allows selection of a single cell at a time. From the perspective of items, only a single item is allowed to be selected. And there is only one column selected in the selected item. + +The focus cursor is always hidden in this mode, but it is positioned at the current selection, making the currently selected item the currently focused item. + +- **SELECT_ROW** = **1** --- Allows selection of a single row at a time. From the perspective of items, only a single items is allowed to be selected. And all the columns are selected in the selected item. + +The focus cursor is always hidden in this mode, but it is positioned at the first column of the current selection, making the currently selected item the currently focused item. + +- **SELECT_MULTI** = **2** --- Allows selection of multiple cells at the same time. From the perspective of items, multiple items are allowed to be selected. And there can be multiple columns selected in each selected item. + +The focus cursor is visible in this mode, the item or column under the cursor is not necessarily selected. + +---- + +.. _enum_Tree_DropModeFlags: + +.. _class_Tree_constant_DROP_MODE_DISABLED: + +.. _class_Tree_constant_DROP_MODE_ON_ITEM: + +.. _class_Tree_constant_DROP_MODE_INBETWEEN: + +enum **DropModeFlags**: + +- **DROP_MODE_DISABLED** = **0** --- Disables all drop sections, but still allows to detect the "on item" drop section by :ref:`get_drop_section_at_position`. + +**Note:** This is the default flag, it has no effect when combined with other flags. + +- **DROP_MODE_ON_ITEM** = **1** --- Enables the "on item" drop section. This drop section covers the entire item. + +When combined with :ref:`DROP_MODE_INBETWEEN`, this drop section halves the height and stays centered vertically. + +- **DROP_MODE_INBETWEEN** = **2** --- Enables "above item" and "below item" drop sections. The "above item" drop section covers the top half of the item, and the "below item" drop section covers the bottom half. + +When combined with :ref:`DROP_MODE_ON_ITEM`, these drop sections halves the height and stays on top / bottom accordingly. + +Property Descriptions +--------------------- + +.. _class_Tree_property_allow_reselect: + +- :ref:`bool` **allow_reselect** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_allow_reselect(value) | ++-----------+---------------------------+ +| *Getter* | get_allow_reselect() | ++-----------+---------------------------+ + +If ``true``, the currently selected cell may be selected again. + +---- + +.. _class_Tree_property_allow_rmb_select: + +- :ref:`bool` **allow_rmb_select** + ++-----------+-----------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------+ +| *Setter* | set_allow_rmb_select(value) | ++-----------+-----------------------------+ +| *Getter* | get_allow_rmb_select() | ++-----------+-----------------------------+ + +If ``true``, a right mouse button click can select items. + +---- + +.. _class_Tree_property_columns: + +- :ref:`int` **columns** + ++-----------+--------------------+ +| *Default* | ``1`` | ++-----------+--------------------+ +| *Setter* | set_columns(value) | ++-----------+--------------------+ +| *Getter* | get_columns() | ++-----------+--------------------+ + +The number of columns. + +---- + +.. _class_Tree_property_drop_mode_flags: + +- :ref:`int` **drop_mode_flags** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_drop_mode_flags(value) | ++-----------+----------------------------+ +| *Getter* | get_drop_mode_flags() | ++-----------+----------------------------+ + +The drop mode as an OR combination of flags. See :ref:`DropModeFlags` constants. Once dropping is done, reverts to :ref:`DROP_MODE_DISABLED`. Setting this during :ref:`Control.can_drop_data` is recommended. + +This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position. + +---- + +.. _class_Tree_property_hide_folding: + +- :ref:`bool` **hide_folding** + ++-----------+-------------------------+ +| *Default* | ``false`` | ++-----------+-------------------------+ +| *Setter* | set_hide_folding(value) | ++-----------+-------------------------+ +| *Getter* | is_folding_hidden() | ++-----------+-------------------------+ + +If ``true``, the folding arrow is hidden. + +---- + +.. _class_Tree_property_hide_root: + +- :ref:`bool` **hide_root** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_hide_root(value) | ++-----------+----------------------+ +| *Getter* | is_root_hidden() | ++-----------+----------------------+ + +If ``true``, the tree's root is hidden. + +---- + +.. _class_Tree_property_select_mode: + +- :ref:`SelectMode` **select_mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_select_mode(value) | ++-----------+------------------------+ +| *Getter* | get_select_mode() | ++-----------+------------------------+ + +Allows single or multiple selection. See the :ref:`SelectMode` constants. + +Method Descriptions +------------------- + +.. _class_Tree_method_are_column_titles_visible: + +- :ref:`bool` **are_column_titles_visible** **(** **)** |const| + +Returns ``true`` if the column titles are being shown. + +---- + +.. _class_Tree_method_clear: + +- void **clear** **(** **)** + +Clears the tree. This removes all items. + +---- + +.. _class_Tree_method_create_item: + +- :ref:`TreeItem` **create_item** **(** :ref:`Object` parent=null, :ref:`int` idx=-1 **)** + +Creates an item in the tree and adds it as a child of ``parent``, which can be either a valid :ref:`TreeItem` or ``null``. + +If ``parent`` is ``null``, the root item will be the parent, or the new item will be the root itself if the tree is empty. + +The new item will be the ``idx``\ th child of parent, or it will be the last child if there are not enough siblings. + +---- + +.. _class_Tree_method_edit_selected: + +- :ref:`bool` **edit_selected** **(** **)** + +Edits the selected tree item as if it was clicked. The item must be set editable with :ref:`TreeItem.set_editable`. Returns ``true`` if the item could be edited. Fails if no item is selected. + +---- + +.. _class_Tree_method_ensure_cursor_is_visible: + +- void **ensure_cursor_is_visible** **(** **)** + +Makes the currently focused cell visible. + +This will scroll the tree if necessary. In :ref:`SELECT_ROW` mode, this will not do horizontal scrolling, as all the cells in the selected row is focused logically. + +**Note:** Despite the name of this method, the focus cursor itself is only visible in :ref:`SELECT_MULTI` mode. + +---- + +.. _class_Tree_method_get_column_at_position: + +- :ref:`int` **get_column_at_position** **(** :ref:`Vector2` position **)** |const| + +Returns the column index at ``position``, or -1 if no item is there. + +---- + +.. _class_Tree_method_get_column_title: + +- :ref:`String` **get_column_title** **(** :ref:`int` column **)** |const| + +Returns the column's title. + +---- + +.. _class_Tree_method_get_column_width: + +- :ref:`int` **get_column_width** **(** :ref:`int` column **)** |const| + +Returns the column's width in pixels. + +---- + +.. _class_Tree_method_get_custom_popup_rect: + +- :ref:`Rect2` **get_custom_popup_rect** **(** **)** |const| + +Returns the rectangle for custom popups. Helper to create custom cell controls that display a popup. See :ref:`TreeItem.set_cell_mode`. + +---- + +.. _class_Tree_method_get_drop_section_at_position: + +- :ref:`int` **get_drop_section_at_position** **(** :ref:`Vector2` position **)** |const| + +Returns the drop section at ``position``, or -100 if no item is there. + +Values -1, 0, or 1 will be returned for the "above item", "on item", and "below item" drop sections, respectively. See :ref:`DropModeFlags` for a description of each drop section. + +To get the item which the returned drop section is relative to, use :ref:`get_item_at_position`. + +---- + +.. _class_Tree_method_get_edited: + +- :ref:`TreeItem` **get_edited** **(** **)** |const| + +Returns the currently edited item. Can be used with :ref:`item_edited` to get the item that was modified. + +:: + + func _ready(): + $Tree.item_edited.connect(on_Tree_item_edited) + + func on_Tree_item_edited(): + print($Tree.get_edited()) # This item just got edited (e.g. checked). + +---- + +.. _class_Tree_method_get_edited_column: + +- :ref:`int` **get_edited_column** **(** **)** |const| + +Returns the column for the currently edited item. + +---- + +.. _class_Tree_method_get_item_area_rect: + +- :ref:`Rect2` **get_item_area_rect** **(** :ref:`Object` item, :ref:`int` column=-1 **)** |const| + +Returns the rectangle area for the specified :ref:`TreeItem`. If ``column`` is specified, only get the position and size of that column, otherwise get the rectangle containing all columns. + +---- + +.. _class_Tree_method_get_item_at_position: + +- :ref:`TreeItem` **get_item_at_position** **(** :ref:`Vector2` position **)** |const| + +Returns the tree item at the specified position (relative to the tree origin position). + +---- + +.. _class_Tree_method_get_next_selected: + +- :ref:`TreeItem` **get_next_selected** **(** :ref:`Object` from **)** + +Returns the next selected :ref:`TreeItem` after the given one, or ``null`` if the end is reached. + +If ``from`` is ``null``, this returns the first selected item. + +---- + +.. _class_Tree_method_get_pressed_button: + +- :ref:`int` **get_pressed_button** **(** **)** |const| + +Returns the last pressed button's index. + +---- + +.. _class_Tree_method_get_root: + +- :ref:`TreeItem` **get_root** **(** **)** + +Returns the tree's root item, or ``null`` if the tree is empty. + +---- + +.. _class_Tree_method_get_scroll: + +- :ref:`Vector2` **get_scroll** **(** **)** |const| + +Returns the current scrolling position. + +---- + +.. _class_Tree_method_get_selected: + +- :ref:`TreeItem` **get_selected** **(** **)** |const| + +Returns the currently focused item, or ``null`` if no item is focused. + +In :ref:`SELECT_ROW` and :ref:`SELECT_SINGLE` modes, the focused item is same as the selected item. In :ref:`SELECT_MULTI` mode, the focused item is the item under the focus cursor, not necessarily selected. + +To get the currently selected item(s), use :ref:`get_next_selected`. + +---- + +.. _class_Tree_method_get_selected_column: + +- :ref:`int` **get_selected_column** **(** **)** |const| + +Returns the currently focused column, or -1 if no column is focused. + +In :ref:`SELECT_SINGLE` mode, the focused column is the selected column. In :ref:`SELECT_ROW` mode, the focused column is always 0 if any item is selected. In :ref:`SELECT_MULTI` mode, the focused column is the column under the focus cursor, and there are not necessarily any column selected. + +To tell whether a column of an item is selected, use :ref:`TreeItem.is_selected`. + +---- + +.. _class_Tree_method_scroll_to_item: + +- void **scroll_to_item** **(** :ref:`Object` item **)** + +Causes the ``Tree`` to jump to the specified :ref:`TreeItem`. + +---- + +.. _class_Tree_method_set_column_expand: + +- void **set_column_expand** **(** :ref:`int` column, :ref:`bool` expand **)** + +If ``true``, the column will have the "Expand" flag of :ref:`Control`. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio`. + +---- + +.. _class_Tree_method_set_column_min_width: + +- void **set_column_min_width** **(** :ref:`int` column, :ref:`int` min_width **)** + +Sets the minimum width of a column. Columns that have the "Expand" flag will use their "min_width" in a similar fashion to :ref:`Control.size_flags_stretch_ratio`. + +---- + +.. _class_Tree_method_set_column_title: + +- void **set_column_title** **(** :ref:`int` column, :ref:`String` title **)** + +Sets the title of a column. + +---- + +.. _class_Tree_method_set_column_titles_visible: + +- void **set_column_titles_visible** **(** :ref:`bool` visible **)** + +If ``true``, column titles are visible. + +Theme Property Descriptions +--------------------------- + +.. _class_Tree_theme_color_custom_button_font_highlight: + +- :ref:`Color` **custom_button_font_highlight** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.94, 0.94, 0.94, 1 )`` | ++-----------+----------------------------------+ + +Text :ref:`Color` for a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell when it's hovered. + +---- + +.. _class_Tree_theme_color_drop_position_color: + +- :ref:`Color` **drop_position_color** + ++-----------+-----------------------------+ +| *Default* | ``Color( 1, 0.3, 0.2, 1 )`` | ++-----------+-----------------------------+ + +:ref:`Color` used to draw possible drop locations. See :ref:`DropModeFlags` constants for further description of drop locations. + +---- + +.. _class_Tree_theme_color_font_color: + +- :ref:`Color` **font_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.69, 0.69, 0.69, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the item. + +---- + +.. _class_Tree_theme_color_font_color_selected: + +- :ref:`Color` **font_color_selected** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ + +Text :ref:`Color` used when the item is selected. + +---- + +.. _class_Tree_theme_color_guide_color: + +- :ref:`Color` **guide_color** + ++-----------+---------------------------+ +| *Default* | ``Color( 0, 0, 0, 0.1 )`` | ++-----------+---------------------------+ + +:ref:`Color` of the guideline. + +---- + +.. _class_Tree_theme_color_relationship_line_color: + +- :ref:`Color` **relationship_line_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.27, 0.27, 0.27, 1 )`` | ++-----------+----------------------------------+ + +:ref:`Color` of the relationship lines. + +---- + +.. _class_Tree_theme_color_title_button_color: + +- :ref:`Color` **title_button_color** + ++-----------+----------------------------------+ +| *Default* | ``Color( 0.88, 0.88, 0.88, 1 )`` | ++-----------+----------------------------------+ + +Default text :ref:`Color` of the title button. + +---- + +.. _class_Tree_theme_constant_button_margin: + +- :ref:`int` **button_margin** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal space between each button in a cell. + +---- + +.. _class_Tree_theme_constant_draw_guides: + +- :ref:`int` **draw_guides** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Draws the guidelines if not zero, this acts as a boolean. The guideline is a horizontal line drawn at the bottom of each item. + +---- + +.. _class_Tree_theme_constant_draw_relationship_lines: + +- :ref:`int` **draw_relationship_lines** + ++-----------+-------+ +| *Default* | ``0`` | ++-----------+-------+ + +Draws the relationship lines if not zero, this acts as a boolean. Relationship lines are drawn at the start of child items to show hierarchy. + +---- + +.. _class_Tree_theme_constant_hseparation: + +- :ref:`int` **hseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The horizontal space between item cells. This is also used as the margin at the start of an item when folding is disabled. + +---- + +.. _class_Tree_theme_constant_item_margin: + +- :ref:`int` **item_margin** + ++-----------+--------+ +| *Default* | ``12`` | ++-----------+--------+ + +The horizontal margin at the start of an item. This is used when folding is enabled for the item. + +---- + +.. _class_Tree_theme_constant_scroll_border: + +- :ref:`int` **scroll_border** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The maximum distance between the mouse cursor and the control's border to trigger border scrolling when dragging. + +---- + +.. _class_Tree_theme_constant_scroll_speed: + +- :ref:`int` **scroll_speed** + ++-----------+--------+ +| *Default* | ``12`` | ++-----------+--------+ + +The speed of border scrolling. + +---- + +.. _class_Tree_theme_constant_vseparation: + +- :ref:`int` **vseparation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The vertical padding inside each item, i.e. the distance between the item's content and top/bottom border. + +---- + +.. _class_Tree_theme_font_font: + +- :ref:`Font` **font** + +:ref:`Font` of the item's text. + +---- + +.. _class_Tree_theme_font_title_button_font: + +- :ref:`Font` **title_button_font** + +:ref:`Font` of the title button's text. + +---- + +.. _class_Tree_theme_icon_arrow: + +- :ref:`Texture` **arrow** + +The arrow icon used when a foldable item is not collapsed. + +---- + +.. _class_Tree_theme_icon_arrow_collapsed: + +- :ref:`Texture` **arrow_collapsed** + +The arrow icon used when a foldable item is collapsed. + +---- + +.. _class_Tree_theme_icon_checked: + +- :ref:`Texture` **checked** + +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is checked. + +---- + +.. _class_Tree_theme_icon_select_arrow: + +- :ref:`Texture` **select_arrow** + +The arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE` mode cell. + +---- + +.. _class_Tree_theme_icon_unchecked: + +- :ref:`Texture` **unchecked** + +The check icon to display when the :ref:`TreeItem.CELL_MODE_CHECK` mode cell is unchecked. + +---- + +.. _class_Tree_theme_icon_updown: + +- :ref:`Texture` **updown** + +The updown arrow icon to display for the :ref:`TreeItem.CELL_MODE_RANGE` mode cell. + +---- + +.. _class_Tree_theme_style_bg: + +- :ref:`StyleBox` **bg** + +Default :ref:`StyleBox` for the ``Tree``, i.e. used when the control is not being focused. + +---- + +.. _class_Tree_theme_style_bg_focus: + +- :ref:`StyleBox` **bg_focus** + +:ref:`StyleBox` used when the ``Tree`` is being focused. + +---- + +.. _class_Tree_theme_style_button_pressed: + +- :ref:`StyleBox` **button_pressed** + +:ref:`StyleBox` used when a button in the tree is pressed. + +---- + +.. _class_Tree_theme_style_cursor: + +- :ref:`StyleBox` **cursor** + +:ref:`StyleBox` used for the cursor, when the ``Tree`` is being focused. + +---- + +.. _class_Tree_theme_style_cursor_unfocused: + +- :ref:`StyleBox` **cursor_unfocused** + +:ref:`StyleBox` used for the cursor, when the ``Tree`` is not being focused. + +---- + +.. _class_Tree_theme_style_custom_button: + +- :ref:`StyleBox` **custom_button** + +Default :ref:`StyleBox` for a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell. + +---- + +.. _class_Tree_theme_style_custom_button_hover: + +- :ref:`StyleBox` **custom_button_hover** + +:ref:`StyleBox` for a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell when it's hovered. + +---- + +.. _class_Tree_theme_style_custom_button_pressed: + +- :ref:`StyleBox` **custom_button_pressed** + +:ref:`StyleBox` for a :ref:`TreeItem.CELL_MODE_CUSTOM` mode cell when it's pressed. + +---- + +.. _class_Tree_theme_style_selected: + +- :ref:`StyleBox` **selected** + +:ref:`StyleBox` for the selected items, used when the ``Tree`` is not being focused. + +---- + +.. _class_Tree_theme_style_selected_focus: + +- :ref:`StyleBox` **selected_focus** + +:ref:`StyleBox` for the selected items, used when the ``Tree`` is being focused. + +---- + +.. _class_Tree_theme_style_title_button_hover: + +- :ref:`StyleBox` **title_button_hover** + +:ref:`StyleBox` used when the title button is being hovered. + +---- + +.. _class_Tree_theme_style_title_button_normal: + +- :ref:`StyleBox` **title_button_normal** + +Default :ref:`StyleBox` for the title button. + +---- + +.. _class_Tree_theme_style_title_button_pressed: + +- :ref:`StyleBox` **title_button_pressed** + +:ref:`StyleBox` used when the title button is being pressed. + +.. |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.)` diff --git a/classes/class_treeitem.rst b/classes/class_treeitem.rst new file mode 100644 index 0000000..72eab56 --- /dev/null +++ b/classes/class_treeitem.rst @@ -0,0 +1,754 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the TreeItem.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TreeItem: + +TreeItem +======== + +**Inherits:** :ref:`Object` + +Control for a single item inside a :ref:`Tree`. + +Description +----------- + +Control for a single item inside a :ref:`Tree`. May have child ``TreeItem``\ s and be styled as well as contain buttons. + +You can remove a ``TreeItem`` by using :ref:`Object.free`. + +Properties +---------- + ++-------------------------+-----------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`collapsed` | ++-------------------------+-----------------------------------------------------------------------------+ +| :ref:`int` | :ref:`custom_minimum_height` | ++-------------------------+-----------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`disable_folding` | ++-------------------------+-----------------------------------------------------------------------------+ + +Methods +------- + ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_button` **(** :ref:`int` column, :ref:`Texture` button, :ref:`int` button_idx=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`call_recursive` **(** :ref:`String` method, ... **)** |vararg| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_custom_bg_color` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_custom_color` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`deselect` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`erase_button` **(** :ref:`int` column, :ref:`int` button_idx **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_button` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_button_count` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_button_tooltip` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeCellMode` | :ref:`get_cell_mode` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_children` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_custom_bg_color` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_custom_color` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_expand_right` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_icon` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_icon_max_width` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`get_icon_modulate` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_icon_region` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_metadata` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_next` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_next_visible` **(** :ref:`bool` wrap=false **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_parent` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_prev` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TreeItem` | :ref:`get_prev_visible` **(** :ref:`bool` wrap=false **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_range` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_range_config` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_suffix` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_text` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TextAlign` | :ref:`get_text_align` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_tooltip` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_button_disabled` **(** :ref:`int` column, :ref:`int` button_idx **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_checked` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_custom_set_as_button` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_editable` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_selectable` **(** :ref:`int` column **)** |const| | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_selected` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_to_bottom` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`move_to_top` **(** **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_child` **(** :ref:`Object` child **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`select` **(** :ref:`int` column **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_button` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture` button **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_button_disabled` **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_cell_mode` **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_checked` **(** :ref:`int` column, :ref:`bool` checked **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_as_button` **(** :ref:`int` column, :ref:`bool` enable **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_bg_color` **(** :ref:`int` column, :ref:`Color` color, :ref:`bool` just_outline=false **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_color` **(** :ref:`int` column, :ref:`Color` color **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_custom_draw` **(** :ref:`int` column, :ref:`Object` object, :ref:`String` callback **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_editable` **(** :ref:`int` column, :ref:`bool` enabled **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_expand_right` **(** :ref:`int` column, :ref:`bool` enable **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon` **(** :ref:`int` column, :ref:`Texture` texture **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon_max_width` **(** :ref:`int` column, :ref:`int` width **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon_modulate` **(** :ref:`int` column, :ref:`Color` modulate **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_icon_region` **(** :ref:`int` column, :ref:`Rect2` region **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_metadata` **(** :ref:`int` column, :ref:`Variant` meta **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_range` **(** :ref:`int` column, :ref:`float` value **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_range_config` **(** :ref:`int` column, :ref:`float` min, :ref:`float` max, :ref:`float` step, :ref:`bool` expr=false **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_selectable` **(** :ref:`int` column, :ref:`bool` selectable **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_suffix` **(** :ref:`int` column, :ref:`String` text **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_text` **(** :ref:`int` column, :ref:`String` text **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_text_align` **(** :ref:`int` column, :ref:`TextAlign` text_align **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_tooltip` **(** :ref:`int` column, :ref:`String` tooltip **)** | ++-------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_TreeItem_TreeCellMode: + +.. _class_TreeItem_constant_CELL_MODE_STRING: + +.. _class_TreeItem_constant_CELL_MODE_CHECK: + +.. _class_TreeItem_constant_CELL_MODE_RANGE: + +.. _class_TreeItem_constant_CELL_MODE_ICON: + +.. _class_TreeItem_constant_CELL_MODE_CUSTOM: + +enum **TreeCellMode**: + +- **CELL_MODE_STRING** = **0** --- Cell contains a string. + +- **CELL_MODE_CHECK** = **1** --- Cell contains a checkbox. + +- **CELL_MODE_RANGE** = **2** --- Cell contains a range. + +- **CELL_MODE_ICON** = **3** --- Cell contains an icon. + +- **CELL_MODE_CUSTOM** = **4** + +---- + +.. _enum_TreeItem_TextAlign: + +.. _class_TreeItem_constant_ALIGN_LEFT: + +.. _class_TreeItem_constant_ALIGN_CENTER: + +.. _class_TreeItem_constant_ALIGN_RIGHT: + +enum **TextAlign**: + +- **ALIGN_LEFT** = **0** --- Align text to the left. See ``set_text_align()``. + +- **ALIGN_CENTER** = **1** --- Center text. See ``set_text_align()``. + +- **ALIGN_RIGHT** = **2** --- Align text to the right. See ``set_text_align()``. + +Property Descriptions +--------------------- + +.. _class_TreeItem_property_collapsed: + +- :ref:`bool` **collapsed** + ++----------+----------------------+ +| *Setter* | set_collapsed(value) | ++----------+----------------------+ +| *Getter* | is_collapsed() | ++----------+----------------------+ + +If ``true``, the TreeItem is collapsed. + +---- + +.. _class_TreeItem_property_custom_minimum_height: + +- :ref:`int` **custom_minimum_height** + ++----------+----------------------------------+ +| *Setter* | set_custom_minimum_height(value) | ++----------+----------------------------------+ +| *Getter* | get_custom_minimum_height() | ++----------+----------------------------------+ + +The custom minimum height. + +---- + +.. _class_TreeItem_property_disable_folding: + +- :ref:`bool` **disable_folding** + ++----------+----------------------------+ +| *Setter* | set_disable_folding(value) | ++----------+----------------------------+ +| *Getter* | is_folding_disabled() | ++----------+----------------------------+ + +If ``true``, folding is disabled for this TreeItem. + +Method Descriptions +------------------- + +.. _class_TreeItem_method_add_button: + +- void **add_button** **(** :ref:`int` column, :ref:`Texture` button, :ref:`int` button_idx=-1, :ref:`bool` disabled=false, :ref:`String` tooltip="" **)** + +Adds a button with :ref:`Texture` ``button`` at column ``column``. The ``button_idx`` is used to identify the button. If not specified, the next available index is used, which may be retrieved by calling :ref:`get_button_count` immediately after this method. Optionally, the button can be ``disabled`` and have a ``tooltip``. + +---- + +.. _class_TreeItem_method_call_recursive: + +- :ref:`Variant` **call_recursive** **(** :ref:`String` method, ... **)** |vararg| + +Calls the ``method`` on the actual TreeItem and its children recursively. Pass parameters as a comma separated list. + +---- + +.. _class_TreeItem_method_clear_custom_bg_color: + +- void **clear_custom_bg_color** **(** :ref:`int` column **)** + +Resets the background color for the given column to default. + +---- + +.. _class_TreeItem_method_clear_custom_color: + +- void **clear_custom_color** **(** :ref:`int` column **)** + +Resets the color for the given column to default. + +---- + +.. _class_TreeItem_method_deselect: + +- void **deselect** **(** :ref:`int` column **)** + +Deselects the given column. + +---- + +.. _class_TreeItem_method_erase_button: + +- void **erase_button** **(** :ref:`int` column, :ref:`int` button_idx **)** + +Removes the button at index ``button_idx`` in column ``column``. + +---- + +.. _class_TreeItem_method_get_button: + +- :ref:`Texture` **get_button** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| + +Returns the :ref:`Texture` of the button at index ``button_idx`` in column ``column``. + +---- + +.. _class_TreeItem_method_get_button_count: + +- :ref:`int` **get_button_count** **(** :ref:`int` column **)** |const| + +Returns the number of buttons in column ``column``. + +---- + +.. _class_TreeItem_method_get_button_tooltip: + +- :ref:`String` **get_button_tooltip** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| + +Returns the tooltip string for the button at index ``button_idx`` in column ``column``. + +---- + +.. _class_TreeItem_method_get_cell_mode: + +- :ref:`TreeCellMode` **get_cell_mode** **(** :ref:`int` column **)** |const| + +Returns the column's cell mode. + +---- + +.. _class_TreeItem_method_get_children: + +- :ref:`TreeItem` **get_children** **(** **)** + +Returns the TreeItem's first child item or a null object if there is none. + +---- + +.. _class_TreeItem_method_get_custom_bg_color: + +- :ref:`Color` **get_custom_bg_color** **(** :ref:`int` column **)** |const| + +Returns the custom background color of column ``column``. + +---- + +.. _class_TreeItem_method_get_custom_color: + +- :ref:`Color` **get_custom_color** **(** :ref:`int` column **)** |const| + +Returns the custom color of column ``column``. + +---- + +.. _class_TreeItem_method_get_expand_right: + +- :ref:`bool` **get_expand_right** **(** :ref:`int` column **)** |const| + +Returns ``true`` if ``expand_right`` is set. + +---- + +.. _class_TreeItem_method_get_icon: + +- :ref:`Texture` **get_icon** **(** :ref:`int` column **)** |const| + +Returns the given column's icon :ref:`Texture`. Error if no icon is set. + +---- + +.. _class_TreeItem_method_get_icon_max_width: + +- :ref:`int` **get_icon_max_width** **(** :ref:`int` column **)** |const| + +Returns the column's icon's maximum width. + +---- + +.. _class_TreeItem_method_get_icon_modulate: + +- :ref:`Color` **get_icon_modulate** **(** :ref:`int` column **)** |const| + +Returns the :ref:`Color` modulating the column's icon. + +---- + +.. _class_TreeItem_method_get_icon_region: + +- :ref:`Rect2` **get_icon_region** **(** :ref:`int` column **)** |const| + +Returns the icon :ref:`Texture` region as :ref:`Rect2`. + +---- + +.. _class_TreeItem_method_get_metadata: + +- :ref:`Variant` **get_metadata** **(** :ref:`int` column **)** |const| + +Returns the metadata value that was set for the given column using :ref:`set_metadata`. + +---- + +.. _class_TreeItem_method_get_next: + +- :ref:`TreeItem` **get_next** **(** **)** + +Returns the next TreeItem in the tree or a null object if there is none. + +---- + +.. _class_TreeItem_method_get_next_visible: + +- :ref:`TreeItem` **get_next_visible** **(** :ref:`bool` wrap=false **)** + +Returns the next visible TreeItem in the tree or a null object if there is none. + +If ``wrap`` is enabled, the method will wrap around to the first visible element in the tree when called on the last visible element, otherwise it returns ``null``. + +---- + +.. _class_TreeItem_method_get_parent: + +- :ref:`TreeItem` **get_parent** **(** **)** + +Returns the parent TreeItem or a null object if there is none. + +---- + +.. _class_TreeItem_method_get_prev: + +- :ref:`TreeItem` **get_prev** **(** **)** + +Returns the previous TreeItem in the tree or a null object if there is none. + +---- + +.. _class_TreeItem_method_get_prev_visible: + +- :ref:`TreeItem` **get_prev_visible** **(** :ref:`bool` wrap=false **)** + +Returns the previous visible TreeItem in the tree or a null object if there is none. + +If ``wrap`` is enabled, the method will wrap around to the last visible element in the tree when called on the first visible element, otherwise it returns ``null``. + +---- + +.. _class_TreeItem_method_get_range: + +- :ref:`float` **get_range** **(** :ref:`int` column **)** |const| + +Returns the value of a :ref:`CELL_MODE_RANGE` column. + +---- + +.. _class_TreeItem_method_get_range_config: + +- :ref:`Dictionary` **get_range_config** **(** :ref:`int` column **)** + +Returns a dictionary containing the range parameters for a given column. The keys are "min", "max", "step", and "expr". + +---- + +.. _class_TreeItem_method_get_suffix: + +- :ref:`String` **get_suffix** **(** :ref:`int` column **)** |const| + +Gets the suffix string shown after the column value. + +---- + +.. _class_TreeItem_method_get_text: + +- :ref:`String` **get_text** **(** :ref:`int` column **)** |const| + +Returns the given column's text. + +---- + +.. _class_TreeItem_method_get_text_align: + +- :ref:`TextAlign` **get_text_align** **(** :ref:`int` column **)** |const| + +Returns the given column's text alignment. + +---- + +.. _class_TreeItem_method_get_tooltip: + +- :ref:`String` **get_tooltip** **(** :ref:`int` column **)** |const| + +Returns the given column's tooltip. + +---- + +.. _class_TreeItem_method_is_button_disabled: + +- :ref:`bool` **is_button_disabled** **(** :ref:`int` column, :ref:`int` button_idx **)** |const| + +Returns ``true`` if the button at index ``button_idx`` for the given column is disabled. + +---- + +.. _class_TreeItem_method_is_checked: + +- :ref:`bool` **is_checked** **(** :ref:`int` column **)** |const| + +Returns ``true`` if the given column is checked. + +---- + +.. _class_TreeItem_method_is_custom_set_as_button: + +- :ref:`bool` **is_custom_set_as_button** **(** :ref:`int` column **)** |const| + +---- + +.. _class_TreeItem_method_is_editable: + +- :ref:`bool` **is_editable** **(** :ref:`int` column **)** + +Returns ``true`` if column ``column`` is editable. + +---- + +.. _class_TreeItem_method_is_selectable: + +- :ref:`bool` **is_selectable** **(** :ref:`int` column **)** |const| + +Returns ``true`` if column ``column`` is selectable. + +---- + +.. _class_TreeItem_method_is_selected: + +- :ref:`bool` **is_selected** **(** :ref:`int` column **)** + +Returns ``true`` if column ``column`` is selected. + +---- + +.. _class_TreeItem_method_move_to_bottom: + +- void **move_to_bottom** **(** **)** + +Moves this TreeItem to the bottom in the :ref:`Tree` hierarchy. + +---- + +.. _class_TreeItem_method_move_to_top: + +- void **move_to_top** **(** **)** + +Moves this TreeItem to the top in the :ref:`Tree` hierarchy. + +---- + +.. _class_TreeItem_method_remove_child: + +- void **remove_child** **(** :ref:`Object` child **)** + +Removes the given child ``TreeItem`` and all its children from the :ref:`Tree`. Note that it doesn't free the item from memory, so it can be reused later. To completely remove a ``TreeItem`` use :ref:`Object.free`. + +---- + +.. _class_TreeItem_method_select: + +- void **select** **(** :ref:`int` column **)** + +Selects the column ``column``. + +---- + +.. _class_TreeItem_method_set_button: + +- void **set_button** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`Texture` button **)** + +Sets the given column's button :ref:`Texture` at index ``button_idx`` to ``button``. + +---- + +.. _class_TreeItem_method_set_button_disabled: + +- void **set_button_disabled** **(** :ref:`int` column, :ref:`int` button_idx, :ref:`bool` disabled **)** + +If ``true``, disables the button at index ``button_idx`` in column ``column``. + +---- + +.. _class_TreeItem_method_set_cell_mode: + +- void **set_cell_mode** **(** :ref:`int` column, :ref:`TreeCellMode` mode **)** + +Sets the given column's cell mode to ``mode``. See :ref:`TreeCellMode` constants. + +---- + +.. _class_TreeItem_method_set_checked: + +- void **set_checked** **(** :ref:`int` column, :ref:`bool` checked **)** + +If ``true``, the column ``column`` is checked. + +---- + +.. _class_TreeItem_method_set_custom_as_button: + +- void **set_custom_as_button** **(** :ref:`int` column, :ref:`bool` enable **)** + +---- + +.. _class_TreeItem_method_set_custom_bg_color: + +- void **set_custom_bg_color** **(** :ref:`int` column, :ref:`Color` color, :ref:`bool` just_outline=false **)** + +Sets the given column's custom background color and whether to just use it as an outline. + +---- + +.. _class_TreeItem_method_set_custom_color: + +- void **set_custom_color** **(** :ref:`int` column, :ref:`Color` color **)** + +Sets the given column's custom color. + +---- + +.. _class_TreeItem_method_set_custom_draw: + +- void **set_custom_draw** **(** :ref:`int` column, :ref:`Object` object, :ref:`String` callback **)** + +Sets the given column's custom draw callback to ``callback`` method on ``object``. + +The ``callback`` should accept two arguments: the ``TreeItem`` that is drawn and its position and size as a :ref:`Rect2`. + +---- + +.. _class_TreeItem_method_set_editable: + +- void **set_editable** **(** :ref:`int` column, :ref:`bool` enabled **)** + +If ``true``, column ``column`` is editable. + +---- + +.. _class_TreeItem_method_set_expand_right: + +- void **set_expand_right** **(** :ref:`int` column, :ref:`bool` enable **)** + +If ``true``, column ``column`` is expanded to the right. + +---- + +.. _class_TreeItem_method_set_icon: + +- void **set_icon** **(** :ref:`int` column, :ref:`Texture` texture **)** + +Sets the given column's icon :ref:`Texture`. + +---- + +.. _class_TreeItem_method_set_icon_max_width: + +- void **set_icon_max_width** **(** :ref:`int` column, :ref:`int` width **)** + +Sets the given column's icon's maximum width. + +---- + +.. _class_TreeItem_method_set_icon_modulate: + +- void **set_icon_modulate** **(** :ref:`int` column, :ref:`Color` modulate **)** + +Modulates the given column's icon with ``modulate``. + +---- + +.. _class_TreeItem_method_set_icon_region: + +- void **set_icon_region** **(** :ref:`int` column, :ref:`Rect2` region **)** + +Sets the given column's icon's texture region. + +---- + +.. _class_TreeItem_method_set_metadata: + +- void **set_metadata** **(** :ref:`int` column, :ref:`Variant` meta **)** + +Sets the metadata value for the given column, which can be retrieved later using :ref:`get_metadata`. This can be used, for example, to store a reference to the original data. + +---- + +.. _class_TreeItem_method_set_range: + +- void **set_range** **(** :ref:`int` column, :ref:`float` value **)** + +Sets the value of a :ref:`CELL_MODE_RANGE` column. + +---- + +.. _class_TreeItem_method_set_range_config: + +- void **set_range_config** **(** :ref:`int` column, :ref:`float` min, :ref:`float` max, :ref:`float` step, :ref:`bool` expr=false **)** + +Sets the range of accepted values for a column. The column must be in the :ref:`CELL_MODE_RANGE` mode. + +If ``expr`` is ``true``, the edit mode slider will use an exponential scale as with :ref:`Range.exp_edit`. + +---- + +.. _class_TreeItem_method_set_selectable: + +- void **set_selectable** **(** :ref:`int` column, :ref:`bool` selectable **)** + +If ``true``, the given column is selectable. + +---- + +.. _class_TreeItem_method_set_suffix: + +- void **set_suffix** **(** :ref:`int` column, :ref:`String` text **)** + +Sets a string to be shown after a column's value (for example, a unit abbreviation). + +---- + +.. _class_TreeItem_method_set_text: + +- void **set_text** **(** :ref:`int` column, :ref:`String` text **)** + +Sets the given column's text value. + +---- + +.. _class_TreeItem_method_set_text_align: + +- void **set_text_align** **(** :ref:`int` column, :ref:`TextAlign` text_align **)** + +Sets the given column's text alignment. See :ref:`TextAlign` for possible values. + +---- + +.. _class_TreeItem_method_set_tooltip: + +- void **set_tooltip** **(** :ref:`int` column, :ref:`String` tooltip **)** + +Sets the given column's tooltip text. + +.. |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.)` diff --git a/classes/class_trianglemesh.rst b/classes/class_trianglemesh.rst new file mode 100644 index 0000000..c80fbcd --- /dev/null +++ b/classes/class_trianglemesh.rst @@ -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 TriangleMesh.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_TriangleMesh: + +TriangleMesh +============ + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Internal mesh type. + +Description +----------- + +Mesh type used internally for collision calculations. + +.. |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.)` diff --git a/classes/class_tween.rst b/classes/class_tween.rst new file mode 100644 index 0000000..08cbf1f --- /dev/null +++ b/classes/class_tween.rst @@ -0,0 +1,463 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Tween.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Tween: + +Tween +===== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Smoothly animates a node's properties over time. + +Description +----------- + +Tweens are useful for animations requiring a numerical property to be interpolated over a range of values. The name *tween* comes from *in-betweening*, an animation technique where you specify *keyframes* and the computer interpolates the frames that appear between them. + +``Tween`` is more suited than :ref:`AnimationPlayer` for animations where you don't know the final values in advance. For example, interpolating a dynamically-chosen camera zoom value is best done with a ``Tween`` node; it would be difficult to do the same thing with an :ref:`AnimationPlayer` node. + +Here is a brief usage example that makes a 2D node move smoothly between two positions: + +:: + + var tween = get_node("Tween") + tween.interpolate_property($Node2D, "position", + Vector2(0, 0), Vector2(100, 100), 1, + Tween.TRANS_LINEAR, Tween.EASE_IN_OUT) + tween.start() + +Many methods require a property name, such as ``"position"`` above. You can find the correct property name by hovering over the property in the Inspector. You can also provide the components of a property directly by using ``"property:component"`` (e.g. ``position:x``), where it would only apply to that particular component. + +Many of the methods accept ``trans_type`` and ``ease_type``. The first accepts an :ref:`TransitionType` constant, and refers to the way the timing of the animation is handled (see `easings.net `__ for some examples). The second accepts an :ref:`EaseType` constant, and controls where the ``trans_type`` is applied to the interpolation (in the beginning, the end, or both). If you don't know which transition and easing to pick, you can try different :ref:`TransitionType` constants with :ref:`EASE_IN_OUT`, and use the one that looks best. + +`Tween easing and transition types cheatsheet `__ + +**Note:** Tween methods will return ``false`` if the requested operation cannot be completed. + +Properties +---------- + ++------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`TweenProcessMode` | :ref:`playback_process_mode` | ``1`` | ++------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`float` | :ref:`playback_speed` | ``1.0`` | ++------------------------------------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`repeat` | ``false`` | ++------------------------------------------------------+--------------------------------------------------------------------------+-----------+ + +Methods +------- + ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`follow_method` **(** :ref:`Object` object, :ref:`String` method, :ref:`Variant` initial_val, :ref:`Object` target, :ref:`String` target_method, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`follow_property` **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Variant` initial_val, :ref:`Object` target, :ref:`NodePath` target_property, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_runtime` **(** **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`interpolate_callback` **(** :ref:`Object` object, :ref:`float` duration, :ref:`String` callback, :ref:`Variant` arg1=null, :ref:`Variant` arg2=null, :ref:`Variant` arg3=null, :ref:`Variant` arg4=null, :ref:`Variant` arg5=null **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`interpolate_deferred_callback` **(** :ref:`Object` object, :ref:`float` duration, :ref:`String` callback, :ref:`Variant` arg1=null, :ref:`Variant` arg2=null, :ref:`Variant` arg3=null, :ref:`Variant` arg4=null, :ref:`Variant` arg5=null **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`interpolate_method` **(** :ref:`Object` object, :ref:`String` method, :ref:`Variant` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`interpolate_property` **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Variant` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_active` **(** **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`remove` **(** :ref:`Object` object, :ref:`String` key="" **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`remove_all` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`reset` **(** :ref:`Object` object, :ref:`String` key="" **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`reset_all` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`resume` **(** :ref:`Object` object, :ref:`String` key="" **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`resume_all` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`seek` **(** :ref:`float` time **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_active` **(** :ref:`bool` active **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`start` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`stop` **(** :ref:`Object` object, :ref:`String` key="" **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`stop_all` **(** **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`targeting_method` **(** :ref:`Object` object, :ref:`String` method, :ref:`Object` initial, :ref:`String` initial_method, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`targeting_property` **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Object` initial, :ref:`NodePath` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`tell` **(** **)** |const| | ++---------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Tween_signal_tween_all_completed: + +- **tween_all_completed** **(** **)** + +Emitted when all processes in a tween end. + +---- + +.. _class_Tween_signal_tween_completed: + +- **tween_completed** **(** :ref:`Object` object, :ref:`NodePath` key **)** + +Emitted when a tween ends. + +---- + +.. _class_Tween_signal_tween_started: + +- **tween_started** **(** :ref:`Object` object, :ref:`NodePath` key **)** + +Emitted when a tween starts. + +---- + +.. _class_Tween_signal_tween_step: + +- **tween_step** **(** :ref:`Object` object, :ref:`NodePath` key, :ref:`float` elapsed, :ref:`Object` value **)** + +Emitted at each step of the animation. + +Enumerations +------------ + +.. _enum_Tween_TweenProcessMode: + +.. _class_Tween_constant_TWEEN_PROCESS_PHYSICS: + +.. _class_Tween_constant_TWEEN_PROCESS_IDLE: + +enum **TweenProcessMode**: + +- **TWEEN_PROCESS_PHYSICS** = **0** --- The tween updates with the ``_physics_process`` callback. + +- **TWEEN_PROCESS_IDLE** = **1** --- The tween updates with the ``_process`` callback. + +---- + +.. _enum_Tween_TransitionType: + +.. _class_Tween_constant_TRANS_LINEAR: + +.. _class_Tween_constant_TRANS_SINE: + +.. _class_Tween_constant_TRANS_QUINT: + +.. _class_Tween_constant_TRANS_QUART: + +.. _class_Tween_constant_TRANS_QUAD: + +.. _class_Tween_constant_TRANS_EXPO: + +.. _class_Tween_constant_TRANS_ELASTIC: + +.. _class_Tween_constant_TRANS_CUBIC: + +.. _class_Tween_constant_TRANS_CIRC: + +.. _class_Tween_constant_TRANS_BOUNCE: + +.. _class_Tween_constant_TRANS_BACK: + +enum **TransitionType**: + +- **TRANS_LINEAR** = **0** --- The animation is interpolated linearly. + +- **TRANS_SINE** = **1** --- The animation is interpolated using a sine function. + +- **TRANS_QUINT** = **2** --- The animation is interpolated with a quintic (to the power of 5) function. + +- **TRANS_QUART** = **3** --- The animation is interpolated with a quartic (to the power of 4) function. + +- **TRANS_QUAD** = **4** --- The animation is interpolated with a quadratic (to the power of 2) function. + +- **TRANS_EXPO** = **5** --- The animation is interpolated with an exponential (to the power of x) function. + +- **TRANS_ELASTIC** = **6** --- The animation is interpolated with elasticity, wiggling around the edges. + +- **TRANS_CUBIC** = **7** --- The animation is interpolated with a cubic (to the power of 3) function. + +- **TRANS_CIRC** = **8** --- The animation is interpolated with a function using square roots. + +- **TRANS_BOUNCE** = **9** --- The animation is interpolated by bouncing at the end. + +- **TRANS_BACK** = **10** --- The animation is interpolated backing out at ends. + +---- + +.. _enum_Tween_EaseType: + +.. _class_Tween_constant_EASE_IN: + +.. _class_Tween_constant_EASE_OUT: + +.. _class_Tween_constant_EASE_IN_OUT: + +.. _class_Tween_constant_EASE_OUT_IN: + +enum **EaseType**: + +- **EASE_IN** = **0** --- The interpolation starts slowly and speeds up towards the end. + +- **EASE_OUT** = **1** --- The interpolation starts quickly and slows down towards the end. + +- **EASE_IN_OUT** = **2** --- A combination of :ref:`EASE_IN` and :ref:`EASE_OUT`. The interpolation is slowest at both ends. + +- **EASE_OUT_IN** = **3** --- A combination of :ref:`EASE_IN` and :ref:`EASE_OUT`. The interpolation is fastest at both ends. + +Property Descriptions +--------------------- + +.. _class_Tween_property_playback_process_mode: + +- :ref:`TweenProcessMode` **playback_process_mode** + ++-----------+-------------------------------+ +| *Default* | ``1`` | ++-----------+-------------------------------+ +| *Setter* | set_tween_process_mode(value) | ++-----------+-------------------------------+ +| *Getter* | get_tween_process_mode() | ++-----------+-------------------------------+ + +The tween's animation process thread. See :ref:`TweenProcessMode`. + +---- + +.. _class_Tween_property_playback_speed: + +- :ref:`float` **playback_speed** + ++-----------+------------------------+ +| *Default* | ``1.0`` | ++-----------+------------------------+ +| *Setter* | set_speed_scale(value) | ++-----------+------------------------+ +| *Getter* | get_speed_scale() | ++-----------+------------------------+ + +The tween's speed multiplier. For example, set it to ``1.0`` for normal speed, ``2.0`` for two times normal speed, or ``0.5`` for half of the normal speed. A value of ``0`` pauses the animation, but see also :ref:`set_active` or :ref:`stop_all` for this. + +---- + +.. _class_Tween_property_repeat: + +- :ref:`bool` **repeat** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_repeat(value) | ++-----------+-------------------+ +| *Getter* | is_repeat() | ++-----------+-------------------+ + +If ``true``, the tween loops. + +Method Descriptions +------------------- + +.. _class_Tween_method_follow_method: + +- :ref:`bool` **follow_method** **(** :ref:`Object` object, :ref:`String` method, :ref:`Variant` initial_val, :ref:`Object` target, :ref:`String` target_method, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Follows ``method`` of ``object`` and applies the returned value on ``target_method`` of ``target``, beginning from ``initial_val`` for ``duration`` seconds, ``delay`` later. Methods are called with consecutive values. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_follow_property: + +- :ref:`bool` **follow_property** **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Variant` initial_val, :ref:`Object` target, :ref:`NodePath` target_property, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Follows ``property`` of ``object`` and applies it on ``target_property`` of ``target``, beginning from ``initial_val`` for ``duration`` seconds, ``delay`` seconds later. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_get_runtime: + +- :ref:`float` **get_runtime** **(** **)** |const| + +Returns the total time needed for all tweens to end. If you have two tweens, one lasting 10 seconds and the other 20 seconds, it would return 20 seconds, as by that time all tweens would have finished. + +---- + +.. _class_Tween_method_interpolate_callback: + +- :ref:`bool` **interpolate_callback** **(** :ref:`Object` object, :ref:`float` duration, :ref:`String` callback, :ref:`Variant` arg1=null, :ref:`Variant` arg2=null, :ref:`Variant` arg3=null, :ref:`Variant` arg4=null, :ref:`Variant` arg5=null **)** + +Calls ``callback`` of ``object`` after ``duration``. ``arg1``-``arg5`` are arguments to be passed to the callback. + +---- + +.. _class_Tween_method_interpolate_deferred_callback: + +- :ref:`bool` **interpolate_deferred_callback** **(** :ref:`Object` object, :ref:`float` duration, :ref:`String` callback, :ref:`Variant` arg1=null, :ref:`Variant` arg2=null, :ref:`Variant` arg3=null, :ref:`Variant` arg4=null, :ref:`Variant` arg5=null **)** + +Calls ``callback`` of ``object`` after ``duration`` on the main thread (similar to :ref:`Object.call_deferred`). ``arg1``-``arg5`` are arguments to be passed to the callback. + +---- + +.. _class_Tween_method_interpolate_method: + +- :ref:`bool` **interpolate_method** **(** :ref:`Object` object, :ref:`String` method, :ref:`Variant` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Animates ``method`` of ``object`` from ``initial_val`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Methods are called with consecutive values. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_interpolate_property: + +- :ref:`bool` **interpolate_property** **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Variant` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Animates ``property`` of ``object`` from ``initial_val`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Setting the initial value to ``null`` uses the current value of the property. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_is_active: + +- :ref:`bool` **is_active** **(** **)** |const| + +Returns ``true`` if any tweens are currently running. + +**Note:** This method doesn't consider tweens that have ended. + +---- + +.. _class_Tween_method_remove: + +- :ref:`bool` **remove** **(** :ref:`Object` object, :ref:`String` key="" **)** + +Stops animation and removes a tween, given its object and property/method pair. By default, all tweens are removed, unless ``key`` is specified. + +---- + +.. _class_Tween_method_remove_all: + +- :ref:`bool` **remove_all** **(** **)** + +Stops animation and removes all tweens. + +---- + +.. _class_Tween_method_reset: + +- :ref:`bool` **reset** **(** :ref:`Object` object, :ref:`String` key="" **)** + +Resets a tween to its initial value (the one given, not the one before the tween), given its object and property/method pair. By default, all tweens are removed, unless ``key`` is specified. + +---- + +.. _class_Tween_method_reset_all: + +- :ref:`bool` **reset_all** **(** **)** + +Resets all tweens to their initial values (the ones given, not those before the tween). + +---- + +.. _class_Tween_method_resume: + +- :ref:`bool` **resume** **(** :ref:`Object` object, :ref:`String` key="" **)** + +Continues animating a stopped tween, given its object and property/method pair. By default, all tweens are resumed, unless ``key`` is specified. + +---- + +.. _class_Tween_method_resume_all: + +- :ref:`bool` **resume_all** **(** **)** + +Continues animating all stopped tweens. + +---- + +.. _class_Tween_method_seek: + +- :ref:`bool` **seek** **(** :ref:`float` time **)** + +Sets the interpolation to the given ``time`` in seconds. + +---- + +.. _class_Tween_method_set_active: + +- void **set_active** **(** :ref:`bool` active **)** + +Activates/deactivates the tween. See also :ref:`stop_all` and :ref:`resume_all`. + +---- + +.. _class_Tween_method_start: + +- :ref:`bool` **start** **(** **)** + +Starts the tween. You can define animations both before and after this. + +---- + +.. _class_Tween_method_stop: + +- :ref:`bool` **stop** **(** :ref:`Object` object, :ref:`String` key="" **)** + +Stops a tween, given its object and property/method pair. By default, all tweens are stopped, unless ``key`` is specified. + +---- + +.. _class_Tween_method_stop_all: + +- :ref:`bool` **stop_all** **(** **)** + +Stops animating all tweens. + +---- + +.. _class_Tween_method_targeting_method: + +- :ref:`bool` **targeting_method** **(** :ref:`Object` object, :ref:`String` method, :ref:`Object` initial, :ref:`String` initial_method, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Animates ``method`` of ``object`` from the value returned by ``initial_method`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. Methods are animated by calling them with consecutive values. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_targeting_property: + +- :ref:`bool` **targeting_property** **(** :ref:`Object` object, :ref:`NodePath` property, :ref:`Object` initial, :ref:`NodePath` initial_val, :ref:`Variant` final_val, :ref:`float` duration, :ref:`TransitionType` trans_type=0, :ref:`EaseType` ease_type=2, :ref:`float` delay=0 **)** + +Animates ``property`` of ``object`` from the current value of the ``initial_val`` property of ``initial`` to ``final_val`` for ``duration`` seconds, ``delay`` seconds later. + +Use :ref:`TransitionType` for ``trans_type`` and :ref:`EaseType` for ``ease_type`` parameters. These values control the timing and direction of the interpolation. See the class description for more information. + +---- + +.. _class_Tween_method_tell: + +- :ref:`float` **tell** **(** **)** |const| + +Returns the current time of the tween. + +.. |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.)` diff --git a/classes/class_udpserver.rst b/classes/class_udpserver.rst new file mode 100644 index 0000000..00b2eca --- /dev/null +++ b/classes/class_udpserver.rst @@ -0,0 +1,163 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the UDPServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_UDPServer: + +UDPServer +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Helper class to implement a UDP server. + +Description +----------- + +A simple server that opens a UDP socket and returns connected :ref:`PacketPeerUDP` upon receiving new packets. See also :ref:`PacketPeerUDP.connect_to_host`. + +After starting the server (:ref:`listen`), you will need to :ref:`poll` it at regular intervals (e.g. inside :ref:`Node._process`) for it to process new packets, delivering them to the appropriate :ref:`PacketPeerUDP`, and taking new connections. + +Below a small example of how it can be used: + +:: + + # server.gd + extends Node + + var server := UDPServer.new() + var peers = [] + + func _ready(): + server.listen(4242) + + func _process(delta): + server.poll() # Important! + if server.is_connection_available(): + var peer : PacketPeerUDP = server.take_connection() + var pkt = peer.get_packet() + print("Accepted peer: %s:%s" % [peer.get_packet_ip(), peer.get_packet_port()]) + print("Received data: %s" % [pkt.get_string_from_utf8()]) + # Reply so it knows we received the message. + peer.put_packet(pkt) + # Keep a reference so we can keep contacting the remote peer. + peers.append(peer) + + for i in range(0, peers.size()): + pass # Do something with the connected peers. + + +:: + + # client.gd + extends Node + + var udp := PacketPeerUDP.new() + var connected = false + + func _ready(): + udp.connect_to_host("127.0.0.1", 4242) + + func _process(delta): + if !connected: + # Try to contact server + udp.put_packet("The answer is... 42!".to_utf8()) + if udp.get_available_packet_count() > 0: + print("Connected: %s" % udp.get_packet().get_string_from_utf8()) + connected = true + +Properties +---------- + ++-----------------------+----------------------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`max_pending_connections` | ``16`` | ++-----------------------+----------------------------------------------------------------------------------+--------+ + +Methods +------- + ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connection_available` **(** **)** |const| | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_listening` **(** **)** |const| | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`String` bind_address="*" **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`poll` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PacketPeerUDP` | :ref:`take_connection` **(** **)** | ++-------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_UDPServer_property_max_pending_connections: + +- :ref:`int` **max_pending_connections** + ++-----------+------------------------------------+ +| *Default* | ``16`` | ++-----------+------------------------------------+ +| *Setter* | set_max_pending_connections(value) | ++-----------+------------------------------------+ +| *Getter* | get_max_pending_connections() | ++-----------+------------------------------------+ + +Define the maximum number of pending connections, during :ref:`poll`, any new pending connection exceeding that value will be automatically dropped. Setting this value to ``0`` effectively prevents any new pending connection to be accepted (e.g. when all your players have connected). + +Method Descriptions +------------------- + +.. _class_UDPServer_method_is_connection_available: + +- :ref:`bool` **is_connection_available** **(** **)** |const| + +Returns ``true`` if a packet with a new address/port combination was received on the socket. + +---- + +.. _class_UDPServer_method_is_listening: + +- :ref:`bool` **is_listening** **(** **)** |const| + +Returns ``true`` if the socket is open and listening on a port. + +---- + +.. _class_UDPServer_method_listen: + +- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`String` bind_address="*" **)** + +Starts the server by opening a UDP socket listening on the given port. You can optionally specify a ``bind_address`` to only listen for packets sent to that address. See also :ref:`PacketPeerUDP.listen`. + +---- + +.. _class_UDPServer_method_poll: + +- :ref:`Error` **poll** **(** **)** + +Call this method at regular intervals (e.g. inside :ref:`Node._process`) to process new packets. And packet from known address/port pair will be delivered to the appropriate :ref:`PacketPeerUDP`, any packet received from an unknown address/port pair will be added as a pending connection (see :ref:`is_connection_available`, :ref:`take_connection`). The maximum number of pending connection is defined via :ref:`max_pending_connections`. + +---- + +.. _class_UDPServer_method_stop: + +- void **stop** **(** **)** + +Stops the server, closing the UDP socket if open. Will close all connected :ref:`PacketPeerUDP` accepted via :ref:`take_connection` (remote peers will not be notified). + +---- + +.. _class_UDPServer_method_take_connection: + +- :ref:`PacketPeerUDP` **take_connection** **(** **)** + +Returns the first pending connection (connected to the appropriate address/port). Will return ``null`` if no new connection is available. See also :ref:`is_connection_available`, :ref:`PacketPeerUDP.connect_to_host`. + +.. |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.)` diff --git a/classes/class_undoredo.rst b/classes/class_undoredo.rst new file mode 100644 index 0000000..f7a82ac --- /dev/null +++ b/classes/class_undoredo.rst @@ -0,0 +1,250 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the UndoRedo.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_UndoRedo: + +UndoRedo +======== + +**Inherits:** :ref:`Object` + +Helper to manage undo/redo operations in the editor or custom tools. + +Description +----------- + +Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions". + +Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. + +Here's an example on how to add an action to the Godot editor's own ``UndoRedo``, from a plugin: + +:: + + var undo_redo = get_undo_redo() # Method of EditorPlugin. + + func do_something(): + pass # Put your code here. + + func undo_something(): + pass # Put here the code that reverts what's done by "do_something()". + + func _on_MyButton_pressed(): + var node = get_node("MyNode2D") + undo_redo.create_action("Move the node") + undo_redo.add_do_method(self, "do_something") + undo_redo.add_undo_method(self, "undo_something") + undo_redo.add_do_property(node, "position", Vector2(100,100)) + undo_redo.add_undo_property(node, "position", node.position) + undo_redo.commit_action() + +:ref:`create_action`, :ref:`add_do_method`, :ref:`add_undo_method`, :ref:`add_do_property`, :ref:`add_undo_property`, and :ref:`commit_action` should be called one after the other, like in the example. Not doing so could lead to crashes. + +If you don't need to register a method, you can leave :ref:`add_do_method` and :ref:`add_undo_method` out; the same goes for properties. You can also register more than one method/property. + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_do_method` **(** :ref:`Object` object, :ref:`String` method, ... **)** |vararg| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_do_property` **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_do_reference` **(** :ref:`Object` object **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_undo_method` **(** :ref:`Object` object, :ref:`String` method, ... **)** |vararg| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_undo_property` **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_undo_reference` **(** :ref:`Object` object **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_history` **(** :ref:`bool` increase_version=true **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`commit_action` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`create_action` **(** :ref:`String` name, :ref:`MergeMode` merge_mode=0 **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_current_action_name` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_version` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_redo` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_undo` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_commiting_action` **(** **)** |const| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`redo` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`undo` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_UndoRedo_signal_version_changed: + +- **version_changed** **(** **)** + +Called when :ref:`undo` or :ref:`redo` was called. + +Enumerations +------------ + +.. _enum_UndoRedo_MergeMode: + +.. _class_UndoRedo_constant_MERGE_DISABLE: + +.. _class_UndoRedo_constant_MERGE_ENDS: + +.. _class_UndoRedo_constant_MERGE_ALL: + +enum **MergeMode**: + +- **MERGE_DISABLE** = **0** --- Makes "do"/"undo" operations stay in separate actions. + +- **MERGE_ENDS** = **1** --- Makes so that the action's "do" operation is from the first action created and the "undo" operation is from the last subsequent action with the same name. + +- **MERGE_ALL** = **2** --- Makes subsequent actions with the same name be merged into one. + +Method Descriptions +------------------- + +.. _class_UndoRedo_method_add_do_method: + +- void **add_do_method** **(** :ref:`Object` object, :ref:`String` method, ... **)** |vararg| + +Register a method that will be called when the action is committed. + +---- + +.. _class_UndoRedo_method_add_do_property: + +- void **add_do_property** **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** + +Register a property value change for "do". + +---- + +.. _class_UndoRedo_method_add_do_reference: + +- void **add_do_reference** **(** :ref:`Object` object **)** + +Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. + +---- + +.. _class_UndoRedo_method_add_undo_method: + +- void **add_undo_method** **(** :ref:`Object` object, :ref:`String` method, ... **)** |vararg| + +Register a method that will be called when the action is undone. + +---- + +.. _class_UndoRedo_method_add_undo_property: + +- void **add_undo_property** **(** :ref:`Object` object, :ref:`String` property, :ref:`Variant` value **)** + +Register a property value change for "undo". + +---- + +.. _class_UndoRedo_method_add_undo_reference: + +- void **add_undo_reference** **(** :ref:`Object` object **)** + +Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). + +---- + +.. _class_UndoRedo_method_clear_history: + +- void **clear_history** **(** :ref:`bool` increase_version=true **)** + +Clear the undo/redo history and associated references. + +Passing ``false`` to ``increase_version`` will prevent the version number to be increased from this. + +---- + +.. _class_UndoRedo_method_commit_action: + +- void **commit_action** **(** **)** + +Commit the action. All "do" methods/properties are called/set when this function is called. + +---- + +.. _class_UndoRedo_method_create_action: + +- void **create_action** **(** :ref:`String` name, :ref:`MergeMode` merge_mode=0 **)** + +Create a new action. After this is called, do all your calls to :ref:`add_do_method`, :ref:`add_undo_method`, :ref:`add_do_property`, and :ref:`add_undo_property`, then commit the action with :ref:`commit_action`. + +The way actions are merged is dictated by the ``merge_mode`` argument. See :ref:`MergeMode` for details. + +---- + +.. _class_UndoRedo_method_get_current_action_name: + +- :ref:`String` **get_current_action_name** **(** **)** |const| + +Gets the name of the current action. + +---- + +.. _class_UndoRedo_method_get_version: + +- :ref:`int` **get_version** **(** **)** |const| + +Gets the version. Every time a new action is committed, the ``UndoRedo``'s version number is increased automatically. + +This is useful mostly to check if something changed from a saved version. + +---- + +.. _class_UndoRedo_method_has_redo: + +- :ref:`bool` **has_redo** **(** **)** |const| + +Returns ``true`` if a "redo" action is available. + +---- + +.. _class_UndoRedo_method_has_undo: + +- :ref:`bool` **has_undo** **(** **)** |const| + +Returns ``true`` if an "undo" action is available. + +---- + +.. _class_UndoRedo_method_is_commiting_action: + +- :ref:`bool` **is_commiting_action** **(** **)** |const| + +Returns ``true`` if the ``UndoRedo`` is currently committing the action, i.e. running its "do" method or property change (see :ref:`commit_action`). + +---- + +.. _class_UndoRedo_method_redo: + +- :ref:`bool` **redo** **(** **)** + +Redo the last action. + +---- + +.. _class_UndoRedo_method_undo: + +- :ref:`bool` **undo** **(** **)** + +Undo the last action. + +.. |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.)` diff --git a/classes/class_upnp.rst b/classes/class_upnp.rst new file mode 100644 index 0000000..b5e4e73 --- /dev/null +++ b/classes/class_upnp.rst @@ -0,0 +1,381 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the UPNP.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_UPNP: + +UPNP +==== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +UPNP network functions. + +Description +----------- + +Provides UPNP functionality to discover :ref:`UPNPDevice`\ s on the local network and execute commands on them, like managing port mappings (port forwarding) and querying the local and remote network IP address. Note that methods on this class are synchronous and block the calling thread. + +To forward a specific port: + +:: + + const PORT = 7777 + var upnp = UPNP.new() + upnp.discover(2000, 2, "InternetGatewayDevice") + upnp.add_port_mapping(port) + +To close a specific port (e.g. after you have finished using it): + +:: + + upnp.delete_port_mapping(port) + +**Note:** UPnP discovery blocks the current thread. To perform discovery without blocking the main thread, use :ref:`Thread`\ s like this: + +:: + + # Emitted when UPnP port mapping setup is completed (regardless of success or failure). + signal upnp_completed(error) + + # Replace this with your own server port number between 1025 and 65535. + const SERVER_PORT = 3928 + var thread = null + + func _upnp_setup(server_port): + # UPNP queries take some time. + var upnp = UPNP.new() + var err = upnp.discover() + + if err != OK: + push_error(str(err)) + emit_signal("upnp_completed", err) + return + + if upnp.get_gateway() and upnp.get_gateway().is_valid_gateway(): + upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "UDP") + upnp.add_port_mapping(server_port, server_port, ProjectSettings.get_setting("application/config/name"), "TCP") + emit_signal("upnp_completed", OK) + + func _ready(): + thread = Thread.new() + thread.start(self, "_upnp_setup", SERVER_PORT) + + func _exit_tree(): + # Wait for thread finish here to handle game exit while the thread is running. + thread.wait_to_finish() + +Properties +---------- + ++-----------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`discover_ipv6` | ``false`` | ++-----------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`discover_local_port` | ``0`` | ++-----------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`discover_multicast_if` | ``""`` | ++-----------------------------+-------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_device` **(** :ref:`UPNPDevice` device **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_port_mapping` **(** :ref:`int` port, :ref:`int` port_internal=0, :ref:`String` desc="", :ref:`String` proto="UDP", :ref:`int` duration=0 **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_devices` **(** **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`delete_port_mapping` **(** :ref:`int` port, :ref:`String` proto="UDP" **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`discover` **(** :ref:`int` timeout=2000, :ref:`int` ttl=2, :ref:`String` device_filter="InternetGatewayDevice" **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UPNPDevice` | :ref:`get_device` **(** :ref:`int` index **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_device_count` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`UPNPDevice` | :ref:`get_gateway` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`query_external_address` **(** **)** |const| | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_device` **(** :ref:`int` index **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_device` **(** :ref:`int` index, :ref:`UPNPDevice` device **)** | ++-------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_UPNP_UPNPResult: + +.. _class_UPNP_constant_UPNP_RESULT_SUCCESS: + +.. _class_UPNP_constant_UPNP_RESULT_NOT_AUTHORIZED: + +.. _class_UPNP_constant_UPNP_RESULT_PORT_MAPPING_NOT_FOUND: + +.. _class_UPNP_constant_UPNP_RESULT_INCONSISTENT_PARAMETERS: + +.. _class_UPNP_constant_UPNP_RESULT_NO_SUCH_ENTRY_IN_ARRAY: + +.. _class_UPNP_constant_UPNP_RESULT_ACTION_FAILED: + +.. _class_UPNP_constant_UPNP_RESULT_SRC_IP_WILDCARD_NOT_PERMITTED: + +.. _class_UPNP_constant_UPNP_RESULT_EXT_PORT_WILDCARD_NOT_PERMITTED: + +.. _class_UPNP_constant_UPNP_RESULT_INT_PORT_WILDCARD_NOT_PERMITTED: + +.. _class_UPNP_constant_UPNP_RESULT_REMOTE_HOST_MUST_BE_WILDCARD: + +.. _class_UPNP_constant_UPNP_RESULT_EXT_PORT_MUST_BE_WILDCARD: + +.. _class_UPNP_constant_UPNP_RESULT_NO_PORT_MAPS_AVAILABLE: + +.. _class_UPNP_constant_UPNP_RESULT_CONFLICT_WITH_OTHER_MECHANISM: + +.. _class_UPNP_constant_UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING: + +.. _class_UPNP_constant_UPNP_RESULT_SAME_PORT_VALUES_REQUIRED: + +.. _class_UPNP_constant_UPNP_RESULT_ONLY_PERMANENT_LEASE_SUPPORTED: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_GATEWAY: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_PORT: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_PROTOCOL: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_DURATION: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_ARGS: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_RESPONSE: + +.. _class_UPNP_constant_UPNP_RESULT_INVALID_PARAM: + +.. _class_UPNP_constant_UPNP_RESULT_HTTP_ERROR: + +.. _class_UPNP_constant_UPNP_RESULT_SOCKET_ERROR: + +.. _class_UPNP_constant_UPNP_RESULT_MEM_ALLOC_ERROR: + +.. _class_UPNP_constant_UPNP_RESULT_NO_GATEWAY: + +.. _class_UPNP_constant_UPNP_RESULT_NO_DEVICES: + +.. _class_UPNP_constant_UPNP_RESULT_UNKNOWN_ERROR: + +enum **UPNPResult**: + +- **UPNP_RESULT_SUCCESS** = **0** --- UPNP command or discovery was successful. + +- **UPNP_RESULT_NOT_AUTHORIZED** = **1** --- Not authorized to use the command on the :ref:`UPNPDevice`. May be returned when the user disabled UPNP on their router. + +- **UPNP_RESULT_PORT_MAPPING_NOT_FOUND** = **2** --- No port mapping was found for the given port, protocol combination on the given :ref:`UPNPDevice`. + +- **UPNP_RESULT_INCONSISTENT_PARAMETERS** = **3** --- Inconsistent parameters. + +- **UPNP_RESULT_NO_SUCH_ENTRY_IN_ARRAY** = **4** --- No such entry in array. May be returned if a given port, protocol combination is not found on an :ref:`UPNPDevice`. + +- **UPNP_RESULT_ACTION_FAILED** = **5** --- The action failed. + +- **UPNP_RESULT_SRC_IP_WILDCARD_NOT_PERMITTED** = **6** --- The :ref:`UPNPDevice` does not allow wildcard values for the source IP address. + +- **UPNP_RESULT_EXT_PORT_WILDCARD_NOT_PERMITTED** = **7** --- The :ref:`UPNPDevice` does not allow wildcard values for the external port. + +- **UPNP_RESULT_INT_PORT_WILDCARD_NOT_PERMITTED** = **8** --- The :ref:`UPNPDevice` does not allow wildcard values for the internal port. + +- **UPNP_RESULT_REMOTE_HOST_MUST_BE_WILDCARD** = **9** --- The remote host value must be a wildcard. + +- **UPNP_RESULT_EXT_PORT_MUST_BE_WILDCARD** = **10** --- The external port value must be a wildcard. + +- **UPNP_RESULT_NO_PORT_MAPS_AVAILABLE** = **11** --- No port maps are available. May also be returned if port mapping functionality is not available. + +- **UPNP_RESULT_CONFLICT_WITH_OTHER_MECHANISM** = **12** --- Conflict with other mechanism. May be returned instead of :ref:`UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING` if a port mapping conflicts with an existing one. + +- **UPNP_RESULT_CONFLICT_WITH_OTHER_MAPPING** = **13** --- Conflict with an existing port mapping. + +- **UPNP_RESULT_SAME_PORT_VALUES_REQUIRED** = **14** --- External and internal port values must be the same. + +- **UPNP_RESULT_ONLY_PERMANENT_LEASE_SUPPORTED** = **15** --- Only permanent leases are supported. Do not use the ``duration`` parameter when adding port mappings. + +- **UPNP_RESULT_INVALID_GATEWAY** = **16** --- Invalid gateway. + +- **UPNP_RESULT_INVALID_PORT** = **17** --- Invalid port. + +- **UPNP_RESULT_INVALID_PROTOCOL** = **18** --- Invalid protocol. + +- **UPNP_RESULT_INVALID_DURATION** = **19** --- Invalid duration. + +- **UPNP_RESULT_INVALID_ARGS** = **20** --- Invalid arguments. + +- **UPNP_RESULT_INVALID_RESPONSE** = **21** --- Invalid response. + +- **UPNP_RESULT_INVALID_PARAM** = **22** --- Invalid parameter. + +- **UPNP_RESULT_HTTP_ERROR** = **23** --- HTTP error. + +- **UPNP_RESULT_SOCKET_ERROR** = **24** --- Socket error. + +- **UPNP_RESULT_MEM_ALLOC_ERROR** = **25** --- Error allocating memory. + +- **UPNP_RESULT_NO_GATEWAY** = **26** --- No gateway available. You may need to call :ref:`discover` first, or discovery didn't detect any valid IGDs (InternetGatewayDevices). + +- **UPNP_RESULT_NO_DEVICES** = **27** --- No devices available. You may need to call :ref:`discover` first, or discovery didn't detect any valid :ref:`UPNPDevice`\ s. + +- **UPNP_RESULT_UNKNOWN_ERROR** = **28** --- Unknown error. + +Property Descriptions +--------------------- + +.. _class_UPNP_property_discover_ipv6: + +- :ref:`bool` **discover_ipv6** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_discover_ipv6(value) | ++-----------+--------------------------+ +| *Getter* | is_discover_ipv6() | ++-----------+--------------------------+ + +If ``true``, IPv6 is used for :ref:`UPNPDevice` discovery. + +---- + +.. _class_UPNP_property_discover_local_port: + +- :ref:`int` **discover_local_port** + ++-----------+--------------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------------+ +| *Setter* | set_discover_local_port(value) | ++-----------+--------------------------------+ +| *Getter* | get_discover_local_port() | ++-----------+--------------------------------+ + +If ``0``, the local port to use for discovery is chosen automatically by the system. If ``1``, discovery will be done from the source port 1900 (same as destination port). Otherwise, the value will be used as the port. + +---- + +.. _class_UPNP_property_discover_multicast_if: + +- :ref:`String` **discover_multicast_if** + ++-----------+----------------------------------+ +| *Default* | ``""`` | ++-----------+----------------------------------+ +| *Setter* | set_discover_multicast_if(value) | ++-----------+----------------------------------+ +| *Getter* | get_discover_multicast_if() | ++-----------+----------------------------------+ + +Multicast interface to use for discovery. Uses the default multicast interface if empty. + +Method Descriptions +------------------- + +.. _class_UPNP_method_add_device: + +- void **add_device** **(** :ref:`UPNPDevice` device **)** + +Adds the given :ref:`UPNPDevice` to the list of discovered devices. + +---- + +.. _class_UPNP_method_add_port_mapping: + +- :ref:`int` **add_port_mapping** **(** :ref:`int` port, :ref:`int` port_internal=0, :ref:`String` desc="", :ref:`String` proto="UDP", :ref:`int` duration=0 **)** |const| + +Adds a mapping to forward the external ``port`` (between 1 and 65535) on the default gateway (see :ref:`get_gateway`) to the ``internal_port`` on the local machine for the given protocol ``proto`` (either ``TCP`` or ``UDP``, with UDP being the default). If a port mapping for the given port and protocol combination already exists on that gateway device, this method tries to overwrite it. If that is not desired, you can retrieve the gateway manually with :ref:`get_gateway` and call :ref:`add_port_mapping` on it, if any. + +If ``internal_port`` is ``0`` (the default), the same port number is used for both the external and the internal port (the ``port`` value). + +The description (``desc``) is shown in some router UIs and can be used to point out which application added the mapping. The mapping's lease duration can be limited by specifying a ``duration`` (in seconds). However, some routers are incompatible with one or both of these, so use with caution and add fallback logic in case of errors to retry without them if in doubt. + +See :ref:`UPNPResult` for possible return values. + +---- + +.. _class_UPNP_method_clear_devices: + +- void **clear_devices** **(** **)** + +Clears the list of discovered devices. + +---- + +.. _class_UPNP_method_delete_port_mapping: + +- :ref:`int` **delete_port_mapping** **(** :ref:`int` port, :ref:`String` proto="UDP" **)** |const| + +Deletes the port mapping for the given port and protocol combination on the default gateway (see :ref:`get_gateway`) if one exists. ``port`` must be a valid port between 1 and 65535, ``proto`` can be either ``TCP`` or ``UDP``. See :ref:`UPNPResult` for possible return values. + +---- + +.. _class_UPNP_method_discover: + +- :ref:`int` **discover** **(** :ref:`int` timeout=2000, :ref:`int` ttl=2, :ref:`String` device_filter="InternetGatewayDevice" **)** + +Discovers local :ref:`UPNPDevice`\ s. Clears the list of previously discovered devices. + +Filters for IGD (InternetGatewayDevice) type devices by default, as those manage port forwarding. ``timeout`` is the time to wait for responses in milliseconds. ``ttl`` is the time-to-live; only touch this if you know what you're doing. + +See :ref:`UPNPResult` for possible return values. + +---- + +.. _class_UPNP_method_get_device: + +- :ref:`UPNPDevice` **get_device** **(** :ref:`int` index **)** |const| + +Returns the :ref:`UPNPDevice` at the given ``index``. + +---- + +.. _class_UPNP_method_get_device_count: + +- :ref:`int` **get_device_count** **(** **)** |const| + +Returns the number of discovered :ref:`UPNPDevice`\ s. + +---- + +.. _class_UPNP_method_get_gateway: + +- :ref:`UPNPDevice` **get_gateway** **(** **)** |const| + +Returns the default gateway. That is the first discovered :ref:`UPNPDevice` that is also a valid IGD (InternetGatewayDevice). + +---- + +.. _class_UPNP_method_query_external_address: + +- :ref:`String` **query_external_address** **(** **)** |const| + +Returns the external :ref:`IP` address of the default gateway (see :ref:`get_gateway`) as string. Returns an empty string on error. + +---- + +.. _class_UPNP_method_remove_device: + +- void **remove_device** **(** :ref:`int` index **)** + +Removes the device at ``index`` from the list of discovered devices. + +---- + +.. _class_UPNP_method_set_device: + +- void **set_device** **(** :ref:`int` index, :ref:`UPNPDevice` device **)** + +Sets the device at ``index`` from the list of discovered devices to ``device``. + +.. |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.)` diff --git a/classes/class_upnpdevice.rst b/classes/class_upnpdevice.rst new file mode 100644 index 0000000..1aa5a87 --- /dev/null +++ b/classes/class_upnpdevice.rst @@ -0,0 +1,230 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the UPNPDevice.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_UPNPDevice: + +UPNPDevice +========== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +UPNP device. + +Description +----------- + +UPNP device. See :ref:`UPNP` for UPNP discovery and utility functions. Provides low-level access to UPNP control commands. Allows to manage port mappings (port forwarding) and to query network information of the device (like local and external IP address and status). Note that methods on this class are synchronous and block the calling thread. + +Properties +---------- + ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`description_url` | ``""`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`igd_control_url` | ``""`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`igd_our_addr` | ``""`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`igd_service_type` | ``""`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`IGDStatus` | :ref:`igd_status` | ``9`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`service_type` | ``""`` | ++---------------------------------------------+---------------------------------------------------------------------+--------+ + +Methods +------- + ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`add_port_mapping` **(** :ref:`int` port, :ref:`int` port_internal=0, :ref:`String` desc="", :ref:`String` proto="UDP", :ref:`int` duration=0 **)** |const| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`delete_port_mapping` **(** :ref:`int` port, :ref:`String` proto="UDP" **)** |const| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_gateway` **(** **)** |const| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`query_external_address` **(** **)** |const| | ++-----------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_UPNPDevice_IGDStatus: + +.. _class_UPNPDevice_constant_IGD_STATUS_OK: + +.. _class_UPNPDevice_constant_IGD_STATUS_HTTP_ERROR: + +.. _class_UPNPDevice_constant_IGD_STATUS_HTTP_EMPTY: + +.. _class_UPNPDevice_constant_IGD_STATUS_NO_URLS: + +.. _class_UPNPDevice_constant_IGD_STATUS_NO_IGD: + +.. _class_UPNPDevice_constant_IGD_STATUS_DISCONNECTED: + +.. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_DEVICE: + +.. _class_UPNPDevice_constant_IGD_STATUS_INVALID_CONTROL: + +.. _class_UPNPDevice_constant_IGD_STATUS_MALLOC_ERROR: + +.. _class_UPNPDevice_constant_IGD_STATUS_UNKNOWN_ERROR: + +enum **IGDStatus**: + +- **IGD_STATUS_OK** = **0** --- OK. + +- **IGD_STATUS_HTTP_ERROR** = **1** --- HTTP error. + +- **IGD_STATUS_HTTP_EMPTY** = **2** --- Empty HTTP response. + +- **IGD_STATUS_NO_URLS** = **3** --- Returned response contained no URLs. + +- **IGD_STATUS_NO_IGD** = **4** --- Not a valid IGD. + +- **IGD_STATUS_DISCONNECTED** = **5** --- Disconnected. + +- **IGD_STATUS_UNKNOWN_DEVICE** = **6** --- Unknown device. + +- **IGD_STATUS_INVALID_CONTROL** = **7** --- Invalid control. + +- **IGD_STATUS_MALLOC_ERROR** = **8** --- Memory allocation error. + +- **IGD_STATUS_UNKNOWN_ERROR** = **9** --- Unknown error. + +Property Descriptions +--------------------- + +.. _class_UPNPDevice_property_description_url: + +- :ref:`String` **description_url** + ++-----------+----------------------------+ +| *Default* | ``""`` | ++-----------+----------------------------+ +| *Setter* | set_description_url(value) | ++-----------+----------------------------+ +| *Getter* | get_description_url() | ++-----------+----------------------------+ + +URL to the device description. + +---- + +.. _class_UPNPDevice_property_igd_control_url: + +- :ref:`String` **igd_control_url** + ++-----------+----------------------------+ +| *Default* | ``""`` | ++-----------+----------------------------+ +| *Setter* | set_igd_control_url(value) | ++-----------+----------------------------+ +| *Getter* | get_igd_control_url() | ++-----------+----------------------------+ + +IDG control URL. + +---- + +.. _class_UPNPDevice_property_igd_our_addr: + +- :ref:`String` **igd_our_addr** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_igd_our_addr(value) | ++-----------+-------------------------+ +| *Getter* | get_igd_our_addr() | ++-----------+-------------------------+ + +Address of the local machine in the network connecting it to this ``UPNPDevice``. + +---- + +.. _class_UPNPDevice_property_igd_service_type: + +- :ref:`String` **igd_service_type** + ++-----------+-----------------------------+ +| *Default* | ``""`` | ++-----------+-----------------------------+ +| *Setter* | set_igd_service_type(value) | ++-----------+-----------------------------+ +| *Getter* | get_igd_service_type() | ++-----------+-----------------------------+ + +IGD service type. + +---- + +.. _class_UPNPDevice_property_igd_status: + +- :ref:`IGDStatus` **igd_status** + ++-----------+-----------------------+ +| *Default* | ``9`` | ++-----------+-----------------------+ +| *Setter* | set_igd_status(value) | ++-----------+-----------------------+ +| *Getter* | get_igd_status() | ++-----------+-----------------------+ + +IGD status. See :ref:`IGDStatus`. + +---- + +.. _class_UPNPDevice_property_service_type: + +- :ref:`String` **service_type** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_service_type(value) | ++-----------+-------------------------+ +| *Getter* | get_service_type() | ++-----------+-------------------------+ + +Service type. + +Method Descriptions +------------------- + +.. _class_UPNPDevice_method_add_port_mapping: + +- :ref:`int` **add_port_mapping** **(** :ref:`int` port, :ref:`int` port_internal=0, :ref:`String` desc="", :ref:`String` proto="UDP", :ref:`int` duration=0 **)** |const| + +Adds a port mapping to forward the given external port on this ``UPNPDevice`` for the given protocol to the local machine. See :ref:`UPNP.add_port_mapping`. + +---- + +.. _class_UPNPDevice_method_delete_port_mapping: + +- :ref:`int` **delete_port_mapping** **(** :ref:`int` port, :ref:`String` proto="UDP" **)** |const| + +Deletes the port mapping identified by the given port and protocol combination on this device. See :ref:`UPNP.delete_port_mapping`. + +---- + +.. _class_UPNPDevice_method_is_valid_gateway: + +- :ref:`bool` **is_valid_gateway** **(** **)** |const| + +Returns ``true`` if this is a valid IGD (InternetGatewayDevice) which potentially supports port forwarding. + +---- + +.. _class_UPNPDevice_method_query_external_address: + +- :ref:`String` **query_external_address** **(** **)** |const| + +Returns the external IP address of this ``UPNPDevice`` or an empty string. + +.. |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.)` diff --git a/classes/class_variant.rst b/classes/class_variant.rst new file mode 100644 index 0000000..708c05e --- /dev/null +++ b/classes/class_variant.rst @@ -0,0 +1,92 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Variant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Variant: + +Variant +======= + +The most important data type in Godot. + +Description +----------- + +In computer programming, a Variant class is a class that is designed to store a variety of other types. Dynamic programming languages like PHP, Lua, JavaScript and GDScript like to use them to store variables' data on the backend. With these Variants, properties are able to change value types freely. + +:: + + var foo = 2 # foo is dynamically an integer + foo = "Now foo is a string!" + foo = Reference.new() # foo is an Object + var bar: int = 2 # bar is a statically typed integer. + # bar = "Uh oh! I can't make static variables become a different type!" + +Godot tracks all scripting API variables within Variants. Without even realizing it, you use Variants all the time. When a particular language enforces its own rules for keeping data typed, then that language is applying its own custom logic over the base Variant scripting API. + +- GDScript automatically wrap values in them. It keeps all data in plain Variants by default and then optionally enforces custom static typing rules on variable types. + +- VisualScript tracks properties inside Variants as well, but it also uses static typing. The GUI interface enforces that properties have a particular type that doesn't change over time. + +- C# is statically typed, but uses the Mono ``object`` type in place of Godot's Variant class when it needs to represent a dynamic value. ``object`` is the Mono runtime's equivalent of the same concept. + +- The statically-typed language NativeScript C++ does not define a built-in Variant-like class. Godot's GDNative bindings provide their own godot::Variant class for users; Any point at which the C++ code starts interacting with the Godot runtime is a place where you might have to start wrapping data inside Variant objects. + +The global :ref:`@GDScript.typeof` function returns the enumerated value of the Variant type stored in the current variable (see :ref:`Variant.Type`). + +:: + + var foo = 2 + match typeof(foo): + TYPE_NIL: + print("foo is null") + TYPE_INTEGER: + print("foo is an integer") + TYPE_OBJECT: + # Note that Objects are their own special category. + # To get the name of the underlying Object type, you need the `get_class()` method. + print("foo is a(n) %s" % foo.get_class()) # inject the class name into a formatted string. + # Note also that there is not yet any way to get a script's `class_name` string easily. + # To fetch that value, you need to dig deeply into a hidden ProjectSettings setting: an Array of Dictionaries called "_global_script_classes". + # Open your project.godot file to see it up close. + +A Variant takes up only 20 bytes and can store almost any engine datatype inside of it. Variants are rarely used to hold information for long periods of time. Instead, they are used mainly for communication, editing, serialization and moving data around. + +Godot has specifically invested in making its Variant class as flexible as possible; so much so that it is used for a multitude of operations to facilitate communication between all of Godot's systems. + +A Variant: + +- Can store almost any datatype. + +- Can perform operations between many variants. GDScript uses Variant as its atomic/native datatype. + +- Can be hashed, so it can be compared quickly to other variants. + +- Can be used to convert safely between datatypes. + +- Can be used to abstract calling methods and their arguments. Godot exports all its functions through variants. + +- Can be used to defer calls or move data between threads. + +- Can be serialized as binary and stored to disk, or transferred via network. + +- Can be serialized to text and use it for printing values and editable settings. + +- Can work as an exported property, so the editor can edit it universally. + +- Can be used for dictionaries, arrays, parsers, etc. + +**Containers (Array and Dictionary):** Both are implemented using variants. A :ref:`Dictionary` can match any datatype used as key to any other datatype. An :ref:`Array` just holds an array of Variants. Of course, a Variant can also hold a :ref:`Dictionary` and an :ref:`Array` inside, making it even more flexible. + +Modifications to a container will modify all references to it. A :ref:`Mutex` should be created to lock it if multi-threaded access is desired. + +Tutorials +--------- + +- :doc:`../development/cpp/variant_class` + +.. |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.)` diff --git a/classes/class_vboxcontainer.rst b/classes/class_vboxcontainer.rst new file mode 100644 index 0000000..45c2ee2 --- /dev/null +++ b/classes/class_vboxcontainer.rst @@ -0,0 +1,50 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VBoxContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VBoxContainer: + +VBoxContainer +============= + +**Inherits:** :ref:`BoxContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`FileSystemDock` + +Vertical box container. + +Description +----------- + +Vertical box container. See :ref:`BoxContainer`. + +Tutorials +--------- + +- `3D Voxel Demo `__ + +Theme Properties +---------------- + ++-----------------------+------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`separation` | ``4`` | ++-----------------------+------------------------------------------------------------------+-------+ + +Theme Property Descriptions +--------------------------- + +.. _class_VBoxContainer_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The vertical space between the ``VBoxContainer``'s elements. + +.. |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.)` diff --git a/classes/class_vector2.rst b/classes/class_vector2.rst new file mode 100644 index 0000000..a98e42e --- /dev/null +++ b/classes/class_vector2.rst @@ -0,0 +1,479 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Vector2.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Vector2: + +Vector2 +======= + +Vector used for 2D math. + +Description +----------- + +2-element structure that can be used to represent positions in 2D space or any other pair of numeric values. + +**Note:** In a boolean context, a Vector2 will evaluate to ``false`` if it's equal to ``Vector2(0, 0)``. Otherwise, a Vector2 will always evaluate to ``true``. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + +- `3Blue1Brown Essence of Linear Algebra `__ + +- `Matrix Transform Demo `__ + +- `All 2D Demos `__ + +Properties +---------- + ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`x` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`y` | ``0.0`` | ++---------------------------+------------------------------------+---------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`Vector2` **(** :ref:`float` x, :ref:`float` y **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`abs` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to_point` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`aspect` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`bounce` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`ceil` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`clamped` **(** :ref:`float` length **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`cross` **(** :ref:`Vector2` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`cubic_interpolate` **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`direction_to` **(** :ref:`Vector2` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector2` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Vector2` with **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`floor` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector2` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`linear_interpolate` **(** :ref:`Vector2` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`move_toward` **(** :ref:`Vector2` to, :ref:`float` delta **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`posmod` **(** :ref:`float` mod **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`posmodv` **(** :ref:`Vector2` modv **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`project` **(** :ref:`Vector2` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`reflect` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`rotated` **(** :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`round` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`sign` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`slerp` **(** :ref:`Vector2` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`slide` **(** :ref:`Vector2` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`snapped` **(** :ref:`Vector2` by **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`tangent` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Vector2_constant_AXIS_X: + +.. _class_Vector2_constant_AXIS_Y: + +.. _class_Vector2_constant_ZERO: + +.. _class_Vector2_constant_ONE: + +.. _class_Vector2_constant_INF: + +.. _class_Vector2_constant_LEFT: + +.. _class_Vector2_constant_RIGHT: + +.. _class_Vector2_constant_UP: + +.. _class_Vector2_constant_DOWN: + +- **AXIS_X** = **0** --- Enumerated value for the X axis. + +- **AXIS_Y** = **1** --- Enumerated value for the Y axis. + +- **ZERO** = **Vector2( 0, 0 )** --- Zero vector, a vector with all components set to ``0``. + +- **ONE** = **Vector2( 1, 1 )** --- One vector, a vector with all components set to ``1``. + +- **INF** = **Vector2( inf, inf )** --- Infinity vector, a vector with all components set to :ref:`@GDScript.INF`. + +- **LEFT** = **Vector2( -1, 0 )** --- Left unit vector. Represents the direction of left. + +- **RIGHT** = **Vector2( 1, 0 )** --- Right unit vector. Represents the direction of right. + +- **UP** = **Vector2( 0, -1 )** --- Up unit vector. Y is down in 2D, so this vector points -Y. + +- **DOWN** = **Vector2( 0, 1 )** --- Down unit vector. Y is down in 2D, so this vector points +Y. + +Property Descriptions +--------------------- + +.. _class_Vector2_property_x: + +- :ref:`float` **x** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The vector's X component. Also accessible by using the index position ``[0]``. + +---- + +.. _class_Vector2_property_y: + +- :ref:`float` **y** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The vector's Y component. Also accessible by using the index position ``[1]``. + +Method Descriptions +------------------- + +.. _class_Vector2_method_Vector2: + +- :ref:`Vector2` **Vector2** **(** :ref:`float` x, :ref:`float` y **)** + +Constructs a new Vector2 from the given ``x`` and ``y``. + +---- + +.. _class_Vector2_method_abs: + +- :ref:`Vector2` **abs** **(** **)** + +Returns a new vector with all components in absolute values (i.e. positive). + +---- + +.. _class_Vector2_method_angle: + +- :ref:`float` **angle** **(** **)** + +Returns this vector's angle with respect to the positive X axis, or ``(1, 0)`` vector, in radians. + +For example, ``Vector2.RIGHT.angle()`` will return zero, ``Vector2.DOWN.angle()`` will return ``PI / 2`` (a quarter turn, or 90 degrees), and ``Vector2(1, -1).angle()`` will return ``-PI / 4`` (a negative eighth turn, or -45 degrees). + +`Illustration of the returned angle. `__ + +Equivalent to the result of :ref:`@GDScript.atan2` when called with the vector's :ref:`y` and :ref:`x` as parameters: ``atan2(y, x)``. + +---- + +.. _class_Vector2_method_angle_to: + +- :ref:`float` **angle_to** **(** :ref:`Vector2` to **)** + +Returns the angle to the given vector, in radians. + +`Illustration of the returned angle. `__ + +---- + +.. _class_Vector2_method_angle_to_point: + +- :ref:`float` **angle_to_point** **(** :ref:`Vector2` to **)** + +Returns the angle between the line connecting the two points and the X axis, in radians. + +`Illustration of the returned angle. `__ + +---- + +.. _class_Vector2_method_aspect: + +- :ref:`float` **aspect** **(** **)** + +Returns the aspect ratio of this vector, the ratio of :ref:`x` to :ref:`y`. + +---- + +.. _class_Vector2_method_bounce: + +- :ref:`Vector2` **bounce** **(** :ref:`Vector2` n **)** + +Returns the vector "bounced off" from a plane defined by the given normal. + +---- + +.. _class_Vector2_method_ceil: + +- :ref:`Vector2` **ceil** **(** **)** + +Returns the vector with all components rounded up (towards positive infinity). + +---- + +.. _class_Vector2_method_clamped: + +- :ref:`Vector2` **clamped** **(** :ref:`float` length **)** + +Returns the vector with a maximum length by limiting its length to ``length``. + +---- + +.. _class_Vector2_method_cross: + +- :ref:`float` **cross** **(** :ref:`Vector2` with **)** + +Returns the cross product of this vector and ``with``. + +---- + +.. _class_Vector2_method_cubic_interpolate: + +- :ref:`Vector2` **cubic_interpolate** **(** :ref:`Vector2` b, :ref:`Vector2` pre_a, :ref:`Vector2` post_b, :ref:`float` weight **)** + +Cubically interpolates between this vector and ``b`` using ``pre_a`` and ``post_b`` as handles, and returns the result at position ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +---- + +.. _class_Vector2_method_direction_to: + +- :ref:`Vector2` **direction_to** **(** :ref:`Vector2` b **)** + +Returns the normalized vector pointing from this vector to ``b``. This is equivalent to using ``(b - a).normalized()``. + +---- + +.. _class_Vector2_method_distance_squared_to: + +- :ref:`float` **distance_squared_to** **(** :ref:`Vector2` to **)** + +Returns the squared distance between this vector and ``b``. + +This method runs faster than :ref:`distance_to`, so prefer it if you need to compare vectors or need the squared distance for some formula. + +---- + +.. _class_Vector2_method_distance_to: + +- :ref:`float` **distance_to** **(** :ref:`Vector2` to **)** + +Returns the distance between this vector and ``to``. + +---- + +.. _class_Vector2_method_dot: + +- :ref:`float` **dot** **(** :ref:`Vector2` with **)** + +Returns the dot product of this vector and ``with``. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player. + +The dot product will be ``0`` for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees. + +When using unit (normalized) vectors, the result will always be between ``-1.0`` (180 degree angle) when the vectors are facing opposite directions, and ``1.0`` (0 degree angle) when the vectors are aligned. + +**Note:** ``a.dot(b)`` is equivalent to ``b.dot(a)``. + +---- + +.. _class_Vector2_method_floor: + +- :ref:`Vector2` **floor** **(** **)** + +Returns the vector with all components rounded down (towards negative infinity). + +---- + +.. _class_Vector2_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Vector2` v **)** + +Returns ``true`` if this vector and ``v`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_Vector2_method_is_normalized: + +- :ref:`bool` **is_normalized** **(** **)** + +Returns ``true`` if the vector is normalized, ``false`` otherwise. + +---- + +.. _class_Vector2_method_length: + +- :ref:`float` **length** **(** **)** + +Returns the length (magnitude) of this vector. + +---- + +.. _class_Vector2_method_length_squared: + +- :ref:`float` **length_squared** **(** **)** + +Returns the squared length (squared magnitude) of this vector. + +This method runs faster than :ref:`length`, so prefer it if you need to compare vectors or need the squared distance for some formula. + +---- + +.. _class_Vector2_method_linear_interpolate: + +- :ref:`Vector2` **linear_interpolate** **(** :ref:`Vector2` to, :ref:`float` weight **)** + +Returns the result of the linear interpolation between this vector and ``to`` by amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +---- + +.. _class_Vector2_method_move_toward: + +- :ref:`Vector2` **move_toward** **(** :ref:`Vector2` to, :ref:`float` delta **)** + +Moves the vector toward ``to`` by the fixed ``delta`` amount. + +---- + +.. _class_Vector2_method_normalized: + +- :ref:`Vector2` **normalized** **(** **)** + +Returns the vector scaled to unit length. Equivalent to ``v / v.length()``. + +---- + +.. _class_Vector2_method_posmod: + +- :ref:`Vector2` **posmod** **(** :ref:`float` mod **)** + +Returns a vector composed of the :ref:`@GDScript.fposmod` of this vector's components and ``mod``. + +---- + +.. _class_Vector2_method_posmodv: + +- :ref:`Vector2` **posmodv** **(** :ref:`Vector2` modv **)** + +Returns a vector composed of the :ref:`@GDScript.fposmod` of this vector's components and ``modv``'s components. + +---- + +.. _class_Vector2_method_project: + +- :ref:`Vector2` **project** **(** :ref:`Vector2` b **)** + +Returns the vector projected onto the vector ``b``. + +---- + +.. _class_Vector2_method_reflect: + +- :ref:`Vector2` **reflect** **(** :ref:`Vector2` n **)** + +Returns the vector reflected (i.e. mirrored, or symmetric) over a line defined by the given direction vector ``n``. + +---- + +.. _class_Vector2_method_rotated: + +- :ref:`Vector2` **rotated** **(** :ref:`float` phi **)** + +Returns the vector rotated by ``phi`` radians. See also :ref:`@GDScript.deg2rad`. + +---- + +.. _class_Vector2_method_round: + +- :ref:`Vector2` **round** **(** **)** + +Returns the vector with all components rounded to the nearest integer, with halfway cases rounded away from zero. + +---- + +.. _class_Vector2_method_sign: + +- :ref:`Vector2` **sign** **(** **)** + +Returns the vector with each component set to one or negative one, depending on the signs of the components. If a component is zero, it returns positive one. + +---- + +.. _class_Vector2_method_slerp: + +- :ref:`Vector2` **slerp** **(** :ref:`Vector2` to, :ref:`float` weight **)** + +Returns the result of spherical linear interpolation between this vector and ``to``, by amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +**Note:** Both vectors must be normalized. + +---- + +.. _class_Vector2_method_slide: + +- :ref:`Vector2` **slide** **(** :ref:`Vector2` n **)** + +Returns this vector slid along a plane defined by the given normal. + +---- + +.. _class_Vector2_method_snapped: + +- :ref:`Vector2` **snapped** **(** :ref:`Vector2` by **)** + +Returns this vector with each component snapped to the nearest multiple of ``step``. This can also be used to round to an arbitrary number of decimals. + +---- + +.. _class_Vector2_method_tangent: + +- :ref:`Vector2` **tangent** **(** **)** + +Returns a perpendicular vector rotated 90 degrees counter-clockwise compared to the original, with the same length. + +.. |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.)` diff --git a/classes/class_vector3.rst b/classes/class_vector3.rst new file mode 100644 index 0000000..d46c617 --- /dev/null +++ b/classes/class_vector3.rst @@ -0,0 +1,507 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Vector3.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Vector3: + +Vector3 +======= + +Vector used for 3D math. + +Description +----------- + +3-element structure that can be used to represent positions in 3D space or any other pair of numeric values. + +**Note:** In a boolean context, a Vector3 will evaluate to ``false`` if it's equal to ``Vector3(0, 0, 0)``. Otherwise, a Vector3 will always evaluate to ``true``. + +Tutorials +--------- + +- :doc:`../tutorials/math/index` + +- :doc:`../tutorials/math/vector_math` + +- :doc:`../tutorials/math/vectors_advanced` + +- `3Blue1Brown Essence of Linear Algebra `__ + +- `Matrix Transform Demo `__ + +- `All 3D Demos `__ + +Properties +---------- + ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`x` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`y` | ``0.0`` | ++---------------------------+------------------------------------+---------+ +| :ref:`float` | :ref:`z` | ``0.0`` | ++---------------------------+------------------------------------+---------+ + +Methods +------- + ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`Vector3` **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`abs` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`angle_to` **(** :ref:`Vector3` to **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`bounce` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`ceil` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`cross` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`cubic_interpolate` **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`direction_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_squared_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`distance_to` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`dot` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`floor` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`inverse` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_equal_approx` **(** :ref:`Vector3` v **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`length_squared` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`linear_interpolate` **(** :ref:`Vector3` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`max_axis` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`min_axis` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`move_toward` **(** :ref:`Vector3` to, :ref:`float` delta **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`normalized` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`outer` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`posmod` **(** :ref:`float` mod **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`posmodv` **(** :ref:`Vector3` modv **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`project` **(** :ref:`Vector3` b **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`reflect` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`rotated` **(** :ref:`Vector3` axis, :ref:`float` phi **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`round` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`sign` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`signed_angle_to` **(** :ref:`Vector3` to, :ref:`Vector3` axis **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`slerp` **(** :ref:`Vector3` to, :ref:`float` weight **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`slide` **(** :ref:`Vector3` n **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector3` | :ref:`snapped` **(** :ref:`Vector3` by **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Basis` | :ref:`to_diagonal_matrix` **(** **)** | ++-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Constants +--------- + +.. _class_Vector3_constant_AXIS_X: + +.. _class_Vector3_constant_AXIS_Y: + +.. _class_Vector3_constant_AXIS_Z: + +.. _class_Vector3_constant_ZERO: + +.. _class_Vector3_constant_ONE: + +.. _class_Vector3_constant_INF: + +.. _class_Vector3_constant_LEFT: + +.. _class_Vector3_constant_RIGHT: + +.. _class_Vector3_constant_UP: + +.. _class_Vector3_constant_DOWN: + +.. _class_Vector3_constant_FORWARD: + +.. _class_Vector3_constant_BACK: + +- **AXIS_X** = **0** --- Enumerated value for the X axis. Returned by :ref:`max_axis` and :ref:`min_axis`. + +- **AXIS_Y** = **1** --- Enumerated value for the Y axis. Returned by :ref:`max_axis` and :ref:`min_axis`. + +- **AXIS_Z** = **2** --- Enumerated value for the Z axis. Returned by :ref:`max_axis` and :ref:`min_axis`. + +- **ZERO** = **Vector3( 0, 0, 0 )** --- Zero vector, a vector with all components set to ``0``. + +- **ONE** = **Vector3( 1, 1, 1 )** --- One vector, a vector with all components set to ``1``. + +- **INF** = **Vector3( inf, inf, inf )** --- Infinity vector, a vector with all components set to :ref:`@GDScript.INF`. + +- **LEFT** = **Vector3( -1, 0, 0 )** --- Left unit vector. Represents the local direction of left, and the global direction of west. + +- **RIGHT** = **Vector3( 1, 0, 0 )** --- Right unit vector. Represents the local direction of right, and the global direction of east. + +- **UP** = **Vector3( 0, 1, 0 )** --- Up unit vector. + +- **DOWN** = **Vector3( 0, -1, 0 )** --- Down unit vector. + +- **FORWARD** = **Vector3( 0, 0, -1 )** --- Forward unit vector. Represents the local direction of forward, and the global direction of north. + +- **BACK** = **Vector3( 0, 0, 1 )** --- Back unit vector. Represents the local direction of back, and the global direction of south. + +Property Descriptions +--------------------- + +.. _class_Vector3_property_x: + +- :ref:`float` **x** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The vector's X component. Also accessible by using the index position ``[0]``. + +---- + +.. _class_Vector3_property_y: + +- :ref:`float` **y** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The vector's Y component. Also accessible by using the index position ``[1]``. + +---- + +.. _class_Vector3_property_z: + +- :ref:`float` **z** + ++-----------+---------+ +| *Default* | ``0.0`` | ++-----------+---------+ + +The vector's Z component. Also accessible by using the index position ``[2]``. + +Method Descriptions +------------------- + +.. _class_Vector3_method_Vector3: + +- :ref:`Vector3` **Vector3** **(** :ref:`float` x, :ref:`float` y, :ref:`float` z **)** + +Returns a Vector3 with the given components. + +---- + +.. _class_Vector3_method_abs: + +- :ref:`Vector3` **abs** **(** **)** + +Returns a new vector with all components in absolute values (i.e. positive). + +---- + +.. _class_Vector3_method_angle_to: + +- :ref:`float` **angle_to** **(** :ref:`Vector3` to **)** + +Returns the unsigned minimum angle to the given vector, in radians. + +---- + +.. _class_Vector3_method_bounce: + +- :ref:`Vector3` **bounce** **(** :ref:`Vector3` n **)** + +Returns the vector "bounced off" from a plane defined by the given normal. + +---- + +.. _class_Vector3_method_ceil: + +- :ref:`Vector3` **ceil** **(** **)** + +Returns a new vector with all components rounded up (towards positive infinity). + +---- + +.. _class_Vector3_method_cross: + +- :ref:`Vector3` **cross** **(** :ref:`Vector3` b **)** + +Returns the cross product of this vector and ``b``. + +---- + +.. _class_Vector3_method_cubic_interpolate: + +- :ref:`Vector3` **cubic_interpolate** **(** :ref:`Vector3` b, :ref:`Vector3` pre_a, :ref:`Vector3` post_b, :ref:`float` weight **)** + +Performs a cubic interpolation between vectors ``pre_a``, ``a``, ``b``, ``post_b`` (``a`` is current), by the given amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +---- + +.. _class_Vector3_method_direction_to: + +- :ref:`Vector3` **direction_to** **(** :ref:`Vector3` b **)** + +Returns the normalized vector pointing from this vector to ``b``. This is equivalent to using ``(b - a).normalized()``. + +---- + +.. _class_Vector3_method_distance_squared_to: + +- :ref:`float` **distance_squared_to** **(** :ref:`Vector3` b **)** + +Returns the squared distance between this vector and ``b``. + +This method runs faster than :ref:`distance_to`, so prefer it if you need to compare vectors or need the squared distance for some formula. + +---- + +.. _class_Vector3_method_distance_to: + +- :ref:`float` **distance_to** **(** :ref:`Vector3` b **)** + +Returns the distance between this vector and ``b``. + +---- + +.. _class_Vector3_method_dot: + +- :ref:`float` **dot** **(** :ref:`Vector3` b **)** + +Returns the dot product of this vector and ``b``. This can be used to compare the angle between two vectors. For example, this can be used to determine whether an enemy is facing the player. + +The dot product will be ``0`` for a straight angle (90 degrees), greater than 0 for angles narrower than 90 degrees and lower than 0 for angles wider than 90 degrees. + +When using unit (normalized) vectors, the result will always be between ``-1.0`` (180 degree angle) when the vectors are facing opposite directions, and ``1.0`` (0 degree angle) when the vectors are aligned. + +**Note:** ``a.dot(b)`` is equivalent to ``b.dot(a)``. + +---- + +.. _class_Vector3_method_floor: + +- :ref:`Vector3` **floor** **(** **)** + +Returns a new vector with all components rounded down (towards negative infinity). + +---- + +.. _class_Vector3_method_inverse: + +- :ref:`Vector3` **inverse** **(** **)** + +Returns the inverse of the vector. This is the same as ``Vector3( 1.0 / v.x, 1.0 / v.y, 1.0 / v.z )``. + +---- + +.. _class_Vector3_method_is_equal_approx: + +- :ref:`bool` **is_equal_approx** **(** :ref:`Vector3` v **)** + +Returns ``true`` if this vector and ``v`` are approximately equal, by running :ref:`@GDScript.is_equal_approx` on each component. + +---- + +.. _class_Vector3_method_is_normalized: + +- :ref:`bool` **is_normalized** **(** **)** + +Returns ``true`` if the vector is normalized, ``false`` otherwise. + +---- + +.. _class_Vector3_method_length: + +- :ref:`float` **length** **(** **)** + +Returns the length (magnitude) of this vector. + +---- + +.. _class_Vector3_method_length_squared: + +- :ref:`float` **length_squared** **(** **)** + +Returns the squared length (squared magnitude) of this vector. + +This method runs faster than :ref:`length`, so prefer it if you need to compare vectors or need the squared distance for some formula. + +---- + +.. _class_Vector3_method_linear_interpolate: + +- :ref:`Vector3` **linear_interpolate** **(** :ref:`Vector3` to, :ref:`float` weight **)** + +Returns the result of the linear interpolation between this vector and ``to`` by amount ``t``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +---- + +.. _class_Vector3_method_max_axis: + +- :ref:`int` **max_axis** **(** **)** + +Returns the axis of the vector's largest value. See ``AXIS_*`` constants. If all components are equal, this method returns :ref:`AXIS_X`. + +---- + +.. _class_Vector3_method_min_axis: + +- :ref:`int` **min_axis** **(** **)** + +Returns the axis of the vector's smallest value. See ``AXIS_*`` constants. If all components are equal, this method returns :ref:`AXIS_Z`. + +---- + +.. _class_Vector3_method_move_toward: + +- :ref:`Vector3` **move_toward** **(** :ref:`Vector3` to, :ref:`float` delta **)** + +Moves this vector toward ``to`` by the fixed ``delta`` amount. + +---- + +.. _class_Vector3_method_normalized: + +- :ref:`Vector3` **normalized** **(** **)** + +Returns the vector scaled to unit length. Equivalent to ``v / v.length()``. + +---- + +.. _class_Vector3_method_outer: + +- :ref:`Basis` **outer** **(** :ref:`Vector3` b **)** + +Returns the outer product with ``b``. + +---- + +.. _class_Vector3_method_posmod: + +- :ref:`Vector3` **posmod** **(** :ref:`float` mod **)** + +Returns a vector composed of the :ref:`@GDScript.fposmod` of this vector's components and ``mod``. + +---- + +.. _class_Vector3_method_posmodv: + +- :ref:`Vector3` **posmodv** **(** :ref:`Vector3` modv **)** + +Returns a vector composed of the :ref:`@GDScript.fposmod` of this vector's components and ``modv``'s components. + +---- + +.. _class_Vector3_method_project: + +- :ref:`Vector3` **project** **(** :ref:`Vector3` b **)** + +Returns this vector projected onto another vector ``b``. + +---- + +.. _class_Vector3_method_reflect: + +- :ref:`Vector3` **reflect** **(** :ref:`Vector3` n **)** + +Returns this vector reflected from a plane defined by the given normal. + +---- + +.. _class_Vector3_method_rotated: + +- :ref:`Vector3` **rotated** **(** :ref:`Vector3` axis, :ref:`float` phi **)** + +Rotates this vector around a given axis by ``phi`` radians. The axis must be a normalized vector. + +---- + +.. _class_Vector3_method_round: + +- :ref:`Vector3` **round** **(** **)** + +Returns this vector with all components rounded to the nearest integer, with halfway cases rounded away from zero. + +---- + +.. _class_Vector3_method_sign: + +- :ref:`Vector3` **sign** **(** **)** + +Returns a vector with each component set to one or negative one, depending on the signs of this vector's components. If a component is zero, it returns positive one. + +---- + +.. _class_Vector3_method_signed_angle_to: + +- :ref:`float` **signed_angle_to** **(** :ref:`Vector3` to, :ref:`Vector3` axis **)** + +Returns the signed angle to the given vector, in radians. The sign of the angle is positive in a counter-clockwise direction and negative in a clockwise direction when viewed from the side specified by the ``axis``. + +---- + +.. _class_Vector3_method_slerp: + +- :ref:`Vector3` **slerp** **(** :ref:`Vector3` to, :ref:`float` weight **)** + +Returns the result of spherical linear interpolation between this vector and ``to``, by amount ``weight``. ``weight`` is on the range of 0.0 to 1.0, representing the amount of interpolation. + +**Note:** Both vectors must be normalized. + +---- + +.. _class_Vector3_method_slide: + +- :ref:`Vector3` **slide** **(** :ref:`Vector3` n **)** + +Returns this vector slid along a plane defined by the given normal. + +---- + +.. _class_Vector3_method_snapped: + +- :ref:`Vector3` **snapped** **(** :ref:`Vector3` by **)** + +Returns this vector with each component snapped to the nearest multiple of ``step``. This can also be used to round to an arbitrary number of decimals. + +---- + +.. _class_Vector3_method_to_diagonal_matrix: + +- :ref:`Basis` **to_diagonal_matrix** **(** **)** + +Returns a diagonal matrix with the vector as main diagonal. + +This is equivalent to a Basis with no rotation or shearing and this vector's components set as the scale. + +.. |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.)` diff --git a/classes/class_vehiclebody.rst b/classes/class_vehiclebody.rst new file mode 100644 index 0000000..6052e42 --- /dev/null +++ b/classes/class_vehiclebody.rst @@ -0,0 +1,100 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VehicleBody.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VehicleBody: + +VehicleBody +=========== + +**Inherits:** :ref:`RigidBody` **<** :ref:`PhysicsBody` **<** :ref:`CollisionObject` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Physics body that simulates the behavior of a car. + +Description +----------- + +This node implements all the physics logic needed to simulate a car. It is based on the raycast vehicle system commonly found in physics engines. You will need to add a :ref:`CollisionShape` for the main body of your vehicle and add :ref:`VehicleWheel` nodes for the wheels. You should also add a :ref:`MeshInstance` to this node for the 3D model of your car but this model should not include meshes for the wheels. You should control the vehicle by using the :ref:`brake`, :ref:`engine_force`, and :ref:`steering` properties and not change the position or orientation of this node directly. + +**Note:** The origin point of your VehicleBody will determine the center of gravity of your vehicle so it is better to keep this low and move the :ref:`CollisionShape` and :ref:`MeshInstance` upwards. + +**Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another :ref:`PhysicsBody` class. + +Tutorials +--------- + +- `3D Truck Town Demo `__ + +Properties +---------- + ++---------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`brake` | ``0.0`` | ++---------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`engine_force` | ``0.0`` | ++---------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`float` | mass | ``40.0`` *(parent override)* | ++---------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`float` | :ref:`steering` | ``0.0`` | ++---------------------------+--------------------------------------------------------------+-------------------------------+ +| :ref:`float` | weight | ``392.0`` *(parent override)* | ++---------------------------+--------------------------------------------------------------+-------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VehicleBody_property_brake: + +- :ref:`float` **brake** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_brake(value) | ++-----------+------------------+ +| *Getter* | get_brake() | ++-----------+------------------+ + +Slows down the vehicle by applying a braking force. The vehicle is only slowed down if the wheels are in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the :ref:`RigidBody.mass` of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. + +---- + +.. _class_VehicleBody_property_engine_force: + +- :ref:`float` **engine_force** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_engine_force(value) | ++-----------+-------------------------+ +| *Getter* | get_engine_force() | ++-----------+-------------------------+ + +Accelerates the vehicle by applying an engine force. The vehicle is only speed up if the wheels that have :ref:`VehicleWheel.use_as_traction` set to ``true`` and are in contact with a surface. The :ref:`RigidBody.mass` of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + +**Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. + +A negative value will result in the vehicle reversing. + +---- + +.. _class_VehicleBody_property_steering: + +- :ref:`float` **steering** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_steering(value) | ++-----------+---------------------+ +| *Getter* | get_steering() | ++-----------+---------------------+ + +The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have :ref:`VehicleWheel.use_as_steering` set to ``true`` will automatically be rotated. + +.. |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.)` diff --git a/classes/class_vehiclewheel.rst b/classes/class_vehiclewheel.rst new file mode 100644 index 0000000..0891c0a --- /dev/null +++ b/classes/class_vehiclewheel.rst @@ -0,0 +1,330 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VehicleWheel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VehicleWheel: + +VehicleWheel +============ + +**Inherits:** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Physics object that simulates the behavior of a wheel. + +Description +----------- + +This node needs to be used as a child node of :ref:`VehicleBody` and simulates the behavior of one of its wheels. This node also acts as a collider to detect if the wheel is touching a surface. + +**Note:** This class has known issues and isn't designed to provide realistic 3D vehicle physics. If you want advanced vehicle physics, you will probably have to write your own physics integration using another :ref:`PhysicsBody` class. + +Tutorials +--------- + +- `3D Truck Town Demo `__ + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`brake` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`damping_compression` | ``0.83`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`damping_relaxation` | ``0.88`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`engine_force` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`steering` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`suspension_max_force` | ``6000.0`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`suspension_stiffness` | ``5.88`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`suspension_travel` | ``5.0`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`bool` | :ref:`use_as_steering` | ``false`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`bool` | :ref:`use_as_traction` | ``false`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`wheel_friction_slip` | ``10.5`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`wheel_radius` | ``0.5`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`wheel_rest_length` | ``0.15`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ +| :ref:`float` | :ref:`wheel_roll_influence` | ``0.1`` | ++---------------------------+-------------------------------------------------------------------------------+------------+ + +Methods +------- + ++---------------------------+-----------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_rpm` **(** **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`get_skidinfo` **(** **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_in_contact` **(** **)** |const| | ++---------------------------+-----------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VehicleWheel_property_brake: + +- :ref:`float` **brake** + ++-----------+------------------+ +| *Default* | ``0.0`` | ++-----------+------------------+ +| *Setter* | set_brake(value) | ++-----------+------------------+ +| *Getter* | get_brake() | ++-----------+------------------+ + +Slows down the wheel by applying a braking force. The wheel is only slowed down if it is in contact with a surface. The force you need to apply to adequately slow down your vehicle depends on the :ref:`RigidBody.mass` of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 30 range for hard braking. + +---- + +.. _class_VehicleWheel_property_damping_compression: + +- :ref:`float` **damping_compression** + ++-----------+--------------------------------+ +| *Default* | ``0.83`` | ++-----------+--------------------------------+ +| *Setter* | set_damping_compression(value) | ++-----------+--------------------------------+ +| *Getter* | get_damping_compression() | ++-----------+--------------------------------+ + +The damping applied to the spring when the spring is being compressed. This value should be between 0.0 (no damping) and 1.0. A value of 0.0 means the car will keep bouncing as the spring keeps its energy. A good value for this is around 0.3 for a normal car, 0.5 for a race car. + +---- + +.. _class_VehicleWheel_property_damping_relaxation: + +- :ref:`float` **damping_relaxation** + ++-----------+-------------------------------+ +| *Default* | ``0.88`` | ++-----------+-------------------------------+ +| *Setter* | set_damping_relaxation(value) | ++-----------+-------------------------------+ +| *Getter* | get_damping_relaxation() | ++-----------+-------------------------------+ + +The damping applied to the spring when relaxing. This value should be between 0.0 (no damping) and 1.0. This value should always be slightly higher than the :ref:`damping_compression` property. For a :ref:`damping_compression` value of 0.3, try a relaxation value of 0.5. + +---- + +.. _class_VehicleWheel_property_engine_force: + +- :ref:`float` **engine_force** + ++-----------+-------------------------+ +| *Default* | ``0.0`` | ++-----------+-------------------------+ +| *Setter* | set_engine_force(value) | ++-----------+-------------------------+ +| *Getter* | get_engine_force() | ++-----------+-------------------------+ + +Accelerates the wheel by applying an engine force. The wheel is only speed up if it is in contact with a surface. The :ref:`RigidBody.mass` of the vehicle has an effect on the acceleration of the vehicle. For a vehicle with a mass set to 1000, try a value in the 25 - 50 range for acceleration. + +**Note:** The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. + +A negative value will result in the wheel reversing. + +---- + +.. _class_VehicleWheel_property_steering: + +- :ref:`float` **steering** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_steering(value) | ++-----------+---------------------+ +| *Getter* | get_steering() | ++-----------+---------------------+ + +The steering angle for the wheel. Setting this to a non-zero value will result in the vehicle turning when it's moving. + +---- + +.. _class_VehicleWheel_property_suspension_max_force: + +- :ref:`float` **suspension_max_force** + ++-----------+---------------------------------+ +| *Default* | ``6000.0`` | ++-----------+---------------------------------+ +| *Setter* | set_suspension_max_force(value) | ++-----------+---------------------------------+ +| *Getter* | get_suspension_max_force() | ++-----------+---------------------------------+ + +The maximum force the spring can resist. This value should be higher than a quarter of the :ref:`RigidBody.mass` of the :ref:`VehicleBody` or the spring will not carry the weight of the vehicle. Good results are often obtained by a value that is about 3× to 4× this number. + +---- + +.. _class_VehicleWheel_property_suspension_stiffness: + +- :ref:`float` **suspension_stiffness** + ++-----------+---------------------------------+ +| *Default* | ``5.88`` | ++-----------+---------------------------------+ +| *Setter* | set_suspension_stiffness(value) | ++-----------+---------------------------------+ +| *Getter* | get_suspension_stiffness() | ++-----------+---------------------------------+ + +This value defines the stiffness of the suspension. Use a value lower than 50 for an off-road car, a value between 50 and 100 for a race car and try something around 200 for something like a Formula 1 car. + +---- + +.. _class_VehicleWheel_property_suspension_travel: + +- :ref:`float` **suspension_travel** + ++-----------+------------------------------+ +| *Default* | ``5.0`` | ++-----------+------------------------------+ +| *Setter* | set_suspension_travel(value) | ++-----------+------------------------------+ +| *Getter* | get_suspension_travel() | ++-----------+------------------------------+ + +This is the distance the suspension can travel. As Godot units are equivalent to meters, keep this setting relatively low. Try a value between 0.1 and 0.3 depending on the type of car. + +---- + +.. _class_VehicleWheel_property_use_as_steering: + +- :ref:`bool` **use_as_steering** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_use_as_steering(value) | ++-----------+----------------------------+ +| *Getter* | is_used_as_steering() | ++-----------+----------------------------+ + +If ``true``, this wheel will be turned when the car steers. This value is used in conjunction with :ref:`VehicleBody.steering` and ignored if you are using the per-wheel :ref:`steering` value instead. + +---- + +.. _class_VehicleWheel_property_use_as_traction: + +- :ref:`bool` **use_as_traction** + ++-----------+----------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------+ +| *Setter* | set_use_as_traction(value) | ++-----------+----------------------------+ +| *Getter* | is_used_as_traction() | ++-----------+----------------------------+ + +If ``true``, this wheel transfers engine force to the ground to propel the vehicle forward. This value is used in conjunction with :ref:`VehicleBody.engine_force` and ignored if you are using the per-wheel :ref:`engine_force` value instead. + +---- + +.. _class_VehicleWheel_property_wheel_friction_slip: + +- :ref:`float` **wheel_friction_slip** + ++-----------+--------------------------+ +| *Default* | ``10.5`` | ++-----------+--------------------------+ +| *Setter* | set_friction_slip(value) | ++-----------+--------------------------+ +| *Getter* | get_friction_slip() | ++-----------+--------------------------+ + +This determines how much grip this wheel has. It is combined with the friction setting of the surface the wheel is in contact with. 0.0 means no grip, 1.0 is normal grip. For a drift car setup, try setting the grip of the rear wheels slightly lower than the front wheels, or use a lower value to simulate tire wear. + +It's best to set this to 1.0 when starting out. + +---- + +.. _class_VehicleWheel_property_wheel_radius: + +- :ref:`float` **wheel_radius** + ++-----------+-------------------+ +| *Default* | ``0.5`` | ++-----------+-------------------+ +| *Setter* | set_radius(value) | ++-----------+-------------------+ +| *Getter* | get_radius() | ++-----------+-------------------+ + +The radius of the wheel in meters. + +---- + +.. _class_VehicleWheel_property_wheel_rest_length: + +- :ref:`float` **wheel_rest_length** + ++-----------+-----------------------------------+ +| *Default* | ``0.15`` | ++-----------+-----------------------------------+ +| *Setter* | set_suspension_rest_length(value) | ++-----------+-----------------------------------+ +| *Getter* | get_suspension_rest_length() | ++-----------+-----------------------------------+ + +This is the distance in meters the wheel is lowered from its origin point. Don't set this to 0.0 and move the wheel into position, instead move the origin point of your wheel (the gizmo in Godot) to the position the wheel will take when bottoming out, then use the rest length to move the wheel down to the position it should be in when the car is in rest. + +---- + +.. _class_VehicleWheel_property_wheel_roll_influence: + +- :ref:`float` **wheel_roll_influence** + ++-----------+---------------------------+ +| *Default* | ``0.1`` | ++-----------+---------------------------+ +| *Setter* | set_roll_influence(value) | ++-----------+---------------------------+ +| *Getter* | get_roll_influence() | ++-----------+---------------------------+ + +This value affects the roll of your vehicle. If set to 1.0 for all wheels, your vehicle will be prone to rolling over, while a value of 0.0 will resist body roll. + +Method Descriptions +------------------- + +.. _class_VehicleWheel_method_get_rpm: + +- :ref:`float` **get_rpm** **(** **)** |const| + +Returns the rotational speed of the wheel in revolutions per minute. + +---- + +.. _class_VehicleWheel_method_get_skidinfo: + +- :ref:`float` **get_skidinfo** **(** **)** |const| + +Returns a value between 0.0 and 1.0 that indicates whether this wheel is skidding. 0.0 is skidding (the wheel has lost grip, e.g. icy terrain), 1.0 means not skidding (the wheel has full grip, e.g. dry asphalt road). + +---- + +.. _class_VehicleWheel_method_is_in_contact: + +- :ref:`bool` **is_in_contact** **(** **)** |const| + +Returns ``true`` if this wheel is in contact with a surface. + +.. |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.)` diff --git a/classes/class_videoplayer.rst b/classes/class_videoplayer.rst new file mode 100644 index 0000000..05cfe95 --- /dev/null +++ b/classes/class_videoplayer.rst @@ -0,0 +1,280 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VideoPlayer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VideoPlayer: + +VideoPlayer +=========== + +**Inherits:** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control for playing video streams. + +Description +----------- + +Control node for playing video streams using :ref:`VideoStream` resources. + +Supported video formats are `WebM `__ (``.webm``, :ref:`VideoStreamWebm`), `Ogg Theora `__ (``.ogv``, :ref:`VideoStreamTheora`), and any format exposed via a GDNative plugin using :ref:`VideoStreamGDNative`. + +**Note:** Due to a bug, VideoPlayer does not support localization remapping yet. + +**Warning:** On HTML5, video playback *will* perform poorly due to missing architecture-specific assembly optimizations, especially for VP8/VP9. + +Properties +---------- + ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`int` | :ref:`audio_track` | ``0`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`autoplay` | ``false`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`int` | :ref:`buffering_msec` | ``500`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`bus` | ``"Master"`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`expand` | ``true`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`paused` | ``false`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`VideoStream` | :ref:`stream` | | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`stream_position` | | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`volume` | | ++---------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`float` | :ref:`volume_db` | ``0.0`` | ++---------------------------------------+--------------------------------------------------------------------+--------------+ + +Methods +------- + ++-------------------------------+------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_stream_name` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`get_video_texture` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_playing` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------------------------------+ +| void | :ref:`play` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++-------------------------------+------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VideoPlayer_signal_finished: + +- **finished** **(** **)** + +Emitted when playback is finished. + +Property Descriptions +--------------------- + +.. _class_VideoPlayer_property_audio_track: + +- :ref:`int` **audio_track** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_audio_track(value) | ++-----------+------------------------+ +| *Getter* | get_audio_track() | ++-----------+------------------------+ + +The embedded audio track to play. + +---- + +.. _class_VideoPlayer_property_autoplay: + +- :ref:`bool` **autoplay** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_autoplay(value) | ++-----------+---------------------+ +| *Getter* | has_autoplay() | ++-----------+---------------------+ + +If ``true``, playback starts when the scene loads. + +---- + +.. _class_VideoPlayer_property_buffering_msec: + +- :ref:`int` **buffering_msec** + ++-----------+---------------------------+ +| *Default* | ``500`` | ++-----------+---------------------------+ +| *Setter* | set_buffering_msec(value) | ++-----------+---------------------------+ +| *Getter* | get_buffering_msec() | ++-----------+---------------------------+ + +Amount of time in milliseconds to store in buffer while playing. + +---- + +.. _class_VideoPlayer_property_bus: + +- :ref:`String` **bus** + ++-----------+----------------+ +| *Default* | ``"Master"`` | ++-----------+----------------+ +| *Setter* | set_bus(value) | ++-----------+----------------+ +| *Getter* | get_bus() | ++-----------+----------------+ + +Audio bus to use for sound playback. + +---- + +.. _class_VideoPlayer_property_expand: + +- :ref:`bool` **expand** + ++-----------+-------------------+ +| *Default* | ``true`` | ++-----------+-------------------+ +| *Setter* | set_expand(value) | ++-----------+-------------------+ +| *Getter* | has_expand() | ++-----------+-------------------+ + +If ``true``, the video scales to the control size. Otherwise, the control minimum size will be automatically adjusted to match the video stream's dimensions. + +---- + +.. _class_VideoPlayer_property_paused: + +- :ref:`bool` **paused** + ++-----------+-------------------+ +| *Default* | ``false`` | ++-----------+-------------------+ +| *Setter* | set_paused(value) | ++-----------+-------------------+ +| *Getter* | is_paused() | ++-----------+-------------------+ + +If ``true``, the video is paused. + +---- + +.. _class_VideoPlayer_property_stream: + +- :ref:`VideoStream` **stream** + ++----------+-------------------+ +| *Setter* | set_stream(value) | ++----------+-------------------+ +| *Getter* | get_stream() | ++----------+-------------------+ + +The assigned video stream. See description for supported formats. + +---- + +.. _class_VideoPlayer_property_stream_position: + +- :ref:`float` **stream_position** + ++----------+----------------------------+ +| *Setter* | set_stream_position(value) | ++----------+----------------------------+ +| *Getter* | get_stream_position() | ++----------+----------------------------+ + +The current position of the stream, in seconds. + +**Note:** Changing this value won't have any effect as seeking is not implemented yet, except in video formats implemented by a GDNative add-on. + +---- + +.. _class_VideoPlayer_property_volume: + +- :ref:`float` **volume** + ++----------+-------------------+ +| *Setter* | set_volume(value) | ++----------+-------------------+ +| *Getter* | get_volume() | ++----------+-------------------+ + +Audio volume as a linear value. + +---- + +.. _class_VideoPlayer_property_volume_db: + +- :ref:`float` **volume_db** + ++-----------+----------------------+ +| *Default* | ``0.0`` | ++-----------+----------------------+ +| *Setter* | set_volume_db(value) | ++-----------+----------------------+ +| *Getter* | get_volume_db() | ++-----------+----------------------+ + +Audio volume in dB. + +Method Descriptions +------------------- + +.. _class_VideoPlayer_method_get_stream_name: + +- :ref:`String` **get_stream_name** **(** **)** |const| + +Returns the video stream's name, or ``""`` if no video stream is assigned. + +---- + +.. _class_VideoPlayer_method_get_video_texture: + +- :ref:`Texture` **get_video_texture** **(** **)** |const| + +Returns the current frame as a :ref:`Texture`. + +---- + +.. _class_VideoPlayer_method_is_playing: + +- :ref:`bool` **is_playing** **(** **)** |const| + +Returns ``true`` if the video is playing. + +**Note:** The video is still considered playing if paused during playback. + +---- + +.. _class_VideoPlayer_method_play: + +- void **play** **(** **)** + +Starts the video playback from the beginning. If the video is paused, this will not unpause the video. + +---- + +.. _class_VideoPlayer_method_stop: + +- void **stop** **(** **)** + +Stops the video playback and sets the stream position to 0. + +**Note:** Although the stream position will be set to 0, the first frame of the video stream won't become the current 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.)` diff --git a/classes/class_videostream.rst b/classes/class_videostream.rst new file mode 100644 index 0000000..a483b94 --- /dev/null +++ b/classes/class_videostream.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VideoStream.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VideoStream: + +VideoStream +=========== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VideoStreamGDNative`, :ref:`VideoStreamTheora`, :ref:`VideoStreamWebm` + +Base resource for video streams. + +Description +----------- + +Base resource type for all video streams. Classes that derive from ``VideoStream`` can all be used as resource types to play back videos in :ref:`VideoPlayer`. + +.. |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.)` diff --git a/classes/class_videostreamgdnative.rst b/classes/class_videostreamgdnative.rst new file mode 100644 index 0000000..3ec2f2a --- /dev/null +++ b/classes/class_videostreamgdnative.rst @@ -0,0 +1,51 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VideoStreamGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VideoStreamGDNative: + +VideoStreamGDNative +=================== + +**Inherits:** :ref:`VideoStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`VideoStream` resource for for video formats implemented via GDNative. + +Description +----------- + +:ref:`VideoStream` resource for for video formats implemented via GDNative. + +It can be used via `godot-videodecoder `__ which uses the `FFmpeg `__ library. + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_file` **(** :ref:`String` file **)** | ++-----------------------------+---------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VideoStreamGDNative_method_get_file: + +- :ref:`String` **get_file** **(** **)** + +Returns the video file handled by this ``VideoStreamGDNative``. + +---- + +.. _class_VideoStreamGDNative_method_set_file: + +- void **set_file** **(** :ref:`String` file **)** + +Sets the video file that this ``VideoStreamGDNative`` resource handles. The supported extensions depend on the GDNative plugins used to expose video formats. + +.. |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.)` diff --git a/classes/class_videostreamtheora.rst b/classes/class_videostreamtheora.rst new file mode 100644 index 0000000..a868194 --- /dev/null +++ b/classes/class_videostreamtheora.rst @@ -0,0 +1,51 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VideoStreamTheora.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VideoStreamTheora: + +VideoStreamTheora +================= + +**Inherits:** :ref:`VideoStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`VideoStream` resource for Ogg Theora videos. + +Description +----------- + +:ref:`VideoStream` resource handling the `Ogg Theora `__ video format with ``.ogv`` extension. The Theora codec is less efficient than :ref:`VideoStreamWebm`'s VP8 and VP9, but it requires less CPU resources to decode. The Theora codec is decoded on the CPU. + +**Note:** While Ogg Theora videos can also have an ``.ogg`` extension, you will have to rename the extension to ``.ogv`` to use those videos within Godot. + +Methods +------- + ++-----------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** **)** | ++-----------------------------+-------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_file` **(** :ref:`String` file **)** | ++-----------------------------+-------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VideoStreamTheora_method_get_file: + +- :ref:`String` **get_file** **(** **)** + +Returns the Ogg Theora video file handled by this ``VideoStreamTheora``. + +---- + +.. _class_VideoStreamTheora_method_set_file: + +- void **set_file** **(** :ref:`String` file **)** + +Sets the Ogg Theora video file that this ``VideoStreamTheora`` resource handles. The ``file`` name should have the ``.ogv`` extension. + +.. |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.)` diff --git a/classes/class_videostreamwebm.rst b/classes/class_videostreamwebm.rst new file mode 100644 index 0000000..6e1e4f7 --- /dev/null +++ b/classes/class_videostreamwebm.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VideoStreamWebm.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VideoStreamWebm: + +VideoStreamWebm +=============== + +**Inherits:** :ref:`VideoStream` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +:ref:`VideoStream` resource for WebM videos. + +Description +----------- + +:ref:`VideoStream` resource handling the `WebM `__ video format with ``.webm`` extension. Both the VP8 and VP9 codecs are supported. The VP8 and VP9 codecs are more efficient than :ref:`VideoStreamTheora`, but they require more CPU resources to decode (especially VP9). Both the VP8 and VP9 codecs are decoded on the CPU. + +**Note:** Alpha channel (also known as transparency) is not supported. The video will always appear to have a black background, even if it originally contains an alpha channel. + +**Note:** There are known bugs and performance issues with WebM video playback in Godot. If you run into problems, try using the Ogg Theora format instead: :ref:`VideoStreamTheora` + +Methods +------- + ++-----------------------------+-----------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_file` **(** **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------+ +| void | :ref:`set_file` **(** :ref:`String` file **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VideoStreamWebm_method_get_file: + +- :ref:`String` **get_file** **(** **)** + +Returns the WebM video file handled by this ``VideoStreamWebm``. + +---- + +.. _class_VideoStreamWebm_method_set_file: + +- void **set_file** **(** :ref:`String` file **)** + +Sets the WebM video file that this ``VideoStreamWebm`` resource handles. The ``file`` name should have the ``.webm`` extension. + +.. |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.)` diff --git a/classes/class_viewport.rst b/classes/class_viewport.rst new file mode 100644 index 0000000..9f01b88 --- /dev/null +++ b/classes/class_viewport.rst @@ -0,0 +1,1117 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the Viewport.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_Viewport: + +Viewport +======== + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Creates a sub-view into the screen. + +Description +----------- + +A Viewport creates a different view into the screen, or a sub-view inside another viewport. Children 2D Nodes will display on it, and children Camera 3D nodes will render on it too. + +Optionally, a viewport can have its own 2D or 3D world, so they don't share what they draw with other viewports. + +If a viewport is a child of a :ref:`ViewportContainer`, it will automatically take up its size, otherwise it must be set manually. + +Viewports can also choose to be audio listeners, so they generate positional audio depending on a 2D or 3D camera child of it. + +Also, viewports can be assigned to different screens in case the devices have multiple screens. + +Finally, viewports can also behave as render targets, in which case they will not be visible unless the associated texture is used to draw. + +**Note:** By default, a newly created Viewport in Godot 3.x will appear to be upside down. Enabling :ref:`render_target_v_flip` will display the Viewport with the correct orientation. + +Tutorials +--------- + +- :doc:`../tutorials/2d/2d_transforms` + +- :doc:`../tutorials/rendering/index` + +- `GUI in 3D Demo `__ + +- `3D in 2D Demo `__ + +- `2D in 3D Demo `__ + +- `Screen Capture Demo `__ + +- `Dynamic Split Screen Demo `__ + +- `3D Viewport Scaling Demo `__ + +Properties +---------- + ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`arvr` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`audio_listener_enable_2d` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`audio_listener_enable_3d` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Transform2D` | :ref:`canvas_transform` | | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`debanding` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`DebugDraw` | :ref:`debug_draw` | ``0`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`disable_3d` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`fxaa` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Transform2D` | :ref:`global_canvas_transform` | | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`gui_disable_input` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`gui_snap_controls_to_pixels` | ``true`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`handle_input_locally` | ``true`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`hdr` | ``true`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`keep_3d_linear` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`MSAA` | :ref:`msaa` | ``0`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`own_world` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`physics_object_picking` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`render_direct_to_screen` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`ClearMode` | :ref:`render_target_clear_mode` | ``0`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`UpdateMode` | :ref:`render_target_update_mode` | ``2`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`render_target_v_flip` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`ShadowAtlasQuadrantSubdiv` | :ref:`shadow_atlas_quad_0` | ``2`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`ShadowAtlasQuadrantSubdiv` | :ref:`shadow_atlas_quad_1` | ``2`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`ShadowAtlasQuadrantSubdiv` | :ref:`shadow_atlas_quad_2` | ``3`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`ShadowAtlasQuadrantSubdiv` | :ref:`shadow_atlas_quad_3` | ``4`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`int` | :ref:`shadow_atlas_size` | ``0`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`float` | :ref:`sharpen_intensity` | ``0.0`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 0, 0 )`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`size_override_stretch` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`bool` | :ref:`transparent_bg` | ``false`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`Usage` | :ref:`usage` | ``2`` | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`World` | :ref:`world` | | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ +| :ref:`World2D` | :ref:`world_2d` | | ++---------------------------------------------------------------------------+-----------------------------------------------------------------------------------------+---------------------+ + +Methods +------- + ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`World` | :ref:`find_world` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`World2D` | :ref:`find_world_2d` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Camera` | :ref:`get_camera` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`get_final_transform` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Control` | :ref:`get_modal_stack_top` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_mouse_position` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_render_info` **(** :ref:`RenderInfo` info **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ShadowAtlasQuadrantSubdiv` | :ref:`get_shadow_atlas_quadrant_subdiv` **(** :ref:`int` quadrant **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_size_override` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ViewportTexture` | :ref:`get_texture` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_viewport_rid` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Rect2` | :ref:`get_visible_rect` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`gui_get_drag_data` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gui_has_modal_stack` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gui_is_dragging` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`input` **(** :ref:`InputEvent` local_event **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_input_handled` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_size_override_enabled` **(** **)** |const| | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_attach_to_screen_rect` **(** :ref:`Rect2` rect **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_as_handled` **(** **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shadow_atlas_quadrant_subdiv` **(** :ref:`int` quadrant, :ref:`ShadowAtlasQuadrantSubdiv` subdiv **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_size_override` **(** :ref:`bool` enable, :ref:`Vector2` size=Vector2( -1, -1 ), :ref:`Vector2` margin=Vector2( 0, 0 ) **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`unhandled_input` **(** :ref:`InputEvent` local_event **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`update_worlds` **(** **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`warp_mouse` **(** :ref:`Vector2` to_position **)** | ++---------------------------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_Viewport_signal_gui_focus_changed: + +- **gui_focus_changed** **(** :ref:`Control` node **)** + +Emitted when a Control node grabs keyboard focus. + +---- + +.. _class_Viewport_signal_size_changed: + +- **size_changed** **(** **)** + +Emitted when the size of the viewport is changed, whether by :ref:`set_size_override`, resize of window, or some other means. + +Enumerations +------------ + +.. _enum_Viewport_UpdateMode: + +.. _class_Viewport_constant_UPDATE_DISABLED: + +.. _class_Viewport_constant_UPDATE_ONCE: + +.. _class_Viewport_constant_UPDATE_WHEN_VISIBLE: + +.. _class_Viewport_constant_UPDATE_ALWAYS: + +enum **UpdateMode**: + +- **UPDATE_DISABLED** = **0** --- Do not update the render target. + +- **UPDATE_ONCE** = **1** --- Update the render target once, then switch to :ref:`UPDATE_DISABLED`. + +- **UPDATE_WHEN_VISIBLE** = **2** --- Update the render target only when it is visible. This is the default value. + +- **UPDATE_ALWAYS** = **3** --- Always update the render target. + +---- + +.. _enum_Viewport_ShadowAtlasQuadrantSubdiv: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_4: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_16: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_64: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_256: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_1024: + +.. _class_Viewport_constant_SHADOW_ATLAS_QUADRANT_SUBDIV_MAX: + +enum **ShadowAtlasQuadrantSubdiv**: + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_DISABLED** = **0** --- This quadrant will not be used. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_1** = **1** --- This quadrant will only be used by one shadow map. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_4** = **2** --- This quadrant will be split in 4 and used by up to 4 shadow maps. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_16** = **3** --- This quadrant will be split 16 ways and used by up to 16 shadow maps. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_64** = **4** --- This quadrant will be split 64 ways and used by up to 64 shadow maps. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_256** = **5** --- This quadrant will be split 256 ways and used by up to 256 shadow maps. Unless the :ref:`shadow_atlas_size` is very high, the shadows in this quadrant will be very low resolution. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_1024** = **6** --- This quadrant will be split 1024 ways and used by up to 1024 shadow maps. Unless the :ref:`shadow_atlas_size` is very high, the shadows in this quadrant will be very low resolution. + +- **SHADOW_ATLAS_QUADRANT_SUBDIV_MAX** = **7** --- Represents the size of the :ref:`ShadowAtlasQuadrantSubdiv` enum. + +---- + +.. _enum_Viewport_RenderInfo: + +.. _class_Viewport_constant_RENDER_INFO_OBJECTS_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_VERTICES_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_SHADER_CHANGES_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_SURFACE_CHANGES_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_DRAW_CALLS_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_2D_ITEMS_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME: + +.. _class_Viewport_constant_RENDER_INFO_MAX: + +enum **RenderInfo**: + +- **RENDER_INFO_OBJECTS_IN_FRAME** = **0** --- Amount of objects in frame. + +- **RENDER_INFO_VERTICES_IN_FRAME** = **1** --- Amount of vertices in frame. + +- **RENDER_INFO_MATERIAL_CHANGES_IN_FRAME** = **2** --- Amount of material changes in frame. + +- **RENDER_INFO_SHADER_CHANGES_IN_FRAME** = **3** --- Amount of shader changes in frame. + +- **RENDER_INFO_SURFACE_CHANGES_IN_FRAME** = **4** --- Amount of surface changes in frame. + +- **RENDER_INFO_DRAW_CALLS_IN_FRAME** = **5** --- Amount of draw calls in frame. + +- **RENDER_INFO_2D_ITEMS_IN_FRAME** = **6** --- Amount of items or joined items in frame. + +- **RENDER_INFO_2D_DRAW_CALLS_IN_FRAME** = **7** --- Amount of draw calls in frame. + +- **RENDER_INFO_MAX** = **8** --- Represents the size of the :ref:`RenderInfo` enum. + +---- + +.. _enum_Viewport_DebugDraw: + +.. _class_Viewport_constant_DEBUG_DRAW_DISABLED: + +.. _class_Viewport_constant_DEBUG_DRAW_UNSHADED: + +.. _class_Viewport_constant_DEBUG_DRAW_OVERDRAW: + +.. _class_Viewport_constant_DEBUG_DRAW_WIREFRAME: + +enum **DebugDraw**: + +- **DEBUG_DRAW_DISABLED** = **0** --- Objects are displayed normally. + +- **DEBUG_DRAW_UNSHADED** = **1** --- Objects are displayed without light information. + +- **DEBUG_DRAW_OVERDRAW** = **2** --- Objected are displayed semi-transparent with additive blending so you can see where they intersect. + +- **DEBUG_DRAW_WIREFRAME** = **3** --- Objects are displayed in wireframe style. + +---- + +.. _enum_Viewport_MSAA: + +.. _class_Viewport_constant_MSAA_DISABLED: + +.. _class_Viewport_constant_MSAA_2X: + +.. _class_Viewport_constant_MSAA_4X: + +.. _class_Viewport_constant_MSAA_8X: + +.. _class_Viewport_constant_MSAA_16X: + +enum **MSAA**: + +- **MSAA_DISABLED** = **0** --- Multisample anti-aliasing mode disabled. This is the default value. + +- **MSAA_2X** = **1** --- Use 2x Multisample Antialiasing. + +- **MSAA_4X** = **2** --- Use 4x Multisample Antialiasing. + +- **MSAA_8X** = **3** --- Use 8x Multisample Antialiasing. Likely unsupported on low-end and older hardware. + +- **MSAA_16X** = **4** --- Use 16x Multisample Antialiasing. Likely unsupported on medium and low-end hardware. + +---- + +.. _enum_Viewport_Usage: + +.. _class_Viewport_constant_USAGE_2D: + +.. _class_Viewport_constant_USAGE_2D_NO_SAMPLING: + +.. _class_Viewport_constant_USAGE_3D: + +.. _class_Viewport_constant_USAGE_3D_NO_EFFECTS: + +enum **Usage**: + +- **USAGE_2D** = **0** --- Allocates all buffers needed for drawing 2D scenes. This takes less VRAM than the 3D usage modes. Note that 3D rendering effects such as glow and HDR are not available when using this mode. + +- **USAGE_2D_NO_SAMPLING** = **1** --- Allocates buffers needed for 2D scenes without allocating a buffer for screen copy. Accordingly, you cannot read from the screen. Of the :ref:`Usage` types, this requires the least VRAM. Note that 3D rendering effects such as glow and HDR are not available when using this mode. + +- **USAGE_3D** = **2** --- Allocates full buffers for drawing 3D scenes and all 3D effects including buffers needed for 2D scenes and effects. + +- **USAGE_3D_NO_EFFECTS** = **3** --- Allocates buffers needed for drawing 3D scenes. But does not allocate buffers needed for reading from the screen and post-processing effects. Saves some VRAM. + +---- + +.. _enum_Viewport_ClearMode: + +.. _class_Viewport_constant_CLEAR_MODE_ALWAYS: + +.. _class_Viewport_constant_CLEAR_MODE_NEVER: + +.. _class_Viewport_constant_CLEAR_MODE_ONLY_NEXT_FRAME: + +enum **ClearMode**: + +- **CLEAR_MODE_ALWAYS** = **0** --- Always clear the render target before drawing. + +- **CLEAR_MODE_NEVER** = **1** --- Never clear the render target. + +- **CLEAR_MODE_ONLY_NEXT_FRAME** = **2** --- Clear the render target next frame, then switch to :ref:`CLEAR_MODE_NEVER`. + +Property Descriptions +--------------------- + +.. _class_Viewport_property_arvr: + +- :ref:`bool` **arvr** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_use_arvr(value) | ++-----------+---------------------+ +| *Getter* | use_arvr() | ++-----------+---------------------+ + +If ``true``, the viewport will be used in AR/VR process. + +---- + +.. _class_Viewport_property_audio_listener_enable_2d: + +- :ref:`bool` **audio_listener_enable_2d** + ++-----------+---------------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------------+ +| *Setter* | set_as_audio_listener_2d(value) | ++-----------+---------------------------------+ +| *Getter* | is_audio_listener_2d() | ++-----------+---------------------------------+ + +If ``true``, the viewport will process 2D audio streams. + +---- + +.. _class_Viewport_property_audio_listener_enable_3d: + +- :ref:`bool` **audio_listener_enable_3d** + ++-----------+------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------+ +| *Setter* | set_as_audio_listener(value) | ++-----------+------------------------------+ +| *Getter* | is_audio_listener() | ++-----------+------------------------------+ + +If ``true``, the viewport will process 3D audio streams. + +---- + +.. _class_Viewport_property_canvas_transform: + +- :ref:`Transform2D` **canvas_transform** + ++----------+-----------------------------+ +| *Setter* | set_canvas_transform(value) | ++----------+-----------------------------+ +| *Getter* | get_canvas_transform() | ++----------+-----------------------------+ + +The canvas transform of the viewport, useful for changing the on-screen positions of all child :ref:`CanvasItem`\ s. This is relative to the global canvas transform of the viewport. + +---- + +.. _class_Viewport_property_debanding: + +- :ref:`bool` **debanding** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_use_debanding(value) | ++-----------+--------------------------+ +| *Getter* | get_use_debanding() | ++-----------+--------------------------+ + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`hdr` must also be ``true`` for debanding to be effective. + +---- + +.. _class_Viewport_property_debug_draw: + +- :ref:`DebugDraw` **debug_draw** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_debug_draw(value) | ++-----------+-----------------------+ +| *Getter* | get_debug_draw() | ++-----------+-----------------------+ + +The overlay mode for test rendered geometry in debug purposes. + +---- + +.. _class_Viewport_property_disable_3d: + +- :ref:`bool` **disable_3d** + ++-----------+-----------------------+ +| *Default* | ``false`` | ++-----------+-----------------------+ +| *Setter* | set_disable_3d(value) | ++-----------+-----------------------+ +| *Getter* | is_3d_disabled() | ++-----------+-----------------------+ + +If ``true``, the viewport will disable 3D rendering. For actual disabling use ``usage``. + +---- + +.. _class_Viewport_property_fxaa: + +- :ref:`bool` **fxaa** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_use_fxaa(value) | ++-----------+---------------------+ +| *Getter* | get_use_fxaa() | ++-----------+---------------------+ + +Enables fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see :ref:`sharpen_intensity`). + +---- + +.. _class_Viewport_property_global_canvas_transform: + +- :ref:`Transform2D` **global_canvas_transform** + ++----------+------------------------------------+ +| *Setter* | set_global_canvas_transform(value) | ++----------+------------------------------------+ +| *Getter* | get_global_canvas_transform() | ++----------+------------------------------------+ + +The global canvas transform of the viewport. The canvas transform is relative to this. + +---- + +.. _class_Viewport_property_gui_disable_input: + +- :ref:`bool` **gui_disable_input** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_disable_input(value) | ++-----------+--------------------------+ +| *Getter* | is_input_disabled() | ++-----------+--------------------------+ + +If ``true``, the viewport will not receive input events. + +---- + +.. _class_Viewport_property_gui_snap_controls_to_pixels: + +- :ref:`bool` **gui_snap_controls_to_pixels** + ++-----------+--------------------------------------+ +| *Default* | ``true`` | ++-----------+--------------------------------------+ +| *Setter* | set_snap_controls_to_pixels(value) | ++-----------+--------------------------------------+ +| *Getter* | is_snap_controls_to_pixels_enabled() | ++-----------+--------------------------------------+ + +If ``true``, the GUI controls on the viewport will lay pixel perfectly. + +---- + +.. _class_Viewport_property_handle_input_locally: + +- :ref:`bool` **handle_input_locally** + ++-----------+---------------------------------+ +| *Default* | ``true`` | ++-----------+---------------------------------+ +| *Setter* | set_handle_input_locally(value) | ++-----------+---------------------------------+ +| *Getter* | is_handling_input_locally() | ++-----------+---------------------------------+ + +---- + +.. _class_Viewport_property_hdr: + +- :ref:`bool` **hdr** + ++-----------+----------------+ +| *Default* | ``true`` | ++-----------+----------------+ +| *Setter* | set_hdr(value) | ++-----------+----------------+ +| *Getter* | get_hdr() | ++-----------+----------------+ + +If ``true``, the viewport rendering will receive benefits from High Dynamic Range algorithm. High Dynamic Range allows the viewport to receive values that are outside the 0-1 range. In Godot HDR uses 16 bits, meaning it does not store the full range of a floating point number. + +**Note:** Requires :ref:`usage` to be set to :ref:`USAGE_3D` or :ref:`USAGE_3D_NO_EFFECTS`, since HDR is not supported for 2D. + +---- + +.. _class_Viewport_property_keep_3d_linear: + +- :ref:`bool` **keep_3d_linear** + ++-----------+---------------------------+ +| *Default* | ``false`` | ++-----------+---------------------------+ +| *Setter* | set_keep_3d_linear(value) | ++-----------+---------------------------+ +| *Getter* | get_keep_3d_linear() | ++-----------+---------------------------+ + +If ``true``, the result after 3D rendering will not have a linear to sRGB color conversion applied. This is important when the viewport is used as a render target where the result is used as a texture on a 3D object rendered in another viewport. It is also important if the viewport is used to create data that is not color based (noise, heightmaps, pickmaps, etc.). Do not enable this when the viewport is used as a texture on a 2D object or if the viewport is your final output. For the GLES2 driver this will convert the sRGB output to linear, this should only be used for VR plugins that require input in linear color space! + +---- + +.. _class_Viewport_property_msaa: + +- :ref:`MSAA` **msaa** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_msaa(value) | ++-----------+-----------------+ +| *Getter* | get_msaa() | ++-----------+-----------------+ + +The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 4 is best unless targeting very high-end systems. + +---- + +.. _class_Viewport_property_own_world: + +- :ref:`bool` **own_world** + ++-----------+--------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------+ +| *Setter* | set_use_own_world(value) | ++-----------+--------------------------+ +| *Getter* | is_using_own_world() | ++-----------+--------------------------+ + +If ``true``, the viewport will use :ref:`World` defined in ``world`` property. + +---- + +.. _class_Viewport_property_physics_object_picking: + +- :ref:`bool` **physics_object_picking** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_physics_object_picking(value) | ++-----------+-----------------------------------+ +| *Getter* | get_physics_object_picking() | ++-----------+-----------------------------------+ + +If ``true``, the objects rendered by viewport become subjects of mouse picking process. + +---- + +.. _class_Viewport_property_render_direct_to_screen: + +- :ref:`bool` **render_direct_to_screen** + ++-----------+----------------------------------------+ +| *Default* | ``false`` | ++-----------+----------------------------------------+ +| *Setter* | set_use_render_direct_to_screen(value) | ++-----------+----------------------------------------+ +| *Getter* | is_using_render_direct_to_screen() | ++-----------+----------------------------------------+ + +If ``true``, renders the Viewport directly to the screen instead of to the root viewport. Only available in GLES2. This is a low-level optimization and should not be used in most cases. If used, reading from the Viewport or from ``SCREEN_TEXTURE`` becomes unavailable. For more information see :ref:`VisualServer.viewport_set_render_direct_to_screen`. + +---- + +.. _class_Viewport_property_render_target_clear_mode: + +- :ref:`ClearMode` **render_target_clear_mode** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_clear_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_clear_mode() | ++-----------+-----------------------+ + +The clear mode when viewport used as a render target. + +**Note:** This property is intended for 2D usage. + +---- + +.. _class_Viewport_property_render_target_update_mode: + +- :ref:`UpdateMode` **render_target_update_mode** + ++-----------+------------------------+ +| *Default* | ``2`` | ++-----------+------------------------+ +| *Setter* | set_update_mode(value) | ++-----------+------------------------+ +| *Getter* | get_update_mode() | ++-----------+------------------------+ + +The update mode when viewport used as a render target. + +---- + +.. _class_Viewport_property_render_target_v_flip: + +- :ref:`bool` **render_target_v_flip** + ++-----------+------------------+ +| *Default* | ``false`` | ++-----------+------------------+ +| *Setter* | set_vflip(value) | ++-----------+------------------+ +| *Getter* | get_vflip() | ++-----------+------------------+ + +If ``true``, the result of rendering will be flipped vertically. Since Viewports in Godot 3.x render upside-down, it's recommended to set this to ``true`` in most situations. + +---- + +.. _class_Viewport_property_shadow_atlas_quad_0: + +- :ref:`ShadowAtlasQuadrantSubdiv` **shadow_atlas_quad_0** + ++-----------+-----------------------------------------+ +| *Default* | ``2`` | ++-----------+-----------------------------------------+ +| *Setter* | set_shadow_atlas_quadrant_subdiv(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_shadow_atlas_quadrant_subdiv() | ++-----------+-----------------------------------------+ + +The subdivision amount of the first quadrant on the shadow atlas. + +---- + +.. _class_Viewport_property_shadow_atlas_quad_1: + +- :ref:`ShadowAtlasQuadrantSubdiv` **shadow_atlas_quad_1** + ++-----------+-----------------------------------------+ +| *Default* | ``2`` | ++-----------+-----------------------------------------+ +| *Setter* | set_shadow_atlas_quadrant_subdiv(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_shadow_atlas_quadrant_subdiv() | ++-----------+-----------------------------------------+ + +The subdivision amount of the second quadrant on the shadow atlas. + +---- + +.. _class_Viewport_property_shadow_atlas_quad_2: + +- :ref:`ShadowAtlasQuadrantSubdiv` **shadow_atlas_quad_2** + ++-----------+-----------------------------------------+ +| *Default* | ``3`` | ++-----------+-----------------------------------------+ +| *Setter* | set_shadow_atlas_quadrant_subdiv(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_shadow_atlas_quadrant_subdiv() | ++-----------+-----------------------------------------+ + +The subdivision amount of the third quadrant on the shadow atlas. + +---- + +.. _class_Viewport_property_shadow_atlas_quad_3: + +- :ref:`ShadowAtlasQuadrantSubdiv` **shadow_atlas_quad_3** + ++-----------+-----------------------------------------+ +| *Default* | ``4`` | ++-----------+-----------------------------------------+ +| *Setter* | set_shadow_atlas_quadrant_subdiv(value) | ++-----------+-----------------------------------------+ +| *Getter* | get_shadow_atlas_quadrant_subdiv() | ++-----------+-----------------------------------------+ + +The subdivision amount of the fourth quadrant on the shadow atlas. + +---- + +.. _class_Viewport_property_shadow_atlas_size: + +- :ref:`int` **shadow_atlas_size** + ++-----------+------------------------------+ +| *Default* | ``0`` | ++-----------+------------------------------+ +| *Setter* | set_shadow_atlas_size(value) | ++-----------+------------------------------+ +| *Getter* | get_shadow_atlas_size() | ++-----------+------------------------------+ + +The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. + +**Note:** If this is set to 0, shadows won't be visible. Since user-created viewports default to a value of 0, this value must be set above 0 manually. + +---- + +.. _class_Viewport_property_sharpen_intensity: + +- :ref:`float` **sharpen_intensity** + ++-----------+------------------------------+ +| *Default* | ``0.0`` | ++-----------+------------------------------+ +| *Setter* | set_sharpen_intensity(value) | ++-----------+------------------------------+ +| *Getter* | get_sharpen_intensity() | ++-----------+------------------------------+ + +If set to a value greater than ``0.0``, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around ``0.5`` generally give the best results. See also :ref:`fxaa`. + +---- + +.. _class_Viewport_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_size(value) | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +The width and height of viewport. Must be set to a value greater than or equal to 2 pixels on both dimensions. Otherwise, nothing will be displayed. + +---- + +.. _class_Viewport_property_size_override_stretch: + +- :ref:`bool` **size_override_stretch** + ++-----------+------------------------------------+ +| *Default* | ``false`` | ++-----------+------------------------------------+ +| *Setter* | set_size_override_stretch(value) | ++-----------+------------------------------------+ +| *Getter* | is_size_override_stretch_enabled() | ++-----------+------------------------------------+ + +If ``true``, the size override affects stretch as well. + +---- + +.. _class_Viewport_property_transparent_bg: + +- :ref:`bool` **transparent_bg** + ++-----------+-----------------------------------+ +| *Default* | ``false`` | ++-----------+-----------------------------------+ +| *Setter* | set_transparent_background(value) | ++-----------+-----------------------------------+ +| *Getter* | has_transparent_background() | ++-----------+-----------------------------------+ + +If ``true``, the viewport should render its background as transparent. + +---- + +.. _class_Viewport_property_usage: + +- :ref:`Usage` **usage** + ++-----------+------------------+ +| *Default* | ``2`` | ++-----------+------------------+ +| *Setter* | set_usage(value) | ++-----------+------------------+ +| *Getter* | get_usage() | ++-----------+------------------+ + +The rendering mode of viewport. + +---- + +.. _class_Viewport_property_world: + +- :ref:`World` **world** + ++----------+------------------+ +| *Setter* | set_world(value) | ++----------+------------------+ +| *Getter* | get_world() | ++----------+------------------+ + +The custom :ref:`World` which can be used as 3D environment source. + +---- + +.. _class_Viewport_property_world_2d: + +- :ref:`World2D` **world_2d** + ++----------+---------------------+ +| *Setter* | set_world_2d(value) | ++----------+---------------------+ +| *Getter* | get_world_2d() | ++----------+---------------------+ + +The custom :ref:`World2D` which can be used as 2D environment source. + +Method Descriptions +------------------- + +.. _class_Viewport_method_find_world: + +- :ref:`World` **find_world** **(** **)** |const| + +Returns the first valid :ref:`World` for this viewport, searching the :ref:`world` property of itself and any Viewport ancestor. + +---- + +.. _class_Viewport_method_find_world_2d: + +- :ref:`World2D` **find_world_2d** **(** **)** |const| + +Returns the first valid :ref:`World2D` for this viewport, searching the :ref:`world_2d` property of itself and any Viewport ancestor. + +---- + +.. _class_Viewport_method_get_camera: + +- :ref:`Camera` **get_camera** **(** **)** |const| + +Returns the active 3D camera. + +---- + +.. _class_Viewport_method_get_final_transform: + +- :ref:`Transform2D` **get_final_transform** **(** **)** |const| + +Returns the total transform of the viewport. + +---- + +.. _class_Viewport_method_get_modal_stack_top: + +- :ref:`Control` **get_modal_stack_top** **(** **)** |const| + +Returns the topmost modal in the stack. + +---- + +.. _class_Viewport_method_get_mouse_position: + +- :ref:`Vector2` **get_mouse_position** **(** **)** |const| + +Returns the mouse position relative to the viewport. + +---- + +.. _class_Viewport_method_get_render_info: + +- :ref:`int` **get_render_info** **(** :ref:`RenderInfo` info **)** + +Returns information about the viewport from the rendering pipeline. + +---- + +.. _class_Viewport_method_get_shadow_atlas_quadrant_subdiv: + +- :ref:`ShadowAtlasQuadrantSubdiv` **get_shadow_atlas_quadrant_subdiv** **(** :ref:`int` quadrant **)** |const| + +Returns the :ref:`ShadowAtlasQuadrantSubdiv` of the specified quadrant. + +---- + +.. _class_Viewport_method_get_size_override: + +- :ref:`Vector2` **get_size_override** **(** **)** |const| + +Returns the size override set with :ref:`set_size_override`. + +---- + +.. _class_Viewport_method_get_texture: + +- :ref:`ViewportTexture` **get_texture** **(** **)** |const| + +Returns the viewport's texture. + +**Note:** Due to the way OpenGL works, the resulting :ref:`ViewportTexture` is flipped vertically. You can use :ref:`Image.flip_y` on the result of :ref:`Texture.get_data` to flip it back, for example: + +:: + + var img = get_viewport().get_texture().get_data() + img.flip_y() + +---- + +.. _class_Viewport_method_get_viewport_rid: + +- :ref:`RID` **get_viewport_rid** **(** **)** |const| + +Returns the viewport's RID from the :ref:`VisualServer`. + +---- + +.. _class_Viewport_method_get_visible_rect: + +- :ref:`Rect2` **get_visible_rect** **(** **)** |const| + +Returns the visible rectangle in global screen coordinates. + +---- + +.. _class_Viewport_method_gui_get_drag_data: + +- :ref:`Variant` **gui_get_drag_data** **(** **)** |const| + +Returns the drag data from the GUI, that was previously returned by :ref:`Control.get_drag_data`. + +---- + +.. _class_Viewport_method_gui_has_modal_stack: + +- :ref:`bool` **gui_has_modal_stack** **(** **)** |const| + +Returns ``true`` if there are visible modals on-screen. + +---- + +.. _class_Viewport_method_gui_is_dragging: + +- :ref:`bool` **gui_is_dragging** **(** **)** |const| + +Returns ``true`` if the viewport is currently performing a drag operation. + +---- + +.. _class_Viewport_method_input: + +- void **input** **(** :ref:`InputEvent` local_event **)** + +---- + +.. _class_Viewport_method_is_input_handled: + +- :ref:`bool` **is_input_handled** **(** **)** |const| + +---- + +.. _class_Viewport_method_is_size_override_enabled: + +- :ref:`bool` **is_size_override_enabled** **(** **)** |const| + +Returns ``true`` if the size override is enabled. See :ref:`set_size_override`. + +---- + +.. _class_Viewport_method_set_attach_to_screen_rect: + +- void **set_attach_to_screen_rect** **(** :ref:`Rect2` rect **)** + +Attaches this ``Viewport`` to the root ``Viewport`` with the specified rectangle. This bypasses the need for another node to display this ``Viewport`` but makes you responsible for updating the position of this ``Viewport`` manually. + +---- + +.. _class_Viewport_method_set_input_as_handled: + +- void **set_input_as_handled** **(** **)** + +Stops the input from propagating further down the :ref:`SceneTree`. + +---- + +.. _class_Viewport_method_set_shadow_atlas_quadrant_subdiv: + +- void **set_shadow_atlas_quadrant_subdiv** **(** :ref:`int` quadrant, :ref:`ShadowAtlasQuadrantSubdiv` subdiv **)** + +Sets the number of subdivisions to use in the specified quadrant. A higher number of subdivisions allows you to have more shadows in the scene at once, but reduces the quality of the shadows. A good practice is to have quadrants with a varying number of subdivisions and to have as few subdivisions as possible. + +---- + +.. _class_Viewport_method_set_size_override: + +- void **set_size_override** **(** :ref:`bool` enable, :ref:`Vector2` size=Vector2( -1, -1 ), :ref:`Vector2` margin=Vector2( 0, 0 ) **)** + +Sets the size override of the viewport. If the ``enable`` parameter is ``true`` the override is used, otherwise it uses the default size. If the size parameter is ``(-1, -1)``, it won't update the size. + +---- + +.. _class_Viewport_method_unhandled_input: + +- void **unhandled_input** **(** :ref:`InputEvent` local_event **)** + +---- + +.. _class_Viewport_method_update_worlds: + +- void **update_worlds** **(** **)** + +Forces update of the 2D and 3D worlds. + +---- + +.. _class_Viewport_method_warp_mouse: + +- void **warp_mouse** **(** :ref:`Vector2` to_position **)** + +Warps the mouse to a position relative to the viewport. + +.. |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.)` diff --git a/classes/class_viewportcontainer.rst b/classes/class_viewportcontainer.rst new file mode 100644 index 0000000..a40a0a7 --- /dev/null +++ b/classes/class_viewportcontainer.rst @@ -0,0 +1,71 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ViewportContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ViewportContainer: + +ViewportContainer +================= + +**Inherits:** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Control for holding :ref:`Viewport`\ s. + +Description +----------- + +A :ref:`Container` node that holds a :ref:`Viewport`, automatically setting its size. + +**Note:** Changing a ViewportContainer's :ref:`Control.rect_scale` will cause its contents to appear distorted. To change its visual size without causing distortion, adjust the node's margins instead (if it's not already in a container). + +Properties +---------- + ++-------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`stretch` | ``false`` | ++-------------------------+------------------------------------------------------------------------+-----------+ +| :ref:`int` | :ref:`stretch_shrink` | ``1`` | ++-------------------------+------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_ViewportContainer_property_stretch: + +- :ref:`bool` **stretch** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_stretch(value) | ++-----------+----------------------+ +| *Getter* | is_stretch_enabled() | ++-----------+----------------------+ + +If ``true``, the viewport will be scaled to the control's size. + +---- + +.. _class_ViewportContainer_property_stretch_shrink: + +- :ref:`int` **stretch_shrink** + ++-----------+---------------------------+ +| *Default* | ``1`` | ++-----------+---------------------------+ +| *Setter* | set_stretch_shrink(value) | ++-----------+---------------------------+ +| *Getter* | get_stretch_shrink() | ++-----------+---------------------------+ + +Divides the viewport's effective resolution by this value while preserving its scale. This can be used to speed up rendering. + +For example, a 1280×720 viewport with :ref:`stretch_shrink` set to ``2`` will be rendered at 640×360 while occupying the same size in the container. + +**Note:** :ref:`stretch` must be ``true`` for this property to work. + +.. |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.)` diff --git a/classes/class_viewporttexture.rst b/classes/class_viewporttexture.rst new file mode 100644 index 0000000..6d099b9 --- /dev/null +++ b/classes/class_viewporttexture.rst @@ -0,0 +1,64 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the ViewportTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_ViewportTexture: + +ViewportTexture +=============== + +**Inherits:** :ref:`Texture` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Texture which displays the content of a :ref:`Viewport`. + +Description +----------- + +Displays the content of a :ref:`Viewport` node as a dynamic :ref:`Texture`. This can be used to mix controls, 2D, and 3D elements in the same scene. + +To create a ViewportTexture in code, use the :ref:`Viewport.get_texture` method on the target viewport. + +Tutorials +--------- + +- `GUI in 3D Demo `__ + +- `3D in 2D Demo `__ + +- `2D in 3D Demo `__ + +- `3D Viewport Scaling Demo `__ + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`int` | flags | ``0`` *(parent override)* | ++---------------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`bool` | resource_local_to_scene | ``true`` *(parent override)* | ++---------------------------------+--------------------------------------------------------------------+------------------------------+ +| :ref:`NodePath` | :ref:`viewport_path` | ``NodePath("")`` | ++---------------------------------+--------------------------------------------------------------------+------------------------------+ + +Property Descriptions +--------------------- + +.. _class_ViewportTexture_property_viewport_path: + +- :ref:`NodePath` **viewport_path** + ++-----------+-----------------------------------+ +| *Default* | ``NodePath("")`` | ++-----------+-----------------------------------+ +| *Setter* | set_viewport_path_in_scene(value) | ++-----------+-----------------------------------+ +| *Getter* | get_viewport_path_in_scene() | ++-----------+-----------------------------------+ + +The path to the :ref:`Viewport` node to display. This is relative to the scene root, not to the node which uses the texture. + +.. |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.)` diff --git a/classes/class_visibilityenabler.rst b/classes/class_visibilityenabler.rst new file mode 100644 index 0000000..ca5c30d --- /dev/null +++ b/classes/class_visibilityenabler.rst @@ -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 VisibilityEnabler.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisibilityEnabler: + +VisibilityEnabler +================= + +**Inherits:** :ref:`VisibilityNotifier` **<** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +Enables certain nodes only when approximately visible. + +Description +----------- + +The VisibilityEnabler will disable :ref:`RigidBody` and :ref:`AnimationPlayer` nodes when they are not visible. It will only affect other nodes within the same scene as the VisibilityEnabler itself. + +If you just want to receive notifications, use :ref:`VisibilityNotifier` instead. + +**Note:** VisibilityEnabler uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account (unless you are using :ref:`Portal`\ s). The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an :ref:`Area` node as a child of a :ref:`Camera` node and/or :ref:`Vector3.dot`. + +**Note:** VisibilityEnabler will not affect nodes added after scene initialization. + +Properties +---------- + ++-------------------------+----------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`freeze_bodies` | ``true`` | ++-------------------------+----------------------------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`pause_animations` | ``true`` | ++-------------------------+----------------------------------------------------------------------------+----------+ + +Methods +------- + ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_enabler_enabled` **(** :ref:`Enabler` enabler **)** |const| | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_enabler` **(** :ref:`Enabler` enabler, :ref:`bool` enabled **)** | ++-------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_VisibilityEnabler_Enabler: + +.. _class_VisibilityEnabler_constant_ENABLER_PAUSE_ANIMATIONS: + +.. _class_VisibilityEnabler_constant_ENABLER_FREEZE_BODIES: + +.. _class_VisibilityEnabler_constant_ENABLER_MAX: + +enum **Enabler**: + +- **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer` nodes. + +- **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody` nodes. + +- **ENABLER_MAX** = **2** --- Represents the size of the :ref:`Enabler` enum. + +Property Descriptions +--------------------- + +.. _class_VisibilityEnabler_property_freeze_bodies: + +- :ref:`bool` **freeze_bodies** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`RigidBody` nodes will be paused. + +---- + +.. _class_VisibilityEnabler_property_pause_animations: + +- :ref:`bool` **pause_animations** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`AnimationPlayer` nodes will be paused. + +Method Descriptions +------------------- + +.. _class_VisibilityEnabler_method_is_enabler_enabled: + +- :ref:`bool` **is_enabler_enabled** **(** :ref:`Enabler` enabler **)** |const| + +Returns whether the enabler identified by given :ref:`Enabler` constant is active. + +---- + +.. _class_VisibilityEnabler_method_set_enabler: + +- void **set_enabler** **(** :ref:`Enabler` enabler, :ref:`bool` enabled **)** + +Sets active state of the enabler identified by given :ref:`Enabler` constant. + +.. |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.)` diff --git a/classes/class_visibilityenabler2d.rst b/classes/class_visibilityenabler2d.rst new file mode 100644 index 0000000..6e94fb8 --- /dev/null +++ b/classes/class_visibilityenabler2d.rst @@ -0,0 +1,204 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisibilityEnabler2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisibilityEnabler2D: + +VisibilityEnabler2D +=================== + +**Inherits:** :ref:`VisibilityNotifier2D` **<** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Enables certain nodes only when approximately visible. + +Description +----------- + +The VisibilityEnabler2D will disable :ref:`RigidBody2D`, :ref:`AnimationPlayer`, and other nodes when they are not visible. It will only affect nodes with the same root node as the VisibilityEnabler2D, and the root node itself. + +If you just want to receive notifications, use :ref:`VisibilityNotifier2D` instead. + +**Note:** For performance reasons, VisibilityEnabler2D uses an approximate heuristic with precision determined by :ref:`ProjectSettings.world/2d/cell_size`. If you need precise visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. + +**Note:** VisibilityEnabler2D will not affect nodes added after scene initialization. + +Properties +---------- + ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`freeze_bodies` | ``true`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pause_animated_sprites` | ``true`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pause_animations` | ``true`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`pause_particles` | ``true`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`physics_process_parent` | ``false`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`process_parent` | ``false`` | ++-------------------------+------------------------------------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_enabler_enabled` **(** :ref:`Enabler` enabler **)** |const| | ++-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_enabler` **(** :ref:`Enabler` enabler, :ref:`bool` enabled **)** | ++-------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_VisibilityEnabler2D_Enabler: + +.. _class_VisibilityEnabler2D_constant_ENABLER_PAUSE_ANIMATIONS: + +.. _class_VisibilityEnabler2D_constant_ENABLER_FREEZE_BODIES: + +.. _class_VisibilityEnabler2D_constant_ENABLER_PAUSE_PARTICLES: + +.. _class_VisibilityEnabler2D_constant_ENABLER_PARENT_PROCESS: + +.. _class_VisibilityEnabler2D_constant_ENABLER_PARENT_PHYSICS_PROCESS: + +.. _class_VisibilityEnabler2D_constant_ENABLER_PAUSE_ANIMATED_SPRITES: + +.. _class_VisibilityEnabler2D_constant_ENABLER_MAX: + +enum **Enabler**: + +- **ENABLER_PAUSE_ANIMATIONS** = **0** --- This enabler will pause :ref:`AnimationPlayer` nodes. + +- **ENABLER_FREEZE_BODIES** = **1** --- This enabler will freeze :ref:`RigidBody2D` nodes. + +- **ENABLER_PAUSE_PARTICLES** = **2** --- This enabler will stop :ref:`Particles2D` nodes. + +- **ENABLER_PARENT_PROCESS** = **3** --- This enabler will stop the parent's _process function. + +- **ENABLER_PARENT_PHYSICS_PROCESS** = **4** --- This enabler will stop the parent's _physics_process function. + +- **ENABLER_PAUSE_ANIMATED_SPRITES** = **5** --- This enabler will stop :ref:`AnimatedSprite` nodes animations. + +- **ENABLER_MAX** = **6** --- Represents the size of the :ref:`Enabler` enum. + +Property Descriptions +--------------------- + +.. _class_VisibilityEnabler2D_property_freeze_bodies: + +- :ref:`bool` **freeze_bodies** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`RigidBody2D` nodes will be paused. + +---- + +.. _class_VisibilityEnabler2D_property_pause_animated_sprites: + +- :ref:`bool` **pause_animated_sprites** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`AnimatedSprite` nodes will be paused. + +---- + +.. _class_VisibilityEnabler2D_property_pause_animations: + +- :ref:`bool` **pause_animations** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`AnimationPlayer` nodes will be paused. + +---- + +.. _class_VisibilityEnabler2D_property_pause_particles: + +- :ref:`bool` **pause_particles** + ++-----------+----------------------+ +| *Default* | ``true`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, :ref:`Particles2D` nodes will be paused. + +---- + +.. _class_VisibilityEnabler2D_property_physics_process_parent: + +- :ref:`bool` **physics_process_parent** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, the parent's :ref:`Node._physics_process` will be stopped. + +---- + +.. _class_VisibilityEnabler2D_property_process_parent: + +- :ref:`bool` **process_parent** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_enabler(value) | ++-----------+----------------------+ +| *Getter* | is_enabler_enabled() | ++-----------+----------------------+ + +If ``true``, the parent's :ref:`Node._process` will be stopped. + +Method Descriptions +------------------- + +.. _class_VisibilityEnabler2D_method_is_enabler_enabled: + +- :ref:`bool` **is_enabler_enabled** **(** :ref:`Enabler` enabler **)** |const| + +Returns whether the enabler identified by given :ref:`Enabler` constant is active. + +---- + +.. _class_VisibilityEnabler2D_method_set_enabler: + +- void **set_enabler** **(** :ref:`Enabler` enabler, :ref:`bool` enabled **)** + +Sets active state of the enabler identified by given :ref:`Enabler` constant. + +.. |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.)` diff --git a/classes/class_visibilitynotifier.rst b/classes/class_visibilitynotifier.rst new file mode 100644 index 0000000..b7a153d --- /dev/null +++ b/classes/class_visibilitynotifier.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisibilityNotifier.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisibilityNotifier: + +VisibilityNotifier +================== + +**Inherits:** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`VisibilityEnabler` + +Detects approximately when the node is visible on screen. + +Description +----------- + +The VisibilityNotifier detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a :ref:`Camera`'s view. + +If you want nodes to be disabled automatically when they exit the screen, use :ref:`VisibilityEnabler` instead. + +**Note:** VisibilityNotifier uses an approximate heuristic for performance reasons. It doesn't take walls and other occlusion into account (unless you are using :ref:`Portal`\ s). The heuristic is an implementation detail and may change in future versions. If you need precise visibility checking, use another method such as adding an :ref:`Area` node as a child of a :ref:`Camera` node and/or :ref:`Vector3.dot`. + +Properties +---------- + ++-------------------------+-----------------------------------------------------+---------------------------------+ +| :ref:`AABB` | :ref:`aabb` | ``AABB( -1, -1, -1, 2, 2, 2 )`` | ++-------------------------+-----------------------------------------------------+---------------------------------+ + +Methods +------- + ++-------------------------+---------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_screen` **(** **)** |const| | ++-------------------------+---------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisibilityNotifier_signal_camera_entered: + +- **camera_entered** **(** :ref:`Camera` camera **)** + +Emitted when the VisibilityNotifier enters a :ref:`Camera`'s view. + +---- + +.. _class_VisibilityNotifier_signal_camera_exited: + +- **camera_exited** **(** :ref:`Camera` camera **)** + +Emitted when the VisibilityNotifier exits a :ref:`Camera`'s view. + +---- + +.. _class_VisibilityNotifier_signal_screen_entered: + +- **screen_entered** **(** **)** + +Emitted when the VisibilityNotifier enters the screen. + +---- + +.. _class_VisibilityNotifier_signal_screen_exited: + +- **screen_exited** **(** **)** + +Emitted when the VisibilityNotifier exits the screen. + +Property Descriptions +--------------------- + +.. _class_VisibilityNotifier_property_aabb: + +- :ref:`AABB` **aabb** + ++-----------+---------------------------------+ +| *Default* | ``AABB( -1, -1, -1, 2, 2, 2 )`` | ++-----------+---------------------------------+ +| *Setter* | set_aabb(value) | ++-----------+---------------------------------+ +| *Getter* | get_aabb() | ++-----------+---------------------------------+ + +The VisibilityNotifier's bounding box. + +Method Descriptions +------------------- + +.. _class_VisibilityNotifier_method_is_on_screen: + +- :ref:`bool` **is_on_screen** **(** **)** |const| + +If ``true``, the bounding box is on the screen. + +**Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return ``false`` right after it is instantiated, even if it will be on screen in the draw 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.)` diff --git a/classes/class_visibilitynotifier2d.rst b/classes/class_visibilitynotifier2d.rst new file mode 100644 index 0000000..c3ce739 --- /dev/null +++ b/classes/class_visibilitynotifier2d.rst @@ -0,0 +1,109 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisibilityNotifier2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisibilityNotifier2D: + +VisibilityNotifier2D +==================== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`VisibilityEnabler2D` + +Detects approximately when the node is visible on screen. + +Description +----------- + +The VisibilityNotifier2D detects when it is visible on the screen. It also notifies when its bounding rectangle enters or exits the screen or a viewport. + +If you want nodes to be disabled automatically when they exit the screen, use :ref:`VisibilityEnabler2D` instead. + +**Note:** For performance reasons, VisibilityNotifier2D uses an approximate heuristic with precision determined by :ref:`ProjectSettings.world/2d/cell_size`. If you need precise visibility checking, use another method such as adding an :ref:`Area2D` node as a child of a :ref:`Camera2D` node. + +Tutorials +--------- + +- `2D Dodge The Creeps Demo `__ + +Properties +---------- + ++---------------------------+-------------------------------------------------------+-------------------------------+ +| :ref:`Rect2` | :ref:`rect` | ``Rect2( -10, -10, 20, 20 )`` | ++---------------------------+-------------------------------------------------------+-------------------------------+ + +Methods +------- + ++-------------------------+-----------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_on_screen` **(** **)** |const| | ++-------------------------+-----------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisibilityNotifier2D_signal_screen_entered: + +- **screen_entered** **(** **)** + +Emitted when the VisibilityNotifier2D enters the screen. + +---- + +.. _class_VisibilityNotifier2D_signal_screen_exited: + +- **screen_exited** **(** **)** + +Emitted when the VisibilityNotifier2D exits the screen. + +---- + +.. _class_VisibilityNotifier2D_signal_viewport_entered: + +- **viewport_entered** **(** :ref:`Viewport` viewport **)** + +Emitted when the VisibilityNotifier2D enters a :ref:`Viewport`'s view. + +---- + +.. _class_VisibilityNotifier2D_signal_viewport_exited: + +- **viewport_exited** **(** :ref:`Viewport` viewport **)** + +Emitted when the VisibilityNotifier2D exits a :ref:`Viewport`'s view. + +Property Descriptions +--------------------- + +.. _class_VisibilityNotifier2D_property_rect: + +- :ref:`Rect2` **rect** + ++-----------+-------------------------------+ +| *Default* | ``Rect2( -10, -10, 20, 20 )`` | ++-----------+-------------------------------+ +| *Setter* | set_rect(value) | ++-----------+-------------------------------+ +| *Getter* | get_rect() | ++-----------+-------------------------------+ + +The VisibilityNotifier2D's bounding rectangle. + +Method Descriptions +------------------- + +.. _class_VisibilityNotifier2D_method_is_on_screen: + +- :ref:`bool` **is_on_screen** **(** **)** |const| + +If ``true``, the bounding rectangle is on the screen. + +**Note:** It takes one frame for the node's visibility to be assessed once added to the scene tree, so this method will return ``false`` right after it is instantiated, even if it will be on screen in the draw 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.)` diff --git a/classes/class_visualinstance.rst b/classes/class_visualinstance.rst new file mode 100644 index 0000000..38e23f8 --- /dev/null +++ b/classes/class_visualinstance.rst @@ -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 VisualInstance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualInstance: + +VisualInstance +============== + +**Inherits:** :ref:`CullInstance` **<** :ref:`Spatial` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`BakedLightmap`, :ref:`GIProbe`, :ref:`GeometryInstance`, :ref:`Light`, :ref:`ReflectionProbe`, :ref:`RootMotionView` + +Parent of all visual 3D nodes. + +Description +----------- + +The ``VisualInstance`` is used to connect a resource to a visual representation. All visual 3D nodes inherit from the ``VisualInstance``. In general, you should not access the ``VisualInstance`` properties directly as they are accessed and managed by the nodes that inherit from ``VisualInstance``. ``VisualInstance`` is the node representation of the :ref:`VisualServer` instance. + +Properties +---------- + ++-----------------------+-----------------------------------------------------+-------+ +| :ref:`int` | :ref:`layers` | ``1`` | ++-----------------------+-----------------------------------------------------+-------+ + +Methods +------- + ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`get_aabb` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_base` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_instance` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_layer_mask_bit` **(** :ref:`int` layer **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`get_transformed_aabb` **(** **)** |const| | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_base` **(** :ref:`RID` base **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_layer_mask_bit` **(** :ref:`int` layer, :ref:`bool` enabled **)** | ++-------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualInstance_property_layers: + +- :ref:`int` **layers** + ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_layer_mask(value) | ++-----------+-----------------------+ +| *Getter* | get_layer_mask() | ++-----------+-----------------------+ + +The render layer(s) this ``VisualInstance`` is drawn on. + +This object will only be visible for :ref:`Camera`\ s whose cull mask includes the render object this ``VisualInstance`` is set to. + +Method Descriptions +------------------- + +.. _class_VisualInstance_method_get_aabb: + +- :ref:`AABB` **get_aabb** **(** **)** |const| + +Returns the :ref:`AABB` (also known as the bounding box) for this ``VisualInstance``. See also :ref:`get_transformed_aabb`. + +---- + +.. _class_VisualInstance_method_get_base: + +- :ref:`RID` **get_base** **(** **)** |const| + +Returns the RID of the resource associated with this ``VisualInstance``. For example, if the Node is a :ref:`MeshInstance`, this will return the RID of the associated :ref:`Mesh`. + +---- + +.. _class_VisualInstance_method_get_instance: + +- :ref:`RID` **get_instance** **(** **)** |const| + +Returns the RID of this instance. This RID is the same as the RID returned by :ref:`VisualServer.instance_create`. This RID is needed if you want to call :ref:`VisualServer` functions directly on this ``VisualInstance``. + +---- + +.. _class_VisualInstance_method_get_layer_mask_bit: + +- :ref:`bool` **get_layer_mask_bit** **(** :ref:`int` layer **)** |const| + +Returns ``true`` when the specified layer is enabled in :ref:`layers` and ``false`` otherwise. + +---- + +.. _class_VisualInstance_method_get_transformed_aabb: + +- :ref:`AABB` **get_transformed_aabb** **(** **)** |const| + +Returns the transformed :ref:`AABB` (also known as the bounding box) for this ``VisualInstance``. + +Transformed in this case means the :ref:`AABB` plus the position, rotation, and scale of the :ref:`Spatial`'s :ref:`Transform`. See also :ref:`get_aabb`. + +---- + +.. _class_VisualInstance_method_set_base: + +- void **set_base** **(** :ref:`RID` base **)** + +Sets the resource that is instantiated by this ``VisualInstance``, which changes how the engine handles the ``VisualInstance`` under the hood. Equivalent to :ref:`VisualServer.instance_set_base`. + +---- + +.. _class_VisualInstance_method_set_layer_mask_bit: + +- void **set_layer_mask_bit** **(** :ref:`int` layer, :ref:`bool` enabled **)** + +Enables a particular layer in :ref:`layers`. + +.. |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.)` diff --git a/classes/class_visualscript.rst b/classes/class_visualscript.rst new file mode 100644 index 0000000..c5c9fb7 --- /dev/null +++ b/classes/class_visualscript.rst @@ -0,0 +1,469 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScript.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScript: + +VisualScript +============ + +**Inherits:** :ref:`Script` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A script implemented in the Visual Script programming environment. + +Description +----------- + +A script implemented in the Visual Script programming environment. The script extends the functionality of all objects that instance it. + +:ref:`Object.set_script` extends an existing object, if that object's class matches one of the script's base classes. + +You are most likely to use this class via the Visual Script editor or when writing plugins for it. + +Tutorials +--------- + +- :doc:`../tutorials/scripting/visual_script/index` + +Methods +------- + ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_custom_signal` **(** :ref:`String` name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_function` **(** :ref:`String` name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`String` func, :ref:`int` id, :ref:`VisualScriptNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_variable` **(** :ref:`String` name, :ref:`Variant` default_value=null, :ref:`bool` export=false **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`custom_signal_add_argument` **(** :ref:`String` name, :ref:`Variant.Type` type, :ref:`String` argname, :ref:`int` index=-1 **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`custom_signal_get_argument_count` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`custom_signal_get_argument_name` **(** :ref:`String` name, :ref:`int` argidx **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant.Type` | :ref:`custom_signal_get_argument_type` **(** :ref:`String` name, :ref:`int` argidx **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`custom_signal_remove_argument` **(** :ref:`String` name, :ref:`int` argidx **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`custom_signal_set_argument_name` **(** :ref:`String` name, :ref:`int` argidx, :ref:`String` argname **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`custom_signal_set_argument_type` **(** :ref:`String` name, :ref:`int` argidx, :ref:`Variant.Type` type **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`custom_signal_swap_argument` **(** :ref:`String` name, :ref:`int` argidx, :ref:`int` withidx **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`data_connect` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`data_disconnect` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_function_node_id` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_function_scroll` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VisualScriptNode` | :ref:`get_node` **(** :ref:`String` func, :ref:`int` id **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`String` func, :ref:`int` id **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_variable_default_value` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`get_variable_export` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_variable_info` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_custom_signal` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_data_connection` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_function` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_node` **(** :ref:`String` func, :ref:`int` id **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_sequence_connection` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_variable` **(** :ref:`String` name **)** |const| | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_custom_signal` **(** :ref:`String` name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_function` **(** :ref:`String` name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`String` func, :ref:`int` id **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_variable` **(** :ref:`String` name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_custom_signal` **(** :ref:`String` name, :ref:`String` new_name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_function` **(** :ref:`String` name, :ref:`String` new_name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`rename_variable` **(** :ref:`String` name, :ref:`String` new_name **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sequence_connect` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sequence_disconnect` **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_function_scroll` **(** :ref:`String` name, :ref:`Vector2` ofs **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_instance_base_type` **(** :ref:`String` type **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_node_position` **(** :ref:`String` func, :ref:`int` id, :ref:`Vector2` position **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_variable_default_value` **(** :ref:`String` name, :ref:`Variant` value **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_variable_export` **(** :ref:`String` name, :ref:`bool` enable **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_variable_info` **(** :ref:`String` name, :ref:`Dictionary` value **)** | ++-----------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualScript_signal_node_ports_changed: + +- **node_ports_changed** **(** :ref:`String` function, :ref:`int` id **)** + +Emitted when the ports of a node are changed. + +Method Descriptions +------------------- + +.. _class_VisualScript_method_add_custom_signal: + +- void **add_custom_signal** **(** :ref:`String` name **)** + +Add a custom signal with the specified name to the VisualScript. + +---- + +.. _class_VisualScript_method_add_function: + +- void **add_function** **(** :ref:`String` name **)** + +Add a function with the specified name to the VisualScript. + +---- + +.. _class_VisualScript_method_add_node: + +- void **add_node** **(** :ref:`String` func, :ref:`int` id, :ref:`VisualScriptNode` node, :ref:`Vector2` position=Vector2( 0, 0 ) **)** + +Add a node to a function of the VisualScript. + +---- + +.. _class_VisualScript_method_add_variable: + +- void **add_variable** **(** :ref:`String` name, :ref:`Variant` default_value=null, :ref:`bool` export=false **)** + +Add a variable to the VisualScript, optionally giving it a default value or marking it as exported. + +---- + +.. _class_VisualScript_method_custom_signal_add_argument: + +- void **custom_signal_add_argument** **(** :ref:`String` name, :ref:`Variant.Type` type, :ref:`String` argname, :ref:`int` index=-1 **)** + +Add an argument to a custom signal added with :ref:`add_custom_signal`. + +---- + +.. _class_VisualScript_method_custom_signal_get_argument_count: + +- :ref:`int` **custom_signal_get_argument_count** **(** :ref:`String` name **)** |const| + +Get the count of a custom signal's arguments. + +---- + +.. _class_VisualScript_method_custom_signal_get_argument_name: + +- :ref:`String` **custom_signal_get_argument_name** **(** :ref:`String` name, :ref:`int` argidx **)** |const| + +Get the name of a custom signal's argument. + +---- + +.. _class_VisualScript_method_custom_signal_get_argument_type: + +- :ref:`Variant.Type` **custom_signal_get_argument_type** **(** :ref:`String` name, :ref:`int` argidx **)** |const| + +Get the type of a custom signal's argument. + +---- + +.. _class_VisualScript_method_custom_signal_remove_argument: + +- void **custom_signal_remove_argument** **(** :ref:`String` name, :ref:`int` argidx **)** + +Remove a specific custom signal's argument. + +---- + +.. _class_VisualScript_method_custom_signal_set_argument_name: + +- void **custom_signal_set_argument_name** **(** :ref:`String` name, :ref:`int` argidx, :ref:`String` argname **)** + +Rename a custom signal's argument. + +---- + +.. _class_VisualScript_method_custom_signal_set_argument_type: + +- void **custom_signal_set_argument_type** **(** :ref:`String` name, :ref:`int` argidx, :ref:`Variant.Type` type **)** + +Change the type of a custom signal's argument. + +---- + +.. _class_VisualScript_method_custom_signal_swap_argument: + +- void **custom_signal_swap_argument** **(** :ref:`String` name, :ref:`int` argidx, :ref:`int` withidx **)** + +Swap two of the arguments of a custom signal. + +---- + +.. _class_VisualScript_method_data_connect: + +- void **data_connect** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** + +Connect two data ports. The value of ``from_node``'s ``from_port`` would be fed into ``to_node``'s ``to_port``. + +---- + +.. _class_VisualScript_method_data_disconnect: + +- void **data_disconnect** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** + +Disconnect two data ports previously connected with :ref:`data_connect`. + +---- + +.. _class_VisualScript_method_get_function_node_id: + +- :ref:`int` **get_function_node_id** **(** :ref:`String` name **)** |const| + +Returns the id of a function's entry point node. + +---- + +.. _class_VisualScript_method_get_function_scroll: + +- :ref:`Vector2` **get_function_scroll** **(** :ref:`String` name **)** |const| + +Returns the position of the center of the screen for a given function. + +---- + +.. _class_VisualScript_method_get_node: + +- :ref:`VisualScriptNode` **get_node** **(** :ref:`String` func, :ref:`int` id **)** |const| + +Returns a node given its id and its function. + +---- + +.. _class_VisualScript_method_get_node_position: + +- :ref:`Vector2` **get_node_position** **(** :ref:`String` func, :ref:`int` id **)** |const| + +Returns a node's position in pixels. + +---- + +.. _class_VisualScript_method_get_variable_default_value: + +- :ref:`Variant` **get_variable_default_value** **(** :ref:`String` name **)** |const| + +Returns the default (initial) value of a variable. + +---- + +.. _class_VisualScript_method_get_variable_export: + +- :ref:`bool` **get_variable_export** **(** :ref:`String` name **)** |const| + +Returns whether a variable is exported. + +---- + +.. _class_VisualScript_method_get_variable_info: + +- :ref:`Dictionary` **get_variable_info** **(** :ref:`String` name **)** |const| + +Returns the information for a given variable as a dictionary. The information includes its name, type, hint and usage. + +---- + +.. _class_VisualScript_method_has_custom_signal: + +- :ref:`bool` **has_custom_signal** **(** :ref:`String` name **)** |const| + +Returns whether a signal exists with the specified name. + +---- + +.. _class_VisualScript_method_has_data_connection: + +- :ref:`bool` **has_data_connection** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| + +Returns whether the specified data ports are connected. + +---- + +.. _class_VisualScript_method_has_function: + +- :ref:`bool` **has_function** **(** :ref:`String` name **)** |const| + +Returns whether a function exists with the specified name. + +---- + +.. _class_VisualScript_method_has_node: + +- :ref:`bool` **has_node** **(** :ref:`String` func, :ref:`int` id **)** |const| + +Returns whether a node exists with the given id. + +---- + +.. _class_VisualScript_method_has_sequence_connection: + +- :ref:`bool` **has_sequence_connection** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** |const| + +Returns whether the specified sequence ports are connected. + +---- + +.. _class_VisualScript_method_has_variable: + +- :ref:`bool` **has_variable** **(** :ref:`String` name **)** |const| + +Returns whether a variable exists with the specified name. + +---- + +.. _class_VisualScript_method_remove_custom_signal: + +- void **remove_custom_signal** **(** :ref:`String` name **)** + +Remove a custom signal with the given name. + +---- + +.. _class_VisualScript_method_remove_function: + +- void **remove_function** **(** :ref:`String` name **)** + +Remove a specific function and its nodes from the script. + +---- + +.. _class_VisualScript_method_remove_node: + +- void **remove_node** **(** :ref:`String` func, :ref:`int` id **)** + +Remove a specific node. + +---- + +.. _class_VisualScript_method_remove_variable: + +- void **remove_variable** **(** :ref:`String` name **)** + +Remove a variable with the given name. + +---- + +.. _class_VisualScript_method_rename_custom_signal: + +- void **rename_custom_signal** **(** :ref:`String` name, :ref:`String` new_name **)** + +Change the name of a custom signal. + +---- + +.. _class_VisualScript_method_rename_function: + +- void **rename_function** **(** :ref:`String` name, :ref:`String` new_name **)** + +Change the name of a function. + +---- + +.. _class_VisualScript_method_rename_variable: + +- void **rename_variable** **(** :ref:`String` name, :ref:`String` new_name **)** + +Change the name of a variable. + +---- + +.. _class_VisualScript_method_sequence_connect: + +- void **sequence_connect** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** + +Connect two sequence ports. The execution will flow from of ``from_node``'s ``from_output`` into ``to_node``. + +Unlike :ref:`data_connect`, there isn't a ``to_port``, since the target node can have only one sequence port. + +---- + +.. _class_VisualScript_method_sequence_disconnect: + +- void **sequence_disconnect** **(** :ref:`String` func, :ref:`int` from_node, :ref:`int` from_output, :ref:`int` to_node **)** + +Disconnect two sequence ports previously connected with :ref:`sequence_connect`. + +---- + +.. _class_VisualScript_method_set_function_scroll: + +- void **set_function_scroll** **(** :ref:`String` name, :ref:`Vector2` ofs **)** + +Position the center of the screen for a function. + +---- + +.. _class_VisualScript_method_set_instance_base_type: + +- void **set_instance_base_type** **(** :ref:`String` type **)** + +Set the base type of the script. + +---- + +.. _class_VisualScript_method_set_node_position: + +- void **set_node_position** **(** :ref:`String` func, :ref:`int` id, :ref:`Vector2` position **)** + +Position a node on the screen. + +---- + +.. _class_VisualScript_method_set_variable_default_value: + +- void **set_variable_default_value** **(** :ref:`String` name, :ref:`Variant` value **)** + +Change the default (initial) value of a variable. + +---- + +.. _class_VisualScript_method_set_variable_export: + +- void **set_variable_export** **(** :ref:`String` name, :ref:`bool` enable **)** + +Change whether a variable is exported. + +---- + +.. _class_VisualScript_method_set_variable_info: + +- void **set_variable_info** **(** :ref:`String` name, :ref:`Dictionary` value **)** + +Set a variable's info, using the same format as :ref:`get_variable_info`. + +.. |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.)` diff --git a/classes/class_visualscriptbasictypeconstant.rst b/classes/class_visualscriptbasictypeconstant.rst new file mode 100644 index 0000000..d134a43 --- /dev/null +++ b/classes/class_visualscriptbasictypeconstant.rst @@ -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 VisualScriptBasicTypeConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptBasicTypeConstant: + +VisualScriptBasicTypeConstant +============================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node representing a constant from the base types. + +Description +----------- + +A Visual Script node representing a constant from base types, such as :ref:`Vector3.AXIS_X`. + +Properties +---------- + ++-----------------------------------------------------+----------------------------------------------------------------------------+-------+ +| :ref:`Variant.Type` | :ref:`basic_type` | ``0`` | ++-----------------------------------------------------+----------------------------------------------------------------------------+-------+ +| :ref:`String` | :ref:`constant` | | ++-----------------------------------------------------+----------------------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptBasicTypeConstant_property_basic_type: + +- :ref:`Variant.Type` **basic_type** + ++-----------+-----------------------+ +| *Default* | ``0`` | ++-----------+-----------------------+ +| *Setter* | set_basic_type(value) | ++-----------+-----------------------+ +| *Getter* | get_basic_type() | ++-----------+-----------------------+ + +The type to get the constant from. + +---- + +.. _class_VisualScriptBasicTypeConstant_property_constant: + +- :ref:`String` **constant** + ++----------+--------------------------------+ +| *Setter* | set_basic_type_constant(value) | ++----------+--------------------------------+ +| *Getter* | get_basic_type_constant() | ++----------+--------------------------------+ + +The name of the constant to return. + +.. |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.)` diff --git a/classes/class_visualscriptbuiltinfunc.rst b/classes/class_visualscriptbuiltinfunc.rst new file mode 100644 index 0000000..7cbfa53 --- /dev/null +++ b/classes/class_visualscriptbuiltinfunc.rst @@ -0,0 +1,339 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptBuiltinFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptBuiltinFunc: + +VisualScriptBuiltinFunc +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node used to call built-in functions. + +Description +----------- + +A built-in function used inside a :ref:`VisualScript`. It is usually a math function or an utility function. + +See also :ref:`@GDScript`, for the same functions in the GDScript language. + +Properties +---------- + ++--------------------------------------------------------------+------------------------------------------------------------------+-------+ +| :ref:`BuiltinFunc` | :ref:`function` | ``0`` | ++--------------------------------------------------------------+------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualScriptBuiltinFunc_BuiltinFunc: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SIN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_COS: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_TAN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SINH: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_COSH: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_TANH: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ASIN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ACOS: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ATAN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ATAN2: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SQRT: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_FMOD: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_FPOSMOD: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_FLOOR: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_CEIL: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ROUND: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ABS: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SIGN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_POW: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_LOG: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_EXP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ISNAN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_ISINF: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_EASE: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_DECIMALS: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_STEPIFY: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_LERP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_INVERSE_LERP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RANGE_LERP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_MOVE_TOWARD: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_DECTIME: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RANDOMIZE: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RAND: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RANDF: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RANDOM: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SEED: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RANDSEED: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_DEG2RAD: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_RAD2DEG: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_LINEAR2DB: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_DB2LINEAR: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_POLAR2CARTESIAN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_CARTESIAN2POLAR: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_WRAP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_WRAPF: + +.. _class_VisualScriptBuiltinFunc_constant_LOGIC_MAX: + +.. _class_VisualScriptBuiltinFunc_constant_LOGIC_MIN: + +.. _class_VisualScriptBuiltinFunc_constant_LOGIC_CLAMP: + +.. _class_VisualScriptBuiltinFunc_constant_LOGIC_NEAREST_PO2: + +.. _class_VisualScriptBuiltinFunc_constant_OBJ_WEAKREF: + +.. _class_VisualScriptBuiltinFunc_constant_FUNC_FUNCREF: + +.. _class_VisualScriptBuiltinFunc_constant_TYPE_CONVERT: + +.. _class_VisualScriptBuiltinFunc_constant_TYPE_OF: + +.. _class_VisualScriptBuiltinFunc_constant_TYPE_EXISTS: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_CHAR: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_STR: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINT: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINTERR: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_PRINTRAW: + +.. _class_VisualScriptBuiltinFunc_constant_VAR_TO_STR: + +.. _class_VisualScriptBuiltinFunc_constant_STR_TO_VAR: + +.. _class_VisualScriptBuiltinFunc_constant_VAR_TO_BYTES: + +.. _class_VisualScriptBuiltinFunc_constant_BYTES_TO_VAR: + +.. _class_VisualScriptBuiltinFunc_constant_COLORN: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_SMOOTHSTEP: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_POSMOD: + +.. _class_VisualScriptBuiltinFunc_constant_MATH_LERP_ANGLE: + +.. _class_VisualScriptBuiltinFunc_constant_TEXT_ORD: + +.. _class_VisualScriptBuiltinFunc_constant_FUNC_MAX: + +enum **BuiltinFunc**: + +- **MATH_SIN** = **0** --- Return the sine of the input. + +- **MATH_COS** = **1** --- Return the cosine of the input. + +- **MATH_TAN** = **2** --- Return the tangent of the input. + +- **MATH_SINH** = **3** --- Return the hyperbolic sine of the input. + +- **MATH_COSH** = **4** --- Return the hyperbolic cosine of the input. + +- **MATH_TANH** = **5** --- Return the hyperbolic tangent of the input. + +- **MATH_ASIN** = **6** --- Return the arc sine of the input. + +- **MATH_ACOS** = **7** --- Return the arc cosine of the input. + +- **MATH_ATAN** = **8** --- Return the arc tangent of the input. + +- **MATH_ATAN2** = **9** --- Return the arc tangent of the input, using the signs of both parameters to determine the exact angle. + +- **MATH_SQRT** = **10** --- Return the square root of the input. + +- **MATH_FMOD** = **11** --- Return the remainder of one input divided by the other, using floating-point numbers. + +- **MATH_FPOSMOD** = **12** --- Return the positive remainder of one input divided by the other, using floating-point numbers. + +- **MATH_FLOOR** = **13** --- Return the input rounded down. + +- **MATH_CEIL** = **14** --- Return the input rounded up. + +- **MATH_ROUND** = **15** --- Return the input rounded to the nearest integer. + +- **MATH_ABS** = **16** --- Return the absolute value of the input. + +- **MATH_SIGN** = **17** --- Return the sign of the input, turning it into 1, -1, or 0. Useful to determine if the input is positive or negative. + +- **MATH_POW** = **18** --- Return the input raised to a given power. + +- **MATH_LOG** = **19** --- Return the natural logarithm of the input. Note that this is not the typical base-10 logarithm function calculators use. + +- **MATH_EXP** = **20** --- Return the mathematical constant **e** raised to the specified power of the input. **e** has an approximate value of 2.71828. + +- **MATH_ISNAN** = **21** --- Return whether the input is NaN (Not a Number) or not. NaN is usually produced by dividing 0 by 0, though other ways exist. + +- **MATH_ISINF** = **22** --- Return whether the input is an infinite floating-point number or not. Infinity is usually produced by dividing a number by 0, though other ways exist. + +- **MATH_EASE** = **23** --- Easing function, based on exponent. 0 is constant, 1 is linear, 0 to 1 is ease-in, 1+ is ease out. Negative values are in-out/out in. + +- **MATH_DECIMALS** = **24** --- Return the number of digit places after the decimal that the first non-zero digit occurs. + +- **MATH_STEPIFY** = **25** --- Return the input snapped to a given step. + +- **MATH_LERP** = **26** --- Return a number linearly interpolated between the first two inputs, based on the third input. Uses the formula ``a + (a - b) * t``. + +- **MATH_INVERSE_LERP** = **27** + +- **MATH_RANGE_LERP** = **28** + +- **MATH_MOVE_TOWARD** = **29** --- Moves the number toward a value, based on the third input. + +- **MATH_DECTIME** = **30** --- Return the result of ``value`` decreased by ``step`` \* ``amount``. + +- **MATH_RANDOMIZE** = **31** --- Randomize the seed (or the internal state) of the random number generator. Current implementation reseeds using a number based on time. + +- **MATH_RAND** = **32** --- Return a random 32 bits integer value. To obtain a random value between 0 to N (where N is smaller than 2^32 - 1), you can use it with the remainder function. + +- **MATH_RANDF** = **33** --- Return a random floating-point value between 0 and 1. To obtain a random value between 0 to N, you can use it with multiplication. + +- **MATH_RANDOM** = **34** --- Return a random floating-point value between the two inputs. + +- **MATH_SEED** = **35** --- Set the seed for the random number generator. + +- **MATH_RANDSEED** = **36** --- Return a random value from the given seed, along with the new seed. + +- **MATH_DEG2RAD** = **37** --- Convert the input from degrees to radians. + +- **MATH_RAD2DEG** = **38** --- Convert the input from radians to degrees. + +- **MATH_LINEAR2DB** = **39** --- Convert the input from linear volume to decibel volume. + +- **MATH_DB2LINEAR** = **40** --- Convert the input from decibel volume to linear volume. + +- **MATH_POLAR2CARTESIAN** = **41** --- Converts a 2D point expressed in the polar coordinate system (a distance from the origin ``r`` and an angle ``th``) to the cartesian coordinate system (X and Y axis). + +- **MATH_CARTESIAN2POLAR** = **42** --- Converts a 2D point expressed in the cartesian coordinate system (X and Y axis) to the polar coordinate system (a distance from the origin and an angle). + +- **MATH_WRAP** = **43** + +- **MATH_WRAPF** = **44** + +- **LOGIC_MAX** = **45** --- Return the greater of the two numbers, also known as their maximum. + +- **LOGIC_MIN** = **46** --- Return the lesser of the two numbers, also known as their minimum. + +- **LOGIC_CLAMP** = **47** --- Return the input clamped inside the given range, ensuring the result is never outside it. Equivalent to ``min(max(input, range_low), range_high)``. + +- **LOGIC_NEAREST_PO2** = **48** --- Return the nearest power of 2 to the input. + +- **OBJ_WEAKREF** = **49** --- Create a :ref:`WeakRef` from the input. + +- **FUNC_FUNCREF** = **50** --- Create a :ref:`FuncRef` from the input. + +- **TYPE_CONVERT** = **51** --- Convert between types. + +- **TYPE_OF** = **52** --- Return the type of the input as an integer. Check :ref:`Variant.Type` for the integers that might be returned. + +- **TYPE_EXISTS** = **53** --- Checks if a type is registered in the :ref:`ClassDB`. + +- **TEXT_CHAR** = **54** --- Return a character with the given ascii value. + +- **TEXT_STR** = **55** --- Convert the input to a string. + +- **TEXT_PRINT** = **56** --- Print the given string to the output window. + +- **TEXT_PRINTERR** = **57** --- Print the given string to the standard error output. + +- **TEXT_PRINTRAW** = **58** --- Print the given string to the standard output, without adding a newline. + +- **VAR_TO_STR** = **59** --- Serialize a :ref:`Variant` to a string. + +- **STR_TO_VAR** = **60** --- Deserialize a :ref:`Variant` from a string serialized using :ref:`VAR_TO_STR`. + +- **VAR_TO_BYTES** = **61** --- Serialize a :ref:`Variant` to a :ref:`PoolByteArray`. + +- **BYTES_TO_VAR** = **62** --- Deserialize a :ref:`Variant` from a :ref:`PoolByteArray` serialized using :ref:`VAR_TO_BYTES`. + +- **COLORN** = **63** --- Return the :ref:`Color` with the given name and alpha ranging from 0 to 1. + +**Note:** Names are defined in ``color_names.inc``. + +- **MATH_SMOOTHSTEP** = **64** --- Return a number smoothly interpolated between the first two inputs, based on the third input. Similar to :ref:`MATH_LERP`, but interpolates faster at the beginning and slower at the end. Using Hermite interpolation formula: + +:: + + var t = clamp((weight - from) / (to - from), 0.0, 1.0) + return t * t * (3.0 - 2.0 * t) + +- **MATH_POSMOD** = **65** + +- **MATH_LERP_ANGLE** = **66** + +- **TEXT_ORD** = **67** + +- **FUNC_MAX** = **68** --- Represents the size of the :ref:`BuiltinFunc` enum. + +Property Descriptions +--------------------- + +.. _class_VisualScriptBuiltinFunc_property_function: + +- :ref:`BuiltinFunc` **function** + ++-----------+-----------------+ +| *Default* | ``0`` | ++-----------+-----------------+ +| *Setter* | set_func(value) | ++-----------+-----------------+ +| *Getter* | get_func() | ++-----------+-----------------+ + +The function to be executed. + +.. |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.)` diff --git a/classes/class_visualscriptclassconstant.rst b/classes/class_visualscriptclassconstant.rst new file mode 100644 index 0000000..e71ef24 --- /dev/null +++ b/classes/class_visualscriptclassconstant.rst @@ -0,0 +1,73 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptClassConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptClassConstant: + +VisualScriptClassConstant +========================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Gets a constant from a given class. + +Description +----------- + +This node returns a constant from a given class, such as :ref:`@GlobalScope.TYPE_INT`. See the given class' documentation for available constants. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (variant): ``value`` + +Properties +---------- + ++-----------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++-----------------------------+----------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`constant` | ``""`` | ++-----------------------------+----------------------------------------------------------------------+--------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptClassConstant_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The constant's parent class. + +---- + +.. _class_VisualScriptClassConstant_property_constant: + +- :ref:`String` **constant** + ++-----------+---------------------------+ +| *Default* | ``""`` | ++-----------+---------------------------+ +| *Setter* | set_class_constant(value) | ++-----------+---------------------------+ +| *Getter* | get_class_constant() | ++-----------+---------------------------+ + +The constant to return. See the given class for its available 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.)` diff --git a/classes/class_visualscriptcomment.rst b/classes/class_visualscriptcomment.rst new file mode 100644 index 0000000..4e5cd6f --- /dev/null +++ b/classes/class_visualscriptcomment.rst @@ -0,0 +1,85 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptComment.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptComment: + +VisualScriptComment +=================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node used to annotate the script. + +Description +----------- + +A Visual Script node used to display annotations in the script, so that code may be documented. + +Comment nodes can be resized so they encompass a group of nodes. + +Properties +---------- + ++-------------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`description` | ``""`` | ++-------------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 150, 150 )`` | ++-------------------------------+--------------------------------------------------------------------+-------------------------+ +| :ref:`String` | :ref:`title` | ``"Comment"`` | ++-------------------------------+--------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptComment_property_description: + +- :ref:`String` **description** + ++-----------+------------------------+ +| *Default* | ``""`` | ++-----------+------------------------+ +| *Setter* | set_description(value) | ++-----------+------------------------+ +| *Getter* | get_description() | ++-----------+------------------------+ + +The text inside the comment node. + +---- + +.. _class_VisualScriptComment_property_size: + +- :ref:`Vector2` **size** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 150, 150 )`` | ++-----------+-------------------------+ +| *Setter* | set_size(value) | ++-----------+-------------------------+ +| *Getter* | get_size() | ++-----------+-------------------------+ + +The comment node's size (in pixels). + +---- + +.. _class_VisualScriptComment_property_title: + +- :ref:`String` **title** + ++-----------+------------------+ +| *Default* | ``"Comment"`` | ++-----------+------------------+ +| *Setter* | set_title(value) | ++-----------+------------------+ +| *Getter* | get_title() | ++-----------+------------------+ + +The comment node's title. + +.. |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.)` diff --git a/classes/class_visualscriptcomposearray.rst b/classes/class_visualscriptcomposearray.rst new file mode 100644 index 0000000..5d9c0d9 --- /dev/null +++ b/classes/class_visualscriptcomposearray.rst @@ -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 VisualScriptComposeArray.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptComposeArray: + +VisualScriptComposeArray +======================== + +**Inherits:** :ref:`VisualScriptLists` **<** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script Node used to create array from a list of items. + +Description +----------- + +A Visual Script Node used to compose array from the list of elements provided with custom in-graph UI hard coded in the VisualScript Editor. + +.. |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.)` diff --git a/classes/class_visualscriptcondition.rst b/classes/class_visualscriptcondition.rst new file mode 100644 index 0000000..4f75d26 --- /dev/null +++ b/classes/class_visualscriptcondition.rst @@ -0,0 +1,37 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptCondition.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptCondition: + +VisualScriptCondition +===================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node which branches the flow. + +Description +----------- + +A Visual Script node that checks a :ref:`bool` input port. If ``true``, it will exit via the "true" sequence port. If ``false``, it will exit via the "false" sequence port. After exiting either, it exits via the "done" port. Sequence ports may be left disconnected. + +**Input Ports:** + +- Sequence: ``if (cond) is`` + +- Data (boolean): ``cond`` + +**Output Ports:** + +- Sequence: ``true`` + +- Sequence: ``false`` + +- Sequence: ``done`` + +.. |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.)` diff --git a/classes/class_visualscriptconstant.rst b/classes/class_visualscriptconstant.rst new file mode 100644 index 0000000..8483995 --- /dev/null +++ b/classes/class_visualscriptconstant.rst @@ -0,0 +1,71 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptConstant: + +VisualScriptConstant +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Gets a contant's value. + +Description +----------- + +This node returns a constant's value. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (variant): ``get`` + +Properties +---------- + ++-----------------------------------------------------+---------------------------------------------------------+-------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------+-------+ +| :ref:`Variant` | :ref:`value` | | ++-----------------------------------------------------+---------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptConstant_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_constant_type(value) | ++-----------+--------------------------+ +| *Getter* | get_constant_type() | ++-----------+--------------------------+ + +The constant's type. + +---- + +.. _class_VisualScriptConstant_property_value: + +- :ref:`Variant` **value** + ++----------+---------------------------+ +| *Setter* | set_constant_value(value) | ++----------+---------------------------+ +| *Getter* | get_constant_value() | ++----------+---------------------------+ + +The constant's value. + +.. |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.)` diff --git a/classes/class_visualscriptconstructor.rst b/classes/class_visualscriptconstructor.rst new file mode 100644 index 0000000..2bf6fca --- /dev/null +++ b/classes/class_visualscriptconstructor.rst @@ -0,0 +1,61 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptConstructor.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptConstructor: + +VisualScriptConstructor +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node which calls a base type constructor. + +Description +----------- + +A Visual Script node which calls a base type constructor. It can be used for type conversion as well. + +Methods +------- + ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_constructor` **(** **)** |const| | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant.Type` | :ref:`get_constructor_type` **(** **)** |const| | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_constructor` **(** :ref:`Dictionary` constructor **)** | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_constructor_type` **(** :ref:`Variant.Type` type **)** | ++-----------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VisualScriptConstructor_method_get_constructor: + +- :ref:`Dictionary` **get_constructor** **(** **)** |const| + +---- + +.. _class_VisualScriptConstructor_method_get_constructor_type: + +- :ref:`Variant.Type` **get_constructor_type** **(** **)** |const| + +---- + +.. _class_VisualScriptConstructor_method_set_constructor: + +- void **set_constructor** **(** :ref:`Dictionary` constructor **)** + +---- + +.. _class_VisualScriptConstructor_method_set_constructor_type: + +- void **set_constructor_type** **(** :ref:`Variant.Type` 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.)` diff --git a/classes/class_visualscriptcustomnode.rst b/classes/class_visualscriptcustomnode.rst new file mode 100644 index 0000000..a11a8d8 --- /dev/null +++ b/classes/class_visualscriptcustomnode.rst @@ -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 VisualScriptCustomNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptCustomNode: + +VisualScriptCustomNode +====================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A scripted Visual Script node. + +Description +----------- + +A custom Visual Script node which can be scripted in powerful ways. + +Methods +------- + ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_caption` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_category` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_input_value_port_count` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_input_value_port_hint` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_input_value_port_hint_string` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_input_value_port_name` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_input_value_port_type` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_sequence_port_count` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_output_sequence_port_text` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_value_port_count` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_value_port_hint` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_output_value_port_hint_string` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_output_value_port_name` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_value_port_type` **(** :ref:`int` idx **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_text` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_working_memory_size` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`_has_input_sequence_port` **(** **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`_step` **(** :ref:`Array` inputs, :ref:`Array` outputs, :ref:`int` start_mode, :ref:`Array` working_mem **)** |virtual| | ++-------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_VisualScriptCustomNode_StartMode: + +.. _class_VisualScriptCustomNode_constant_START_MODE_BEGIN_SEQUENCE: + +.. _class_VisualScriptCustomNode_constant_START_MODE_CONTINUE_SEQUENCE: + +.. _class_VisualScriptCustomNode_constant_START_MODE_RESUME_YIELD: + +enum **StartMode**: + +- **START_MODE_BEGIN_SEQUENCE** = **0** --- The start mode used the first time when :ref:`_step` is called. + +- **START_MODE_CONTINUE_SEQUENCE** = **1** --- The start mode used when :ref:`_step` is called after coming back from a :ref:`STEP_PUSH_STACK_BIT`. + +- **START_MODE_RESUME_YIELD** = **2** --- The start mode used when :ref:`_step` is called after resuming from :ref:`STEP_YIELD_BIT`. + +Constants +--------- + +.. _class_VisualScriptCustomNode_constant_STEP_PUSH_STACK_BIT: + +.. _class_VisualScriptCustomNode_constant_STEP_GO_BACK_BIT: + +.. _class_VisualScriptCustomNode_constant_STEP_NO_ADVANCE_BIT: + +.. _class_VisualScriptCustomNode_constant_STEP_EXIT_FUNCTION_BIT: + +.. _class_VisualScriptCustomNode_constant_STEP_YIELD_BIT: + +- **STEP_PUSH_STACK_BIT** = **16777216** --- Hint used by :ref:`_step` to tell that control should return to it when there is no other node left to execute. + +This is used by :ref:`VisualScriptCondition` to redirect the sequence to the "Done" port after the ``true``/``false`` branch has finished execution. + +- **STEP_GO_BACK_BIT** = **33554432** --- Hint used by :ref:`_step` to tell that control should return back, either hitting a previous :ref:`STEP_PUSH_STACK_BIT` or exiting the function. + +- **STEP_NO_ADVANCE_BIT** = **67108864** + +- **STEP_EXIT_FUNCTION_BIT** = **134217728** --- Hint used by :ref:`_step` to tell that control should stop and exit the function. + +- **STEP_YIELD_BIT** = **268435456** --- Hint used by :ref:`_step` to tell that the function should be yielded. + +Using this requires you to have at least one working memory slot, which is used for the :ref:`VisualScriptFunctionState`. + +Method Descriptions +------------------- + +.. _class_VisualScriptCustomNode_method__get_caption: + +- :ref:`String` **_get_caption** **(** **)** |virtual| + +Return the node's title. + +---- + +.. _class_VisualScriptCustomNode_method__get_category: + +- :ref:`String` **_get_category** **(** **)** |virtual| + +Return the node's category. + +---- + +.. _class_VisualScriptCustomNode_method__get_input_value_port_count: + +- :ref:`int` **_get_input_value_port_count** **(** **)** |virtual| + +Return the count of input value ports. + +---- + +.. _class_VisualScriptCustomNode_method__get_input_value_port_hint: + +- :ref:`int` **_get_input_value_port_hint** **(** :ref:`int` idx **)** |virtual| + +Return the specified input port's hint. See the :ref:`PropertyHint` hints. + +---- + +.. _class_VisualScriptCustomNode_method__get_input_value_port_hint_string: + +- :ref:`String` **_get_input_value_port_hint_string** **(** :ref:`int` idx **)** |virtual| + +Return the specified input port's hint string. + +---- + +.. _class_VisualScriptCustomNode_method__get_input_value_port_name: + +- :ref:`String` **_get_input_value_port_name** **(** :ref:`int` idx **)** |virtual| + +Return the specified input port's name. + +---- + +.. _class_VisualScriptCustomNode_method__get_input_value_port_type: + +- :ref:`int` **_get_input_value_port_type** **(** :ref:`int` idx **)** |virtual| + +Return the specified input port's type. See the :ref:`Variant.Type` values. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_sequence_port_count: + +- :ref:`int` **_get_output_sequence_port_count** **(** **)** |virtual| + +Return the amount of output **sequence** ports. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_sequence_port_text: + +- :ref:`String` **_get_output_sequence_port_text** **(** :ref:`int` idx **)** |virtual| + +Return the specified **sequence** output's name. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_value_port_count: + +- :ref:`int` **_get_output_value_port_count** **(** **)** |virtual| + +Return the amount of output value ports. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_value_port_hint: + +- :ref:`int` **_get_output_value_port_hint** **(** :ref:`int` idx **)** |virtual| + +Return the specified output port's hint. See the :ref:`PropertyHint` hints. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_value_port_hint_string: + +- :ref:`String` **_get_output_value_port_hint_string** **(** :ref:`int` idx **)** |virtual| + +Return the specified output port's hint string. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_value_port_name: + +- :ref:`String` **_get_output_value_port_name** **(** :ref:`int` idx **)** |virtual| + +Return the specified output port's name. + +---- + +.. _class_VisualScriptCustomNode_method__get_output_value_port_type: + +- :ref:`int` **_get_output_value_port_type** **(** :ref:`int` idx **)** |virtual| + +Return the specified output port's type. See the :ref:`Variant.Type` values. + +---- + +.. _class_VisualScriptCustomNode_method__get_text: + +- :ref:`String` **_get_text** **(** **)** |virtual| + +Return the custom node's text, which is shown right next to the input **sequence** port (if there is none, on the place that is usually taken by it). + +---- + +.. _class_VisualScriptCustomNode_method__get_working_memory_size: + +- :ref:`int` **_get_working_memory_size** **(** **)** |virtual| + +Return the size of the custom node's working memory. See :ref:`_step` for more details. + +---- + +.. _class_VisualScriptCustomNode_method__has_input_sequence_port: + +- :ref:`bool` **_has_input_sequence_port** **(** **)** |virtual| + +Return whether the custom node has an input **sequence** port. + +---- + +.. _class_VisualScriptCustomNode_method__step: + +- :ref:`Variant` **_step** **(** :ref:`Array` inputs, :ref:`Array` outputs, :ref:`int` start_mode, :ref:`Array` working_mem **)** |virtual| + +Execute the custom node's logic, returning the index of the output sequence port to use or a :ref:`String` when there is an error. + +The ``inputs`` array contains the values of the input ports. + +``outputs`` is an array whose indices should be set to the respective outputs. + +The ``start_mode`` is usually :ref:`START_MODE_BEGIN_SEQUENCE`, unless you have used the ``STEP_*`` constants. + +``working_mem`` is an array which can be used to persist information between runs of the custom node. The size needs to be predefined using :ref:`_get_working_memory_size`. + +When returning, you can mask the returned value with one of the ``STEP_*`` 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.)` diff --git a/classes/class_visualscriptdeconstruct.rst b/classes/class_visualscriptdeconstruct.rst new file mode 100644 index 0000000..6271a7a --- /dev/null +++ b/classes/class_visualscriptdeconstruct.rst @@ -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 VisualScriptDeconstruct.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptDeconstruct: + +VisualScriptDeconstruct +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node which deconstructs a base type instance into its parts. + +Description +----------- + +A Visual Script node which deconstructs a base type instance into its parts. + +Properties +---------- + ++-----------------------------------------------------+----------------------------------------------------------+-------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-----------------------------------------------------+----------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptDeconstruct_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+-----------------------------+ +| *Default* | ``0`` | ++-----------+-----------------------------+ +| *Setter* | set_deconstruct_type(value) | ++-----------+-----------------------------+ +| *Getter* | get_deconstruct_type() | ++-----------+-----------------------------+ + +The type to deconstruct. + +.. |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.)` diff --git a/classes/class_visualscripteditor.rst b/classes/class_visualscripteditor.rst new file mode 100644 index 0000000..387226b --- /dev/null +++ b/classes/class_visualscripteditor.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptEditor.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptEditor: + +VisualScriptEditor +================== + +**Inherits:** :ref:`Object` + + + +Methods +------- + ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_custom_node` **(** :ref:`String` name, :ref:`String` category, :ref:`Script` script **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_custom_node` **(** :ref:`String` name, :ref:`String` category **)** | ++------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualScriptEditor_signal_custom_nodes_updated: + +- **custom_nodes_updated** **(** **)** + +Emitted when a custom Visual Script node is added or removed. + +Method Descriptions +------------------- + +.. _class_VisualScriptEditor_method_add_custom_node: + +- void **add_custom_node** **(** :ref:`String` name, :ref:`String` category, :ref:`Script` script **)** + +Add a custom Visual Script node to the editor. It'll be placed under "Custom Nodes" with the ``category`` as the parameter. + +---- + +.. _class_VisualScriptEditor_method_remove_custom_node: + +- void **remove_custom_node** **(** :ref:`String` name, :ref:`String` category **)** + +Remove a custom Visual Script node from the editor. Custom nodes already placed on scripts won't be removed. + +.. |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.)` diff --git a/classes/class_visualscriptemitsignal.rst b/classes/class_visualscriptemitsignal.rst new file mode 100644 index 0000000..43f644f --- /dev/null +++ b/classes/class_visualscriptemitsignal.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptEmitSignal.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptEmitSignal: + +VisualScriptEmitSignal +====================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Emits a specified signal. + +Description +----------- + +Emits a specified signal when it is executed. + +**Input Ports:** + +- Sequence: ``emit`` + +**Output Ports:** + +- Sequence + +Properties +---------- + ++-----------------------------+-------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`signal` | ``""`` | ++-----------------------------+-------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptEmitSignal_property_signal: + +- :ref:`String` **signal** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_signal(value) | ++-----------+-------------------+ +| *Getter* | get_signal() | ++-----------+-------------------+ + +The signal to emit. + +.. |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.)` diff --git a/classes/class_visualscriptenginesingleton.rst b/classes/class_visualscriptenginesingleton.rst new file mode 100644 index 0000000..6477997 --- /dev/null +++ b/classes/class_visualscriptenginesingleton.rst @@ -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 VisualScriptEngineSingleton.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptEngineSingleton: + +VisualScriptEngineSingleton +=========================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node returning a singleton from :ref:`@GlobalScope`. + +Description +----------- + +A Visual Script node returning a singleton from :ref:`@GlobalScope`. + +Properties +---------- + ++-----------------------------+----------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`constant` | ``""`` | ++-----------------------------+----------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptEngineSingleton_property_constant: + +- :ref:`String` **constant** + ++-----------+----------------------+ +| *Default* | ``""`` | ++-----------+----------------------+ +| *Setter* | set_singleton(value) | ++-----------+----------------------+ +| *Getter* | get_singleton() | ++-----------+----------------------+ + +The singleton's 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.)` diff --git a/classes/class_visualscriptexpression.rst b/classes/class_visualscriptexpression.rst new file mode 100644 index 0000000..fb8377b --- /dev/null +++ b/classes/class_visualscriptexpression.rst @@ -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 VisualScriptExpression.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptExpression: + +VisualScriptExpression +====================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node that can execute a custom expression. + +Description +----------- + +A Visual Script node that can execute a custom expression. Values can be provided for the input and the expression result can be retrieved from the output. + +.. |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.)` diff --git a/classes/class_visualscriptfunction.rst b/classes/class_visualscriptfunction.rst new file mode 100644 index 0000000..f1bce4e --- /dev/null +++ b/classes/class_visualscriptfunction.rst @@ -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 VisualScriptFunction.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptFunction: + +VisualScriptFunction +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node representing a function. + +Description +----------- + +``VisualScriptFunction`` represents a function header. It is the starting point for the function body and can be used to tweak the function's properties (e.g. RPC mode). + +.. |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.)` diff --git a/classes/class_visualscriptfunctioncall.rst b/classes/class_visualscriptfunctioncall.rst new file mode 100644 index 0000000..bee56bd --- /dev/null +++ b/classes/class_visualscriptfunctioncall.rst @@ -0,0 +1,252 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptFunctionCall.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptFunctionCall: + +VisualScriptFunctionCall +======================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node for calling a function. + +Description +----------- + +``VisualScriptFunctionCall`` is created when you add or drag and drop a function onto the Visual Script graph. It allows to tweak parameters of the call, e.g. what object the function is called on. + +Properties +---------- + ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_script` | | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`Variant.Type` | :ref:`basic_type` | | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`CallMode` | :ref:`call_mode` | ``0`` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`function` | ``""`` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`NodePath` | :ref:`node_path` | | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`RPCCallMode` | :ref:`rpc_call_mode` | ``0`` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`singleton` | | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`int` | :ref:`use_default_args` | | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ +| :ref:`bool` | :ref:`validate` | ``true`` | ++---------------------------------------------------------------+-----------------------------------------------------------------------------------+--------------+ + +Enumerations +------------ + +.. _enum_VisualScriptFunctionCall_CallMode: + +.. _class_VisualScriptFunctionCall_constant_CALL_MODE_SELF: + +.. _class_VisualScriptFunctionCall_constant_CALL_MODE_NODE_PATH: + +.. _class_VisualScriptFunctionCall_constant_CALL_MODE_INSTANCE: + +.. _class_VisualScriptFunctionCall_constant_CALL_MODE_BASIC_TYPE: + +.. _class_VisualScriptFunctionCall_constant_CALL_MODE_SINGLETON: + +enum **CallMode**: + +- **CALL_MODE_SELF** = **0** --- The method will be called on this :ref:`Object`. + +- **CALL_MODE_NODE_PATH** = **1** --- The method will be called on the given :ref:`Node` in the scene tree. + +- **CALL_MODE_INSTANCE** = **2** --- The method will be called on an instanced node with the given type and script. + +- **CALL_MODE_BASIC_TYPE** = **3** --- The method will be called on a GDScript basic type (e.g. :ref:`Vector2`). + +- **CALL_MODE_SINGLETON** = **4** --- The method will be called on a singleton. + +---- + +.. _enum_VisualScriptFunctionCall_RPCCallMode: + +.. _class_VisualScriptFunctionCall_constant_RPC_DISABLED: + +.. _class_VisualScriptFunctionCall_constant_RPC_RELIABLE: + +.. _class_VisualScriptFunctionCall_constant_RPC_UNRELIABLE: + +.. _class_VisualScriptFunctionCall_constant_RPC_RELIABLE_TO_ID: + +.. _class_VisualScriptFunctionCall_constant_RPC_UNRELIABLE_TO_ID: + +enum **RPCCallMode**: + +- **RPC_DISABLED** = **0** --- The method will be called locally. + +- **RPC_RELIABLE** = **1** --- The method will be called remotely. + +- **RPC_UNRELIABLE** = **2** --- The method will be called remotely using an unreliable protocol. + +- **RPC_RELIABLE_TO_ID** = **3** --- The method will be called remotely for the given peer. + +- **RPC_UNRELIABLE_TO_ID** = **4** --- The method will be called remotely for the given peer, using an unreliable protocol. + +Property Descriptions +--------------------- + +.. _class_VisualScriptFunctionCall_property_base_script: + +- :ref:`String` **base_script** + ++----------+------------------------+ +| *Setter* | set_base_script(value) | ++----------+------------------------+ +| *Getter* | get_base_script() | ++----------+------------------------+ + +The script to be used when :ref:`call_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptFunctionCall_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The base type to be used when :ref:`call_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptFunctionCall_property_basic_type: + +- :ref:`Variant.Type` **basic_type** + ++----------+-----------------------+ +| *Setter* | set_basic_type(value) | ++----------+-----------------------+ +| *Getter* | get_basic_type() | ++----------+-----------------------+ + +The type to be used when :ref:`call_mode` is set to :ref:`CALL_MODE_BASIC_TYPE`. + +---- + +.. _class_VisualScriptFunctionCall_property_call_mode: + +- :ref:`CallMode` **call_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_call_mode(value) | ++-----------+----------------------+ +| *Getter* | get_call_mode() | ++-----------+----------------------+ + +``call_mode`` determines the target object on which the method will be called. See :ref:`CallMode` for options. + +---- + +.. _class_VisualScriptFunctionCall_property_function: + +- :ref:`String` **function** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The name of the function to be called. + +---- + +.. _class_VisualScriptFunctionCall_property_node_path: + +- :ref:`NodePath` **node_path** + ++----------+----------------------+ +| *Setter* | set_base_path(value) | ++----------+----------------------+ +| *Getter* | get_base_path() | ++----------+----------------------+ + +The node path to use when :ref:`call_mode` is set to :ref:`CALL_MODE_NODE_PATH`. + +---- + +.. _class_VisualScriptFunctionCall_property_rpc_call_mode: + +- :ref:`RPCCallMode` **rpc_call_mode** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_rpc_call_mode(value) | ++-----------+--------------------------+ +| *Getter* | get_rpc_call_mode() | ++-----------+--------------------------+ + +The mode for RPC calls. See :ref:`Node.rpc` for more details and :ref:`RPCCallMode` for available options. + +---- + +.. _class_VisualScriptFunctionCall_property_singleton: + +- :ref:`String` **singleton** + ++----------+----------------------+ +| *Setter* | set_singleton(value) | ++----------+----------------------+ +| *Getter* | get_singleton() | ++----------+----------------------+ + +The singleton to call the method on. Used when :ref:`call_mode` is set to :ref:`CALL_MODE_SINGLETON`. + +---- + +.. _class_VisualScriptFunctionCall_property_use_default_args: + +- :ref:`int` **use_default_args** + ++----------+-----------------------------+ +| *Setter* | set_use_default_args(value) | ++----------+-----------------------------+ +| *Getter* | get_use_default_args() | ++----------+-----------------------------+ + +Number of default arguments that will be used when calling the function. Can't be higher than the number of available default arguments in the method's declaration. + +---- + +.. _class_VisualScriptFunctionCall_property_validate: + +- :ref:`bool` **validate** + ++-----------+---------------------+ +| *Default* | ``true`` | ++-----------+---------------------+ +| *Setter* | set_validate(value) | ++-----------+---------------------+ +| *Getter* | get_validate() | ++-----------+---------------------+ + +If ``false``, call errors (e.g. wrong number of arguments) will be ignored. + +.. |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.)` diff --git a/classes/class_visualscriptfunctionstate.rst b/classes/class_visualscriptfunctionstate.rst new file mode 100644 index 0000000..4cfeba5 --- /dev/null +++ b/classes/class_visualscriptfunctionstate.rst @@ -0,0 +1,59 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptFunctionState.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptFunctionState: + +VisualScriptFunctionState +========================= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node representing a function state. + +Description +----------- + +``VisualScriptFunctionState`` is returned from :ref:`VisualScriptYield` and can be used to resume a paused function call. + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_to_signal` **(** :ref:`Object` obj, :ref:`String` signals, :ref:`Array` args **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`resume` **(** :ref:`Array` args=null **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VisualScriptFunctionState_method_connect_to_signal: + +- void **connect_to_signal** **(** :ref:`Object` obj, :ref:`String` signals, :ref:`Array` args **)** + +Connects this ``VisualScriptFunctionState`` to a signal in the given object to automatically resume when it's emitted. + +---- + +.. _class_VisualScriptFunctionState_method_is_valid: + +- :ref:`bool` **is_valid** **(** **)** |const| + +Returns whether the function state is valid. + +---- + +.. _class_VisualScriptFunctionState_method_resume: + +- :ref:`Variant` **resume** **(** :ref:`Array` args=null **)** + +Resumes the function to run from the point it was yielded. + +.. |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.)` diff --git a/classes/class_visualscriptglobalconstant.rst b/classes/class_visualscriptglobalconstant.rst new file mode 100644 index 0000000..f59ccfa --- /dev/null +++ b/classes/class_visualscriptglobalconstant.rst @@ -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 VisualScriptGlobalConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptGlobalConstant: + +VisualScriptGlobalConstant +========================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node returning a constant from :ref:`@GlobalScope`. + +Description +----------- + +A Visual Script node returning a constant from :ref:`@GlobalScope`. + +Properties +---------- + ++-----------------------+---------------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`constant` | ``0`` | ++-----------------------+---------------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptGlobalConstant_property_constant: + +- :ref:`int` **constant** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_global_constant(value) | ++-----------+----------------------------+ +| *Getter* | get_global_constant() | ++-----------+----------------------------+ + +The constant to be used. + +.. |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.)` diff --git a/classes/class_visualscriptindexget.rst b/classes/class_visualscriptindexget.rst new file mode 100644 index 0000000..fbff45b --- /dev/null +++ b/classes/class_visualscriptindexget.rst @@ -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 VisualScriptIndexGet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptIndexGet: + +VisualScriptIndexGet +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node for getting a value from an array or a dictionary. + +Description +----------- + +``VisualScriptIndexGet`` will return the value stored in an array or a dictionary under the given 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.)` diff --git a/classes/class_visualscriptindexset.rst b/classes/class_visualscriptindexset.rst new file mode 100644 index 0000000..ae82a90 --- /dev/null +++ b/classes/class_visualscriptindexset.rst @@ -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 VisualScriptIndexSet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptIndexSet: + +VisualScriptIndexSet +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node for setting a value in an array or a dictionary. + +Description +----------- + +``VisualScriptIndexSet`` will set the value stored in an array or a dictionary under the given index to the provided new value. + +.. |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.)` diff --git a/classes/class_visualscriptinputaction.rst b/classes/class_visualscriptinputaction.rst new file mode 100644 index 0000000..41ba2a5 --- /dev/null +++ b/classes/class_visualscriptinputaction.rst @@ -0,0 +1,88 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptInputAction.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptInputAction: + +VisualScriptInputAction +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node returning a state of an action. + +Description +----------- + +``VisualScriptInputAction`` can be used to check if an action is pressed or released. + +Properties +---------- + ++------------------------------------------------+--------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`action` | ``""`` | ++------------------------------------------------+--------------------------------------------------------------+--------+ +| :ref:`Mode` | :ref:`mode` | ``0`` | ++------------------------------------------------+--------------------------------------------------------------+--------+ + +Enumerations +------------ + +.. _enum_VisualScriptInputAction_Mode: + +.. _class_VisualScriptInputAction_constant_MODE_PRESSED: + +.. _class_VisualScriptInputAction_constant_MODE_RELEASED: + +.. _class_VisualScriptInputAction_constant_MODE_JUST_PRESSED: + +.. _class_VisualScriptInputAction_constant_MODE_JUST_RELEASED: + +enum **Mode**: + +- **MODE_PRESSED** = **0** --- ``True`` if action is pressed. + +- **MODE_RELEASED** = **1** --- ``True`` if action is released (i.e. not pressed). + +- **MODE_JUST_PRESSED** = **2** --- ``True`` on the frame the action was pressed. + +- **MODE_JUST_RELEASED** = **3** --- ``True`` on the frame the action was released. + +Property Descriptions +--------------------- + +.. _class_VisualScriptInputAction_property_action: + +- :ref:`String` **action** + ++-----------+------------------------+ +| *Default* | ``""`` | ++-----------+------------------------+ +| *Setter* | set_action_name(value) | ++-----------+------------------------+ +| *Getter* | get_action_name() | ++-----------+------------------------+ + +Name of the action. + +---- + +.. _class_VisualScriptInputAction_property_mode: + +- :ref:`Mode` **mode** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_action_mode(value) | ++-----------+------------------------+ +| *Getter* | get_action_mode() | ++-----------+------------------------+ + +State of the action to check. See :ref:`Mode` for options. + +.. |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.)` diff --git a/classes/class_visualscriptiterator.rst b/classes/class_visualscriptiterator.rst new file mode 100644 index 0000000..8f002c8 --- /dev/null +++ b/classes/class_visualscriptiterator.rst @@ -0,0 +1,37 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptIterator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptIterator: + +VisualScriptIterator +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Steps through items in a given input. + +Description +----------- + +This node steps through each item in a given input. Input can be any sequence data type, such as an :ref:`Array` or :ref:`String`. When each item has been processed, execution passed out the ``exit`` Sequence port. + +**Input Ports:** + +- Sequence: ``for (elem) in (input)`` + +- Data (variant): ``input`` + +**Output Ports:** + +- Sequence: ``each`` + +- Sequence: ``exit`` + +- Data (variant): ``elem`` + +.. |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.)` diff --git a/classes/class_visualscriptlists.rst b/classes/class_visualscriptlists.rst new file mode 100644 index 0000000..a9a38e1 --- /dev/null +++ b/classes/class_visualscriptlists.rst @@ -0,0 +1,111 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptLists.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptLists: + +VisualScriptLists +================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualScriptComposeArray` + +A Visual Script virtual class for in-graph editable nodes. + +Description +----------- + +A Visual Script virtual class that defines the shape and the default behavior of the nodes that have to be in-graph editable nodes. + +Methods +------- + ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_input_data_port` **(** :ref:`Variant.Type` type, :ref:`String` name, :ref:`int` index **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_output_data_port` **(** :ref:`Variant.Type` type, :ref:`String` name, :ref:`int` index **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_input_data_port` **(** :ref:`int` index **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_output_data_port` **(** :ref:`int` index **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_data_port_name` **(** :ref:`int` index, :ref:`String` name **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_data_port_type` **(** :ref:`int` index, :ref:`Variant.Type` type **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_output_data_port_name` **(** :ref:`int` index, :ref:`String` name **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_output_data_port_type` **(** :ref:`int` index, :ref:`Variant.Type` type **)** | ++------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VisualScriptLists_method_add_input_data_port: + +- void **add_input_data_port** **(** :ref:`Variant.Type` type, :ref:`String` name, :ref:`int` index **)** + +Adds an input port to the Visual Script node. + +---- + +.. _class_VisualScriptLists_method_add_output_data_port: + +- void **add_output_data_port** **(** :ref:`Variant.Type` type, :ref:`String` name, :ref:`int` index **)** + +Adds an output port to the Visual Script node. + +---- + +.. _class_VisualScriptLists_method_remove_input_data_port: + +- void **remove_input_data_port** **(** :ref:`int` index **)** + +Removes an input port from the Visual Script node. + +---- + +.. _class_VisualScriptLists_method_remove_output_data_port: + +- void **remove_output_data_port** **(** :ref:`int` index **)** + +Removes an output port from the Visual Script node. + +---- + +.. _class_VisualScriptLists_method_set_input_data_port_name: + +- void **set_input_data_port_name** **(** :ref:`int` index, :ref:`String` name **)** + +Sets the name of an input port. + +---- + +.. _class_VisualScriptLists_method_set_input_data_port_type: + +- void **set_input_data_port_type** **(** :ref:`int` index, :ref:`Variant.Type` type **)** + +Sets the type of an input port. + +---- + +.. _class_VisualScriptLists_method_set_output_data_port_name: + +- void **set_output_data_port_name** **(** :ref:`int` index, :ref:`String` name **)** + +Sets the name of an output port. + +---- + +.. _class_VisualScriptLists_method_set_output_data_port_type: + +- void **set_output_data_port_type** **(** :ref:`int` index, :ref:`Variant.Type` type **)** + +Sets the type of an output port. + +.. |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.)` diff --git a/classes/class_visualscriptlocalvar.rst b/classes/class_visualscriptlocalvar.rst new file mode 100644 index 0000000..8102610 --- /dev/null +++ b/classes/class_visualscriptlocalvar.rst @@ -0,0 +1,73 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptLocalVar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptLocalVar: + +VisualScriptLocalVar +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Gets a local variable's value. + +Description +----------- + +Returns a local variable's value. "Var Name" must be supplied, with an optional type. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (variant): ``get`` + +Properties +---------- + ++-----------------------------------------------------+---------------------------------------------------------------+-----------------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------+ +| :ref:`String` | :ref:`var_name` | ``"new_local"`` | ++-----------------------------------------------------+---------------------------------------------------------------+-----------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptLocalVar_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_var_type(value) | ++-----------+---------------------+ +| *Getter* | get_var_type() | ++-----------+---------------------+ + +The local variable's type. + +---- + +.. _class_VisualScriptLocalVar_property_var_name: + +- :ref:`String` **var_name** + ++-----------+---------------------+ +| *Default* | ``"new_local"`` | ++-----------+---------------------+ +| *Setter* | set_var_name(value) | ++-----------+---------------------+ +| *Getter* | get_var_name() | ++-----------+---------------------+ + +The local variable's 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.)` diff --git a/classes/class_visualscriptlocalvarset.rst b/classes/class_visualscriptlocalvarset.rst new file mode 100644 index 0000000..16e7907 --- /dev/null +++ b/classes/class_visualscriptlocalvarset.rst @@ -0,0 +1,77 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptLocalVarSet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptLocalVarSet: + +VisualScriptLocalVarSet +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Changes a local variable's value. + +Description +----------- + +Changes a local variable's value to the given input. The new value is also provided on an output Data port. + +**Input Ports:** + +- Sequence + +- Data (variant): ``set`` + +**Output Ports:** + +- Sequence + +- Data (variant): ``get`` + +Properties +---------- + ++-----------------------------------------------------+------------------------------------------------------------------+-----------------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-----------------------------------------------------+------------------------------------------------------------------+-----------------+ +| :ref:`String` | :ref:`var_name` | ``"new_local"`` | ++-----------------------------------------------------+------------------------------------------------------------------+-----------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptLocalVarSet_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_var_type(value) | ++-----------+---------------------+ +| *Getter* | get_var_type() | ++-----------+---------------------+ + +The local variable's type. + +---- + +.. _class_VisualScriptLocalVarSet_property_var_name: + +- :ref:`String` **var_name** + ++-----------+---------------------+ +| *Default* | ``"new_local"`` | ++-----------+---------------------+ +| *Setter* | set_var_name(value) | ++-----------+---------------------+ +| *Getter* | get_var_name() | ++-----------+---------------------+ + +The local variable's 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.)` diff --git a/classes/class_visualscriptmathconstant.rst b/classes/class_visualscriptmathconstant.rst new file mode 100644 index 0000000..a013e95 --- /dev/null +++ b/classes/class_visualscriptmathconstant.rst @@ -0,0 +1,98 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptMathConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptMathConstant: + +VisualScriptMathConstant +======================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Commonly used mathematical constants. + +Description +----------- + +Provides common math constants, such as Pi, on an output Data port. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (variant): ``get`` + +Properties +---------- + ++-----------------------------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`MathConstant` | :ref:`constant` | ``0`` | ++-----------------------------------------------------------------+-------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualScriptMathConstant_MathConstant: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_ONE: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_PI: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_HALF_PI: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_TAU: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_E: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_SQRT2: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_INF: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_NAN: + +.. _class_VisualScriptMathConstant_constant_MATH_CONSTANT_MAX: + +enum **MathConstant**: + +- **MATH_CONSTANT_ONE** = **0** --- Unity: ``1``. + +- **MATH_CONSTANT_PI** = **1** --- Pi: ``3.141593``. + +- **MATH_CONSTANT_HALF_PI** = **2** --- Pi divided by two: ``1.570796``. + +- **MATH_CONSTANT_TAU** = **3** --- Tau: ``6.283185``. + +- **MATH_CONSTANT_E** = **4** --- Mathematical constant ``e``, the natural log base: ``2.718282``. + +- **MATH_CONSTANT_SQRT2** = **5** --- Square root of two: ``1.414214``. + +- **MATH_CONSTANT_INF** = **6** --- Infinity: ``inf``. + +- **MATH_CONSTANT_NAN** = **7** --- Not a number: ``nan``. + +- **MATH_CONSTANT_MAX** = **8** --- Represents the size of the :ref:`MathConstant` enum. + +Property Descriptions +--------------------- + +.. _class_VisualScriptMathConstant_property_constant: + +- :ref:`MathConstant` **constant** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_math_constant(value) | ++-----------+--------------------------+ +| *Getter* | get_math_constant() | ++-----------+--------------------------+ + +The math constant. + +.. |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.)` diff --git a/classes/class_visualscriptnode.rst b/classes/class_visualscriptnode.rst new file mode 100644 index 0000000..01ab22a --- /dev/null +++ b/classes/class_visualscriptnode.rst @@ -0,0 +1,80 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptNode: + +VisualScriptNode +================ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualScriptBasicTypeConstant`, :ref:`VisualScriptBuiltinFunc`, :ref:`VisualScriptClassConstant`, :ref:`VisualScriptComment`, :ref:`VisualScriptCondition`, :ref:`VisualScriptConstant`, :ref:`VisualScriptConstructor`, :ref:`VisualScriptCustomNode`, :ref:`VisualScriptDeconstruct`, :ref:`VisualScriptEmitSignal`, :ref:`VisualScriptEngineSingleton`, :ref:`VisualScriptExpression`, :ref:`VisualScriptFunction`, :ref:`VisualScriptFunctionCall`, :ref:`VisualScriptGlobalConstant`, :ref:`VisualScriptIndexGet`, :ref:`VisualScriptIndexSet`, :ref:`VisualScriptInputAction`, :ref:`VisualScriptIterator`, :ref:`VisualScriptLists`, :ref:`VisualScriptLocalVar`, :ref:`VisualScriptLocalVarSet`, :ref:`VisualScriptMathConstant`, :ref:`VisualScriptOperator`, :ref:`VisualScriptPreload`, :ref:`VisualScriptPropertyGet`, :ref:`VisualScriptPropertySet`, :ref:`VisualScriptResourcePath`, :ref:`VisualScriptReturn`, :ref:`VisualScriptSceneNode`, :ref:`VisualScriptSceneTree`, :ref:`VisualScriptSelect`, :ref:`VisualScriptSelf`, :ref:`VisualScriptSequence`, :ref:`VisualScriptSubCall`, :ref:`VisualScriptSwitch`, :ref:`VisualScriptTypeCast`, :ref:`VisualScriptVariableGet`, :ref:`VisualScriptVariableSet`, :ref:`VisualScriptWhile`, :ref:`VisualScriptYield`, :ref:`VisualScriptYieldSignal` + +A node which is part of a :ref:`VisualScript`. + +Description +----------- + +A node which is part of a :ref:`VisualScript`. Not to be confused with :ref:`Node`, which is a part of a :ref:`SceneTree`. + +Methods +------- + ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_default_input_value` **(** :ref:`int` port_idx **)** |const| | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VisualScript` | :ref:`get_visual_script` **(** **)** |const| | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`ports_changed_notify` **(** **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_input_value` **(** :ref:`int` port_idx, :ref:`Variant` value **)** | ++-----------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualScriptNode_signal_ports_changed: + +- **ports_changed** **(** **)** + +Emitted when the available input/output ports are changed. + +Method Descriptions +------------------- + +.. _class_VisualScriptNode_method_get_default_input_value: + +- :ref:`Variant` **get_default_input_value** **(** :ref:`int` port_idx **)** |const| + +Returns the default value of a given port. The default value is used when nothing is connected to the port. + +---- + +.. _class_VisualScriptNode_method_get_visual_script: + +- :ref:`VisualScript` **get_visual_script** **(** **)** |const| + +Returns the :ref:`VisualScript` instance the node is bound to. + +---- + +.. _class_VisualScriptNode_method_ports_changed_notify: + +- void **ports_changed_notify** **(** **)** + +Notify that the node's ports have changed. Usually used in conjunction with :ref:`VisualScriptCustomNode` . + +---- + +.. _class_VisualScriptNode_method_set_default_input_value: + +- void **set_default_input_value** **(** :ref:`int` port_idx, :ref:`Variant` value **)** + +Change the default value of a given port. + +.. |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.)` diff --git a/classes/class_visualscriptoperator.rst b/classes/class_visualscriptoperator.rst new file mode 100644 index 0000000..65e551b --- /dev/null +++ b/classes/class_visualscriptoperator.rst @@ -0,0 +1,73 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptOperator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptOperator: + +VisualScriptOperator +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node that performs an operation on two values. + +Description +----------- + +**Input Ports:** + +- Data (variant): ``A`` + +- Data (variant): ``B`` + +**Output Ports:** + +- Data (variant): ``result`` + +Properties +---------- + ++-------------------------------------------------------------+---------------------------------------------------------------+-------+ +| :ref:`Variant.Operator` | :ref:`operator` | ``6`` | ++-------------------------------------------------------------+---------------------------------------------------------------+-------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-------------------------------------------------------------+---------------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptOperator_property_operator: + +- :ref:`Variant.Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``6`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +The operation to be performed. See :ref:`Variant.Operator` for available options. + +---- + +.. _class_VisualScriptOperator_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_typed(value) | ++-----------+------------------+ +| *Getter* | get_typed() | ++-----------+------------------+ + +The type of the values for this operation. See :ref:`Variant.Type` for available options. + +.. |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.)` diff --git a/classes/class_visualscriptpreload.rst b/classes/class_visualscriptpreload.rst new file mode 100644 index 0000000..1e8e665 --- /dev/null +++ b/classes/class_visualscriptpreload.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptPreload.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptPreload: + +VisualScriptPreload +=================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Creates a new :ref:`Resource` or loads one from the filesystem. + +Description +----------- + +Creates a new :ref:`Resource` or loads one from the filesystem. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (object): ``res`` + +Properties +---------- + ++---------------------------------+--------------------------------------------------------------+ +| :ref:`Resource` | :ref:`resource` | ++---------------------------------+--------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptPreload_property_resource: + +- :ref:`Resource` **resource** + ++----------+--------------------+ +| *Setter* | set_preload(value) | ++----------+--------------------+ +| *Getter* | get_preload() | ++----------+--------------------+ + +The :ref:`Resource` to load. + +.. |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.)` diff --git a/classes/class_visualscriptpropertyget.rst b/classes/class_visualscriptpropertyget.rst new file mode 100644 index 0000000..e641c96 --- /dev/null +++ b/classes/class_visualscriptpropertyget.rst @@ -0,0 +1,170 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptPropertyGet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptPropertyGet: + +VisualScriptPropertyGet +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node returning a value of a property from an :ref:`Object`. + +Description +----------- + +``VisualScriptPropertyGet`` can return a value of any property from the current object or other objects. + +Properties +---------- + ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_script` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`Variant.Type` | :ref:`basic_type` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`index` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`NodePath` | :ref:`node_path` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`property` | ``""`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`CallMode` | :ref:`set_mode` | ``0`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ + +Enumerations +------------ + +.. _enum_VisualScriptPropertyGet_CallMode: + +.. _class_VisualScriptPropertyGet_constant_CALL_MODE_SELF: + +.. _class_VisualScriptPropertyGet_constant_CALL_MODE_NODE_PATH: + +.. _class_VisualScriptPropertyGet_constant_CALL_MODE_INSTANCE: + +.. _class_VisualScriptPropertyGet_constant_CALL_MODE_BASIC_TYPE: + +enum **CallMode**: + +- **CALL_MODE_SELF** = **0** --- The property will be retrieved from this :ref:`Object`. + +- **CALL_MODE_NODE_PATH** = **1** --- The property will be retrieved from the given :ref:`Node` in the scene tree. + +- **CALL_MODE_INSTANCE** = **2** --- The property will be retrieved from an instanced node with the given type and script. + +- **CALL_MODE_BASIC_TYPE** = **3** --- The property will be retrieved from a GDScript basic type (e.g. :ref:`Vector2`). + +Property Descriptions +--------------------- + +.. _class_VisualScriptPropertyGet_property_base_script: + +- :ref:`String` **base_script** + ++----------+------------------------+ +| *Setter* | set_base_script(value) | ++----------+------------------------+ +| *Getter* | get_base_script() | ++----------+------------------------+ + +The script to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptPropertyGet_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The base type to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptPropertyGet_property_basic_type: + +- :ref:`Variant.Type` **basic_type** + ++----------+-----------------------+ +| *Setter* | set_basic_type(value) | ++----------+-----------------------+ +| *Getter* | get_basic_type() | ++----------+-----------------------+ + +The type to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_BASIC_TYPE`. + +---- + +.. _class_VisualScriptPropertyGet_property_index: + +- :ref:`String` **index** + ++----------+------------------+ +| *Setter* | set_index(value) | ++----------+------------------+ +| *Getter* | get_index() | ++----------+------------------+ + +The indexed name of the property to retrieve. See :ref:`Object.get_indexed` for details. + +---- + +.. _class_VisualScriptPropertyGet_property_node_path: + +- :ref:`NodePath` **node_path** + ++----------+----------------------+ +| *Setter* | set_base_path(value) | ++----------+----------------------+ +| *Getter* | get_base_path() | ++----------+----------------------+ + +The node path to use when :ref:`set_mode` is set to :ref:`CALL_MODE_NODE_PATH`. + +---- + +.. _class_VisualScriptPropertyGet_property_property: + +- :ref:`String` **property** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_property(value) | ++-----------+---------------------+ +| *Getter* | get_property() | ++-----------+---------------------+ + +The name of the property to retrieve. Changing this will clear :ref:`index`. + +---- + +.. _class_VisualScriptPropertyGet_property_set_mode: + +- :ref:`CallMode` **set_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_call_mode(value) | ++-----------+----------------------+ +| *Getter* | get_call_mode() | ++-----------+----------------------+ + +``set_mode`` determines the target object from which the property will be retrieved. See :ref:`CallMode` for options. + +.. |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.)` diff --git a/classes/class_visualscriptpropertyset.rst b/classes/class_visualscriptpropertyset.rst new file mode 100644 index 0000000..9154c56 --- /dev/null +++ b/classes/class_visualscriptpropertyset.rst @@ -0,0 +1,238 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptPropertySet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptPropertySet: + +VisualScriptPropertySet +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node that sets a property of an :ref:`Object`. + +Description +----------- + +``VisualScriptPropertySet`` can set the value of any property from the current object or other objects. + +Properties +---------- + ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`AssignOp` | :ref:`assign_op` | ``0`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_script` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`Variant.Type` | :ref:`basic_type` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`index` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`NodePath` | :ref:`node_path` | | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`property` | ``""`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ +| :ref:`CallMode` | :ref:`set_mode` | ``0`` | ++--------------------------------------------------------+------------------------------------------------------------------------+--------------+ + +Enumerations +------------ + +.. _enum_VisualScriptPropertySet_CallMode: + +.. _class_VisualScriptPropertySet_constant_CALL_MODE_SELF: + +.. _class_VisualScriptPropertySet_constant_CALL_MODE_NODE_PATH: + +.. _class_VisualScriptPropertySet_constant_CALL_MODE_INSTANCE: + +.. _class_VisualScriptPropertySet_constant_CALL_MODE_BASIC_TYPE: + +enum **CallMode**: + +- **CALL_MODE_SELF** = **0** --- The property will be set on this :ref:`Object`. + +- **CALL_MODE_NODE_PATH** = **1** --- The property will be set on the given :ref:`Node` in the scene tree. + +- **CALL_MODE_INSTANCE** = **2** --- The property will be set on an instanced node with the given type and script. + +- **CALL_MODE_BASIC_TYPE** = **3** --- The property will be set on a GDScript basic type (e.g. :ref:`Vector2`). + +---- + +.. _enum_VisualScriptPropertySet_AssignOp: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_NONE: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_ADD: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SUB: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_MUL: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_DIV: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_MOD: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SHIFT_LEFT: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_SHIFT_RIGHT: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_AND: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_OR: + +.. _class_VisualScriptPropertySet_constant_ASSIGN_OP_BIT_XOR: + +enum **AssignOp**: + +- **ASSIGN_OP_NONE** = **0** --- The property will be assigned regularly. + +- **ASSIGN_OP_ADD** = **1** --- The value will be added to the property. Equivalent of doing ``+=``. + +- **ASSIGN_OP_SUB** = **2** --- The value will be subtracted from the property. Equivalent of doing ``-=``. + +- **ASSIGN_OP_MUL** = **3** --- The property will be multiplied by the value. Equivalent of doing ``*=``. + +- **ASSIGN_OP_DIV** = **4** --- The property will be divided by the value. Equivalent of doing ``/=``. + +- **ASSIGN_OP_MOD** = **5** --- A modulo operation will be performed on the property and the value. Equivalent of doing ``%=``. + +- **ASSIGN_OP_SHIFT_LEFT** = **6** --- The property will be binarly shifted to the left by the given value. Equivalent of doing ``<<``. + +- **ASSIGN_OP_SHIFT_RIGHT** = **7** --- The property will be binarly shifted to the right by the given value. Equivalent of doing ``>>``. + +- **ASSIGN_OP_BIT_AND** = **8** --- A binary ``AND`` operation will be performed on the property. Equivalent of doing ``&=``. + +- **ASSIGN_OP_BIT_OR** = **9** --- A binary ``OR`` operation will be performed on the property. Equivalent of doing ``|=``. + +- **ASSIGN_OP_BIT_XOR** = **10** --- A binary ``XOR`` operation will be performed on the property. Equivalent of doing ``^=``. + +Property Descriptions +--------------------- + +.. _class_VisualScriptPropertySet_property_assign_op: + +- :ref:`AssignOp` **assign_op** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_assign_op(value) | ++-----------+----------------------+ +| *Getter* | get_assign_op() | ++-----------+----------------------+ + +The additional operation to perform when assigning. See :ref:`AssignOp` for options. + +---- + +.. _class_VisualScriptPropertySet_property_base_script: + +- :ref:`String` **base_script** + ++----------+------------------------+ +| *Setter* | set_base_script(value) | ++----------+------------------------+ +| *Getter* | get_base_script() | ++----------+------------------------+ + +The script to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptPropertySet_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The base type to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptPropertySet_property_basic_type: + +- :ref:`Variant.Type` **basic_type** + ++----------+-----------------------+ +| *Setter* | set_basic_type(value) | ++----------+-----------------------+ +| *Getter* | get_basic_type() | ++----------+-----------------------+ + +The type to be used when :ref:`set_mode` is set to :ref:`CALL_MODE_BASIC_TYPE`. + +---- + +.. _class_VisualScriptPropertySet_property_index: + +- :ref:`String` **index** + ++----------+------------------+ +| *Setter* | set_index(value) | ++----------+------------------+ +| *Getter* | get_index() | ++----------+------------------+ + +The indexed name of the property to set. See :ref:`Object.set_indexed` for details. + +---- + +.. _class_VisualScriptPropertySet_property_node_path: + +- :ref:`NodePath` **node_path** + ++----------+----------------------+ +| *Setter* | set_base_path(value) | ++----------+----------------------+ +| *Getter* | get_base_path() | ++----------+----------------------+ + +The node path to use when :ref:`set_mode` is set to :ref:`CALL_MODE_NODE_PATH`. + +---- + +.. _class_VisualScriptPropertySet_property_property: + +- :ref:`String` **property** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_property(value) | ++-----------+---------------------+ +| *Getter* | get_property() | ++-----------+---------------------+ + +The name of the property to set. Changing this will clear :ref:`index`. + +---- + +.. _class_VisualScriptPropertySet_property_set_mode: + +- :ref:`CallMode` **set_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_call_mode(value) | ++-----------+----------------------+ +| *Getter* | get_call_mode() | ++-----------+----------------------+ + +``set_mode`` determines the target object on which the property will be set. See :ref:`CallMode` for options. + +.. |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.)` diff --git a/classes/class_visualscriptresourcepath.rst b/classes/class_visualscriptresourcepath.rst new file mode 100644 index 0000000..e98a817 --- /dev/null +++ b/classes/class_visualscriptresourcepath.rst @@ -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 VisualScriptResourcePath.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptResourcePath: + +VisualScriptResourcePath +======================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------+--------+ +| :ref:`String` | :ref:`path` | ``""`` | ++-----------------------------+-----------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptResourcePath_property_path: + +- :ref:`String` **path** + ++-----------+--------------------------+ +| *Default* | ``""`` | ++-----------+--------------------------+ +| *Setter* | set_resource_path(value) | ++-----------+--------------------------+ +| *Getter* | get_resource_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.)` diff --git a/classes/class_visualscriptreturn.rst b/classes/class_visualscriptreturn.rst new file mode 100644 index 0000000..18d15fe --- /dev/null +++ b/classes/class_visualscriptreturn.rst @@ -0,0 +1,75 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptReturn.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptReturn: + +VisualScriptReturn +================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Exits a function and returns an optional value. + +Description +----------- + +Ends the execution of a function and returns control to the calling function. Optionally, it can return a :ref:`Variant` value. + +**Input Ports:** + +- Sequence + +- Data (variant): ``result`` (optional) + +**Output Ports:** + +none + +Properties +---------- + ++-----------------------------------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`return_enabled` | ``false`` | ++-----------------------------------------------------+-------------------------------------------------------------------------+-----------+ +| :ref:`Variant.Type` | :ref:`return_type` | ``0`` | ++-----------------------------------------------------+-------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptReturn_property_return_enabled: + +- :ref:`bool` **return_enabled** + ++-----------+--------------------------------+ +| *Default* | ``false`` | ++-----------+--------------------------------+ +| *Setter* | set_enable_return_value(value) | ++-----------+--------------------------------+ +| *Getter* | is_return_value_enabled() | ++-----------+--------------------------------+ + +If ``true``, the ``return`` input port is available. + +---- + +.. _class_VisualScriptReturn_property_return_type: + +- :ref:`Variant.Type` **return_type** + ++-----------+------------------------+ +| *Default* | ``0`` | ++-----------+------------------------+ +| *Setter* | set_return_type(value) | ++-----------+------------------------+ +| *Getter* | get_return_type() | ++-----------+------------------------+ + +The return value's data 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.)` diff --git a/classes/class_visualscriptscenenode.rst b/classes/class_visualscriptscenenode.rst new file mode 100644 index 0000000..6c9e35b --- /dev/null +++ b/classes/class_visualscriptscenenode.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptSceneNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSceneNode: + +VisualScriptSceneNode +===================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Node reference. + +Description +----------- + +A direct reference to a node. + +**Input Ports:** + +none + +**Output Ports:** + +- Data: ``node`` (obj) + +Properties +---------- + ++---------------------------------+------------------------------------------------------------------+-------------------+ +| :ref:`NodePath` | :ref:`node_path` | ``NodePath(".")`` | ++---------------------------------+------------------------------------------------------------------+-------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptSceneNode_property_node_path: + +- :ref:`NodePath` **node_path** + ++-----------+----------------------+ +| *Default* | ``NodePath(".")`` | ++-----------+----------------------+ +| *Setter* | set_node_path(value) | ++-----------+----------------------+ +| *Getter* | get_node_path() | ++-----------+----------------------+ + +The node's path in the scene 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.)` diff --git a/classes/class_visualscriptscenetree.rst b/classes/class_visualscriptscenetree.rst new file mode 100644 index 0000000..521835a --- /dev/null +++ b/classes/class_visualscriptscenetree.rst @@ -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 VisualScriptSceneTree.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSceneTree: + +VisualScriptSceneTree +===================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node for accessing :ref:`SceneTree` methods. + +Description +----------- + +A Visual Script node for accessing :ref:`SceneTree` methods. + +.. |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.)` diff --git a/classes/class_visualscriptselect.rst b/classes/class_visualscriptselect.rst new file mode 100644 index 0000000..da98302 --- /dev/null +++ b/classes/class_visualscriptselect.rst @@ -0,0 +1,59 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptSelect.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSelect: + +VisualScriptSelect +================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Chooses between two input values. + +Description +----------- + +Chooses between two input values based on a Boolean condition. + +**Input Ports:** + +- Data (boolean): ``cond`` + +- Data (variant): ``a`` + +- Data (variant): ``b`` + +**Output Ports:** + +- Data (variant): ``out`` + +Properties +---------- + ++-----------------------------------------------------+-----------------------------------------------------+-------+ +| :ref:`Variant.Type` | :ref:`type` | ``0`` | ++-----------------------------------------------------+-----------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptSelect_property_type: + +- :ref:`Variant.Type` **type** + ++-----------+------------------+ +| *Default* | ``0`` | ++-----------+------------------+ +| *Setter* | set_typed(value) | ++-----------+------------------+ +| *Getter* | get_typed() | ++-----------+------------------+ + +The input variables' 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.)` diff --git a/classes/class_visualscriptself.rst b/classes/class_visualscriptself.rst new file mode 100644 index 0000000..f642bee --- /dev/null +++ b/classes/class_visualscriptself.rst @@ -0,0 +1,31 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptSelf.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSelf: + +VisualScriptSelf +================ + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Outputs a reference to the current instance. + +Description +----------- + +Provides a reference to the node running the visual script. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (object): ``instance`` + +.. |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.)` diff --git a/classes/class_visualscriptsequence.rst b/classes/class_visualscriptsequence.rst new file mode 100644 index 0000000..99970d2 --- /dev/null +++ b/classes/class_visualscriptsequence.rst @@ -0,0 +1,59 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptSequence.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSequence: + +VisualScriptSequence +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Executes a series of Sequence ports. + +Description +----------- + +Steps through a series of one or more output Sequence ports. The ``current`` data port outputs the currently executing item. + +**Input Ports:** + +- Sequence: ``in order`` + +**Output Ports:** + +- Sequence: ``1`` + +- Sequence: ``2 - n`` (optional) + +- Data (int): ``current`` + +Properties +---------- + ++-----------------------+---------------------------------------------------------+-------+ +| :ref:`int` | :ref:`steps` | ``1`` | ++-----------------------+---------------------------------------------------------+-------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptSequence_property_steps: + +- :ref:`int` **steps** + ++-----------+------------------+ +| *Default* | ``1`` | ++-----------+------------------+ +| *Setter* | set_steps(value) | ++-----------+------------------+ +| *Getter* | get_steps() | ++-----------+------------------+ + +The number of steps in the sequence. + +.. |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.)` diff --git a/classes/class_visualscriptsubcall.rst b/classes/class_visualscriptsubcall.rst new file mode 100644 index 0000000..0b750c2 --- /dev/null +++ b/classes/class_visualscriptsubcall.rst @@ -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 VisualScriptSubCall.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSubCall: + +VisualScriptSubCall +=================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calls a method called ``_subcall`` in this object. + +Description +----------- + +``VisualScriptSubCall`` will call method named ``_subcall`` in the current script. It will fail if the method doesn't exist or the provided arguments are wrong. + +Methods +------- + ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`_subcall` **(** :ref:`Variant` arguments **)** |virtual| | ++-------------------------------+--------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VisualScriptSubCall_method__subcall: + +- :ref:`Variant` **_subcall** **(** :ref:`Variant` arguments **)** |virtual| + +Called by this 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.)` diff --git a/classes/class_visualscriptswitch.rst b/classes/class_visualscriptswitch.rst new file mode 100644 index 0000000..32d8bed --- /dev/null +++ b/classes/class_visualscriptswitch.rst @@ -0,0 +1,41 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptSwitch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptSwitch: + +VisualScriptSwitch +================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Branches program flow based on a given input's value. + +Description +----------- + +Branches the flow based on an input's value. Use **Case Count** in the Inspector to set the number of branches and each comparison's optional type. + +**Input Ports:** + +- Sequence: ``'input' is`` + +- Data (variant): ``=`` + +- Data (variant): ``=`` (optional) + +- Data (variant): ``input`` + +**Output Ports:** + +- Sequence + +- Sequence (optional) + +- Sequence: ``done`` + +.. |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.)` diff --git a/classes/class_visualscripttypecast.rst b/classes/class_visualscripttypecast.rst new file mode 100644 index 0000000..7558fe3 --- /dev/null +++ b/classes/class_visualscripttypecast.rst @@ -0,0 +1,65 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptTypeCast.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptTypeCast: + +VisualScriptTypeCast +==================== + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node that casts the given value to another type. + +Description +----------- + +``VisualScriptTypeCast`` will perform a type conversion to an :ref:`Object`-derived type. + +Properties +---------- + ++-----------------------------+---------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_script` | ``""`` | ++-----------------------------+---------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++-----------------------------+---------------------------------------------------------------------+--------------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptTypeCast_property_base_script: + +- :ref:`String` **base_script** + ++-----------+------------------------+ +| *Default* | ``""`` | ++-----------+------------------------+ +| *Setter* | set_base_script(value) | ++-----------+------------------------+ +| *Getter* | get_base_script() | ++-----------+------------------------+ + +The target script class to be converted to. If none, only the :ref:`base_type` will be used. + +---- + +.. _class_VisualScriptTypeCast_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The target type to be converted to. + +.. |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.)` diff --git a/classes/class_visualscriptvariableget.rst b/classes/class_visualscriptvariableget.rst new file mode 100644 index 0000000..6a8e462 --- /dev/null +++ b/classes/class_visualscriptvariableget.rst @@ -0,0 +1,55 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptVariableGet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptVariableGet: + +VisualScriptVariableGet +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Gets a variable's value. + +Description +----------- + +Returns a variable's value. "Var Name" must be supplied, with an optional type. + +**Input Ports:** + +none + +**Output Ports:** + +- Data (variant): ``value`` + +Properties +---------- + ++-----------------------------+------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`var_name` | ``""`` | ++-----------------------------+------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptVariableGet_property_var_name: + +- :ref:`String` **var_name** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_variable(value) | ++-----------+---------------------+ +| *Getter* | get_variable() | ++-----------+---------------------+ + +The variable's 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.)` diff --git a/classes/class_visualscriptvariableset.rst b/classes/class_visualscriptvariableset.rst new file mode 100644 index 0000000..44947a4 --- /dev/null +++ b/classes/class_visualscriptvariableset.rst @@ -0,0 +1,57 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptVariableSet.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptVariableSet: + +VisualScriptVariableSet +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Changes a variable's value. + +Description +----------- + +Changes a variable's value to the given input. + +**Input Ports:** + +- Sequence + +- Data (variant): ``set`` + +**Output Ports:** + +- Sequence + +Properties +---------- + ++-----------------------------+------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`var_name` | ``""`` | ++-----------------------------+------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualScriptVariableSet_property_var_name: + +- :ref:`String` **var_name** + ++-----------+---------------------+ +| *Default* | ``""`` | ++-----------+---------------------+ +| *Setter* | set_variable(value) | ++-----------+---------------------+ +| *Getter* | get_variable() | ++-----------+---------------------+ + +The variable's 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.)` diff --git a/classes/class_visualscriptwhile.rst b/classes/class_visualscriptwhile.rst new file mode 100644 index 0000000..da9d265 --- /dev/null +++ b/classes/class_visualscriptwhile.rst @@ -0,0 +1,35 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptWhile.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptWhile: + +VisualScriptWhile +================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Conditional loop. + +Description +----------- + +Loops while a condition is ``true``. Execution continues out the ``exit`` Sequence port when the loop terminates. + +**Input Ports:** + +- Sequence: ``while(cond)`` + +- Data (bool): ``cond`` + +**Output Ports:** + +- Sequence: ``repeat`` + +- Sequence: ``exit`` + +.. |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.)` diff --git a/classes/class_visualscriptyield.rst b/classes/class_visualscriptyield.rst new file mode 100644 index 0000000..1dcb31b --- /dev/null +++ b/classes/class_visualscriptyield.rst @@ -0,0 +1,82 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptYield.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptYield: + +VisualScriptYield +================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node used to pause a function execution. + +Description +----------- + +``VisualScriptYield`` will pause the function call and return :ref:`VisualScriptFunctionState`, which can be used to resume the function. + +Properties +---------- + ++----------------------------------------------------+--------------------------------------------------------------+-------+ +| :ref:`YieldMode` | :ref:`mode` | ``1`` | ++----------------------------------------------------+--------------------------------------------------------------+-------+ +| :ref:`float` | :ref:`wait_time` | | ++----------------------------------------------------+--------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualScriptYield_YieldMode: + +.. _class_VisualScriptYield_constant_YIELD_FRAME: + +.. _class_VisualScriptYield_constant_YIELD_PHYSICS_FRAME: + +.. _class_VisualScriptYield_constant_YIELD_WAIT: + +enum **YieldMode**: + +- **YIELD_FRAME** = **1** --- Yields during an idle frame. + +- **YIELD_PHYSICS_FRAME** = **2** --- Yields during a physics frame. + +- **YIELD_WAIT** = **3** --- Yields a function and waits the given time. + +Property Descriptions +--------------------- + +.. _class_VisualScriptYield_property_mode: + +- :ref:`YieldMode` **mode** + ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_yield_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_yield_mode() | ++-----------+-----------------------+ + +The mode to use for yielding. See :ref:`YieldMode` for available options. + +---- + +.. _class_VisualScriptYield_property_wait_time: + +- :ref:`float` **wait_time** + ++----------+----------------------+ +| *Setter* | set_wait_time(value) | ++----------+----------------------+ +| *Getter* | get_wait_time() | ++----------+----------------------+ + +The time to wait when :ref:`mode` is set to :ref:`YIELD_WAIT`. + +.. |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.)` diff --git a/classes/class_visualscriptyieldsignal.rst b/classes/class_visualscriptyieldsignal.rst new file mode 100644 index 0000000..c169022 --- /dev/null +++ b/classes/class_visualscriptyieldsignal.rst @@ -0,0 +1,118 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualScriptYieldSignal.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualScriptYieldSignal: + +VisualScriptYieldSignal +======================= + +**Inherits:** :ref:`VisualScriptNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Visual Script node yielding for a signal. + +Description +----------- + +``VisualScriptYieldSignal`` will pause the function execution until the provided signal is emitted. + +Properties +---------- + ++--------------------------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`base_type` | ``"Object"`` | ++--------------------------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`CallMode` | :ref:`call_mode` | ``0`` | ++--------------------------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`NodePath` | :ref:`node_path` | | ++--------------------------------------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`signal` | ``""`` | ++--------------------------------------------------------+--------------------------------------------------------------------+--------------+ + +Enumerations +------------ + +.. _enum_VisualScriptYieldSignal_CallMode: + +.. _class_VisualScriptYieldSignal_constant_CALL_MODE_SELF: + +.. _class_VisualScriptYieldSignal_constant_CALL_MODE_NODE_PATH: + +.. _class_VisualScriptYieldSignal_constant_CALL_MODE_INSTANCE: + +enum **CallMode**: + +- **CALL_MODE_SELF** = **0** --- A signal from this :ref:`Object` will be used. + +- **CALL_MODE_NODE_PATH** = **1** --- A signal from the given :ref:`Node` in the scene tree will be used. + +- **CALL_MODE_INSTANCE** = **2** --- A signal from an instanced node with the given type will be used. + +Property Descriptions +--------------------- + +.. _class_VisualScriptYieldSignal_property_base_type: + +- :ref:`String` **base_type** + ++-----------+----------------------+ +| *Default* | ``"Object"`` | ++-----------+----------------------+ +| *Setter* | set_base_type(value) | ++-----------+----------------------+ +| *Getter* | get_base_type() | ++-----------+----------------------+ + +The base type to be used when :ref:`call_mode` is set to :ref:`CALL_MODE_INSTANCE`. + +---- + +.. _class_VisualScriptYieldSignal_property_call_mode: + +- :ref:`CallMode` **call_mode** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_call_mode(value) | ++-----------+----------------------+ +| *Getter* | get_call_mode() | ++-----------+----------------------+ + +``call_mode`` determines the target object to wait for the signal emission. See :ref:`CallMode` for options. + +---- + +.. _class_VisualScriptYieldSignal_property_node_path: + +- :ref:`NodePath` **node_path** + ++----------+----------------------+ +| *Setter* | set_base_path(value) | ++----------+----------------------+ +| *Getter* | get_base_path() | ++----------+----------------------+ + +The node path to use when :ref:`call_mode` is set to :ref:`CALL_MODE_NODE_PATH`. + +---- + +.. _class_VisualScriptYieldSignal_property_signal: + +- :ref:`String` **signal** + ++-----------+-------------------+ +| *Default* | ``""`` | ++-----------+-------------------+ +| *Setter* | set_signal(value) | ++-----------+-------------------+ +| *Getter* | get_signal() | ++-----------+-------------------+ + +The signal name to be waited for. + +.. |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.)` diff --git a/classes/class_visualserver.rst b/classes/class_visualserver.rst new file mode 100644 index 0000000..649ae04 --- /dev/null +++ b/classes/class_visualserver.rst @@ -0,0 +1,5101 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualServer: + +VisualServer +============ + +**Inherits:** :ref:`Object` + +Server for anything visible. + +Description +----------- + +Server for anything visible. The visual server is the API backend for everything visible. The whole scene system mounts on it to display. + +The visual server is completely opaque, the internals are entirely implementation specific and cannot be accessed. + +The visual server can be used to bypass the scene system entirely. + +Resources are created using the ``*_create`` functions. + +All objects are drawn to a viewport. You can use the :ref:`Viewport` attached to the :ref:`SceneTree` or you can create one yourself with :ref:`viewport_create`. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using :ref:`viewport_set_scenario` or :ref:`viewport_attach_canvas`. + +In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the visual server from a running game, the scenario can be accessed from the scene tree from any :ref:`Spatial` node with :ref:`Spatial.get_world`. Otherwise, a scenario can be created with :ref:`scenario_create`. + +Similarly, in 2D, a canvas is needed to draw all canvas items. + +In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using :ref:`instance_set_base`. The instance must also be attached to the scenario using :ref:`instance_set_scenario` in order to be visible. + +In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. + +Tutorials +--------- + +- :doc:`../tutorials/performance/using_servers` + +Properties +---------- + ++-------------------------+-----------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`render_loop_enabled` | ++-------------------------+-----------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`black_bars_set_images` **(** :ref:`RID` left, :ref:`RID` top, :ref:`RID` right, :ref:`RID` bottom **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`black_bars_set_margins` **(** :ref:`int` left, :ref:`int` top, :ref:`int` right, :ref:`int` bottom **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`camera_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_cull_mask` **(** :ref:`RID` camera, :ref:`int` layers **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_environment` **(** :ref:`RID` camera, :ref:`RID` env **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_frustum` **(** :ref:`RID` camera, :ref:`float` size, :ref:`Vector2` offset, :ref:`float` z_near, :ref:`float` z_far **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_orthogonal` **(** :ref:`RID` camera, :ref:`float` size, :ref:`float` z_near, :ref:`float` z_far **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_perspective` **(** :ref:`RID` camera, :ref:`float` fovy_degrees, :ref:`float` z_near, :ref:`float` z_far **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_transform` **(** :ref:`RID` camera, :ref:`Transform` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`camera_set_use_vertical_aspect` **(** :ref:`RID` camera, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_circle` **(** :ref:`RID` item, :ref:`Vector2` pos, :ref:`float` radius, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_clip_ignore` **(** :ref:`RID` item, :ref:`bool` ignore **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_line` **(** :ref:`RID` item, :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_mesh` **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`RID` texture, :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_multimesh` **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`RID` texture, :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_nine_patch` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`Rect2` source, :ref:`RID` texture, :ref:`Vector2` topleft, :ref:`Vector2` bottomright, :ref:`NinePatchAxisMode` x_axis_mode=0, :ref:`NinePatchAxisMode` y_axis_mode=0, :ref:`bool` draw_center=true, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_particles` **(** :ref:`RID` item, :ref:`RID` particles, :ref:`RID` texture, :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_polygon` **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`RID` texture, :ref:`RID` normal_map, :ref:`bool` antialiased=false **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_polyline` **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_primitive` **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs, :ref:`RID` texture, :ref:`float` width=1.0, :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_rect` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_set_transform` **(** :ref:`RID` item, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_texture_rect` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`bool` tile=false, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`RID` normal_map **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_texture_rect_region` **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`RID` normal_map, :ref:`bool` clip_uv=true **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_add_triangle_array` **(** :ref:`RID` item, :ref:`PoolIntArray` indices, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`PoolIntArray` bones=PoolIntArray( ), :ref:`PoolRealArray` weights=PoolRealArray( ), :ref:`RID` texture, :ref:`int` count=-1, :ref:`RID` normal_map, :ref:`bool` antialiased=false, :ref:`bool` antialiasing_use_indices=false **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_clear` **(** :ref:`RID` item **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas_item_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_clip` **(** :ref:`RID` item, :ref:`bool` clip **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_copy_to_backbuffer` **(** :ref:`RID` item, :ref:`bool` enabled, :ref:`Rect2` rect **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_custom_rect` **(** :ref:`RID` item, :ref:`bool` use_custom_rect, :ref:`Rect2` rect=Rect2( 0, 0, 0, 0 ) **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_distance_field_mode` **(** :ref:`RID` item, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_draw_behind_parent` **(** :ref:`RID` item, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_draw_index` **(** :ref:`RID` item, :ref:`int` index **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_light_mask` **(** :ref:`RID` item, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_material` **(** :ref:`RID` item, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_modulate` **(** :ref:`RID` item, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_parent` **(** :ref:`RID` item, :ref:`RID` parent **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_self_modulate` **(** :ref:`RID` item, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_sort_children_by_y` **(** :ref:`RID` item, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_transform` **(** :ref:`RID` item, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_use_parent_material` **(** :ref:`RID` item, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_visible` **(** :ref:`RID` item, :ref:`bool` visible **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_z_as_relative_to_parent` **(** :ref:`RID` item, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_item_set_z_index` **(** :ref:`RID` item, :ref:`int` z_index **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_attach_to_canvas` **(** :ref:`RID` light, :ref:`RID` canvas **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas_light_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_occluder_attach_to_canvas` **(** :ref:`RID` occluder, :ref:`RID` canvas **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas_light_occluder_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_occluder_set_enabled` **(** :ref:`RID` occluder, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_occluder_set_light_mask` **(** :ref:`RID` occluder, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_occluder_set_polygon` **(** :ref:`RID` occluder, :ref:`RID` polygon **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_occluder_set_transform` **(** :ref:`RID` occluder, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_color` **(** :ref:`RID` light, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_enabled` **(** :ref:`RID` light, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_energy` **(** :ref:`RID` light, :ref:`float` energy **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_height` **(** :ref:`RID` light, :ref:`float` height **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_item_cull_mask` **(** :ref:`RID` light, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_item_shadow_cull_mask` **(** :ref:`RID` light, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_layer_range` **(** :ref:`RID` light, :ref:`int` min_layer, :ref:`int` max_layer **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_mode` **(** :ref:`RID` light, :ref:`CanvasLightMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_scale` **(** :ref:`RID` light, :ref:`float` scale **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_buffer_size` **(** :ref:`RID` light, :ref:`int` size **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_color` **(** :ref:`RID` light, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_enabled` **(** :ref:`RID` light, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_filter` **(** :ref:`RID` light, :ref:`CanvasLightShadowFilter` filter **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_gradient_length` **(** :ref:`RID` light, :ref:`float` length **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_shadow_smooth` **(** :ref:`RID` light, :ref:`float` smooth **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_texture` **(** :ref:`RID` light, :ref:`RID` texture **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_texture_offset` **(** :ref:`RID` light, :ref:`Vector2` offset **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_transform` **(** :ref:`RID` light, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_light_set_z_range` **(** :ref:`RID` light, :ref:`int` min_z, :ref:`int` max_z **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas_occluder_polygon_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_occluder_polygon_set_cull_mode` **(** :ref:`RID` occluder_polygon, :ref:`CanvasOccluderPolygonCullMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_occluder_polygon_set_shape` **(** :ref:`RID` occluder_polygon, :ref:`PoolVector2Array` shape, :ref:`bool` closed **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_occluder_polygon_set_shape_as_lines` **(** :ref:`RID` occluder_polygon, :ref:`PoolVector2Array` shape **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_set_item_mirroring` **(** :ref:`RID` canvas, :ref:`RID` item, :ref:`Vector2` mirroring **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`canvas_set_modulate` **(** :ref:`RID` canvas, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`directional_light_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`draw` **(** :ref:`bool` swap_buffers=true, :ref:`float` frame_step=0.0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`environment_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_adjustment` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation, :ref:`RID` ramp **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_ambient_light` **(** :ref:`RID` env, :ref:`Color` color, :ref:`float` energy=1.0, :ref:`float` sky_contibution=0.0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_background` **(** :ref:`RID` env, :ref:`EnvironmentBG` bg **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_bg_color` **(** :ref:`RID` env, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_bg_energy` **(** :ref:`RID` env, :ref:`float` energy **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_canvas_max_layer` **(** :ref:`RID` env, :ref:`int` max_layer **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_dof_blur_far` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` distance, :ref:`float` transition, :ref:`float` far_amount, :ref:`EnvironmentDOFBlurQuality` quality **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_dof_blur_near` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` distance, :ref:`float` transition, :ref:`float` far_amount, :ref:`EnvironmentDOFBlurQuality` quality **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_fog` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`Color` color, :ref:`Color` sun_color, :ref:`float` sun_amount **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_fog_depth` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` depth_begin, :ref:`float` depth_end, :ref:`float` depth_curve, :ref:`bool` transmit, :ref:`float` transmit_curve **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_fog_height` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` min_height, :ref:`float` max_height, :ref:`float` height_curve **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_glow` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`int` level_flags, :ref:`float` intensity, :ref:`float` strength, :ref:`float` bloom_threshold, :ref:`EnvironmentGlowBlendMode` blend_mode, :ref:`float` hdr_bleed_threshold, :ref:`float` hdr_bleed_scale, :ref:`float` hdr_luminance_cap, :ref:`bool` bicubic_upscale, :ref:`bool` high_quality **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_sky` **(** :ref:`RID` env, :ref:`RID` sky **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_sky_custom_fov` **(** :ref:`RID` env, :ref:`float` scale **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_sky_orientation` **(** :ref:`RID` env, :ref:`Basis` orientation **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_ssao` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` radius, :ref:`float` intensity, :ref:`float` radius2, :ref:`float` intensity2, :ref:`float` bias, :ref:`float` light_affect, :ref:`float` ao_channel_affect, :ref:`Color` color, :ref:`EnvironmentSSAOQuality` quality, :ref:`EnvironmentSSAOBlur` blur, :ref:`float` bilateral_sharpness **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_ssr` **(** :ref:`RID` env, :ref:`bool` enable, :ref:`int` max_steps, :ref:`float` fade_in, :ref:`float` fade_out, :ref:`float` depth_tolerance, :ref:`bool` roughness **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`environment_set_tonemap` **(** :ref:`RID` env, :ref:`EnvironmentToneMapper` tone_mapper, :ref:`float` exposure, :ref:`float` white, :ref:`bool` auto_exposure, :ref:`float` min_luminance, :ref:`float` max_luminance, :ref:`float` auto_exp_speed, :ref:`float` auto_exp_grey **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`finish` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_draw` **(** :ref:`bool` swap_buffers=true, :ref:`float` frame_step=0.0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`force_sync` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`free_rid` **(** :ref:`RID` rid **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_render_info` **(** :ref:`RenderInfo` info **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_test_cube` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_test_texture` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_video_adapter_name` **(** **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_video_adapter_vendor` **(** **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`get_white_texture` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`gi_probe_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gi_probe_get_bias` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`gi_probe_get_bounds` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gi_probe_get_cell_size` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`gi_probe_get_dynamic_data` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`gi_probe_get_dynamic_range` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gi_probe_get_energy` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gi_probe_get_normal_bias` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`gi_probe_get_propagation` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`gi_probe_get_to_cell_xform` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gi_probe_is_compressed` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`gi_probe_is_interior` **(** :ref:`RID` probe **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_bias` **(** :ref:`RID` probe, :ref:`float` bias **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_bounds` **(** :ref:`RID` probe, :ref:`AABB` bounds **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_cell_size` **(** :ref:`RID` probe, :ref:`float` range **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_compress` **(** :ref:`RID` probe, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_dynamic_data` **(** :ref:`RID` probe, :ref:`PoolIntArray` data **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_dynamic_range` **(** :ref:`RID` probe, :ref:`int` range **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_energy` **(** :ref:`RID` probe, :ref:`float` energy **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_interior` **(** :ref:`RID` probe, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_normal_bias` **(** :ref:`RID` probe, :ref:`float` bias **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_propagation` **(** :ref:`RID` probe, :ref:`float` propagation **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`gi_probe_set_to_cell_xform` **(** :ref:`RID` probe, :ref:`Transform` xform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_changed` **(** **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_feature` **(** :ref:`Features` feature **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_os_feature` **(** :ref:`String` feature **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_begin` **(** :ref:`RID` immediate, :ref:`PrimitiveType` primitive, :ref:`RID` texture **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_clear` **(** :ref:`RID` immediate **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_color` **(** :ref:`RID` immediate, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`immediate_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_end` **(** :ref:`RID` immediate **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`immediate_get_material` **(** :ref:`RID` immediate **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_normal` **(** :ref:`RID` immediate, :ref:`Vector3` normal **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_set_material` **(** :ref:`RID` immediate, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_tangent` **(** :ref:`RID` immediate, :ref:`Plane` tangent **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_uv` **(** :ref:`RID` immediate, :ref:`Vector2` tex_uv **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_uv2` **(** :ref:`RID` immediate, :ref:`Vector2` tex_uv **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_vertex` **(** :ref:`RID` immediate, :ref:`Vector3` vertex **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`immediate_vertex_2d` **(** :ref:`RID` immediate, :ref:`Vector2` vertex **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`init` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_attach_object_instance_id` **(** :ref:`RID` instance, :ref:`int` id **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_attach_skeleton` **(** :ref:`RID` instance, :ref:`RID` skeleton **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`instance_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`instance_create2` **(** :ref:`RID` base, :ref:`RID` scenario **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_geometry_set_as_instance_lod` **(** :ref:`RID` instance, :ref:`RID` as_lod_of_instance **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_geometry_set_cast_shadows_setting` **(** :ref:`RID` instance, :ref:`ShadowCastingSetting` shadow_casting_setting **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_geometry_set_draw_range` **(** :ref:`RID` instance, :ref:`float` min, :ref:`float` max, :ref:`float` min_margin, :ref:`float` max_margin **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_geometry_set_flag` **(** :ref:`RID` instance, :ref:`InstanceFlags` flag, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_geometry_set_material_override` **(** :ref:`RID` instance, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_base` **(** :ref:`RID` instance, :ref:`RID` base **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_blend_shape_weight` **(** :ref:`RID` instance, :ref:`int` shape, :ref:`float` weight **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_custom_aabb` **(** :ref:`RID` instance, :ref:`AABB` aabb **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_exterior` **(** :ref:`RID` instance, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_extra_visibility_margin` **(** :ref:`RID` instance, :ref:`float` margin **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_layer_mask` **(** :ref:`RID` instance, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_scenario` **(** :ref:`RID` instance, :ref:`RID` scenario **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_surface_material` **(** :ref:`RID` instance, :ref:`int` surface, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_transform` **(** :ref:`RID` instance, :ref:`Transform` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_use_lightmap` **(** :ref:`RID` instance, :ref:`RID` lightmap_instance, :ref:`RID` lightmap, :ref:`int` lightmap_slice=-1, :ref:`Rect2` lightmap_uv_rect=Rect2( 0, 0, 1, 1 ) **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`instance_set_visible` **(** :ref:`RID` instance, :ref:`bool` visible **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`instances_cull_aabb` **(** :ref:`AABB` aabb, :ref:`RID` scenario **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`instances_cull_convex` **(** :ref:`Array` convex, :ref:`RID` scenario **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`instances_cull_ray` **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`RID` scenario **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_directional_set_blend_splits` **(** :ref:`RID` light, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_directional_set_shadow_depth_range_mode` **(** :ref:`RID` light, :ref:`LightDirectionalShadowDepthRangeMode` range_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_directional_set_shadow_mode` **(** :ref:`RID` light, :ref:`LightDirectionalShadowMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_omni_set_shadow_detail` **(** :ref:`RID` light, :ref:`LightOmniShadowDetail` detail **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_omni_set_shadow_mode` **(** :ref:`RID` light, :ref:`LightOmniShadowMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_bake_mode` **(** :ref:`RID` light, :ref:`LightBakeMode` bake_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_color` **(** :ref:`RID` light, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_cull_mask` **(** :ref:`RID` light, :ref:`int` mask **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_negative` **(** :ref:`RID` light, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_param` **(** :ref:`RID` light, :ref:`LightParam` param, :ref:`float` value **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_projector` **(** :ref:`RID` light, :ref:`RID` texture **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_reverse_cull_face_mode` **(** :ref:`RID` light, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_shadow` **(** :ref:`RID` light, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_shadow_color` **(** :ref:`RID` light, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`light_set_use_gi` **(** :ref:`RID` light, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`lightmap_capture_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`lightmap_capture_get_bounds` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`float` | :ref:`lightmap_capture_get_energy` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`lightmap_capture_get_octree` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`lightmap_capture_get_octree_cell_subdiv` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`lightmap_capture_get_octree_cell_transform` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`lightmap_capture_is_interior` **(** :ref:`RID` capture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_bounds` **(** :ref:`RID` capture, :ref:`AABB` bounds **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_energy` **(** :ref:`RID` capture, :ref:`float` energy **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_interior` **(** :ref:`RID` capture, :ref:`bool` interior **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_octree` **(** :ref:`RID` capture, :ref:`PoolByteArray` octree **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_octree_cell_subdiv` **(** :ref:`RID` capture, :ref:`int` subdiv **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`lightmap_capture_set_octree_cell_transform` **(** :ref:`RID` capture, :ref:`Transform` xform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`make_sphere_mesh` **(** :ref:`int` latitudes, :ref:`int` longitudes, :ref:`float` radius **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`material_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`material_get_param` **(** :ref:`RID` material, :ref:`String` parameter **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`material_get_param_default` **(** :ref:`RID` material, :ref:`String` parameter **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`material_get_shader` **(** :ref:`RID` shader_material **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`material_set_line_width` **(** :ref:`RID` material, :ref:`float` width **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`material_set_next_pass` **(** :ref:`RID` material, :ref:`RID` next_material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`material_set_param` **(** :ref:`RID` material, :ref:`String` parameter, :ref:`Variant` value **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`material_set_render_priority` **(** :ref:`RID` material, :ref:`int` priority **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`material_set_shader` **(** :ref:`RID` shader_material, :ref:`RID` shader **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_add_surface_from_arrays` **(** :ref:`RID` mesh, :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`int` compress_format=2194432 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_clear` **(** :ref:`RID` mesh **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`mesh_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_get_blend_shape_count` **(** :ref:`RID` mesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`BlendShapeMode` | :ref:`mesh_get_blend_shape_mode` **(** :ref:`RID` mesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`mesh_get_custom_aabb` **(** :ref:`RID` mesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_get_surface_count` **(** :ref:`RID` mesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_remove_surface` **(** :ref:`RID` mesh, :ref:`int` index **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_set_blend_shape_count` **(** :ref:`RID` mesh, :ref:`int` amount **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_set_blend_shape_mode` **(** :ref:`RID` mesh, :ref:`BlendShapeMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_set_custom_aabb` **(** :ref:`RID` mesh, :ref:`AABB` aabb **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`mesh_surface_get_aabb` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`mesh_surface_get_array` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_surface_get_array_index_len` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_surface_get_array_len` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`mesh_surface_get_arrays` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`mesh_surface_get_blend_shape_arrays` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_surface_get_format` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_surface_get_format_offset` **(** :ref:`int` format, :ref:`int` vertex_len, :ref:`int` index_len, :ref:`int` array_index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`mesh_surface_get_format_stride` **(** :ref:`int` format, :ref:`int` vertex_len, :ref:`int` index_len, :ref:`int` array_index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolByteArray` | :ref:`mesh_surface_get_index_array` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`mesh_surface_get_material` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PrimitiveType` | :ref:`mesh_surface_get_primitive_type` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`mesh_surface_get_skeleton_aabb` **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_surface_set_material` **(** :ref:`RID` mesh, :ref:`int` surface, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`mesh_surface_update_region` **(** :ref:`RID` mesh, :ref:`int` surface, :ref:`int` offset, :ref:`PoolByteArray` data **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_allocate` **(** :ref:`RID` multimesh, :ref:`int` instances, :ref:`MultimeshTransformFormat` transform_format, :ref:`MultimeshColorFormat` color_format, :ref:`MultimeshCustomDataFormat` custom_data_format=0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`multimesh_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`multimesh_get_aabb` **(** :ref:`RID` multimesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`multimesh_get_instance_count` **(** :ref:`RID` multimesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`multimesh_get_mesh` **(** :ref:`RID` multimesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`multimesh_get_visible_instances` **(** :ref:`RID` multimesh **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`multimesh_instance_get_color` **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Color` | :ref:`multimesh_instance_get_custom_data` **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`multimesh_instance_get_transform` **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`multimesh_instance_get_transform_2d` **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_instance_set_color` **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_instance_set_custom_data` **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Color` custom_data **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_instance_set_transform` **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Transform` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_instance_set_transform_2d` **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_set_as_bulk_array` **(** :ref:`RID` multimesh, :ref:`PoolRealArray` array **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_set_mesh` **(** :ref:`RID` multimesh, :ref:`RID` mesh **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`multimesh_set_visible_instances` **(** :ref:`RID` multimesh, :ref:`int` visible **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`omni_light_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`particles_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`AABB` | :ref:`particles_get_current_aabb` **(** :ref:`RID` particles **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`particles_get_emitting` **(** :ref:`RID` particles **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`particles_is_inactive` **(** :ref:`RID` particles **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_request_process` **(** :ref:`RID` particles **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_restart` **(** :ref:`RID` particles **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_amount` **(** :ref:`RID` particles, :ref:`int` amount **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_custom_aabb` **(** :ref:`RID` particles, :ref:`AABB` aabb **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_draw_order` **(** :ref:`RID` particles, :ref:`ParticlesDrawOrder` order **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_draw_pass_mesh` **(** :ref:`RID` particles, :ref:`int` pass, :ref:`RID` mesh **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_draw_passes` **(** :ref:`RID` particles, :ref:`int` count **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_emission_transform` **(** :ref:`RID` particles, :ref:`Transform` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_emitting` **(** :ref:`RID` particles, :ref:`bool` emitting **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_explosiveness_ratio` **(** :ref:`RID` particles, :ref:`float` ratio **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_fixed_fps` **(** :ref:`RID` particles, :ref:`int` fps **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_fractional_delta` **(** :ref:`RID` particles, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_lifetime` **(** :ref:`RID` particles, :ref:`float` lifetime **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_one_shot` **(** :ref:`RID` particles, :ref:`bool` one_shot **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_pre_process_time` **(** :ref:`RID` particles, :ref:`float` time **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_process_material` **(** :ref:`RID` particles, :ref:`RID` material **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_randomness_ratio` **(** :ref:`RID` particles, :ref:`float` ratio **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_speed_scale` **(** :ref:`RID` particles, :ref:`float` scale **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`particles_set_use_local_coordinates` **(** :ref:`RID` particles, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`reflection_probe_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_as_interior` **(** :ref:`RID` probe, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_cull_mask` **(** :ref:`RID` probe, :ref:`int` layers **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_enable_box_projection` **(** :ref:`RID` probe, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_enable_shadows` **(** :ref:`RID` probe, :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_extents` **(** :ref:`RID` probe, :ref:`Vector3` extents **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_intensity` **(** :ref:`RID` probe, :ref:`float` intensity **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_interior_ambient` **(** :ref:`RID` probe, :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_interior_ambient_energy` **(** :ref:`RID` probe, :ref:`float` energy **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_interior_ambient_probe_contribution` **(** :ref:`RID` probe, :ref:`float` contrib **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_max_distance` **(** :ref:`RID` probe, :ref:`float` distance **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_origin_offset` **(** :ref:`RID` probe, :ref:`Vector3` offset **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`reflection_probe_set_update_mode` **(** :ref:`RID` probe, :ref:`ReflectionProbeUpdateMode` mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`request_frame_drawn_callback` **(** :ref:`Object` where, :ref:`String` method, :ref:`Variant` userdata **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`scenario_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scenario_set_debug` **(** :ref:`RID` scenario, :ref:`ScenarioDebugMode` debug_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scenario_set_environment` **(** :ref:`RID` scenario, :ref:`RID` environment **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scenario_set_fallback_environment` **(** :ref:`RID` scenario, :ref:`RID` environment **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`scenario_set_reflection_atlas_size` **(** :ref:`RID` scenario, :ref:`int` size, :ref:`int` subdiv **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_boot_image` **(** :ref:`Image` image, :ref:`Color` color, :ref:`bool` scale, :ref:`bool` use_filter=true **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_debug_generate_wireframes` **(** :ref:`bool` generate **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_clear_color` **(** :ref:`Color` color **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_shader_time_scale` **(** :ref:`float` scale **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_use_occlusion_culling` **(** :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`shader_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`shader_get_code` **(** :ref:`RID` shader **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`shader_get_default_texture_param` **(** :ref:`RID` shader, :ref:`String` name **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`shader_get_param_list` **(** :ref:`RID` shader **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shader_set_code` **(** :ref:`RID` shader, :ref:`String` code **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`shader_set_default_texture_param` **(** :ref:`RID` shader, :ref:`String` name, :ref:`RID` texture **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`skeleton_allocate` **(** :ref:`RID` skeleton, :ref:`int` bones, :ref:`bool` is_2d_skeleton=false **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform` | :ref:`skeleton_bone_get_transform` **(** :ref:`RID` skeleton, :ref:`int` bone **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Transform2D` | :ref:`skeleton_bone_get_transform_2d` **(** :ref:`RID` skeleton, :ref:`int` bone **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`skeleton_bone_set_transform` **(** :ref:`RID` skeleton, :ref:`int` bone, :ref:`Transform` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`skeleton_bone_set_transform_2d` **(** :ref:`RID` skeleton, :ref:`int` bone, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`skeleton_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`skeleton_get_bone_count` **(** :ref:`RID` skeleton **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`sky_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sky_set_texture` **(** :ref:`RID` sky, :ref:`RID` cube_map, :ref:`int` radiance_size **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`spot_light_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`sync` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_allocate` **(** :ref:`RID` texture, :ref:`int` width, :ref:`int` height, :ref:`int` depth_3d, :ref:`Format` format, :ref:`TextureType` type, :ref:`int` flags=7 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_bind` **(** :ref:`RID` texture, :ref:`int` number **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`texture_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`texture_create_from_image` **(** :ref:`Image` image, :ref:`int` flags=7 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`texture_debug_usage` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Image` | :ref:`texture_get_data` **(** :ref:`RID` texture, :ref:`int` cube_side=0 **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`texture_get_depth` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`texture_get_flags` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Format` | :ref:`texture_get_format` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`texture_get_height` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`texture_get_path` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`texture_get_texid` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`TextureType` | :ref:`texture_get_type` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`texture_get_width` **(** :ref:`RID` texture **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_data` **(** :ref:`RID` texture, :ref:`Image` image, :ref:`int` layer=0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_data_partial` **(** :ref:`RID` texture, :ref:`Image` image, :ref:`int` src_x, :ref:`int` src_y, :ref:`int` src_w, :ref:`int` src_h, :ref:`int` dst_x, :ref:`int` dst_y, :ref:`int` dst_mip, :ref:`int` layer=0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_flags` **(** :ref:`RID` texture, :ref:`int` flags **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_path` **(** :ref:`RID` texture, :ref:`String` path **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_shrink_all_x2_on_set_data` **(** :ref:`bool` shrink **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`texture_set_size_override` **(** :ref:`RID` texture, :ref:`int` width, :ref:`int` height, :ref:`int` depth **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`textures_keep_original` **(** :ref:`bool` enable **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_attach_camera` **(** :ref:`RID` viewport, :ref:`RID` camera **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_attach_canvas` **(** :ref:`RID` viewport, :ref:`RID` canvas **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_attach_to_screen` **(** :ref:`RID` viewport, :ref:`Rect2` rect=Rect2( 0, 0, 0, 0 ), :ref:`int` screen=0 **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`viewport_create` **(** **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_detach` **(** :ref:`RID` viewport **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`viewport_get_render_info` **(** :ref:`RID` viewport, :ref:`ViewportRenderInfo` info **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`viewport_get_texture` **(** :ref:`RID` viewport **)** |const| | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_remove_canvas` **(** :ref:`RID` viewport, :ref:`RID` canvas **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_active` **(** :ref:`RID` viewport, :ref:`bool` active **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_canvas_stacking` **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`int` layer, :ref:`int` sublayer **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_canvas_transform` **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`Transform2D` offset **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_clear_mode` **(** :ref:`RID` viewport, :ref:`ViewportClearMode` clear_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_debug_draw` **(** :ref:`RID` viewport, :ref:`ViewportDebugDraw` draw **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_disable_3d` **(** :ref:`RID` viewport, :ref:`bool` disabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_disable_environment` **(** :ref:`RID` viewport, :ref:`bool` disabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_global_canvas_transform` **(** :ref:`RID` viewport, :ref:`Transform2D` transform **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_hdr` **(** :ref:`RID` viewport, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_hide_canvas` **(** :ref:`RID` viewport, :ref:`bool` hidden **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_hide_scenario` **(** :ref:`RID` viewport, :ref:`bool` hidden **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_msaa` **(** :ref:`RID` viewport, :ref:`ViewportMSAA` msaa **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_parent_viewport` **(** :ref:`RID` viewport, :ref:`RID` parent_viewport **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_render_direct_to_screen` **(** :ref:`RID` viewport, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_scenario` **(** :ref:`RID` viewport, :ref:`RID` scenario **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_shadow_atlas_quadrant_subdivision` **(** :ref:`RID` viewport, :ref:`int` quadrant, :ref:`int` subdivision **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_shadow_atlas_size` **(** :ref:`RID` viewport, :ref:`int` size **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_sharpen_intensity` **(** :ref:`RID` viewport, :ref:`float` intensity **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_size` **(** :ref:`RID` viewport, :ref:`int` width, :ref:`int` height **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_transparent_background` **(** :ref:`RID` viewport, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_update_mode` **(** :ref:`RID` viewport, :ref:`ViewportUpdateMode` update_mode **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_usage` **(** :ref:`RID` viewport, :ref:`ViewportUsage` usage **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_use_arvr` **(** :ref:`RID` viewport, :ref:`bool` use_arvr **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_use_debanding` **(** :ref:`RID` viewport, :ref:`bool` debanding **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_use_fxaa` **(** :ref:`RID` viewport, :ref:`bool` fxaa **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`viewport_set_vflip` **(** :ref:`RID` viewport, :ref:`bool` enabled **)** | ++---------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualServer_signal_frame_post_draw: + +- **frame_post_draw** **(** **)** + +Emitted at the end of the frame, after the VisualServer has finished updating all the Viewports. + +---- + +.. _class_VisualServer_signal_frame_pre_draw: + +- **frame_pre_draw** **(** **)** + +Emitted at the beginning of the frame, before the VisualServer updates all the Viewports. + +Enumerations +------------ + +.. _enum_VisualServer_CubeMapSide: + +.. _class_VisualServer_constant_CUBEMAP_LEFT: + +.. _class_VisualServer_constant_CUBEMAP_RIGHT: + +.. _class_VisualServer_constant_CUBEMAP_BOTTOM: + +.. _class_VisualServer_constant_CUBEMAP_TOP: + +.. _class_VisualServer_constant_CUBEMAP_FRONT: + +.. _class_VisualServer_constant_CUBEMAP_BACK: + +enum **CubeMapSide**: + +- **CUBEMAP_LEFT** = **0** --- Marks the left side of a cubemap. + +- **CUBEMAP_RIGHT** = **1** --- Marks the right side of a cubemap. + +- **CUBEMAP_BOTTOM** = **2** --- Marks the bottom side of a cubemap. + +- **CUBEMAP_TOP** = **3** --- Marks the top side of a cubemap. + +- **CUBEMAP_FRONT** = **4** --- Marks the front side of a cubemap. + +- **CUBEMAP_BACK** = **5** --- Marks the back side of a cubemap. + +---- + +.. _enum_VisualServer_TextureType: + +.. _class_VisualServer_constant_TEXTURE_TYPE_2D: + +.. _class_VisualServer_constant_TEXTURE_TYPE_CUBEMAP: + +.. _class_VisualServer_constant_TEXTURE_TYPE_2D_ARRAY: + +.. _class_VisualServer_constant_TEXTURE_TYPE_3D: + +enum **TextureType**: + +- **TEXTURE_TYPE_2D** = **0** --- Normal texture with 2 dimensions, width and height. + +- **TEXTURE_TYPE_CUBEMAP** = **2** --- Texture made up of six faces, can be looked up with a ``vec3`` in shader. + +- **TEXTURE_TYPE_2D_ARRAY** = **3** --- An array of 2-dimensional textures. + +- **TEXTURE_TYPE_3D** = **4** --- A 3-dimensional texture with width, height, and depth. + +---- + +.. _enum_VisualServer_TextureFlags: + +.. _class_VisualServer_constant_TEXTURE_FLAG_MIPMAPS: + +.. _class_VisualServer_constant_TEXTURE_FLAG_REPEAT: + +.. _class_VisualServer_constant_TEXTURE_FLAG_FILTER: + +.. _class_VisualServer_constant_TEXTURE_FLAG_ANISOTROPIC_FILTER: + +.. _class_VisualServer_constant_TEXTURE_FLAG_CONVERT_TO_LINEAR: + +.. _class_VisualServer_constant_TEXTURE_FLAG_MIRRORED_REPEAT: + +.. _class_VisualServer_constant_TEXTURE_FLAG_USED_FOR_STREAMING: + +.. _class_VisualServer_constant_TEXTURE_FLAGS_DEFAULT: + +enum **TextureFlags**: + +- **TEXTURE_FLAG_MIPMAPS** = **1** --- Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio. + +- **TEXTURE_FLAG_REPEAT** = **2** --- Repeats the texture (instead of clamp to edge). + +- **TEXTURE_FLAG_FILTER** = **4** --- Uses a magnifying filter, to enable smooth zooming in of the texture. + +- **TEXTURE_FLAG_ANISOTROPIC_FILTER** = **8** --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios. + +This results in better-looking textures when viewed from oblique angles. + +- **TEXTURE_FLAG_CONVERT_TO_LINEAR** = **16** --- Converts the texture to the sRGB color space. + +- **TEXTURE_FLAG_MIRRORED_REPEAT** = **32** --- Repeats the texture with alternate sections mirrored. + +- **TEXTURE_FLAG_USED_FOR_STREAMING** = **2048** --- Texture is a video surface. + +- **TEXTURE_FLAGS_DEFAULT** = **7** --- Default flags. :ref:`TEXTURE_FLAG_MIPMAPS`, :ref:`TEXTURE_FLAG_REPEAT` and :ref:`TEXTURE_FLAG_FILTER` are enabled. + +---- + +.. _enum_VisualServer_ShaderMode: + +.. _class_VisualServer_constant_SHADER_SPATIAL: + +.. _class_VisualServer_constant_SHADER_CANVAS_ITEM: + +.. _class_VisualServer_constant_SHADER_PARTICLES: + +.. _class_VisualServer_constant_SHADER_MAX: + +enum **ShaderMode**: + +- **SHADER_SPATIAL** = **0** --- Shader is a 3D shader. + +- **SHADER_CANVAS_ITEM** = **1** --- Shader is a 2D shader. + +- **SHADER_PARTICLES** = **2** --- Shader is a particle shader. + +- **SHADER_MAX** = **3** --- Represents the size of the :ref:`ShaderMode` enum. + +---- + +.. _enum_VisualServer_ArrayType: + +.. _class_VisualServer_constant_ARRAY_VERTEX: + +.. _class_VisualServer_constant_ARRAY_NORMAL: + +.. _class_VisualServer_constant_ARRAY_TANGENT: + +.. _class_VisualServer_constant_ARRAY_COLOR: + +.. _class_VisualServer_constant_ARRAY_TEX_UV: + +.. _class_VisualServer_constant_ARRAY_TEX_UV2: + +.. _class_VisualServer_constant_ARRAY_BONES: + +.. _class_VisualServer_constant_ARRAY_WEIGHTS: + +.. _class_VisualServer_constant_ARRAY_INDEX: + +.. _class_VisualServer_constant_ARRAY_MAX: + +enum **ArrayType**: + +- **ARRAY_VERTEX** = **0** --- Array is a vertex array. + +- **ARRAY_NORMAL** = **1** --- Array is a normal array. + +- **ARRAY_TANGENT** = **2** --- Array is a tangent array. + +- **ARRAY_COLOR** = **3** --- Array is a color array. + +- **ARRAY_TEX_UV** = **4** --- Array is an UV coordinates array. + +- **ARRAY_TEX_UV2** = **5** --- Array is an UV coordinates array for the second UV coordinates. + +- **ARRAY_BONES** = **6** --- Array contains bone information. + +- **ARRAY_WEIGHTS** = **7** --- Array is weight information. + +- **ARRAY_INDEX** = **8** --- Array is index array. + +- **ARRAY_MAX** = **9** --- Represents the size of the :ref:`ArrayType` enum. + +---- + +.. _enum_VisualServer_ArrayFormat: + +.. _class_VisualServer_constant_ARRAY_FORMAT_VERTEX: + +.. _class_VisualServer_constant_ARRAY_FORMAT_NORMAL: + +.. _class_VisualServer_constant_ARRAY_FORMAT_TANGENT: + +.. _class_VisualServer_constant_ARRAY_FORMAT_COLOR: + +.. _class_VisualServer_constant_ARRAY_FORMAT_TEX_UV: + +.. _class_VisualServer_constant_ARRAY_FORMAT_TEX_UV2: + +.. _class_VisualServer_constant_ARRAY_FORMAT_BONES: + +.. _class_VisualServer_constant_ARRAY_FORMAT_WEIGHTS: + +.. _class_VisualServer_constant_ARRAY_FORMAT_INDEX: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_VERTEX: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_NORMAL: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_TANGENT: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_COLOR: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_TEX_UV: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_TEX_UV2: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_BONES: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_WEIGHTS: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_INDEX: + +.. _class_VisualServer_constant_ARRAY_FLAG_USE_2D_VERTICES: + +.. _class_VisualServer_constant_ARRAY_FLAG_USE_16_BIT_BONES: + +.. _class_VisualServer_constant_ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION: + +.. _class_VisualServer_constant_ARRAY_COMPRESS_DEFAULT: + +enum **ArrayFormat**: + +- **ARRAY_FORMAT_VERTEX** = **1** --- Flag used to mark a vertex array. + +- **ARRAY_FORMAT_NORMAL** = **2** --- Flag used to mark a normal array. + +- **ARRAY_FORMAT_TANGENT** = **4** --- Flag used to mark a tangent array. + +- **ARRAY_FORMAT_COLOR** = **8** --- Flag used to mark a color array. + +- **ARRAY_FORMAT_TEX_UV** = **16** --- Flag used to mark an UV coordinates array. + +- **ARRAY_FORMAT_TEX_UV2** = **32** --- Flag used to mark an UV coordinates array for the second UV coordinates. + +- **ARRAY_FORMAT_BONES** = **64** --- Flag used to mark a bone information array. + +- **ARRAY_FORMAT_WEIGHTS** = **128** --- Flag used to mark a weights array. + +- **ARRAY_FORMAT_INDEX** = **256** --- Flag used to mark an index array. + +- **ARRAY_COMPRESS_VERTEX** = **512** --- Flag used to mark a compressed (half float) vertex array. + +- **ARRAY_COMPRESS_NORMAL** = **1024** --- Flag used to mark a compressed (half float) normal array. + +- **ARRAY_COMPRESS_TANGENT** = **2048** --- Flag used to mark a compressed (half float) tangent array. + +- **ARRAY_COMPRESS_COLOR** = **4096** --- Flag used to mark a compressed (half float) color array. + +- **ARRAY_COMPRESS_TEX_UV** = **8192** --- Flag used to mark a compressed (half float) UV coordinates array. + +- **ARRAY_COMPRESS_TEX_UV2** = **16384** --- Flag used to mark a compressed (half float) UV coordinates array for the second UV coordinates. + +- **ARRAY_COMPRESS_BONES** = **32768** --- Flag used to mark a compressed bone array. + +- **ARRAY_COMPRESS_WEIGHTS** = **65536** --- Flag used to mark a compressed (half float) weight array. + +- **ARRAY_COMPRESS_INDEX** = **131072** --- Flag used to mark a compressed index array. + +- **ARRAY_FLAG_USE_2D_VERTICES** = **262144** --- Flag used to mark that the array contains 2D vertices. + +- **ARRAY_FLAG_USE_16_BIT_BONES** = **524288** --- Flag used to mark that the array uses 16-bit bones instead of 8-bit. + +- **ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION** = **2097152** --- Flag used to mark that the array uses an octahedral representation of normal and tangent vectors rather than cartesian. + +- **ARRAY_COMPRESS_DEFAULT** = **2194432** --- Used to set flags :ref:`ARRAY_COMPRESS_NORMAL`, :ref:`ARRAY_COMPRESS_TANGENT`, :ref:`ARRAY_COMPRESS_COLOR`, :ref:`ARRAY_COMPRESS_TEX_UV`, :ref:`ARRAY_COMPRESS_TEX_UV2`, :ref:`ARRAY_COMPRESS_WEIGHTS`, and :ref:`ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION` quickly. + +---- + +.. _enum_VisualServer_PrimitiveType: + +.. _class_VisualServer_constant_PRIMITIVE_POINTS: + +.. _class_VisualServer_constant_PRIMITIVE_LINES: + +.. _class_VisualServer_constant_PRIMITIVE_LINE_STRIP: + +.. _class_VisualServer_constant_PRIMITIVE_LINE_LOOP: + +.. _class_VisualServer_constant_PRIMITIVE_TRIANGLES: + +.. _class_VisualServer_constant_PRIMITIVE_TRIANGLE_STRIP: + +.. _class_VisualServer_constant_PRIMITIVE_TRIANGLE_FAN: + +.. _class_VisualServer_constant_PRIMITIVE_MAX: + +enum **PrimitiveType**: + +- **PRIMITIVE_POINTS** = **0** --- Primitive to draw consists of points. + +- **PRIMITIVE_LINES** = **1** --- Primitive to draw consists of lines. + +- **PRIMITIVE_LINE_STRIP** = **2** --- Primitive to draw consists of a line strip from start to end. + +- **PRIMITIVE_LINE_LOOP** = **3** --- Primitive to draw consists of a line loop (a line strip with a line between the last and the first vertex). + +- **PRIMITIVE_TRIANGLES** = **4** --- Primitive to draw consists of triangles. + +- **PRIMITIVE_TRIANGLE_STRIP** = **5** --- Primitive to draw consists of a triangle strip (the last 3 vertices are always combined to make a triangle). + +- **PRIMITIVE_TRIANGLE_FAN** = **6** --- Primitive to draw consists of a triangle strip (the last 2 vertices are always combined with the first to make a triangle). + +- **PRIMITIVE_MAX** = **7** --- Represents the size of the :ref:`PrimitiveType` enum. + +---- + +.. _enum_VisualServer_BlendShapeMode: + +.. _class_VisualServer_constant_BLEND_SHAPE_MODE_NORMALIZED: + +.. _class_VisualServer_constant_BLEND_SHAPE_MODE_RELATIVE: + +enum **BlendShapeMode**: + +- **BLEND_SHAPE_MODE_NORMALIZED** = **0** --- Blend shapes are normalized. + +- **BLEND_SHAPE_MODE_RELATIVE** = **1** --- Blend shapes are relative to base weight. + +---- + +.. _enum_VisualServer_LightType: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL: + +.. _class_VisualServer_constant_LIGHT_OMNI: + +.. _class_VisualServer_constant_LIGHT_SPOT: + +enum **LightType**: + +- **LIGHT_DIRECTIONAL** = **0** --- Is a directional (sun) light. + +- **LIGHT_OMNI** = **1** --- Is an omni light. + +- **LIGHT_SPOT** = **2** --- Is a spot light. + +---- + +.. _enum_VisualServer_LightParam: + +.. _class_VisualServer_constant_LIGHT_PARAM_ENERGY: + +.. _class_VisualServer_constant_LIGHT_PARAM_INDIRECT_ENERGY: + +.. _class_VisualServer_constant_LIGHT_PARAM_SIZE: + +.. _class_VisualServer_constant_LIGHT_PARAM_SPECULAR: + +.. _class_VisualServer_constant_LIGHT_PARAM_RANGE: + +.. _class_VisualServer_constant_LIGHT_PARAM_ATTENUATION: + +.. _class_VisualServer_constant_LIGHT_PARAM_SPOT_ANGLE: + +.. _class_VisualServer_constant_LIGHT_PARAM_SPOT_ATTENUATION: + +.. _class_VisualServer_constant_LIGHT_PARAM_CONTACT_SHADOW_SIZE: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_MAX_DISTANCE: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_NORMAL_BIAS: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_BIAS: + +.. _class_VisualServer_constant_LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE: + +.. _class_VisualServer_constant_LIGHT_PARAM_MAX: + +enum **LightParam**: + +- **LIGHT_PARAM_ENERGY** = **0** --- The light's energy. + +- **LIGHT_PARAM_INDIRECT_ENERGY** = **1** --- Secondary multiplier used with indirect light (light bounces). + +- **LIGHT_PARAM_SIZE** = **2** --- The light's size, currently only used for soft shadows in baked lightmaps. + +- **LIGHT_PARAM_SPECULAR** = **3** --- The light's influence on specularity. + +- **LIGHT_PARAM_RANGE** = **4** --- The light's range. + +- **LIGHT_PARAM_ATTENUATION** = **5** --- The light's attenuation. + +- **LIGHT_PARAM_SPOT_ANGLE** = **6** --- The spotlight's angle. + +- **LIGHT_PARAM_SPOT_ATTENUATION** = **7** --- The spotlight's attenuation. + +- **LIGHT_PARAM_CONTACT_SHADOW_SIZE** = **8** --- Scales the shadow color. + +- **LIGHT_PARAM_SHADOW_MAX_DISTANCE** = **9** --- Max distance that shadows will be rendered. + +- **LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET** = **10** --- Proportion of shadow atlas occupied by the first split. + +- **LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET** = **11** --- Proportion of shadow atlas occupied by the second split. + +- **LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET** = **12** --- Proportion of shadow atlas occupied by the third split. The fourth split occupies the rest. + +- **LIGHT_PARAM_SHADOW_NORMAL_BIAS** = **13** --- Normal bias used to offset shadow lookup by object normal. Can be used to fix self-shadowing artifacts. + +- **LIGHT_PARAM_SHADOW_BIAS** = **14** --- Bias the shadow lookup to fix self-shadowing artifacts. + +- **LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE** = **15** --- Increases bias on further splits to fix self-shadowing that only occurs far away from the camera. + +- **LIGHT_PARAM_MAX** = **16** --- Represents the size of the :ref:`LightParam` enum. + +---- + +.. _enum_VisualServer_LightBakeMode: + +.. _class_VisualServer_constant_LIGHT_BAKE_DISABLED: + +.. _class_VisualServer_constant_LIGHT_BAKE_INDIRECT: + +.. _class_VisualServer_constant_LIGHT_BAKE_ALL: + +enum **LightBakeMode**: + +- **LIGHT_BAKE_DISABLED** = **0** + +- **LIGHT_BAKE_INDIRECT** = **1** + +- **LIGHT_BAKE_ALL** = **2** + +---- + +.. _enum_VisualServer_LightOmniShadowMode: + +.. _class_VisualServer_constant_LIGHT_OMNI_SHADOW_DUAL_PARABOLOID: + +.. _class_VisualServer_constant_LIGHT_OMNI_SHADOW_CUBE: + +enum **LightOmniShadowMode**: + +- **LIGHT_OMNI_SHADOW_DUAL_PARABOLOID** = **0** --- Use a dual paraboloid shadow map for omni lights. + +- **LIGHT_OMNI_SHADOW_CUBE** = **1** --- Use a cubemap shadow map for omni lights. Slower but better quality than dual paraboloid. + +---- + +.. _enum_VisualServer_LightOmniShadowDetail: + +.. _class_VisualServer_constant_LIGHT_OMNI_SHADOW_DETAIL_VERTICAL: + +.. _class_VisualServer_constant_LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL: + +enum **LightOmniShadowDetail**: + +- **LIGHT_OMNI_SHADOW_DETAIL_VERTICAL** = **0** --- Use more detail vertically when computing shadow map. + +- **LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL** = **1** --- Use more detail horizontally when computing shadow map. + +---- + +.. _enum_VisualServer_LightDirectionalShadowMode: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS: + +enum **LightDirectionalShadowMode**: + +- **LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL** = **0** --- Use orthogonal shadow projection for directional light. + +- **LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS** = **1** --- Use 2 splits for shadow projection when using directional light. + +- **LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS** = **2** --- Use 4 splits for shadow projection when using directional light. + +---- + +.. _enum_VisualServer_LightDirectionalShadowDepthRangeMode: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE: + +.. _class_VisualServer_constant_LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED: + +enum **LightDirectionalShadowDepthRangeMode**: + +- **LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE** = **0** --- Keeps shadows stable as camera moves but has lower effective resolution. + +- **LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED** = **1** --- Optimize use of shadow maps, increasing the effective resolution. But may result in shadows moving or flickering slightly. + +---- + +.. _enum_VisualServer_ViewportUpdateMode: + +.. _class_VisualServer_constant_VIEWPORT_UPDATE_DISABLED: + +.. _class_VisualServer_constant_VIEWPORT_UPDATE_ONCE: + +.. _class_VisualServer_constant_VIEWPORT_UPDATE_WHEN_VISIBLE: + +.. _class_VisualServer_constant_VIEWPORT_UPDATE_ALWAYS: + +enum **ViewportUpdateMode**: + +- **VIEWPORT_UPDATE_DISABLED** = **0** --- Do not update the viewport. + +- **VIEWPORT_UPDATE_ONCE** = **1** --- Update the viewport once then set to disabled. + +- **VIEWPORT_UPDATE_WHEN_VISIBLE** = **2** --- Update the viewport whenever it is visible. + +- **VIEWPORT_UPDATE_ALWAYS** = **3** --- Always update the viewport. + +---- + +.. _enum_VisualServer_ViewportClearMode: + +.. _class_VisualServer_constant_VIEWPORT_CLEAR_ALWAYS: + +.. _class_VisualServer_constant_VIEWPORT_CLEAR_NEVER: + +.. _class_VisualServer_constant_VIEWPORT_CLEAR_ONLY_NEXT_FRAME: + +enum **ViewportClearMode**: + +- **VIEWPORT_CLEAR_ALWAYS** = **0** --- The viewport is always cleared before drawing. + +- **VIEWPORT_CLEAR_NEVER** = **1** --- The viewport is never cleared before drawing. + +- **VIEWPORT_CLEAR_ONLY_NEXT_FRAME** = **2** --- The viewport is cleared once, then the clear mode is set to :ref:`VIEWPORT_CLEAR_NEVER`. + +---- + +.. _enum_VisualServer_ViewportMSAA: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_DISABLED: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_2X: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_4X: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_8X: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_16X: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_EXT_2X: + +.. _class_VisualServer_constant_VIEWPORT_MSAA_EXT_4X: + +enum **ViewportMSAA**: + +- **VIEWPORT_MSAA_DISABLED** = **0** --- Multisample antialiasing is disabled. + +- **VIEWPORT_MSAA_2X** = **1** --- Multisample antialiasing is set to 2×. + +- **VIEWPORT_MSAA_4X** = **2** --- Multisample antialiasing is set to 4×. + +- **VIEWPORT_MSAA_8X** = **3** --- Multisample antialiasing is set to 8×. + +- **VIEWPORT_MSAA_16X** = **4** --- Multisample antialiasing is set to 16×. + +- **VIEWPORT_MSAA_EXT_2X** = **5** --- Multisample antialiasing is set to 2× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go). + +- **VIEWPORT_MSAA_EXT_4X** = **6** --- Multisample antialiasing is set to 4× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go). + +---- + +.. _enum_VisualServer_ViewportUsage: + +.. _class_VisualServer_constant_VIEWPORT_USAGE_2D: + +.. _class_VisualServer_constant_VIEWPORT_USAGE_2D_NO_SAMPLING: + +.. _class_VisualServer_constant_VIEWPORT_USAGE_3D: + +.. _class_VisualServer_constant_VIEWPORT_USAGE_3D_NO_EFFECTS: + +enum **ViewportUsage**: + +- **VIEWPORT_USAGE_2D** = **0** --- The Viewport does not render 3D but samples. + +- **VIEWPORT_USAGE_2D_NO_SAMPLING** = **1** --- The Viewport does not render 3D and does not sample. + +- **VIEWPORT_USAGE_3D** = **2** --- The Viewport renders 3D with effects. + +- **VIEWPORT_USAGE_3D_NO_EFFECTS** = **3** --- The Viewport renders 3D but without effects. + +---- + +.. _enum_VisualServer_ViewportRenderInfo: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_2D_ITEMS_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME: + +.. _class_VisualServer_constant_VIEWPORT_RENDER_INFO_MAX: + +enum **ViewportRenderInfo**: + +- **VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME** = **0** --- Number of objects drawn in a single frame. + +- **VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME** = **1** --- Number of vertices drawn in a single frame. + +- **VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME** = **2** --- Number of material changes during this frame. + +- **VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME** = **3** --- Number of shader changes during this frame. + +- **VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME** = **4** --- Number of surface changes during this frame. + +- **VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME** = **5** --- Number of draw calls during this frame. + +- **VIEWPORT_RENDER_INFO_2D_ITEMS_IN_FRAME** = **6** --- Number of 2d items drawn this frame. + +- **VIEWPORT_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME** = **7** --- Number of 2d draw calls during this frame. + +- **VIEWPORT_RENDER_INFO_MAX** = **8** --- Represents the size of the :ref:`ViewportRenderInfo` enum. + +---- + +.. _enum_VisualServer_ViewportDebugDraw: + +.. _class_VisualServer_constant_VIEWPORT_DEBUG_DRAW_DISABLED: + +.. _class_VisualServer_constant_VIEWPORT_DEBUG_DRAW_UNSHADED: + +.. _class_VisualServer_constant_VIEWPORT_DEBUG_DRAW_OVERDRAW: + +.. _class_VisualServer_constant_VIEWPORT_DEBUG_DRAW_WIREFRAME: + +enum **ViewportDebugDraw**: + +- **VIEWPORT_DEBUG_DRAW_DISABLED** = **0** --- Debug draw is disabled. Default setting. + +- **VIEWPORT_DEBUG_DRAW_UNSHADED** = **1** --- Debug draw sets objects to unshaded. + +- **VIEWPORT_DEBUG_DRAW_OVERDRAW** = **2** --- Overwrites clear color to ``(0,0,0,0)``. + +- **VIEWPORT_DEBUG_DRAW_WIREFRAME** = **3** --- Debug draw draws objects in wireframe. + +---- + +.. _enum_VisualServer_ScenarioDebugMode: + +.. _class_VisualServer_constant_SCENARIO_DEBUG_DISABLED: + +.. _class_VisualServer_constant_SCENARIO_DEBUG_WIREFRAME: + +.. _class_VisualServer_constant_SCENARIO_DEBUG_OVERDRAW: + +.. _class_VisualServer_constant_SCENARIO_DEBUG_SHADELESS: + +enum **ScenarioDebugMode**: + +- **SCENARIO_DEBUG_DISABLED** = **0** --- Do not use a debug mode. + +- **SCENARIO_DEBUG_WIREFRAME** = **1** --- Draw all objects as wireframe models. + +- **SCENARIO_DEBUG_OVERDRAW** = **2** --- Draw all objects in a way that displays how much overdraw is occurring. Overdraw occurs when a section of pixels is drawn and shaded and then another object covers it up. To optimize a scene, you should reduce overdraw. + +- **SCENARIO_DEBUG_SHADELESS** = **3** --- Draw all objects without shading. Equivalent to setting all objects shaders to ``unshaded``. + +---- + +.. _enum_VisualServer_InstanceType: + +.. _class_VisualServer_constant_INSTANCE_NONE: + +.. _class_VisualServer_constant_INSTANCE_MESH: + +.. _class_VisualServer_constant_INSTANCE_MULTIMESH: + +.. _class_VisualServer_constant_INSTANCE_IMMEDIATE: + +.. _class_VisualServer_constant_INSTANCE_PARTICLES: + +.. _class_VisualServer_constant_INSTANCE_LIGHT: + +.. _class_VisualServer_constant_INSTANCE_REFLECTION_PROBE: + +.. _class_VisualServer_constant_INSTANCE_GI_PROBE: + +.. _class_VisualServer_constant_INSTANCE_LIGHTMAP_CAPTURE: + +.. _class_VisualServer_constant_INSTANCE_MAX: + +.. _class_VisualServer_constant_INSTANCE_GEOMETRY_MASK: + +enum **InstanceType**: + +- **INSTANCE_NONE** = **0** --- The instance does not have a type. + +- **INSTANCE_MESH** = **1** --- The instance is a mesh. + +- **INSTANCE_MULTIMESH** = **2** --- The instance is a multimesh. + +- **INSTANCE_IMMEDIATE** = **3** --- The instance is an immediate geometry. + +- **INSTANCE_PARTICLES** = **4** --- The instance is a particle emitter. + +- **INSTANCE_LIGHT** = **5** --- The instance is a light. + +- **INSTANCE_REFLECTION_PROBE** = **6** --- The instance is a reflection probe. + +- **INSTANCE_GI_PROBE** = **7** --- The instance is a GI probe. + +- **INSTANCE_LIGHTMAP_CAPTURE** = **8** --- The instance is a lightmap capture. + +- **INSTANCE_MAX** = **9** --- Represents the size of the :ref:`InstanceType` enum. + +- **INSTANCE_GEOMETRY_MASK** = **30** --- A combination of the flags of geometry instances (mesh, multimesh, immediate and particles). + +---- + +.. _enum_VisualServer_InstanceFlags: + +.. _class_VisualServer_constant_INSTANCE_FLAG_USE_BAKED_LIGHT: + +.. _class_VisualServer_constant_INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE: + +.. _class_VisualServer_constant_INSTANCE_FLAG_MAX: + +enum **InstanceFlags**: + +- **INSTANCE_FLAG_USE_BAKED_LIGHT** = **0** --- Allows the instance to be used in baked lighting. + +- **INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE** = **1** --- When set, manually requests to draw geometry on next frame. + +- **INSTANCE_FLAG_MAX** = **2** --- Represents the size of the :ref:`InstanceFlags` enum. + +---- + +.. _enum_VisualServer_ShadowCastingSetting: + +.. _class_VisualServer_constant_SHADOW_CASTING_SETTING_OFF: + +.. _class_VisualServer_constant_SHADOW_CASTING_SETTING_ON: + +.. _class_VisualServer_constant_SHADOW_CASTING_SETTING_DOUBLE_SIDED: + +.. _class_VisualServer_constant_SHADOW_CASTING_SETTING_SHADOWS_ONLY: + +enum **ShadowCastingSetting**: + +- **SHADOW_CASTING_SETTING_OFF** = **0** --- Disable shadows from this instance. + +- **SHADOW_CASTING_SETTING_ON** = **1** --- Cast shadows from this instance. + +- **SHADOW_CASTING_SETTING_DOUBLE_SIDED** = **2** --- Disable backface culling when rendering the shadow of the object. This is slightly slower but may result in more correct shadows. + +- **SHADOW_CASTING_SETTING_SHADOWS_ONLY** = **3** --- Only render the shadows from the object. The object itself will not be drawn. + +---- + +.. _enum_VisualServer_NinePatchAxisMode: + +.. _class_VisualServer_constant_NINE_PATCH_STRETCH: + +.. _class_VisualServer_constant_NINE_PATCH_TILE: + +.. _class_VisualServer_constant_NINE_PATCH_TILE_FIT: + +enum **NinePatchAxisMode**: + +- **NINE_PATCH_STRETCH** = **0** --- The nine patch gets stretched where needed. + +- **NINE_PATCH_TILE** = **1** --- The nine patch gets filled with tiles where needed. + +- **NINE_PATCH_TILE_FIT** = **2** --- The nine patch gets filled with tiles where needed and stretches them a bit if needed. + +---- + +.. _enum_VisualServer_CanvasLightMode: + +.. _class_VisualServer_constant_CANVAS_LIGHT_MODE_ADD: + +.. _class_VisualServer_constant_CANVAS_LIGHT_MODE_SUB: + +.. _class_VisualServer_constant_CANVAS_LIGHT_MODE_MIX: + +.. _class_VisualServer_constant_CANVAS_LIGHT_MODE_MASK: + +enum **CanvasLightMode**: + +- **CANVAS_LIGHT_MODE_ADD** = **0** --- Adds light color additive to the canvas. + +- **CANVAS_LIGHT_MODE_SUB** = **1** --- Adds light color subtractive to the canvas. + +- **CANVAS_LIGHT_MODE_MIX** = **2** --- The light adds color depending on transparency. + +- **CANVAS_LIGHT_MODE_MASK** = **3** --- The light adds color depending on mask. + +---- + +.. _enum_VisualServer_CanvasLightShadowFilter: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_NONE: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_PCF3: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_PCF5: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_PCF7: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_PCF9: + +.. _class_VisualServer_constant_CANVAS_LIGHT_FILTER_PCF13: + +enum **CanvasLightShadowFilter**: + +- **CANVAS_LIGHT_FILTER_NONE** = **0** --- Do not apply a filter to canvas light shadows. + +- **CANVAS_LIGHT_FILTER_PCF3** = **1** --- Use PCF3 filtering to filter canvas light shadows. + +- **CANVAS_LIGHT_FILTER_PCF5** = **2** --- Use PCF5 filtering to filter canvas light shadows. + +- **CANVAS_LIGHT_FILTER_PCF7** = **3** --- Use PCF7 filtering to filter canvas light shadows. + +- **CANVAS_LIGHT_FILTER_PCF9** = **4** --- Use PCF9 filtering to filter canvas light shadows. + +- **CANVAS_LIGHT_FILTER_PCF13** = **5** --- Use PCF13 filtering to filter canvas light shadows. + +---- + +.. _enum_VisualServer_CanvasOccluderPolygonCullMode: + +.. _class_VisualServer_constant_CANVAS_OCCLUDER_POLYGON_CULL_DISABLED: + +.. _class_VisualServer_constant_CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE: + +.. _class_VisualServer_constant_CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE: + +enum **CanvasOccluderPolygonCullMode**: + +- **CANVAS_OCCLUDER_POLYGON_CULL_DISABLED** = **0** --- Culling of the canvas occluder is disabled. + +- **CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE** = **1** --- Culling of the canvas occluder is clockwise. + +- **CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE** = **2** --- Culling of the canvas occluder is counterclockwise. + +---- + +.. _enum_VisualServer_RenderInfo: + +.. _class_VisualServer_constant_INFO_OBJECTS_IN_FRAME: + +.. _class_VisualServer_constant_INFO_VERTICES_IN_FRAME: + +.. _class_VisualServer_constant_INFO_MATERIAL_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_INFO_SHADER_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_INFO_SURFACE_CHANGES_IN_FRAME: + +.. _class_VisualServer_constant_INFO_DRAW_CALLS_IN_FRAME: + +.. _class_VisualServer_constant_INFO_2D_ITEMS_IN_FRAME: + +.. _class_VisualServer_constant_INFO_2D_DRAW_CALLS_IN_FRAME: + +.. _class_VisualServer_constant_INFO_USAGE_VIDEO_MEM_TOTAL: + +.. _class_VisualServer_constant_INFO_VIDEO_MEM_USED: + +.. _class_VisualServer_constant_INFO_TEXTURE_MEM_USED: + +.. _class_VisualServer_constant_INFO_VERTEX_MEM_USED: + +enum **RenderInfo**: + +- **INFO_OBJECTS_IN_FRAME** = **0** --- The amount of objects in the frame. + +- **INFO_VERTICES_IN_FRAME** = **1** --- The amount of vertices in the frame. + +- **INFO_MATERIAL_CHANGES_IN_FRAME** = **2** --- The amount of modified materials in the frame. + +- **INFO_SHADER_CHANGES_IN_FRAME** = **3** --- The amount of shader rebinds in the frame. + +- **INFO_SURFACE_CHANGES_IN_FRAME** = **4** --- The amount of surface changes in the frame. + +- **INFO_DRAW_CALLS_IN_FRAME** = **5** --- The amount of draw calls in frame. + +- **INFO_2D_ITEMS_IN_FRAME** = **6** --- The amount of 2d items in the frame. + +- **INFO_2D_DRAW_CALLS_IN_FRAME** = **7** --- The amount of 2d draw calls in frame. + +- **INFO_USAGE_VIDEO_MEM_TOTAL** = **8** --- Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0. + +- **INFO_VIDEO_MEM_USED** = **9** --- The amount of video memory used, i.e. texture and vertex memory combined. + +- **INFO_TEXTURE_MEM_USED** = **10** --- The amount of texture memory used. + +- **INFO_VERTEX_MEM_USED** = **11** --- The amount of vertex memory used. + +---- + +.. _enum_VisualServer_Features: + +.. _class_VisualServer_constant_FEATURE_SHADERS: + +.. _class_VisualServer_constant_FEATURE_MULTITHREADED: + +enum **Features**: + +- **FEATURE_SHADERS** = **0** --- Hardware supports shaders. This enum is currently unused in Godot 3.x. + +- **FEATURE_MULTITHREADED** = **1** --- Hardware supports multithreading. This enum is currently unused in Godot 3.x. + +---- + +.. _enum_VisualServer_MultimeshTransformFormat: + +.. _class_VisualServer_constant_MULTIMESH_TRANSFORM_2D: + +.. _class_VisualServer_constant_MULTIMESH_TRANSFORM_3D: + +enum **MultimeshTransformFormat**: + +- **MULTIMESH_TRANSFORM_2D** = **0** --- Use :ref:`Transform2D` to store MultiMesh transform. + +- **MULTIMESH_TRANSFORM_3D** = **1** --- Use :ref:`Transform` to store MultiMesh transform. + +---- + +.. _enum_VisualServer_MultimeshColorFormat: + +.. _class_VisualServer_constant_MULTIMESH_COLOR_NONE: + +.. _class_VisualServer_constant_MULTIMESH_COLOR_8BIT: + +.. _class_VisualServer_constant_MULTIMESH_COLOR_FLOAT: + +enum **MultimeshColorFormat**: + +- **MULTIMESH_COLOR_NONE** = **0** --- MultiMesh does not use per-instance color. + +- **MULTIMESH_COLOR_8BIT** = **1** --- MultiMesh color uses 8 bits per component. This packs the color into a single float. + +- **MULTIMESH_COLOR_FLOAT** = **2** --- MultiMesh color uses a float per channel. + +---- + +.. _enum_VisualServer_MultimeshCustomDataFormat: + +.. _class_VisualServer_constant_MULTIMESH_CUSTOM_DATA_NONE: + +.. _class_VisualServer_constant_MULTIMESH_CUSTOM_DATA_8BIT: + +.. _class_VisualServer_constant_MULTIMESH_CUSTOM_DATA_FLOAT: + +enum **MultimeshCustomDataFormat**: + +- **MULTIMESH_CUSTOM_DATA_NONE** = **0** --- MultiMesh does not use custom data. + +- **MULTIMESH_CUSTOM_DATA_8BIT** = **1** --- MultiMesh custom data uses 8 bits per component. This packs the 4-component custom data into a single float. + +- **MULTIMESH_CUSTOM_DATA_FLOAT** = **2** --- MultiMesh custom data uses a float per component. + +---- + +.. _enum_VisualServer_ReflectionProbeUpdateMode: + +.. _class_VisualServer_constant_REFLECTION_PROBE_UPDATE_ONCE: + +.. _class_VisualServer_constant_REFLECTION_PROBE_UPDATE_ALWAYS: + +enum **ReflectionProbeUpdateMode**: + +- **REFLECTION_PROBE_UPDATE_ONCE** = **0** --- Reflection probe will update reflections once and then stop. + +- **REFLECTION_PROBE_UPDATE_ALWAYS** = **1** --- Reflection probe will update each frame. This mode is necessary to capture moving objects. + +---- + +.. _enum_VisualServer_ParticlesDrawOrder: + +.. _class_VisualServer_constant_PARTICLES_DRAW_ORDER_INDEX: + +.. _class_VisualServer_constant_PARTICLES_DRAW_ORDER_LIFETIME: + +.. _class_VisualServer_constant_PARTICLES_DRAW_ORDER_VIEW_DEPTH: + +enum **ParticlesDrawOrder**: + +- **PARTICLES_DRAW_ORDER_INDEX** = **0** --- Draw particles in the order that they appear in the particles array. + +- **PARTICLES_DRAW_ORDER_LIFETIME** = **1** --- Sort particles based on their lifetime. + +- **PARTICLES_DRAW_ORDER_VIEW_DEPTH** = **2** --- Sort particles based on their distance to the camera. + +---- + +.. _enum_VisualServer_EnvironmentBG: + +.. _class_VisualServer_constant_ENV_BG_CLEAR_COLOR: + +.. _class_VisualServer_constant_ENV_BG_COLOR: + +.. _class_VisualServer_constant_ENV_BG_SKY: + +.. _class_VisualServer_constant_ENV_BG_COLOR_SKY: + +.. _class_VisualServer_constant_ENV_BG_CANVAS: + +.. _class_VisualServer_constant_ENV_BG_KEEP: + +.. _class_VisualServer_constant_ENV_BG_MAX: + +enum **EnvironmentBG**: + +- **ENV_BG_CLEAR_COLOR** = **0** --- Use the clear color as background. + +- **ENV_BG_COLOR** = **1** --- Use a specified color as the background. + +- **ENV_BG_SKY** = **2** --- Use a sky resource for the background. + +- **ENV_BG_COLOR_SKY** = **3** --- Use a custom color for background, but use a sky for shading and reflections. + +- **ENV_BG_CANVAS** = **4** --- Use a specified canvas layer as the background. This can be useful for instantiating a 2D scene in a 3D world. + +- **ENV_BG_KEEP** = **5** --- Do not clear the background, use whatever was rendered last frame as the background. + +- **ENV_BG_MAX** = **7** --- Represents the size of the :ref:`EnvironmentBG` enum. + +---- + +.. _enum_VisualServer_EnvironmentDOFBlurQuality: + +.. _class_VisualServer_constant_ENV_DOF_BLUR_QUALITY_LOW: + +.. _class_VisualServer_constant_ENV_DOF_BLUR_QUALITY_MEDIUM: + +.. _class_VisualServer_constant_ENV_DOF_BLUR_QUALITY_HIGH: + +enum **EnvironmentDOFBlurQuality**: + +- **ENV_DOF_BLUR_QUALITY_LOW** = **0** --- Use lowest blur quality. Fastest, but may look bad. + +- **ENV_DOF_BLUR_QUALITY_MEDIUM** = **1** --- Use medium blur quality. + +- **ENV_DOF_BLUR_QUALITY_HIGH** = **2** --- Used highest blur quality. Looks the best, but is the slowest. + +---- + +.. _enum_VisualServer_EnvironmentGlowBlendMode: + +.. _class_VisualServer_constant_GLOW_BLEND_MODE_ADDITIVE: + +.. _class_VisualServer_constant_GLOW_BLEND_MODE_SCREEN: + +.. _class_VisualServer_constant_GLOW_BLEND_MODE_SOFTLIGHT: + +.. _class_VisualServer_constant_GLOW_BLEND_MODE_REPLACE: + +enum **EnvironmentGlowBlendMode**: + +- **GLOW_BLEND_MODE_ADDITIVE** = **0** --- Add the effect of the glow on top of the scene. + +- **GLOW_BLEND_MODE_SCREEN** = **1** --- Blends the glow effect with the screen. Does not get as bright as additive. + +- **GLOW_BLEND_MODE_SOFTLIGHT** = **2** --- Produces a subtle color disturbance around objects. + +- **GLOW_BLEND_MODE_REPLACE** = **3** --- Shows the glow effect by itself without the underlying scene. + +---- + +.. _enum_VisualServer_EnvironmentToneMapper: + +.. _class_VisualServer_constant_ENV_TONE_MAPPER_LINEAR: + +.. _class_VisualServer_constant_ENV_TONE_MAPPER_REINHARD: + +.. _class_VisualServer_constant_ENV_TONE_MAPPER_FILMIC: + +.. _class_VisualServer_constant_ENV_TONE_MAPPER_ACES: + +.. _class_VisualServer_constant_ENV_TONE_MAPPER_ACES_FITTED: + +enum **EnvironmentToneMapper**: + +- **ENV_TONE_MAPPER_LINEAR** = **0** --- Output color as they came in. + +- **ENV_TONE_MAPPER_REINHARD** = **1** --- Use the Reinhard tonemapper. + +- **ENV_TONE_MAPPER_FILMIC** = **2** --- Use the filmic tonemapper. + +- **ENV_TONE_MAPPER_ACES** = **3** --- Use the ACES tonemapper. + +- **ENV_TONE_MAPPER_ACES_FITTED** = **4** --- Use the ACES Fitted tonemapper. + +---- + +.. _enum_VisualServer_EnvironmentSSAOQuality: + +.. _class_VisualServer_constant_ENV_SSAO_QUALITY_LOW: + +.. _class_VisualServer_constant_ENV_SSAO_QUALITY_MEDIUM: + +.. _class_VisualServer_constant_ENV_SSAO_QUALITY_HIGH: + +enum **EnvironmentSSAOQuality**: + +- **ENV_SSAO_QUALITY_LOW** = **0** --- Lowest quality of screen space ambient occlusion. + +- **ENV_SSAO_QUALITY_MEDIUM** = **1** --- Medium quality screen space ambient occlusion. + +- **ENV_SSAO_QUALITY_HIGH** = **2** --- Highest quality screen space ambient occlusion. + +---- + +.. _enum_VisualServer_EnvironmentSSAOBlur: + +.. _class_VisualServer_constant_ENV_SSAO_BLUR_DISABLED: + +.. _class_VisualServer_constant_ENV_SSAO_BLUR_1x1: + +.. _class_VisualServer_constant_ENV_SSAO_BLUR_2x2: + +.. _class_VisualServer_constant_ENV_SSAO_BLUR_3x3: + +enum **EnvironmentSSAOBlur**: + +- **ENV_SSAO_BLUR_DISABLED** = **0** --- Disables the blur set for SSAO. Will make SSAO look noisier. + +- **ENV_SSAO_BLUR_1x1** = **1** --- Perform a 1x1 blur on the SSAO output. + +- **ENV_SSAO_BLUR_2x2** = **2** --- Performs a 2x2 blur on the SSAO output. + +- **ENV_SSAO_BLUR_3x3** = **3** --- Performs a 3x3 blur on the SSAO output. Use this for smoothest SSAO. + +Constants +--------- + +.. _class_VisualServer_constant_NO_INDEX_ARRAY: + +.. _class_VisualServer_constant_ARRAY_WEIGHTS_SIZE: + +.. _class_VisualServer_constant_CANVAS_ITEM_Z_MIN: + +.. _class_VisualServer_constant_CANVAS_ITEM_Z_MAX: + +.. _class_VisualServer_constant_MAX_GLOW_LEVELS: + +.. _class_VisualServer_constant_MAX_CURSORS: + +.. _class_VisualServer_constant_MATERIAL_RENDER_PRIORITY_MIN: + +.. _class_VisualServer_constant_MATERIAL_RENDER_PRIORITY_MAX: + +- **NO_INDEX_ARRAY** = **-1** --- Marks an error that shows that the index array is empty. + +- **ARRAY_WEIGHTS_SIZE** = **4** --- Number of weights/bones per vertex. + +- **CANVAS_ITEM_Z_MIN** = **-4096** --- The minimum Z-layer for canvas items. + +- **CANVAS_ITEM_Z_MAX** = **4096** --- The maximum Z-layer for canvas items. + +- **MAX_GLOW_LEVELS** = **7** --- Max number of glow levels that can be used with glow post-process effect. + +- **MAX_CURSORS** = **8** --- Unused enum in Godot 3.x. + +- **MATERIAL_RENDER_PRIORITY_MIN** = **-128** --- The minimum renderpriority of all materials. + +- **MATERIAL_RENDER_PRIORITY_MAX** = **127** --- The maximum renderpriority of all materials. + +Property Descriptions +--------------------- + +.. _class_VisualServer_property_render_loop_enabled: + +- :ref:`bool` **render_loop_enabled** + ++----------+--------------------------------+ +| *Setter* | set_render_loop_enabled(value) | ++----------+--------------------------------+ +| *Getter* | is_render_loop_enabled() | ++----------+--------------------------------+ + +If ``false``, disables rendering completely, but the engine logic is still being processed. You can call :ref:`force_draw` to draw a frame even with rendering disabled. + +Method Descriptions +------------------- + +.. _class_VisualServer_method_black_bars_set_images: + +- void **black_bars_set_images** **(** :ref:`RID` left, :ref:`RID` top, :ref:`RID` right, :ref:`RID` bottom **)** + +Sets images to be rendered in the window margin. + +---- + +.. _class_VisualServer_method_black_bars_set_margins: + +- void **black_bars_set_margins** **(** :ref:`int` left, :ref:`int` top, :ref:`int` right, :ref:`int` bottom **)** + +Sets margin size, where black bars (or images, if :ref:`black_bars_set_images` was used) are rendered. + +---- + +.. _class_VisualServer_method_camera_create: + +- :ref:`RID` **camera_create** **(** **)** + +Creates a camera and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``camera_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_camera_set_cull_mask: + +- void **camera_set_cull_mask** **(** :ref:`RID` camera, :ref:`int` layers **)** + +Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to :ref:`Camera.cull_mask`. + +---- + +.. _class_VisualServer_method_camera_set_environment: + +- void **camera_set_environment** **(** :ref:`RID` camera, :ref:`RID` env **)** + +Sets the environment used by this camera. Equivalent to :ref:`Camera.environment`. + +---- + +.. _class_VisualServer_method_camera_set_frustum: + +- void **camera_set_frustum** **(** :ref:`RID` camera, :ref:`float` size, :ref:`Vector2` offset, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets camera to use frustum projection. This mode allows adjusting the ``offset`` argument to create "tilted frustum" effects. + +---- + +.. _class_VisualServer_method_camera_set_orthogonal: + +- void **camera_set_orthogonal** **(** :ref:`RID` camera, :ref:`float` size, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets camera to use orthogonal projection, also known as orthographic projection. Objects remain the same size on the screen no matter how far away they are. + +---- + +.. _class_VisualServer_method_camera_set_perspective: + +- void **camera_set_perspective** **(** :ref:`RID` camera, :ref:`float` fovy_degrees, :ref:`float` z_near, :ref:`float` z_far **)** + +Sets camera to use perspective projection. Objects on the screen becomes smaller when they are far away. + +---- + +.. _class_VisualServer_method_camera_set_transform: + +- void **camera_set_transform** **(** :ref:`RID` camera, :ref:`Transform` transform **)** + +Sets :ref:`Transform` of camera. + +---- + +.. _class_VisualServer_method_camera_set_use_vertical_aspect: + +- void **camera_set_use_vertical_aspect** **(** :ref:`RID` camera, :ref:`bool` enable **)** + +If ``true``, preserves the horizontal aspect ratio which is equivalent to :ref:`Camera.KEEP_WIDTH`. If ``false``, preserves the vertical aspect ratio which is equivalent to :ref:`Camera.KEEP_HEIGHT`. + +---- + +.. _class_VisualServer_method_canvas_create: + +- :ref:`RID` **canvas_create** **(** **)** + +Creates a canvas and returns the assigned :ref:`RID`. It can be accessed with the RID that is returned. This RID will be used in all ``canvas_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_canvas_item_add_circle: + +- void **canvas_item_add_circle** **(** :ref:`RID` item, :ref:`Vector2` pos, :ref:`float` radius, :ref:`Color` color **)** + +Adds a circle command to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_clip_ignore: + +- void **canvas_item_add_clip_ignore** **(** :ref:`RID` item, :ref:`bool` ignore **)** + +If ignore is ``true``, the VisualServer does not perform clipping. + +---- + +.. _class_VisualServer_method_canvas_item_add_line: + +- void **canvas_item_add_line** **(** :ref:`RID` item, :ref:`Vector2` from, :ref:`Vector2` to, :ref:`Color` color, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Adds a line command to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_mesh: + +- void **canvas_item_add_mesh** **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`Transform2D` transform=Transform2D( 1, 0, 0, 1, 0, 0 ), :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`RID` texture, :ref:`RID` normal_map **)** + +Adds a mesh command to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_multimesh: + +- void **canvas_item_add_multimesh** **(** :ref:`RID` item, :ref:`RID` mesh, :ref:`RID` texture, :ref:`RID` normal_map **)** + +Adds a :ref:`MultiMesh` to the :ref:`CanvasItem`'s draw commands. Only affects its aabb at the moment. + +---- + +.. _class_VisualServer_method_canvas_item_add_nine_patch: + +- void **canvas_item_add_nine_patch** **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`Rect2` source, :ref:`RID` texture, :ref:`Vector2` topleft, :ref:`Vector2` bottomright, :ref:`NinePatchAxisMode` x_axis_mode=0, :ref:`NinePatchAxisMode` y_axis_mode=0, :ref:`bool` draw_center=true, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`RID` normal_map **)** + +Adds a nine patch image to the :ref:`CanvasItem`'s draw commands. + +See :ref:`NinePatchRect` for more explanation. + +---- + +.. _class_VisualServer_method_canvas_item_add_particles: + +- void **canvas_item_add_particles** **(** :ref:`RID` item, :ref:`RID` particles, :ref:`RID` texture, :ref:`RID` normal_map **)** + +Adds a particle system to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_polygon: + +- void **canvas_item_add_polygon** **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`RID` texture, :ref:`RID` normal_map, :ref:`bool` antialiased=false **)** + +Adds a polygon to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_polyline: + +- void **canvas_item_add_polyline** **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`float` width=1.0, :ref:`bool` antialiased=false **)** + +Adds a polyline, which is a line from multiple points with a width, to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_primitive: + +- void **canvas_item_add_primitive** **(** :ref:`RID` item, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs, :ref:`RID` texture, :ref:`float` width=1.0, :ref:`RID` normal_map **)** + +Adds a primitive to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_rect: + +- void **canvas_item_add_rect** **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`Color` color **)** + +Adds a rectangle to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_set_transform: + +- void **canvas_item_add_set_transform** **(** :ref:`RID` item, :ref:`Transform2D` transform **)** + +Adds a :ref:`Transform2D` command to the :ref:`CanvasItem`'s draw commands. + +This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item. + +---- + +.. _class_VisualServer_method_canvas_item_add_texture_rect: + +- void **canvas_item_add_texture_rect** **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`bool` tile=false, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`RID` normal_map **)** + +Adds a textured rect to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_texture_rect_region: + +- void **canvas_item_add_texture_rect_region** **(** :ref:`RID` item, :ref:`Rect2` rect, :ref:`RID` texture, :ref:`Rect2` src_rect, :ref:`Color` modulate=Color( 1, 1, 1, 1 ), :ref:`bool` transpose=false, :ref:`RID` normal_map, :ref:`bool` clip_uv=true **)** + +Adds a texture rect with region setting to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_add_triangle_array: + +- void **canvas_item_add_triangle_array** **(** :ref:`RID` item, :ref:`PoolIntArray` indices, :ref:`PoolVector2Array` points, :ref:`PoolColorArray` colors, :ref:`PoolVector2Array` uvs=PoolVector2Array( ), :ref:`PoolIntArray` bones=PoolIntArray( ), :ref:`PoolRealArray` weights=PoolRealArray( ), :ref:`RID` texture, :ref:`int` count=-1, :ref:`RID` normal_map, :ref:`bool` antialiased=false, :ref:`bool` antialiasing_use_indices=false **)** + +Adds a triangle array to the :ref:`CanvasItem`'s draw commands. + +---- + +.. _class_VisualServer_method_canvas_item_clear: + +- void **canvas_item_clear** **(** :ref:`RID` item **)** + +Clears the :ref:`CanvasItem` and removes all commands in it. + +---- + +.. _class_VisualServer_method_canvas_item_create: + +- :ref:`RID` **canvas_item_create** **(** **)** + +Creates a new :ref:`CanvasItem` and returns its :ref:`RID`. It can be accessed with the RID that is returned. This RID will be used in all ``canvas_item_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_canvas_item_set_clip: + +- void **canvas_item_set_clip** **(** :ref:`RID` item, :ref:`bool` clip **)** + +Sets clipping for the :ref:`CanvasItem`. + +---- + +.. _class_VisualServer_method_canvas_item_set_copy_to_backbuffer: + +- void **canvas_item_set_copy_to_backbuffer** **(** :ref:`RID` item, :ref:`bool` enabled, :ref:`Rect2` rect **)** + +Sets the :ref:`CanvasItem` to copy a rect to the backbuffer. + +---- + +.. _class_VisualServer_method_canvas_item_set_custom_rect: + +- void **canvas_item_set_custom_rect** **(** :ref:`RID` item, :ref:`bool` use_custom_rect, :ref:`Rect2` rect=Rect2( 0, 0, 0, 0 ) **)** + +Defines a custom drawing rectangle for the :ref:`CanvasItem`. + +---- + +.. _class_VisualServer_method_canvas_item_set_distance_field_mode: + +- void **canvas_item_set_distance_field_mode** **(** :ref:`RID` item, :ref:`bool` enabled **)** + +Enables the use of distance fields for GUI elements that are rendering distance field based fonts. + +---- + +.. _class_VisualServer_method_canvas_item_set_draw_behind_parent: + +- void **canvas_item_set_draw_behind_parent** **(** :ref:`RID` item, :ref:`bool` enabled **)** + +Sets :ref:`CanvasItem` to be drawn behind its parent. + +---- + +.. _class_VisualServer_method_canvas_item_set_draw_index: + +- void **canvas_item_set_draw_index** **(** :ref:`RID` item, :ref:`int` index **)** + +Sets the index for the :ref:`CanvasItem`. + +---- + +.. _class_VisualServer_method_canvas_item_set_light_mask: + +- void **canvas_item_set_light_mask** **(** :ref:`RID` item, :ref:`int` mask **)** + +The light mask. See :ref:`LightOccluder2D` for more information on light masks. + +---- + +.. _class_VisualServer_method_canvas_item_set_material: + +- void **canvas_item_set_material** **(** :ref:`RID` item, :ref:`RID` material **)** + +Sets a new material to the :ref:`CanvasItem`. + +---- + +.. _class_VisualServer_method_canvas_item_set_modulate: + +- void **canvas_item_set_modulate** **(** :ref:`RID` item, :ref:`Color` color **)** + +Sets the color that modulates the :ref:`CanvasItem` and its children. + +---- + +.. _class_VisualServer_method_canvas_item_set_parent: + +- void **canvas_item_set_parent** **(** :ref:`RID` item, :ref:`RID` parent **)** + +Sets the parent for the :ref:`CanvasItem`. The parent can be another canvas item, or it can be the root canvas that is attached to the viewport. + +---- + +.. _class_VisualServer_method_canvas_item_set_self_modulate: + +- void **canvas_item_set_self_modulate** **(** :ref:`RID` item, :ref:`Color` color **)** + +Sets the color that modulates the :ref:`CanvasItem` without children. + +---- + +.. _class_VisualServer_method_canvas_item_set_sort_children_by_y: + +- void **canvas_item_set_sort_children_by_y** **(** :ref:`RID` item, :ref:`bool` enabled **)** + +Sets if :ref:`CanvasItem`'s children should be sorted by y-position. + +---- + +.. _class_VisualServer_method_canvas_item_set_transform: + +- void **canvas_item_set_transform** **(** :ref:`RID` item, :ref:`Transform2D` transform **)** + +Sets the :ref:`CanvasItem`'s :ref:`Transform2D`. + +---- + +.. _class_VisualServer_method_canvas_item_set_use_parent_material: + +- void **canvas_item_set_use_parent_material** **(** :ref:`RID` item, :ref:`bool` enabled **)** + +Sets if the :ref:`CanvasItem` uses its parent's material. + +---- + +.. _class_VisualServer_method_canvas_item_set_visible: + +- void **canvas_item_set_visible** **(** :ref:`RID` item, :ref:`bool` visible **)** + +Sets if the canvas item (including its children) is visible. + +---- + +.. _class_VisualServer_method_canvas_item_set_z_as_relative_to_parent: + +- void **canvas_item_set_z_as_relative_to_parent** **(** :ref:`RID` item, :ref:`bool` enabled **)** + +If this is enabled, the Z index of the parent will be added to the children's Z index. + +---- + +.. _class_VisualServer_method_canvas_item_set_z_index: + +- void **canvas_item_set_z_index** **(** :ref:`RID` item, :ref:`int` z_index **)** + +Sets the :ref:`CanvasItem`'s Z index, i.e. its draw order (lower indexes are drawn first). + +---- + +.. _class_VisualServer_method_canvas_light_attach_to_canvas: + +- void **canvas_light_attach_to_canvas** **(** :ref:`RID` light, :ref:`RID` canvas **)** + +Attaches the canvas light to the canvas. Removes it from its previous canvas. + +---- + +.. _class_VisualServer_method_canvas_light_create: + +- :ref:`RID` **canvas_light_create** **(** **)** + +Creates a canvas light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``canvas_light_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_attach_to_canvas: + +- void **canvas_light_occluder_attach_to_canvas** **(** :ref:`RID` occluder, :ref:`RID` canvas **)** + +Attaches a light occluder to the canvas. Removes it from its previous canvas. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_create: + +- :ref:`RID` **canvas_light_occluder_create** **(** **)** + +Creates a light occluder and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``canvas_light_ocluder_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_set_enabled: + +- void **canvas_light_occluder_set_enabled** **(** :ref:`RID` occluder, :ref:`bool` enabled **)** + +Enables or disables light occluder. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_set_light_mask: + +- void **canvas_light_occluder_set_light_mask** **(** :ref:`RID` occluder, :ref:`int` mask **)** + +The light mask. See :ref:`LightOccluder2D` for more information on light masks. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_set_polygon: + +- void **canvas_light_occluder_set_polygon** **(** :ref:`RID` occluder, :ref:`RID` polygon **)** + +Sets a light occluder's polygon. + +---- + +.. _class_VisualServer_method_canvas_light_occluder_set_transform: + +- void **canvas_light_occluder_set_transform** **(** :ref:`RID` occluder, :ref:`Transform2D` transform **)** + +Sets a light occluder's :ref:`Transform2D`. + +---- + +.. _class_VisualServer_method_canvas_light_set_color: + +- void **canvas_light_set_color** **(** :ref:`RID` light, :ref:`Color` color **)** + +Sets the color for a light. + +---- + +.. _class_VisualServer_method_canvas_light_set_enabled: + +- void **canvas_light_set_enabled** **(** :ref:`RID` light, :ref:`bool` enabled **)** + +Enables or disables a canvas light. + +---- + +.. _class_VisualServer_method_canvas_light_set_energy: + +- void **canvas_light_set_energy** **(** :ref:`RID` light, :ref:`float` energy **)** + +Sets a canvas light's energy. + +---- + +.. _class_VisualServer_method_canvas_light_set_height: + +- void **canvas_light_set_height** **(** :ref:`RID` light, :ref:`float` height **)** + +Sets a canvas light's height. + +---- + +.. _class_VisualServer_method_canvas_light_set_item_cull_mask: + +- void **canvas_light_set_item_cull_mask** **(** :ref:`RID` light, :ref:`int` mask **)** + +The light mask. See :ref:`LightOccluder2D` for more information on light masks. + +---- + +.. _class_VisualServer_method_canvas_light_set_item_shadow_cull_mask: + +- void **canvas_light_set_item_shadow_cull_mask** **(** :ref:`RID` light, :ref:`int` mask **)** + +The binary mask used to determine which layers this canvas light's shadows affects. See :ref:`LightOccluder2D` for more information on light masks. + +---- + +.. _class_VisualServer_method_canvas_light_set_layer_range: + +- void **canvas_light_set_layer_range** **(** :ref:`RID` light, :ref:`int` min_layer, :ref:`int` max_layer **)** + +The layer range that gets rendered with this light. + +---- + +.. _class_VisualServer_method_canvas_light_set_mode: + +- void **canvas_light_set_mode** **(** :ref:`RID` light, :ref:`CanvasLightMode` mode **)** + +The mode of the light, see :ref:`CanvasLightMode` constants. + +---- + +.. _class_VisualServer_method_canvas_light_set_scale: + +- void **canvas_light_set_scale** **(** :ref:`RID` light, :ref:`float` scale **)** + +Sets the texture's scale factor of the light. Equivalent to :ref:`Light2D.texture_scale`. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_buffer_size: + +- void **canvas_light_set_shadow_buffer_size** **(** :ref:`RID` light, :ref:`int` size **)** + +Sets the width of the shadow buffer, size gets scaled to the next power of two for this. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_color: + +- void **canvas_light_set_shadow_color** **(** :ref:`RID` light, :ref:`Color` color **)** + +Sets the color of the canvas light's shadow. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_enabled: + +- void **canvas_light_set_shadow_enabled** **(** :ref:`RID` light, :ref:`bool` enabled **)** + +Enables or disables the canvas light's shadow. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_filter: + +- void **canvas_light_set_shadow_filter** **(** :ref:`RID` light, :ref:`CanvasLightShadowFilter` filter **)** + +Sets the canvas light's shadow's filter, see :ref:`CanvasLightShadowFilter` constants. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_gradient_length: + +- void **canvas_light_set_shadow_gradient_length** **(** :ref:`RID` light, :ref:`float` length **)** + +Sets the length of the shadow's gradient. + +---- + +.. _class_VisualServer_method_canvas_light_set_shadow_smooth: + +- void **canvas_light_set_shadow_smooth** **(** :ref:`RID` light, :ref:`float` smooth **)** + +Smoothens the shadow. The lower, the smoother. + +---- + +.. _class_VisualServer_method_canvas_light_set_texture: + +- void **canvas_light_set_texture** **(** :ref:`RID` light, :ref:`RID` texture **)** + +Sets texture to be used by light. Equivalent to :ref:`Light2D.texture`. + +---- + +.. _class_VisualServer_method_canvas_light_set_texture_offset: + +- void **canvas_light_set_texture_offset** **(** :ref:`RID` light, :ref:`Vector2` offset **)** + +Sets the offset of the light's texture. Equivalent to :ref:`Light2D.offset`. + +---- + +.. _class_VisualServer_method_canvas_light_set_transform: + +- void **canvas_light_set_transform** **(** :ref:`RID` light, :ref:`Transform2D` transform **)** + +Sets the canvas light's :ref:`Transform2D`. + +---- + +.. _class_VisualServer_method_canvas_light_set_z_range: + +- void **canvas_light_set_z_range** **(** :ref:`RID` light, :ref:`int` min_z, :ref:`int` max_z **)** + +Sets the Z range of objects that will be affected by this light. Equivalent to :ref:`Light2D.range_z_min` and :ref:`Light2D.range_z_max`. + +---- + +.. _class_VisualServer_method_canvas_occluder_polygon_create: + +- :ref:`RID` **canvas_occluder_polygon_create** **(** **)** + +Creates a new light occluder polygon and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``canvas_occluder_polygon_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_canvas_occluder_polygon_set_cull_mode: + +- void **canvas_occluder_polygon_set_cull_mode** **(** :ref:`RID` occluder_polygon, :ref:`CanvasOccluderPolygonCullMode` mode **)** + +Sets an occluder polygons cull mode. See :ref:`CanvasOccluderPolygonCullMode` constants. + +---- + +.. _class_VisualServer_method_canvas_occluder_polygon_set_shape: + +- void **canvas_occluder_polygon_set_shape** **(** :ref:`RID` occluder_polygon, :ref:`PoolVector2Array` shape, :ref:`bool` closed **)** + +Sets the shape of the occluder polygon. + +---- + +.. _class_VisualServer_method_canvas_occluder_polygon_set_shape_as_lines: + +- void **canvas_occluder_polygon_set_shape_as_lines** **(** :ref:`RID` occluder_polygon, :ref:`PoolVector2Array` shape **)** + +Sets the shape of the occluder polygon as lines. + +---- + +.. _class_VisualServer_method_canvas_set_item_mirroring: + +- void **canvas_set_item_mirroring** **(** :ref:`RID` canvas, :ref:`RID` item, :ref:`Vector2` mirroring **)** + +A copy of the canvas item will be drawn with a local offset of the mirroring :ref:`Vector2`. + +---- + +.. _class_VisualServer_method_canvas_set_modulate: + +- void **canvas_set_modulate** **(** :ref:`RID` canvas, :ref:`Color` color **)** + +Modulates all colors in the given canvas. + +---- + +.. _class_VisualServer_method_directional_light_create: + +- :ref:`RID` **directional_light_create** **(** **)** + +Creates a directional light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most ``light_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this directional light to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_draw: + +- void **draw** **(** :ref:`bool` swap_buffers=true, :ref:`float` frame_step=0.0 **)** + +Draws a frame. *This method is deprecated*, please use :ref:`force_draw` instead. + +---- + +.. _class_VisualServer_method_environment_create: + +- :ref:`RID` **environment_create** **(** **)** + +Creates an environment and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``environment_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_environment_set_adjustment: + +- void **environment_set_adjustment** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` brightness, :ref:`float` contrast, :ref:`float` saturation, :ref:`RID` ramp **)** + +Sets the values to be used with the "Adjustment" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_ambient_light: + +- void **environment_set_ambient_light** **(** :ref:`RID` env, :ref:`Color` color, :ref:`float` energy=1.0, :ref:`float` sky_contibution=0.0 **)** + +Sets the ambient light parameters. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_background: + +- void **environment_set_background** **(** :ref:`RID` env, :ref:`EnvironmentBG` bg **)** + +Sets the *BGMode* of the environment. Equivalent to :ref:`Environment.background_mode`. + +---- + +.. _class_VisualServer_method_environment_set_bg_color: + +- void **environment_set_bg_color** **(** :ref:`RID` env, :ref:`Color` color **)** + +Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes). + +---- + +.. _class_VisualServer_method_environment_set_bg_energy: + +- void **environment_set_bg_energy** **(** :ref:`RID` env, :ref:`float` energy **)** + +Sets the intensity of the background color. + +---- + +.. _class_VisualServer_method_environment_set_canvas_max_layer: + +- void **environment_set_canvas_max_layer** **(** :ref:`RID` env, :ref:`int` max_layer **)** + +Sets the maximum layer to use if using Canvas background mode. + +---- + +.. _class_VisualServer_method_environment_set_dof_blur_far: + +- void **environment_set_dof_blur_far** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` distance, :ref:`float` transition, :ref:`float` far_amount, :ref:`EnvironmentDOFBlurQuality` quality **)** + +Sets the values to be used with the "DoF Far Blur" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_dof_blur_near: + +- void **environment_set_dof_blur_near** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` distance, :ref:`float` transition, :ref:`float` far_amount, :ref:`EnvironmentDOFBlurQuality` quality **)** + +Sets the values to be used with the "DoF Near Blur" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_fog: + +- void **environment_set_fog** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`Color` color, :ref:`Color` sun_color, :ref:`float` sun_amount **)** + +Sets the variables to be used with the scene fog. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_fog_depth: + +- void **environment_set_fog_depth** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` depth_begin, :ref:`float` depth_end, :ref:`float` depth_curve, :ref:`bool` transmit, :ref:`float` transmit_curve **)** + +Sets the variables to be used with the fog depth effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_fog_height: + +- void **environment_set_fog_height** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` min_height, :ref:`float` max_height, :ref:`float` height_curve **)** + +Sets the variables to be used with the fog height effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_glow: + +- void **environment_set_glow** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`int` level_flags, :ref:`float` intensity, :ref:`float` strength, :ref:`float` bloom_threshold, :ref:`EnvironmentGlowBlendMode` blend_mode, :ref:`float` hdr_bleed_threshold, :ref:`float` hdr_bleed_scale, :ref:`float` hdr_luminance_cap, :ref:`bool` bicubic_upscale, :ref:`bool` high_quality **)** + +Sets the variables to be used with the "glow" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_sky: + +- void **environment_set_sky** **(** :ref:`RID` env, :ref:`RID` sky **)** + +Sets the :ref:`Sky` to be used as the environment's background when using *BGMode* sky. Equivalent to :ref:`Environment.background_sky`. + +---- + +.. _class_VisualServer_method_environment_set_sky_custom_fov: + +- void **environment_set_sky_custom_fov** **(** :ref:`RID` env, :ref:`float` scale **)** + +Sets a custom field of view for the background :ref:`Sky`. Equivalent to :ref:`Environment.background_sky_custom_fov`. + +---- + +.. _class_VisualServer_method_environment_set_sky_orientation: + +- void **environment_set_sky_orientation** **(** :ref:`RID` env, :ref:`Basis` orientation **)** + +Sets the rotation of the background :ref:`Sky` expressed as a :ref:`Basis`. Equivalent to :ref:`Environment.background_sky_orientation`. + +---- + +.. _class_VisualServer_method_environment_set_ssao: + +- void **environment_set_ssao** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`float` radius, :ref:`float` intensity, :ref:`float` radius2, :ref:`float` intensity2, :ref:`float` bias, :ref:`float` light_affect, :ref:`float` ao_channel_affect, :ref:`Color` color, :ref:`EnvironmentSSAOQuality` quality, :ref:`EnvironmentSSAOBlur` blur, :ref:`float` bilateral_sharpness **)** + +Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_ssr: + +- void **environment_set_ssr** **(** :ref:`RID` env, :ref:`bool` enable, :ref:`int` max_steps, :ref:`float` fade_in, :ref:`float` fade_out, :ref:`float` depth_tolerance, :ref:`bool` roughness **)** + +Sets the variables to be used with the "screen space reflections" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_environment_set_tonemap: + +- void **environment_set_tonemap** **(** :ref:`RID` env, :ref:`EnvironmentToneMapper` tone_mapper, :ref:`float` exposure, :ref:`float` white, :ref:`bool` auto_exposure, :ref:`float` min_luminance, :ref:`float` max_luminance, :ref:`float` auto_exp_speed, :ref:`float` auto_exp_grey **)** + +Sets the variables to be used with the "tonemap" post-process effect. See :ref:`Environment` for more details. + +---- + +.. _class_VisualServer_method_finish: + +- void **finish** **(** **)** + +Removes buffers and clears testcubes. + +---- + +.. _class_VisualServer_method_force_draw: + +- void **force_draw** **(** :ref:`bool` swap_buffers=true, :ref:`float` frame_step=0.0 **)** + +Forces a frame to be drawn when the function is called. Drawing a frame updates all :ref:`Viewport`\ s that are set to update. Use with extreme caution. + +---- + +.. _class_VisualServer_method_force_sync: + +- void **force_sync** **(** **)** + +Synchronizes threads. + +---- + +.. _class_VisualServer_method_free_rid: + +- void **free_rid** **(** :ref:`RID` rid **)** + +Tries to free an object in the VisualServer. + +---- + +.. _class_VisualServer_method_get_render_info: + +- :ref:`int` **get_render_info** **(** :ref:`RenderInfo` info **)** + +Returns a certain information, see :ref:`RenderInfo` for options. + +---- + +.. _class_VisualServer_method_get_test_cube: + +- :ref:`RID` **get_test_cube** **(** **)** + +Returns the id of the test cube. Creates one if none exists. + +---- + +.. _class_VisualServer_method_get_test_texture: + +- :ref:`RID` **get_test_texture** **(** **)** + +Returns the id of the test texture. Creates one if none exists. + +---- + +.. _class_VisualServer_method_get_video_adapter_name: + +- :ref:`String` **get_video_adapter_name** **(** **)** |const| + +Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). + +**Note:** When running a headless or server binary, this function returns an empty string. + +---- + +.. _class_VisualServer_method_get_video_adapter_vendor: + +- :ref:`String` **get_video_adapter_vendor** **(** **)** |const| + +Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). + +**Note:** When running a headless or server binary, this function returns an empty string. + +---- + +.. _class_VisualServer_method_get_white_texture: + +- :ref:`RID` **get_white_texture** **(** **)** + +Returns the id of a white texture. Creates one if none exists. + +---- + +.. _class_VisualServer_method_gi_probe_create: + +- :ref:`RID` **gi_probe_create** **(** **)** + +Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``gi_probe_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this GI probe to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_gi_probe_get_bias: + +- :ref:`float` **gi_probe_get_bias** **(** :ref:`RID` probe **)** |const| + +Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to :ref:`GIProbeData.bias`. + +---- + +.. _class_VisualServer_method_gi_probe_get_bounds: + +- :ref:`AABB` **gi_probe_get_bounds** **(** :ref:`RID` probe **)** |const| + +Returns the axis-aligned bounding box that covers the full extent of the GI probe. + +---- + +.. _class_VisualServer_method_gi_probe_get_cell_size: + +- :ref:`float` **gi_probe_get_cell_size** **(** :ref:`RID` probe **)** |const| + +Returns the cell size set by :ref:`gi_probe_set_cell_size`. + +---- + +.. _class_VisualServer_method_gi_probe_get_dynamic_data: + +- :ref:`PoolIntArray` **gi_probe_get_dynamic_data** **(** :ref:`RID` probe **)** |const| + +Returns the data used by the GI probe. + +---- + +.. _class_VisualServer_method_gi_probe_get_dynamic_range: + +- :ref:`int` **gi_probe_get_dynamic_range** **(** :ref:`RID` probe **)** |const| + +Returns the dynamic range set for this GI probe. Equivalent to :ref:`GIProbe.dynamic_range`. + +---- + +.. _class_VisualServer_method_gi_probe_get_energy: + +- :ref:`float` **gi_probe_get_energy** **(** :ref:`RID` probe **)** |const| + +Returns the energy multiplier for this GI probe. Equivalent to :ref:`GIProbe.energy`. + +---- + +.. _class_VisualServer_method_gi_probe_get_normal_bias: + +- :ref:`float` **gi_probe_get_normal_bias** **(** :ref:`RID` probe **)** |const| + +Returns the normal bias for this GI probe. Equivalent to :ref:`GIProbe.normal_bias`. + +---- + +.. _class_VisualServer_method_gi_probe_get_propagation: + +- :ref:`float` **gi_probe_get_propagation** **(** :ref:`RID` probe **)** |const| + +Returns the propagation value for this GI probe. Equivalent to :ref:`GIProbe.propagation`. + +---- + +.. _class_VisualServer_method_gi_probe_get_to_cell_xform: + +- :ref:`Transform` **gi_probe_get_to_cell_xform** **(** :ref:`RID` probe **)** |const| + +Returns the Transform set by :ref:`gi_probe_set_to_cell_xform`. + +---- + +.. _class_VisualServer_method_gi_probe_is_compressed: + +- :ref:`bool` **gi_probe_is_compressed** **(** :ref:`RID` probe **)** |const| + +Returns ``true`` if the GI probe data associated with this GI probe is compressed. Equivalent to :ref:`GIProbe.compress`. + +---- + +.. _class_VisualServer_method_gi_probe_is_interior: + +- :ref:`bool` **gi_probe_is_interior** **(** :ref:`RID` probe **)** |const| + +Returns ``true`` if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to :ref:`GIProbe.interior`. + +---- + +.. _class_VisualServer_method_gi_probe_set_bias: + +- void **gi_probe_set_bias** **(** :ref:`RID` probe, :ref:`float` bias **)** + +Sets the bias value to avoid self-occlusion. Equivalent to :ref:`GIProbe.bias`. + +---- + +.. _class_VisualServer_method_gi_probe_set_bounds: + +- void **gi_probe_set_bounds** **(** :ref:`RID` probe, :ref:`AABB` bounds **)** + +Sets the axis-aligned bounding box that covers the extent of the GI probe. + +---- + +.. _class_VisualServer_method_gi_probe_set_cell_size: + +- void **gi_probe_set_cell_size** **(** :ref:`RID` probe, :ref:`float` range **)** + +Sets the size of individual cells within the GI probe. + +---- + +.. _class_VisualServer_method_gi_probe_set_compress: + +- void **gi_probe_set_compress** **(** :ref:`RID` probe, :ref:`bool` enable **)** + +Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to :ref:`GIProbe.compress`. + +---- + +.. _class_VisualServer_method_gi_probe_set_dynamic_data: + +- void **gi_probe_set_dynamic_data** **(** :ref:`RID` probe, :ref:`PoolIntArray` data **)** + +Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the :ref:`GIProbe` node. You should not try to set this yourself. + +---- + +.. _class_VisualServer_method_gi_probe_set_dynamic_range: + +- void **gi_probe_set_dynamic_range** **(** :ref:`RID` probe, :ref:`int` range **)** + +Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to :ref:`GIProbe.dynamic_range`. + +---- + +.. _class_VisualServer_method_gi_probe_set_energy: + +- void **gi_probe_set_energy** **(** :ref:`RID` probe, :ref:`float` energy **)** + +Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to :ref:`GIProbe.energy`. + +---- + +.. _class_VisualServer_method_gi_probe_set_interior: + +- void **gi_probe_set_interior** **(** :ref:`RID` probe, :ref:`bool` enable **)** + +Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to :ref:`GIProbe.interior`. + +---- + +.. _class_VisualServer_method_gi_probe_set_normal_bias: + +- void **gi_probe_set_normal_bias** **(** :ref:`RID` probe, :ref:`float` bias **)** + +Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to :ref:`GIProbe.normal_bias`. + +---- + +.. _class_VisualServer_method_gi_probe_set_propagation: + +- void **gi_probe_set_propagation** **(** :ref:`RID` probe, :ref:`float` propagation **)** + +Sets the propagation of light within this GI probe. Equivalent to :ref:`GIProbe.propagation`. + +---- + +.. _class_VisualServer_method_gi_probe_set_to_cell_xform: + +- void **gi_probe_set_to_cell_xform** **(** :ref:`RID` probe, :ref:`Transform` xform **)** + +Sets the to cell :ref:`Transform` for this GI probe. + +---- + +.. _class_VisualServer_method_has_changed: + +- :ref:`bool` **has_changed** **(** **)** |const| + +Returns ``true`` if changes have been made to the VisualServer's data. :ref:`draw` is usually called if this happens. + +---- + +.. _class_VisualServer_method_has_feature: + +- :ref:`bool` **has_feature** **(** :ref:`Features` feature **)** |const| + +Not yet implemented. Always returns ``false``. + +---- + +.. _class_VisualServer_method_has_os_feature: + +- :ref:`bool` **has_os_feature** **(** :ref:`String` feature **)** |const| + +Returns ``true`` if the OS supports a certain feature. Features might be ``s3tc``, ``etc``, ``etc2``, ``pvrtc`` and ``skinning_fallback``. + +When rendering with GLES2, returns ``true`` with ``skinning_fallback`` in case the hardware doesn't support the default GPU skinning process. + +---- + +.. _class_VisualServer_method_immediate_begin: + +- void **immediate_begin** **(** :ref:`RID` immediate, :ref:`PrimitiveType` primitive, :ref:`RID` texture **)** + +Sets up :ref:`ImmediateGeometry` internals to prepare for drawing. Equivalent to :ref:`ImmediateGeometry.begin`. + +---- + +.. _class_VisualServer_method_immediate_clear: + +- void **immediate_clear** **(** :ref:`RID` immediate **)** + +Clears everything that was set up between :ref:`immediate_begin` and :ref:`immediate_end`. Equivalent to :ref:`ImmediateGeometry.clear`. + +---- + +.. _class_VisualServer_method_immediate_color: + +- void **immediate_color** **(** :ref:`RID` immediate, :ref:`Color` color **)** + +Sets the color to be used with next vertex. Equivalent to :ref:`ImmediateGeometry.set_color`. + +---- + +.. _class_VisualServer_method_immediate_create: + +- :ref:`RID` **immediate_create** **(** **)** + +Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``immediate_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this immediate geometry to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_immediate_end: + +- void **immediate_end** **(** :ref:`RID` immediate **)** + +Ends drawing the :ref:`ImmediateGeometry` and displays it. Equivalent to :ref:`ImmediateGeometry.end`. + +---- + +.. _class_VisualServer_method_immediate_get_material: + +- :ref:`RID` **immediate_get_material** **(** :ref:`RID` immediate **)** |const| + +Returns the material assigned to the :ref:`ImmediateGeometry`. + +---- + +.. _class_VisualServer_method_immediate_normal: + +- void **immediate_normal** **(** :ref:`RID` immediate, :ref:`Vector3` normal **)** + +Sets the normal to be used with next vertex. Equivalent to :ref:`ImmediateGeometry.set_normal`. + +---- + +.. _class_VisualServer_method_immediate_set_material: + +- void **immediate_set_material** **(** :ref:`RID` immediate, :ref:`RID` material **)** + +Sets the material to be used to draw the :ref:`ImmediateGeometry`. + +---- + +.. _class_VisualServer_method_immediate_tangent: + +- void **immediate_tangent** **(** :ref:`RID` immediate, :ref:`Plane` tangent **)** + +Sets the tangent to be used with next vertex. Equivalent to :ref:`ImmediateGeometry.set_tangent`. + +---- + +.. _class_VisualServer_method_immediate_uv: + +- void **immediate_uv** **(** :ref:`RID` immediate, :ref:`Vector2` tex_uv **)** + +Sets the UV to be used with next vertex. Equivalent to :ref:`ImmediateGeometry.set_uv`. + +---- + +.. _class_VisualServer_method_immediate_uv2: + +- void **immediate_uv2** **(** :ref:`RID` immediate, :ref:`Vector2` tex_uv **)** + +Sets the UV2 to be used with next vertex. Equivalent to :ref:`ImmediateGeometry.set_uv2`. + +---- + +.. _class_VisualServer_method_immediate_vertex: + +- void **immediate_vertex** **(** :ref:`RID` immediate, :ref:`Vector3` vertex **)** + +Adds the next vertex using the information provided in advance. Equivalent to :ref:`ImmediateGeometry.add_vertex`. + +---- + +.. _class_VisualServer_method_immediate_vertex_2d: + +- void **immediate_vertex_2d** **(** :ref:`RID` immediate, :ref:`Vector2` vertex **)** + +Adds the next vertex using the information provided in advance. This is a helper class that calls :ref:`immediate_vertex` under the hood. Equivalent to :ref:`ImmediateGeometry.add_vertex`. + +---- + +.. _class_VisualServer_method_init: + +- void **init** **(** **)** + +Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything. + +---- + +.. _class_VisualServer_method_instance_attach_object_instance_id: + +- void **instance_attach_object_instance_id** **(** :ref:`RID` instance, :ref:`int` id **)** + +Attaches a unique Object ID to instance. Object ID must be attached to instance for proper culling with :ref:`instances_cull_aabb`, :ref:`instances_cull_convex`, and :ref:`instances_cull_ray`. + +---- + +.. _class_VisualServer_method_instance_attach_skeleton: + +- void **instance_attach_skeleton** **(** :ref:`RID` instance, :ref:`RID` skeleton **)** + +Attaches a skeleton to an instance. Removes the previous skeleton from the instance. + +---- + +.. _class_VisualServer_method_instance_create: + +- :ref:`RID` **instance_create** **(** **)** + +Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``instance_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using :ref:`instance_set_base`. + +---- + +.. _class_VisualServer_method_instance_create2: + +- :ref:`RID` **instance_create2** **(** :ref:`RID` base, :ref:`RID` scenario **)** + +Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all ``instance_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_instance_geometry_set_as_instance_lod: + +- void **instance_geometry_set_as_instance_lod** **(** :ref:`RID` instance, :ref:`RID` as_lod_of_instance **)** + +Not implemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_instance_geometry_set_cast_shadows_setting: + +- void **instance_geometry_set_cast_shadows_setting** **(** :ref:`RID` instance, :ref:`ShadowCastingSetting` shadow_casting_setting **)** + +Sets the shadow casting setting to one of :ref:`ShadowCastingSetting`. Equivalent to :ref:`GeometryInstance.cast_shadow`. + +---- + +.. _class_VisualServer_method_instance_geometry_set_draw_range: + +- void **instance_geometry_set_draw_range** **(** :ref:`RID` instance, :ref:`float` min, :ref:`float` max, :ref:`float` min_margin, :ref:`float` max_margin **)** + +Not implemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_instance_geometry_set_flag: + +- void **instance_geometry_set_flag** **(** :ref:`RID` instance, :ref:`InstanceFlags` flag, :ref:`bool` enabled **)** + +Sets the flag for a given :ref:`InstanceFlags`. See :ref:`InstanceFlags` for more details. + +---- + +.. _class_VisualServer_method_instance_geometry_set_material_override: + +- void **instance_geometry_set_material_override** **(** :ref:`RID` instance, :ref:`RID` material **)** + +Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to :ref:`GeometryInstance.material_override`. + +---- + +.. _class_VisualServer_method_instance_set_base: + +- void **instance_set_base** **(** :ref:`RID` instance, :ref:`RID` base **)** + +Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario. + +---- + +.. _class_VisualServer_method_instance_set_blend_shape_weight: + +- void **instance_set_blend_shape_weight** **(** :ref:`RID` instance, :ref:`int` shape, :ref:`float` weight **)** + +Sets the weight for a given blend shape associated with this instance. + +---- + +.. _class_VisualServer_method_instance_set_custom_aabb: + +- void **instance_set_custom_aabb** **(** :ref:`RID` instance, :ref:`AABB` aabb **)** + +Sets a custom AABB to use when culling objects from the view frustum. Equivalent to :ref:`GeometryInstance.set_custom_aabb`. + +---- + +.. _class_VisualServer_method_instance_set_exterior: + +- void **instance_set_exterior** **(** :ref:`RID` instance, :ref:`bool` enabled **)** + +Function not implemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_instance_set_extra_visibility_margin: + +- void **instance_set_extra_visibility_margin** **(** :ref:`RID` instance, :ref:`float` margin **)** + +Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to :ref:`GeometryInstance.extra_cull_margin`. + +---- + +.. _class_VisualServer_method_instance_set_layer_mask: + +- void **instance_set_layer_mask** **(** :ref:`RID` instance, :ref:`int` mask **)** + +Sets the render layers that this instance will be drawn to. Equivalent to :ref:`VisualInstance.layers`. + +---- + +.. _class_VisualServer_method_instance_set_scenario: + +- void **instance_set_scenario** **(** :ref:`RID` instance, :ref:`RID` scenario **)** + +Sets the scenario that the instance is in. The scenario is the 3D world that the objects will be displayed in. + +---- + +.. _class_VisualServer_method_instance_set_surface_material: + +- void **instance_set_surface_material** **(** :ref:`RID` instance, :ref:`int` surface, :ref:`RID` material **)** + +Sets the material of a specific surface. Equivalent to :ref:`MeshInstance.set_surface_material`. + +---- + +.. _class_VisualServer_method_instance_set_transform: + +- void **instance_set_transform** **(** :ref:`RID` instance, :ref:`Transform` transform **)** + +Sets the world space transform of the instance. Equivalent to :ref:`Spatial.transform`. + +---- + +.. _class_VisualServer_method_instance_set_use_lightmap: + +- void **instance_set_use_lightmap** **(** :ref:`RID` instance, :ref:`RID` lightmap_instance, :ref:`RID` lightmap, :ref:`int` lightmap_slice=-1, :ref:`Rect2` lightmap_uv_rect=Rect2( 0, 0, 1, 1 ) **)** + +Sets the lightmap to use with this instance. + +---- + +.. _class_VisualServer_method_instance_set_visible: + +- void **instance_set_visible** **(** :ref:`RID` instance, :ref:`bool` visible **)** + +Sets whether an instance is drawn or not. Equivalent to :ref:`Spatial.visible`. + +---- + +.. _class_VisualServer_method_instances_cull_aabb: + +- :ref:`Array` **instances_cull_aabb** **(** :ref:`AABB` aabb, :ref:`RID` scenario **)** |const| + +Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as :ref:`MeshInstance` or :ref:`DirectionalLight`. Use :ref:`@GDScript.instance_from_id` to obtain the actual nodes. A scenario RID must be provided, which is available in the :ref:`World` you want to query. This forces an update for all resources queued to update. + +**Warning:** This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + +---- + +.. _class_VisualServer_method_instances_cull_convex: + +- :ref:`Array` **instances_cull_convex** **(** :ref:`Array` convex, :ref:`RID` scenario **)** |const| + +Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as :ref:`MeshInstance` or :ref:`DirectionalLight`. Use :ref:`@GDScript.instance_from_id` to obtain the actual nodes. A scenario RID must be provided, which is available in the :ref:`World` you want to query. This forces an update for all resources queued to update. + +**Warning:** This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + +---- + +.. _class_VisualServer_method_instances_cull_ray: + +- :ref:`Array` **instances_cull_ray** **(** :ref:`Vector3` from, :ref:`Vector3` to, :ref:`RID` scenario **)** |const| + +Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as :ref:`MeshInstance` or :ref:`DirectionalLight`. Use :ref:`@GDScript.instance_from_id` to obtain the actual nodes. A scenario RID must be provided, which is available in the :ref:`World` you want to query. This forces an update for all resources queued to update. + +**Warning:** This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. + +---- + +.. _class_VisualServer_method_light_directional_set_blend_splits: + +- void **light_directional_set_blend_splits** **(** :ref:`RID` light, :ref:`bool` enable **)** + +If ``true``, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to :ref:`DirectionalLight.directional_shadow_blend_splits`. + +---- + +.. _class_VisualServer_method_light_directional_set_shadow_depth_range_mode: + +- void **light_directional_set_shadow_depth_range_mode** **(** :ref:`RID` light, :ref:`LightDirectionalShadowDepthRangeMode` range_mode **)** + +Sets the shadow depth range mode for this directional light. Equivalent to :ref:`DirectionalLight.directional_shadow_depth_range`. See :ref:`LightDirectionalShadowDepthRangeMode` for options. + +---- + +.. _class_VisualServer_method_light_directional_set_shadow_mode: + +- void **light_directional_set_shadow_mode** **(** :ref:`RID` light, :ref:`LightDirectionalShadowMode` mode **)** + +Sets the shadow mode for this directional light. Equivalent to :ref:`DirectionalLight.directional_shadow_mode`. See :ref:`LightDirectionalShadowMode` for options. + +---- + +.. _class_VisualServer_method_light_omni_set_shadow_detail: + +- void **light_omni_set_shadow_detail** **(** :ref:`RID` light, :ref:`LightOmniShadowDetail` detail **)** + +Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to :ref:`OmniLight.omni_shadow_detail`. + +---- + +.. _class_VisualServer_method_light_omni_set_shadow_mode: + +- void **light_omni_set_shadow_mode** **(** :ref:`RID` light, :ref:`LightOmniShadowMode` mode **)** + +Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to :ref:`OmniLight.omni_shadow_mode`. + +---- + +.. _class_VisualServer_method_light_set_bake_mode: + +- void **light_set_bake_mode** **(** :ref:`RID` light, :ref:`LightBakeMode` bake_mode **)** + +Sets the bake mode for this light, see :ref:`LightBakeMode` for options. The bake mode affects how the light will be baked in :ref:`BakedLightmap`\ s and :ref:`GIProbe`\ s. + +---- + +.. _class_VisualServer_method_light_set_color: + +- void **light_set_color** **(** :ref:`RID` light, :ref:`Color` color **)** + +Sets the color of the light. Equivalent to :ref:`Light.light_color`. + +---- + +.. _class_VisualServer_method_light_set_cull_mask: + +- void **light_set_cull_mask** **(** :ref:`RID` light, :ref:`int` mask **)** + +Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to :ref:`Light.light_cull_mask`. + +---- + +.. _class_VisualServer_method_light_set_negative: + +- void **light_set_negative** **(** :ref:`RID` light, :ref:`bool` enable **)** + +If ``true``, light will subtract light instead of adding light. Equivalent to :ref:`Light.light_negative`. + +---- + +.. _class_VisualServer_method_light_set_param: + +- void **light_set_param** **(** :ref:`RID` light, :ref:`LightParam` param, :ref:`float` value **)** + +Sets the specified light parameter. See :ref:`LightParam` for options. Equivalent to :ref:`Light.set_param`. + +---- + +.. _class_VisualServer_method_light_set_projector: + +- void **light_set_projector** **(** :ref:`RID` light, :ref:`RID` texture **)** + +Not implemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_light_set_reverse_cull_face_mode: + +- void **light_set_reverse_cull_face_mode** **(** :ref:`RID` light, :ref:`bool` enabled **)** + +If ``true``, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double sided shadows with :ref:`instance_geometry_set_cast_shadows_setting`. Equivalent to :ref:`Light.shadow_reverse_cull_face`. + +---- + +.. _class_VisualServer_method_light_set_shadow: + +- void **light_set_shadow** **(** :ref:`RID` light, :ref:`bool` enabled **)** + +If ``true``, light will cast shadows. Equivalent to :ref:`Light.shadow_enabled`. + +---- + +.. _class_VisualServer_method_light_set_shadow_color: + +- void **light_set_shadow_color** **(** :ref:`RID` light, :ref:`Color` color **)** + +Sets the color of the shadow cast by the light. Equivalent to :ref:`Light.shadow_color`. + +---- + +.. _class_VisualServer_method_light_set_use_gi: + +- void **light_set_use_gi** **(** :ref:`RID` light, :ref:`bool` enabled **)** + +Sets whether GI probes capture light information from this light. *Deprecated method.* Use :ref:`light_set_bake_mode` instead. This method is only kept for compatibility reasons and calls :ref:`light_set_bake_mode` internally, setting the bake mode to :ref:`LIGHT_BAKE_DISABLED` or :ref:`LIGHT_BAKE_INDIRECT` depending on the given parameter. + +---- + +.. _class_VisualServer_method_lightmap_capture_create: + +- :ref:`RID` **lightmap_capture_create** **(** **)** + +Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``lightmap_capture_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this lightmap capture to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_lightmap_capture_get_bounds: + +- :ref:`AABB` **lightmap_capture_get_bounds** **(** :ref:`RID` capture **)** |const| + +Returns the size of the lightmap capture area. + +---- + +.. _class_VisualServer_method_lightmap_capture_get_energy: + +- :ref:`float` **lightmap_capture_get_energy** **(** :ref:`RID` capture **)** |const| + +Returns the energy multiplier used by the lightmap capture. + +---- + +.. _class_VisualServer_method_lightmap_capture_get_octree: + +- :ref:`PoolByteArray` **lightmap_capture_get_octree** **(** :ref:`RID` capture **)** |const| + +Returns the octree used by the lightmap capture. + +---- + +.. _class_VisualServer_method_lightmap_capture_get_octree_cell_subdiv: + +- :ref:`int` **lightmap_capture_get_octree_cell_subdiv** **(** :ref:`RID` capture **)** |const| + +Returns the cell subdivision amount used by this lightmap capture's octree. + +---- + +.. _class_VisualServer_method_lightmap_capture_get_octree_cell_transform: + +- :ref:`Transform` **lightmap_capture_get_octree_cell_transform** **(** :ref:`RID` capture **)** |const| + +Returns the cell transform for this lightmap capture's octree. + +---- + +.. _class_VisualServer_method_lightmap_capture_is_interior: + +- :ref:`bool` **lightmap_capture_is_interior** **(** :ref:`RID` capture **)** |const| + +Returns ``true`` if capture is in "interior" mode. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_bounds: + +- void **lightmap_capture_set_bounds** **(** :ref:`RID` capture, :ref:`AABB` bounds **)** + +Sets the size of the area covered by the lightmap capture. Equivalent to :ref:`BakedLightmapData.bounds`. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_energy: + +- void **lightmap_capture_set_energy** **(** :ref:`RID` capture, :ref:`float` energy **)** + +Sets the energy multiplier for this lightmap capture. Equivalent to :ref:`BakedLightmapData.energy`. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_interior: + +- void **lightmap_capture_set_interior** **(** :ref:`RID` capture, :ref:`bool` interior **)** + +Sets the "interior" mode for this lightmap capture. Equivalent to :ref:`BakedLightmapData.interior`. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_octree: + +- void **lightmap_capture_set_octree** **(** :ref:`RID` capture, :ref:`PoolByteArray` octree **)** + +Sets the octree to be used by this lightmap capture. This function is normally used by the :ref:`BakedLightmap` node. Equivalent to :ref:`BakedLightmapData.octree`. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_octree_cell_subdiv: + +- void **lightmap_capture_set_octree_cell_subdiv** **(** :ref:`RID` capture, :ref:`int` subdiv **)** + +Sets the subdivision level of this lightmap capture's octree. Equivalent to :ref:`BakedLightmapData.cell_subdiv`. + +---- + +.. _class_VisualServer_method_lightmap_capture_set_octree_cell_transform: + +- void **lightmap_capture_set_octree_cell_transform** **(** :ref:`RID` capture, :ref:`Transform` xform **)** + +Sets the octree cell transform for this lightmap capture's octree. Equivalent to :ref:`BakedLightmapData.cell_space_transform`. + +---- + +.. _class_VisualServer_method_make_sphere_mesh: + +- :ref:`RID` **make_sphere_mesh** **(** :ref:`int` latitudes, :ref:`int` longitudes, :ref:`float` radius **)** + +Returns a mesh of a sphere with the given amount of horizontal and vertical subdivisions. + +---- + +.. _class_VisualServer_method_material_create: + +- :ref:`RID` **material_create** **(** **)** + +Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``material_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_material_get_param: + +- :ref:`Variant` **material_get_param** **(** :ref:`RID` material, :ref:`String` parameter **)** |const| + +Returns the value of a certain material's parameter. + +---- + +.. _class_VisualServer_method_material_get_param_default: + +- :ref:`Variant` **material_get_param_default** **(** :ref:`RID` material, :ref:`String` parameter **)** |const| + +Returns the default value for the param if available. Otherwise returns an empty :ref:`Variant`. + +---- + +.. _class_VisualServer_method_material_get_shader: + +- :ref:`RID` **material_get_shader** **(** :ref:`RID` shader_material **)** |const| + +Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader. + +---- + +.. _class_VisualServer_method_material_set_line_width: + +- void **material_set_line_width** **(** :ref:`RID` material, :ref:`float` width **)** + +Sets a material's line width. + +---- + +.. _class_VisualServer_method_material_set_next_pass: + +- void **material_set_next_pass** **(** :ref:`RID` material, :ref:`RID` next_material **)** + +Sets an object's next material. + +---- + +.. _class_VisualServer_method_material_set_param: + +- void **material_set_param** **(** :ref:`RID` material, :ref:`String` parameter, :ref:`Variant` value **)** + +Sets a material's parameter. + +---- + +.. _class_VisualServer_method_material_set_render_priority: + +- void **material_set_render_priority** **(** :ref:`RID` material, :ref:`int` priority **)** + +Sets a material's render priority. + +---- + +.. _class_VisualServer_method_material_set_shader: + +- void **material_set_shader** **(** :ref:`RID` shader_material, :ref:`RID` shader **)** + +Sets a shader material's shader. + +---- + +.. _class_VisualServer_method_mesh_add_surface_from_arrays: + +- void **mesh_add_surface_from_arrays** **(** :ref:`RID` mesh, :ref:`PrimitiveType` primitive, :ref:`Array` arrays, :ref:`Array` blend_shapes=[ ], :ref:`int` compress_format=2194432 **)** + +Adds a surface generated from the Arrays to a mesh. See :ref:`PrimitiveType` constants for types. + +---- + +.. _class_VisualServer_method_mesh_clear: + +- void **mesh_clear** **(** :ref:`RID` mesh **)** + +Removes all surfaces from a mesh. + +---- + +.. _class_VisualServer_method_mesh_create: + +- :ref:`RID` **mesh_create** **(** **)** + +Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``mesh_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this mesh to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_mesh_get_blend_shape_count: + +- :ref:`int` **mesh_get_blend_shape_count** **(** :ref:`RID` mesh **)** |const| + +Returns a mesh's blend shape count. + +---- + +.. _class_VisualServer_method_mesh_get_blend_shape_mode: + +- :ref:`BlendShapeMode` **mesh_get_blend_shape_mode** **(** :ref:`RID` mesh **)** |const| + +Returns a mesh's blend shape mode. + +---- + +.. _class_VisualServer_method_mesh_get_custom_aabb: + +- :ref:`AABB` **mesh_get_custom_aabb** **(** :ref:`RID` mesh **)** |const| + +Returns a mesh's custom aabb. + +---- + +.. _class_VisualServer_method_mesh_get_surface_count: + +- :ref:`int` **mesh_get_surface_count** **(** :ref:`RID` mesh **)** |const| + +Returns a mesh's number of surfaces. + +---- + +.. _class_VisualServer_method_mesh_remove_surface: + +- void **mesh_remove_surface** **(** :ref:`RID` mesh, :ref:`int` index **)** + +Removes a mesh's surface. + +---- + +.. _class_VisualServer_method_mesh_set_blend_shape_count: + +- void **mesh_set_blend_shape_count** **(** :ref:`RID` mesh, :ref:`int` amount **)** + +Sets a mesh's blend shape count. + +---- + +.. _class_VisualServer_method_mesh_set_blend_shape_mode: + +- void **mesh_set_blend_shape_mode** **(** :ref:`RID` mesh, :ref:`BlendShapeMode` mode **)** + +Sets a mesh's blend shape mode. + +---- + +.. _class_VisualServer_method_mesh_set_custom_aabb: + +- void **mesh_set_custom_aabb** **(** :ref:`RID` mesh, :ref:`AABB` aabb **)** + +Sets a mesh's custom aabb. + +---- + +.. _class_VisualServer_method_mesh_surface_get_aabb: + +- :ref:`AABB` **mesh_surface_get_aabb** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's aabb. + +---- + +.. _class_VisualServer_method_mesh_surface_get_array: + +- :ref:`PoolByteArray` **mesh_surface_get_array** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's vertex buffer. + +---- + +.. _class_VisualServer_method_mesh_surface_get_array_index_len: + +- :ref:`int` **mesh_surface_get_array_index_len** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's amount of indices. + +---- + +.. _class_VisualServer_method_mesh_surface_get_array_len: + +- :ref:`int` **mesh_surface_get_array_len** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's amount of vertices. + +---- + +.. _class_VisualServer_method_mesh_surface_get_arrays: + +- :ref:`Array` **mesh_surface_get_arrays** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's buffer arrays. + +---- + +.. _class_VisualServer_method_mesh_surface_get_blend_shape_arrays: + +- :ref:`Array` **mesh_surface_get_blend_shape_arrays** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's arrays for blend shapes. + +---- + +.. _class_VisualServer_method_mesh_surface_get_format: + +- :ref:`int` **mesh_surface_get_format** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns the format of a mesh's surface. + +---- + +.. _class_VisualServer_method_mesh_surface_get_format_offset: + +- :ref:`int` **mesh_surface_get_format_offset** **(** :ref:`int` format, :ref:`int` vertex_len, :ref:`int` index_len, :ref:`int` array_index **)** |const| + +Function is unused in Godot 3.x. + +---- + +.. _class_VisualServer_method_mesh_surface_get_format_stride: + +- :ref:`int` **mesh_surface_get_format_stride** **(** :ref:`int` format, :ref:`int` vertex_len, :ref:`int` index_len, :ref:`int` array_index **)** |const| + +---- + +.. _class_VisualServer_method_mesh_surface_get_index_array: + +- :ref:`PoolByteArray` **mesh_surface_get_index_array** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's index buffer. + +---- + +.. _class_VisualServer_method_mesh_surface_get_material: + +- :ref:`RID` **mesh_surface_get_material** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns a mesh's surface's material. + +---- + +.. _class_VisualServer_method_mesh_surface_get_primitive_type: + +- :ref:`PrimitiveType` **mesh_surface_get_primitive_type** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns the primitive type of a mesh's surface. + +---- + +.. _class_VisualServer_method_mesh_surface_get_skeleton_aabb: + +- :ref:`Array` **mesh_surface_get_skeleton_aabb** **(** :ref:`RID` mesh, :ref:`int` surface **)** |const| + +Returns the aabb of a mesh's surface's skeleton. + +---- + +.. _class_VisualServer_method_mesh_surface_set_material: + +- void **mesh_surface_set_material** **(** :ref:`RID` mesh, :ref:`int` surface, :ref:`RID` material **)** + +Sets a mesh's surface's material. + +---- + +.. _class_VisualServer_method_mesh_surface_update_region: + +- void **mesh_surface_update_region** **(** :ref:`RID` mesh, :ref:`int` surface, :ref:`int` offset, :ref:`PoolByteArray` data **)** + +Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh. + +---- + +.. _class_VisualServer_method_multimesh_allocate: + +- void **multimesh_allocate** **(** :ref:`RID` multimesh, :ref:`int` instances, :ref:`MultimeshTransformFormat` transform_format, :ref:`MultimeshColorFormat` color_format, :ref:`MultimeshCustomDataFormat` custom_data_format=0 **)** + +Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See :ref:`MultimeshTransformFormat`, :ref:`MultimeshColorFormat`, and :ref:`MultimeshCustomDataFormat` for usage. Equivalent to :ref:`MultiMesh.instance_count`. + +---- + +.. _class_VisualServer_method_multimesh_create: + +- :ref:`RID` **multimesh_create** **(** **)** + +Creates a new multimesh on the VisualServer and returns an :ref:`RID` handle. This RID will be used in all ``multimesh_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this multimesh to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_multimesh_get_aabb: + +- :ref:`AABB` **multimesh_get_aabb** **(** :ref:`RID` multimesh **)** |const| + +Calculates and returns the axis-aligned bounding box that encloses all instances within the multimesh. + +---- + +.. _class_VisualServer_method_multimesh_get_instance_count: + +- :ref:`int` **multimesh_get_instance_count** **(** :ref:`RID` multimesh **)** |const| + +Returns the number of instances allocated for this multimesh. + +---- + +.. _class_VisualServer_method_multimesh_get_mesh: + +- :ref:`RID` **multimesh_get_mesh** **(** :ref:`RID` multimesh **)** |const| + +Returns the RID of the mesh that will be used in drawing this multimesh. + +---- + +.. _class_VisualServer_method_multimesh_get_visible_instances: + +- :ref:`int` **multimesh_get_visible_instances** **(** :ref:`RID` multimesh **)** |const| + +Returns the number of visible instances for this multimesh. + +---- + +.. _class_VisualServer_method_multimesh_instance_get_color: + +- :ref:`Color` **multimesh_instance_get_color** **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| + +Returns the color by which the specified instance will be modulated. + +---- + +.. _class_VisualServer_method_multimesh_instance_get_custom_data: + +- :ref:`Color` **multimesh_instance_get_custom_data** **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| + +Returns the custom data associated with the specified instance. + +---- + +.. _class_VisualServer_method_multimesh_instance_get_transform: + +- :ref:`Transform` **multimesh_instance_get_transform** **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| + +Returns the :ref:`Transform` of the specified instance. + +---- + +.. _class_VisualServer_method_multimesh_instance_get_transform_2d: + +- :ref:`Transform2D` **multimesh_instance_get_transform_2d** **(** :ref:`RID` multimesh, :ref:`int` index **)** |const| + +Returns the :ref:`Transform2D` of the specified instance. For use when the multimesh is set to use 2D transforms. + +---- + +.. _class_VisualServer_method_multimesh_instance_set_color: + +- void **multimesh_instance_set_color** **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Color` color **)** + +Sets the color by which this instance will be modulated. Equivalent to :ref:`MultiMesh.set_instance_color`. + +---- + +.. _class_VisualServer_method_multimesh_instance_set_custom_data: + +- void **multimesh_instance_set_custom_data** **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Color` custom_data **)** + +Sets the custom data for this instance. Custom data is passed as a :ref:`Color`, but is interpreted as a ``vec4`` in the shader. Equivalent to :ref:`MultiMesh.set_instance_custom_data`. + +---- + +.. _class_VisualServer_method_multimesh_instance_set_transform: + +- void **multimesh_instance_set_transform** **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Transform` transform **)** + +Sets the :ref:`Transform` for this instance. Equivalent to :ref:`MultiMesh.set_instance_transform`. + +---- + +.. _class_VisualServer_method_multimesh_instance_set_transform_2d: + +- void **multimesh_instance_set_transform_2d** **(** :ref:`RID` multimesh, :ref:`int` index, :ref:`Transform2D` transform **)** + +Sets the :ref:`Transform2D` for this instance. For use when multimesh is used in 2D. Equivalent to :ref:`MultiMesh.set_instance_transform_2d`. + +---- + +.. _class_VisualServer_method_multimesh_set_as_bulk_array: + +- void **multimesh_set_as_bulk_array** **(** :ref:`RID` multimesh, :ref:`PoolRealArray` array **)** + +Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative. + + + +All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc. + + + +:ref:`Transform` is stored as 12 floats, :ref:`Transform2D` is stored as 8 floats, ``COLOR_8BIT`` / ``CUSTOM_DATA_8BIT`` is stored as 1 float (4 bytes as is) and ``COLOR_FLOAT`` / ``CUSTOM_DATA_FLOAT`` is stored as 4 floats. + +---- + +.. _class_VisualServer_method_multimesh_set_mesh: + +- void **multimesh_set_mesh** **(** :ref:`RID` multimesh, :ref:`RID` mesh **)** + +Sets the mesh to be drawn by the multimesh. Equivalent to :ref:`MultiMesh.mesh`. + +---- + +.. _class_VisualServer_method_multimesh_set_visible_instances: + +- void **multimesh_set_visible_instances** **(** :ref:`RID` multimesh, :ref:`int` visible **)** + +Sets the number of instances visible at a given time. If -1, all instances that have been allocated are drawn. Equivalent to :ref:`MultiMesh.visible_instance_count`. + +---- + +.. _class_VisualServer_method_omni_light_create: + +- :ref:`RID` **omni_light_create** **(** **)** + +Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most ``light_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this omni light to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_particles_create: + +- :ref:`RID` **particles_create** **(** **)** + +Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``particles_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach these particles to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_particles_get_current_aabb: + +- :ref:`AABB` **particles_get_current_aabb** **(** :ref:`RID` particles **)** + +Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to :ref:`Particles.capture_aabb`. + +---- + +.. _class_VisualServer_method_particles_get_emitting: + +- :ref:`bool` **particles_get_emitting** **(** :ref:`RID` particles **)** + +Returns ``true`` if particles are currently set to emitting. + +---- + +.. _class_VisualServer_method_particles_is_inactive: + +- :ref:`bool` **particles_is_inactive** **(** :ref:`RID` particles **)** + +Returns ``true`` if particles are not emitting and particles are set to inactive. + +---- + +.. _class_VisualServer_method_particles_request_process: + +- void **particles_request_process** **(** :ref:`RID` particles **)** + +Add particle system to list of particle systems that need to be updated. Update will take place on the next frame, or on the next call to :ref:`instances_cull_aabb`, :ref:`instances_cull_convex`, or :ref:`instances_cull_ray`. + +---- + +.. _class_VisualServer_method_particles_restart: + +- void **particles_restart** **(** :ref:`RID` particles **)** + +Reset the particles on the next update. Equivalent to :ref:`Particles.restart`. + +---- + +.. _class_VisualServer_method_particles_set_amount: + +- void **particles_set_amount** **(** :ref:`RID` particles, :ref:`int` amount **)** + +Sets the number of particles to be drawn and allocates the memory for them. Equivalent to :ref:`Particles.amount`. + +---- + +.. _class_VisualServer_method_particles_set_custom_aabb: + +- void **particles_set_custom_aabb** **(** :ref:`RID` particles, :ref:`AABB` aabb **)** + +Sets a custom axis-aligned bounding box for the particle system. Equivalent to :ref:`Particles.visibility_aabb`. + +---- + +.. _class_VisualServer_method_particles_set_draw_order: + +- void **particles_set_draw_order** **(** :ref:`RID` particles, :ref:`ParticlesDrawOrder` order **)** + +Sets the draw order of the particles to one of the named enums from :ref:`ParticlesDrawOrder`. See :ref:`ParticlesDrawOrder` for options. Equivalent to :ref:`Particles.draw_order`. + +---- + +.. _class_VisualServer_method_particles_set_draw_pass_mesh: + +- void **particles_set_draw_pass_mesh** **(** :ref:`RID` particles, :ref:`int` pass, :ref:`RID` mesh **)** + +Sets the mesh to be used for the specified draw pass. Equivalent to :ref:`Particles.draw_pass_1`, :ref:`Particles.draw_pass_2`, :ref:`Particles.draw_pass_3`, and :ref:`Particles.draw_pass_4`. + +---- + +.. _class_VisualServer_method_particles_set_draw_passes: + +- void **particles_set_draw_passes** **(** :ref:`RID` particles, :ref:`int` count **)** + +Sets the number of draw passes to use. Equivalent to :ref:`Particles.draw_passes`. + +---- + +.. _class_VisualServer_method_particles_set_emission_transform: + +- void **particles_set_emission_transform** **(** :ref:`RID` particles, :ref:`Transform` transform **)** + +Sets the :ref:`Transform` that will be used by the particles when they first emit. + +---- + +.. _class_VisualServer_method_particles_set_emitting: + +- void **particles_set_emitting** **(** :ref:`RID` particles, :ref:`bool` emitting **)** + +If ``true``, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to :ref:`Particles.emitting`. + +---- + +.. _class_VisualServer_method_particles_set_explosiveness_ratio: + +- void **particles_set_explosiveness_ratio** **(** :ref:`RID` particles, :ref:`float` ratio **)** + +Sets the explosiveness ratio. Equivalent to :ref:`Particles.explosiveness`. + +---- + +.. _class_VisualServer_method_particles_set_fixed_fps: + +- void **particles_set_fixed_fps** **(** :ref:`RID` particles, :ref:`int` fps **)** + +Sets the frame rate that the particle system rendering will be fixed to. Equivalent to :ref:`Particles.fixed_fps`. + +---- + +.. _class_VisualServer_method_particles_set_fractional_delta: + +- void **particles_set_fractional_delta** **(** :ref:`RID` particles, :ref:`bool` enable **)** + +If ``true``, uses fractional delta which smooths the movement of the particles. Equivalent to :ref:`Particles.fract_delta`. + +---- + +.. _class_VisualServer_method_particles_set_lifetime: + +- void **particles_set_lifetime** **(** :ref:`RID` particles, :ref:`float` lifetime **)** + +Sets the lifetime of each particle in the system. Equivalent to :ref:`Particles.lifetime`. + +---- + +.. _class_VisualServer_method_particles_set_one_shot: + +- void **particles_set_one_shot** **(** :ref:`RID` particles, :ref:`bool` one_shot **)** + +If ``true``, particles will emit once and then stop. Equivalent to :ref:`Particles.one_shot`. + +---- + +.. _class_VisualServer_method_particles_set_pre_process_time: + +- void **particles_set_pre_process_time** **(** :ref:`RID` particles, :ref:`float` time **)** + +Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to :ref:`Particles.preprocess`. + +---- + +.. _class_VisualServer_method_particles_set_process_material: + +- void **particles_set_process_material** **(** :ref:`RID` particles, :ref:`RID` material **)** + +Sets the material for processing the particles. + +**Note:** This is not the material used to draw the materials. Equivalent to :ref:`Particles.process_material`. + +---- + +.. _class_VisualServer_method_particles_set_randomness_ratio: + +- void **particles_set_randomness_ratio** **(** :ref:`RID` particles, :ref:`float` ratio **)** + +Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to :ref:`Particles.randomness`. + +---- + +.. _class_VisualServer_method_particles_set_speed_scale: + +- void **particles_set_speed_scale** **(** :ref:`RID` particles, :ref:`float` scale **)** + +Sets the speed scale of the particle system. Equivalent to :ref:`Particles.speed_scale`. + +---- + +.. _class_VisualServer_method_particles_set_use_local_coordinates: + +- void **particles_set_use_local_coordinates** **(** :ref:`RID` particles, :ref:`bool` enable **)** + +If ``true``, particles use local coordinates. If ``false`` they use global coordinates. Equivalent to :ref:`Particles.local_coords`. + +---- + +.. _class_VisualServer_method_reflection_probe_create: + +- :ref:`RID` **reflection_probe_create** **(** **)** + +Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``reflection_probe_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this reflection probe to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_reflection_probe_set_as_interior: + +- void **reflection_probe_set_as_interior** **(** :ref:`RID` probe, :ref:`bool` enable **)** + +If ``true``, reflections will ignore sky contribution. Equivalent to :ref:`ReflectionProbe.interior_enable`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_cull_mask: + +- void **reflection_probe_set_cull_mask** **(** :ref:`RID` probe, :ref:`int` layers **)** + +Sets the render cull mask for this reflection probe. Only instances with a matching cull mask will be rendered by this probe. Equivalent to :ref:`ReflectionProbe.cull_mask`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_enable_box_projection: + +- void **reflection_probe_set_enable_box_projection** **(** :ref:`RID` probe, :ref:`bool` enable **)** + +If ``true``, uses box projection. This can make reflections look more correct in certain situations. Equivalent to :ref:`ReflectionProbe.box_projection`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_enable_shadows: + +- void **reflection_probe_set_enable_shadows** **(** :ref:`RID` probe, :ref:`bool` enable **)** + +If ``true``, computes shadows in the reflection probe. This makes the reflection much slower to compute. Equivalent to :ref:`ReflectionProbe.enable_shadows`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_extents: + +- void **reflection_probe_set_extents** **(** :ref:`RID` probe, :ref:`Vector3` extents **)** + +Sets the size of the area that the reflection probe will capture. Equivalent to :ref:`ReflectionProbe.extents`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_intensity: + +- void **reflection_probe_set_intensity** **(** :ref:`RID` probe, :ref:`float` intensity **)** + +Sets the intensity of the reflection probe. Intensity modulates the strength of the reflection. Equivalent to :ref:`ReflectionProbe.intensity`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_interior_ambient: + +- void **reflection_probe_set_interior_ambient** **(** :ref:`RID` probe, :ref:`Color` color **)** + +Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to :ref:`ReflectionProbe.interior_ambient_color`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_interior_ambient_energy: + +- void **reflection_probe_set_interior_ambient_energy** **(** :ref:`RID` probe, :ref:`float` energy **)** + +Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to :ref:`ReflectionProbe.interior_ambient_energy`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_interior_ambient_probe_contribution: + +- void **reflection_probe_set_interior_ambient_probe_contribution** **(** :ref:`RID` probe, :ref:`float` contrib **)** + +Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to :ref:`ReflectionProbe.interior_ambient_contrib`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_max_distance: + +- void **reflection_probe_set_max_distance** **(** :ref:`RID` probe, :ref:`float` distance **)** + +Sets the max distance away from the probe an object can be before it is culled. Equivalent to :ref:`ReflectionProbe.max_distance`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_origin_offset: + +- void **reflection_probe_set_origin_offset** **(** :ref:`RID` probe, :ref:`Vector3` offset **)** + +Sets the origin offset to be used when this reflection probe is in box project mode. Equivalent to :ref:`ReflectionProbe.origin_offset`. + +---- + +.. _class_VisualServer_method_reflection_probe_set_update_mode: + +- void **reflection_probe_set_update_mode** **(** :ref:`RID` probe, :ref:`ReflectionProbeUpdateMode` mode **)** + +Sets how often the reflection probe updates. Can either be once or every frame. See :ref:`ReflectionProbeUpdateMode` for options. + +---- + +.. _class_VisualServer_method_request_frame_drawn_callback: + +- void **request_frame_drawn_callback** **(** :ref:`Object` where, :ref:`String` method, :ref:`Variant` userdata **)** + +Schedules a callback to the corresponding named ``method`` on ``where`` after a frame has been drawn. + +The callback method must use only 1 argument which will be called with ``userdata``. + +---- + +.. _class_VisualServer_method_scenario_create: + +- :ref:`RID` **scenario_create** **(** **)** + +Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``scenario_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +The scenario is the 3D world that all the visual instances exist in. + +---- + +.. _class_VisualServer_method_scenario_set_debug: + +- void **scenario_set_debug** **(** :ref:`RID` scenario, :ref:`ScenarioDebugMode` debug_mode **)** + +Sets the :ref:`ScenarioDebugMode` for this scenario. See :ref:`ScenarioDebugMode` for options. + +---- + +.. _class_VisualServer_method_scenario_set_environment: + +- void **scenario_set_environment** **(** :ref:`RID` scenario, :ref:`RID` environment **)** + +Sets the environment that will be used with this scenario. + +---- + +.. _class_VisualServer_method_scenario_set_fallback_environment: + +- void **scenario_set_fallback_environment** **(** :ref:`RID` scenario, :ref:`RID` environment **)** + +Sets the fallback environment to be used by this scenario. The fallback environment is used if no environment is set. Internally, this is used by the editor to provide a default environment. + +---- + +.. _class_VisualServer_method_scenario_set_reflection_atlas_size: + +- void **scenario_set_reflection_atlas_size** **(** :ref:`RID` scenario, :ref:`int` size, :ref:`int` subdiv **)** + +Sets the size of the reflection atlas shared by all reflection probes in this scenario. + +---- + +.. _class_VisualServer_method_set_boot_image: + +- void **set_boot_image** **(** :ref:`Image` image, :ref:`Color` color, :ref:`bool` scale, :ref:`bool` use_filter=true **)** + +Sets a boot image. The color defines the background color. If ``scale`` is ``true``, the image will be scaled to fit the screen size. If ``use_filter`` is ``true``, the image will be scaled with linear interpolation. If ``use_filter`` is ``false``, the image will be scaled with nearest-neighbor interpolation. + +---- + +.. _class_VisualServer_method_set_debug_generate_wireframes: + +- void **set_debug_generate_wireframes** **(** :ref:`bool` generate **)** + +If ``true``, the engine will generate wireframes for use with the wireframe debug mode. + +---- + +.. _class_VisualServer_method_set_default_clear_color: + +- void **set_default_clear_color** **(** :ref:`Color` color **)** + +Sets the default clear color which is used when a specific clear color has not been selected. + +---- + +.. _class_VisualServer_method_set_shader_time_scale: + +- void **set_shader_time_scale** **(** :ref:`float` scale **)** + +Sets the scale to apply to the passage of time for the shaders' ``TIME`` builtin. + +The default value is ``1.0``, which means ``TIME`` will count the real time as it goes by, without narrowing or stretching it. + +---- + +.. _class_VisualServer_method_set_use_occlusion_culling: + +- void **set_use_occlusion_culling** **(** :ref:`bool` enable **)** + +Enables or disables occlusion culling. + +---- + +.. _class_VisualServer_method_shader_create: + +- :ref:`RID` **shader_create** **(** **)** + +Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``shader_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_shader_get_code: + +- :ref:`String` **shader_get_code** **(** :ref:`RID` shader **)** |const| + +Returns a shader's code. + +---- + +.. _class_VisualServer_method_shader_get_default_texture_param: + +- :ref:`RID` **shader_get_default_texture_param** **(** :ref:`RID` shader, :ref:`String` name **)** |const| + +Returns a default texture from a shader searched by name. + +---- + +.. _class_VisualServer_method_shader_get_param_list: + +- :ref:`Array` **shader_get_param_list** **(** :ref:`RID` shader **)** |const| + +Returns the parameters of a shader. + +---- + +.. _class_VisualServer_method_shader_set_code: + +- void **shader_set_code** **(** :ref:`RID` shader, :ref:`String` code **)** + +Sets a shader's code. + +---- + +.. _class_VisualServer_method_shader_set_default_texture_param: + +- void **shader_set_default_texture_param** **(** :ref:`RID` shader, :ref:`String` name, :ref:`RID` texture **)** + +Sets a shader's default texture. Overwrites the texture given by name. + +---- + +.. _class_VisualServer_method_skeleton_allocate: + +- void **skeleton_allocate** **(** :ref:`RID` skeleton, :ref:`int` bones, :ref:`bool` is_2d_skeleton=false **)** + +Allocates the GPU buffers for this skeleton. + +---- + +.. _class_VisualServer_method_skeleton_bone_get_transform: + +- :ref:`Transform` **skeleton_bone_get_transform** **(** :ref:`RID` skeleton, :ref:`int` bone **)** |const| + +Returns the :ref:`Transform` set for a specific bone of this skeleton. + +---- + +.. _class_VisualServer_method_skeleton_bone_get_transform_2d: + +- :ref:`Transform2D` **skeleton_bone_get_transform_2d** **(** :ref:`RID` skeleton, :ref:`int` bone **)** |const| + +Returns the :ref:`Transform2D` set for a specific bone of this skeleton. + +---- + +.. _class_VisualServer_method_skeleton_bone_set_transform: + +- void **skeleton_bone_set_transform** **(** :ref:`RID` skeleton, :ref:`int` bone, :ref:`Transform` transform **)** + +Sets the :ref:`Transform` for a specific bone of this skeleton. + +---- + +.. _class_VisualServer_method_skeleton_bone_set_transform_2d: + +- void **skeleton_bone_set_transform_2d** **(** :ref:`RID` skeleton, :ref:`int` bone, :ref:`Transform2D` transform **)** + +Sets the :ref:`Transform2D` for a specific bone of this skeleton. + +---- + +.. _class_VisualServer_method_skeleton_create: + +- :ref:`RID` **skeleton_create** **(** **)** + +Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``skeleton_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_skeleton_get_bone_count: + +- :ref:`int` **skeleton_get_bone_count** **(** :ref:`RID` skeleton **)** |const| + +Returns the number of bones allocated for this skeleton. + +---- + +.. _class_VisualServer_method_sky_create: + +- :ref:`RID` **sky_create** **(** **)** + +Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``sky_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_sky_set_texture: + +- void **sky_set_texture** **(** :ref:`RID` sky, :ref:`RID` cube_map, :ref:`int` radiance_size **)** + +Sets a sky's texture. + +---- + +.. _class_VisualServer_method_spot_light_create: + +- :ref:`RID` **spot_light_create** **(** **)** + +Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most ``light_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +To place in a scene, attach this spot light to an instance using :ref:`instance_set_base` using the returned RID. + +---- + +.. _class_VisualServer_method_sync: + +- void **sync** **(** **)** + +Not implemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_texture_allocate: + +- void **texture_allocate** **(** :ref:`RID` texture, :ref:`int` width, :ref:`int` height, :ref:`int` depth_3d, :ref:`Format` format, :ref:`TextureType` type, :ref:`int` flags=7 **)** + +Allocates the GPU memory for the texture. + +---- + +.. _class_VisualServer_method_texture_bind: + +- void **texture_bind** **(** :ref:`RID` texture, :ref:`int` number **)** + +Binds the texture to a texture slot. + +---- + +.. _class_VisualServer_method_texture_create: + +- :ref:`RID` **texture_create** **(** **)** + +Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``texture_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_texture_create_from_image: + +- :ref:`RID` **texture_create_from_image** **(** :ref:`Image` image, :ref:`int` flags=7 **)** + +Creates a texture, allocates the space for an image, and fills in the image. + +---- + +.. _class_VisualServer_method_texture_debug_usage: + +- :ref:`Array` **texture_debug_usage** **(** **)** + +Returns a list of all the textures and their information. + +---- + +.. _class_VisualServer_method_texture_get_data: + +- :ref:`Image` **texture_get_data** **(** :ref:`RID` texture, :ref:`int` cube_side=0 **)** |const| + +Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the :ref:`RID` of the image at one of the cubes sides. + +---- + +.. _class_VisualServer_method_texture_get_depth: + +- :ref:`int` **texture_get_depth** **(** :ref:`RID` texture **)** |const| + +Returns the depth of the texture. + +---- + +.. _class_VisualServer_method_texture_get_flags: + +- :ref:`int` **texture_get_flags** **(** :ref:`RID` texture **)** |const| + +Returns the flags of a texture. + +---- + +.. _class_VisualServer_method_texture_get_format: + +- :ref:`Format` **texture_get_format** **(** :ref:`RID` texture **)** |const| + +Returns the format of the texture's image. + +---- + +.. _class_VisualServer_method_texture_get_height: + +- :ref:`int` **texture_get_height** **(** :ref:`RID` texture **)** |const| + +Returns the texture's height. + +---- + +.. _class_VisualServer_method_texture_get_path: + +- :ref:`String` **texture_get_path** **(** :ref:`RID` texture **)** |const| + +Returns the texture's path. + +---- + +.. _class_VisualServer_method_texture_get_texid: + +- :ref:`int` **texture_get_texid** **(** :ref:`RID` texture **)** |const| + +Returns the opengl id of the texture's image. + +---- + +.. _class_VisualServer_method_texture_get_type: + +- :ref:`TextureType` **texture_get_type** **(** :ref:`RID` texture **)** |const| + +Returns the type of the texture, can be any of the :ref:`TextureType`. + +---- + +.. _class_VisualServer_method_texture_get_width: + +- :ref:`int` **texture_get_width** **(** :ref:`RID` texture **)** |const| + +Returns the texture's width. + +---- + +.. _class_VisualServer_method_texture_set_data: + +- void **texture_set_data** **(** :ref:`RID` texture, :ref:`Image` image, :ref:`int` layer=0 **)** + +Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side. + +---- + +.. _class_VisualServer_method_texture_set_data_partial: + +- void **texture_set_data_partial** **(** :ref:`RID` texture, :ref:`Image` image, :ref:`int` src_x, :ref:`int` src_y, :ref:`int` src_w, :ref:`int` src_h, :ref:`int` dst_x, :ref:`int` dst_y, :ref:`int` dst_mip, :ref:`int` layer=0 **)** + +Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly. + +---- + +.. _class_VisualServer_method_texture_set_flags: + +- void **texture_set_flags** **(** :ref:`RID` texture, :ref:`int` flags **)** + +Sets the texture's flags. See :ref:`TextureFlags` for options. + +---- + +.. _class_VisualServer_method_texture_set_path: + +- void **texture_set_path** **(** :ref:`RID` texture, :ref:`String` path **)** + +Sets the texture's path. + +---- + +.. _class_VisualServer_method_texture_set_shrink_all_x2_on_set_data: + +- void **texture_set_shrink_all_x2_on_set_data** **(** :ref:`bool` shrink **)** + +If ``true``, sets internal processes to shrink all image data to half the size. + +---- + +.. _class_VisualServer_method_texture_set_size_override: + +- void **texture_set_size_override** **(** :ref:`RID` texture, :ref:`int` width, :ref:`int` height, :ref:`int` depth **)** + +Resizes the texture to the specified dimensions. + +---- + +.. _class_VisualServer_method_textures_keep_original: + +- void **textures_keep_original** **(** :ref:`bool` enable **)** + +If ``true``, the image will be stored in the texture's images array if overwritten. + +---- + +.. _class_VisualServer_method_viewport_attach_camera: + +- void **viewport_attach_camera** **(** :ref:`RID` viewport, :ref:`RID` camera **)** + +Sets a viewport's camera. + +---- + +.. _class_VisualServer_method_viewport_attach_canvas: + +- void **viewport_attach_canvas** **(** :ref:`RID` viewport, :ref:`RID` canvas **)** + +Sets a viewport's canvas. + +---- + +.. _class_VisualServer_method_viewport_attach_to_screen: + +- void **viewport_attach_to_screen** **(** :ref:`RID` viewport, :ref:`Rect2` rect=Rect2( 0, 0, 0, 0 ), :ref:`int` screen=0 **)** + +Copies viewport to a region of the screen specified by ``rect``. If :ref:`Viewport.render_direct_to_screen` is ``true``, then viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to. + +For example, you can set the root viewport to not render at all with the following code: + +:: + + func _ready(): + get_viewport().set_attach_to_screen_rect(Rect2()) + $Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600)) + +Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, :ref:`viewport_set_render_direct_to_screen`. + +---- + +.. _class_VisualServer_method_viewport_create: + +- :ref:`RID` **viewport_create** **(** **)** + +Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all ``viewport_*`` VisualServer functions. + +Once finished with your RID, you will want to free the RID using the VisualServer's :ref:`free_rid` static method. + +---- + +.. _class_VisualServer_method_viewport_detach: + +- void **viewport_detach** **(** :ref:`RID` viewport **)** + +Detaches the viewport from the screen. + +---- + +.. _class_VisualServer_method_viewport_get_render_info: + +- :ref:`int` **viewport_get_render_info** **(** :ref:`RID` viewport, :ref:`ViewportRenderInfo` info **)** + +Returns a viewport's render information. For options, see the :ref:`ViewportRenderInfo` constants. + +---- + +.. _class_VisualServer_method_viewport_get_texture: + +- :ref:`RID` **viewport_get_texture** **(** :ref:`RID` viewport **)** |const| + +Returns the viewport's last rendered frame. + +---- + +.. _class_VisualServer_method_viewport_remove_canvas: + +- void **viewport_remove_canvas** **(** :ref:`RID` viewport, :ref:`RID` canvas **)** + +Detaches a viewport from a canvas and vice versa. + +---- + +.. _class_VisualServer_method_viewport_set_active: + +- void **viewport_set_active** **(** :ref:`RID` viewport, :ref:`bool` active **)** + +If ``true``, sets the viewport active, else sets it inactive. + +---- + +.. _class_VisualServer_method_viewport_set_canvas_stacking: + +- void **viewport_set_canvas_stacking** **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`int` layer, :ref:`int` sublayer **)** + +Sets the stacking order for a viewport's canvas. + +``layer`` is the actual canvas layer, while ``sublayer`` specifies the stacking order of the canvas among those in the same layer. + +---- + +.. _class_VisualServer_method_viewport_set_canvas_transform: + +- void **viewport_set_canvas_transform** **(** :ref:`RID` viewport, :ref:`RID` canvas, :ref:`Transform2D` offset **)** + +Sets the transformation of a viewport's canvas. + +---- + +.. _class_VisualServer_method_viewport_set_clear_mode: + +- void **viewport_set_clear_mode** **(** :ref:`RID` viewport, :ref:`ViewportClearMode` clear_mode **)** + +Sets the clear mode of a viewport. See :ref:`ViewportClearMode` for options. + +---- + +.. _class_VisualServer_method_viewport_set_debug_draw: + +- void **viewport_set_debug_draw** **(** :ref:`RID` viewport, :ref:`ViewportDebugDraw` draw **)** + +Sets the debug draw mode of a viewport. See :ref:`ViewportDebugDraw` for options. + +---- + +.. _class_VisualServer_method_viewport_set_disable_3d: + +- void **viewport_set_disable_3d** **(** :ref:`RID` viewport, :ref:`bool` disabled **)** + +If ``true``, a viewport's 3D rendering is disabled. + +---- + +.. _class_VisualServer_method_viewport_set_disable_environment: + +- void **viewport_set_disable_environment** **(** :ref:`RID` viewport, :ref:`bool` disabled **)** + +If ``true``, rendering of a viewport's environment is disabled. + +---- + +.. _class_VisualServer_method_viewport_set_global_canvas_transform: + +- void **viewport_set_global_canvas_transform** **(** :ref:`RID` viewport, :ref:`Transform2D` transform **)** + +Sets the viewport's global transformation matrix. + +---- + +.. _class_VisualServer_method_viewport_set_hdr: + +- void **viewport_set_hdr** **(** :ref:`RID` viewport, :ref:`bool` enabled **)** + +If ``true``, the viewport renders to hdr. + +---- + +.. _class_VisualServer_method_viewport_set_hide_canvas: + +- void **viewport_set_hide_canvas** **(** :ref:`RID` viewport, :ref:`bool` hidden **)** + +If ``true``, the viewport's canvas is not rendered. + +---- + +.. _class_VisualServer_method_viewport_set_hide_scenario: + +- void **viewport_set_hide_scenario** **(** :ref:`RID` viewport, :ref:`bool` hidden **)** + +Currently unimplemented in Godot 3.x. + +---- + +.. _class_VisualServer_method_viewport_set_msaa: + +- void **viewport_set_msaa** **(** :ref:`RID` viewport, :ref:`ViewportMSAA` msaa **)** + +Sets the anti-aliasing mode. See :ref:`ViewportMSAA` for options. + +---- + +.. _class_VisualServer_method_viewport_set_parent_viewport: + +- void **viewport_set_parent_viewport** **(** :ref:`RID` viewport, :ref:`RID` parent_viewport **)** + +Sets the viewport's parent to another viewport. + +---- + +.. _class_VisualServer_method_viewport_set_render_direct_to_screen: + +- void **viewport_set_render_direct_to_screen** **(** :ref:`RID` viewport, :ref:`bool` enabled **)** + +If ``true``, render the contents of the viewport directly to screen. This allows a low-level optimization where you can skip drawing a viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the ``SCREEN_TEXTURE``. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size. + +---- + +.. _class_VisualServer_method_viewport_set_scenario: + +- void **viewport_set_scenario** **(** :ref:`RID` viewport, :ref:`RID` scenario **)** + +Sets a viewport's scenario. + +The scenario contains information about the :ref:`ScenarioDebugMode`, environment information, reflection atlas etc. + +---- + +.. _class_VisualServer_method_viewport_set_shadow_atlas_quadrant_subdivision: + +- void **viewport_set_shadow_atlas_quadrant_subdivision** **(** :ref:`RID` viewport, :ref:`int` quadrant, :ref:`int` subdivision **)** + +Sets the shadow atlas quadrant's subdivision. + +---- + +.. _class_VisualServer_method_viewport_set_shadow_atlas_size: + +- void **viewport_set_shadow_atlas_size** **(** :ref:`RID` viewport, :ref:`int` size **)** + +Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2. + +---- + +.. _class_VisualServer_method_viewport_set_sharpen_intensity: + +- void **viewport_set_sharpen_intensity** **(** :ref:`RID` viewport, :ref:`float` intensity **)** + +Sets the sharpening ``intensity`` for the ``viewport``. If set to a value greater than ``0.0``, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around ``0.5`` generally give the best results. See also :ref:`viewport_set_use_fxaa`. + +---- + +.. _class_VisualServer_method_viewport_set_size: + +- void **viewport_set_size** **(** :ref:`RID` viewport, :ref:`int` width, :ref:`int` height **)** + +Sets the viewport's width and height. + +---- + +.. _class_VisualServer_method_viewport_set_transparent_background: + +- void **viewport_set_transparent_background** **(** :ref:`RID` viewport, :ref:`bool` enabled **)** + +If ``true``, the viewport renders its background as transparent. + +---- + +.. _class_VisualServer_method_viewport_set_update_mode: + +- void **viewport_set_update_mode** **(** :ref:`RID` viewport, :ref:`ViewportUpdateMode` update_mode **)** + +Sets when the viewport should be updated. See :ref:`ViewportUpdateMode` constants for options. + +---- + +.. _class_VisualServer_method_viewport_set_usage: + +- void **viewport_set_usage** **(** :ref:`RID` viewport, :ref:`ViewportUsage` usage **)** + +Sets the viewport's 2D/3D mode. See :ref:`ViewportUsage` constants for options. + +---- + +.. _class_VisualServer_method_viewport_set_use_arvr: + +- void **viewport_set_use_arvr** **(** :ref:`RID` viewport, :ref:`bool` use_arvr **)** + +If ``true``, the viewport uses augmented or virtual reality technologies. See :ref:`ARVRInterface`. + +---- + +.. _class_VisualServer_method_viewport_set_use_debanding: + +- void **viewport_set_use_debanding** **(** :ref:`RID` viewport, :ref:`bool` debanding **)** + +If ``true``, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger. + +**Note:** Only available on the GLES3 backend. :ref:`Viewport.hdr` must also be ``true`` for debanding to be effective. + +---- + +.. _class_VisualServer_method_viewport_set_use_fxaa: + +- void **viewport_set_use_fxaa** **(** :ref:`RID` viewport, :ref:`bool` fxaa **)** + +Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see :ref:`viewport_set_sharpen_intensity`). + +---- + +.. _class_VisualServer_method_viewport_set_vflip: + +- void **viewport_set_vflip** **(** :ref:`RID` viewport, :ref:`bool` enabled **)** + +If ``true``, the viewport's rendering is flipped vertically. + +.. |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.)` diff --git a/classes/class_visualshader.rst b/classes/class_visualshader.rst new file mode 100644 index 0000000..e99a5ce --- /dev/null +++ b/classes/class_visualshader.rst @@ -0,0 +1,227 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShader.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShader: + +VisualShader +============ + +**Inherits:** :ref:`Shader` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A custom shader program with a visual editor. + +Description +----------- + +This class allows you to define a custom shader program that can be used for various materials to render objects. + +The visual shader editor creates the shader. + +Properties +---------- + ++-------------------------------+---------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`graph_offset` | ``Vector2( 0, 0 )`` | ++-------------------------------+---------------------------------------------------------------+---------------------+ + +Methods +------- + ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_node` **(** :ref:`Type` type, :ref:`VisualShaderNode` node, :ref:`Vector2` position, :ref:`int` id **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`can_connect_nodes` **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_nodes` **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`connect_nodes_forced` **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_nodes` **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`VisualShaderNode` | :ref:`get_node` **(** :ref:`Type` type, :ref:`int` id **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_node_connections` **(** :ref:`Type` type **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`PoolIntArray` | :ref:`get_node_list` **(** :ref:`Type` type **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Vector2` | :ref:`get_node_position` **(** :ref:`Type` type, :ref:`int` id **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_valid_node_id` **(** :ref:`Type` type **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_node_connection` **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_node` **(** :ref:`Type` type, :ref:`int` id **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_mode` **(** :ref:`Mode` mode **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_node_position` **(** :ref:`Type` type, :ref:`int` id, :ref:`Vector2` position **)** | ++-------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_VisualShader_Type: + +.. _class_VisualShader_constant_TYPE_VERTEX: + +.. _class_VisualShader_constant_TYPE_FRAGMENT: + +.. _class_VisualShader_constant_TYPE_LIGHT: + +.. _class_VisualShader_constant_TYPE_MAX: + +enum **Type**: + +- **TYPE_VERTEX** = **0** --- A vertex shader, operating on vertices. + +- **TYPE_FRAGMENT** = **1** --- A fragment shader, operating on fragments (pixels). + +- **TYPE_LIGHT** = **2** --- A shader for light calculations. + +- **TYPE_MAX** = **3** --- Represents the size of the :ref:`Type` enum. + +Constants +--------- + +.. _class_VisualShader_constant_NODE_ID_INVALID: + +.. _class_VisualShader_constant_NODE_ID_OUTPUT: + +- **NODE_ID_INVALID** = **-1** + +- **NODE_ID_OUTPUT** = **0** + +Property Descriptions +--------------------- + +.. _class_VisualShader_property_graph_offset: + +- :ref:`Vector2` **graph_offset** + ++-----------+-------------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+-------------------------+ +| *Setter* | set_graph_offset(value) | ++-----------+-------------------------+ +| *Getter* | get_graph_offset() | ++-----------+-------------------------+ + +The offset vector of the whole graph. + +Method Descriptions +------------------- + +.. _class_VisualShader_method_add_node: + +- void **add_node** **(** :ref:`Type` type, :ref:`VisualShaderNode` node, :ref:`Vector2` position, :ref:`int` id **)** + +Adds the specified node to the shader. + +---- + +.. _class_VisualShader_method_can_connect_nodes: + +- :ref:`bool` **can_connect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| + +Returns ``true`` if the specified nodes and ports can be connected together. + +---- + +.. _class_VisualShader_method_connect_nodes: + +- :ref:`Error` **connect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** + +Connects the specified nodes and ports. + +---- + +.. _class_VisualShader_method_connect_nodes_forced: + +- void **connect_nodes_forced** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** + +Connects the specified nodes and ports, even if they can't be connected. Such connection is invalid and will not function properly. + +---- + +.. _class_VisualShader_method_disconnect_nodes: + +- void **disconnect_nodes** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** + +Connects the specified nodes and ports. + +---- + +.. _class_VisualShader_method_get_node: + +- :ref:`VisualShaderNode` **get_node** **(** :ref:`Type` type, :ref:`int` id **)** |const| + +Returns the shader node instance with specified ``type`` and ``id``. + +---- + +.. _class_VisualShader_method_get_node_connections: + +- :ref:`Array` **get_node_connections** **(** :ref:`Type` type **)** |const| + +Returns the list of connected nodes with the specified type. + +---- + +.. _class_VisualShader_method_get_node_list: + +- :ref:`PoolIntArray` **get_node_list** **(** :ref:`Type` type **)** |const| + +Returns the list of all nodes in the shader with the specified type. + +---- + +.. _class_VisualShader_method_get_node_position: + +- :ref:`Vector2` **get_node_position** **(** :ref:`Type` type, :ref:`int` id **)** |const| + +Returns the position of the specified node within the shader graph. + +---- + +.. _class_VisualShader_method_get_valid_node_id: + +- :ref:`int` **get_valid_node_id** **(** :ref:`Type` type **)** |const| + +---- + +.. _class_VisualShader_method_is_node_connection: + +- :ref:`bool` **is_node_connection** **(** :ref:`Type` type, :ref:`int` from_node, :ref:`int` from_port, :ref:`int` to_node, :ref:`int` to_port **)** |const| + +Returns ``true`` if the specified node and port connection exist. + +---- + +.. _class_VisualShader_method_remove_node: + +- void **remove_node** **(** :ref:`Type` type, :ref:`int` id **)** + +Removes the specified node from the shader. + +---- + +.. _class_VisualShader_method_set_mode: + +- void **set_mode** **(** :ref:`Mode` mode **)** + +Sets the mode of this shader. + +---- + +.. _class_VisualShader_method_set_node_position: + +- void **set_node_position** **(** :ref:`Type` type, :ref:`int` id, :ref:`Vector2` position **)** + +Sets the position of the specified 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.)` diff --git a/classes/class_visualshadernode.rst b/classes/class_visualshadernode.rst new file mode 100644 index 0000000..d018559 --- /dev/null +++ b/classes/class_visualshadernode.rst @@ -0,0 +1,140 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNode.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNode: + +VisualShaderNode +================ + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeBooleanConstant`, :ref:`VisualShaderNodeColorConstant`, :ref:`VisualShaderNodeColorFunc`, :ref:`VisualShaderNodeColorOp`, :ref:`VisualShaderNodeCompare`, :ref:`VisualShaderNodeCubeMap`, :ref:`VisualShaderNodeCustom`, :ref:`VisualShaderNodeDeterminant`, :ref:`VisualShaderNodeDotProduct`, :ref:`VisualShaderNodeFaceForward`, :ref:`VisualShaderNodeFresnel`, :ref:`VisualShaderNodeGroupBase`, :ref:`VisualShaderNodeIf`, :ref:`VisualShaderNodeInput`, :ref:`VisualShaderNodeIs`, :ref:`VisualShaderNodeOuterProduct`, :ref:`VisualShaderNodeOutput`, :ref:`VisualShaderNodeScalarClamp`, :ref:`VisualShaderNodeScalarConstant`, :ref:`VisualShaderNodeScalarDerivativeFunc`, :ref:`VisualShaderNodeScalarFunc`, :ref:`VisualShaderNodeScalarInterp`, :ref:`VisualShaderNodeScalarOp`, :ref:`VisualShaderNodeScalarSmoothStep`, :ref:`VisualShaderNodeSwitch`, :ref:`VisualShaderNodeTexture`, :ref:`VisualShaderNodeTransformCompose`, :ref:`VisualShaderNodeTransformConstant`, :ref:`VisualShaderNodeTransformDecompose`, :ref:`VisualShaderNodeTransformFunc`, :ref:`VisualShaderNodeTransformMult`, :ref:`VisualShaderNodeTransformVecMult`, :ref:`VisualShaderNodeUniform`, :ref:`VisualShaderNodeUniformRef`, :ref:`VisualShaderNodeVec3Constant`, :ref:`VisualShaderNodeVectorClamp`, :ref:`VisualShaderNodeVectorCompose`, :ref:`VisualShaderNodeVectorDecompose`, :ref:`VisualShaderNodeVectorDerivativeFunc`, :ref:`VisualShaderNodeVectorDistance`, :ref:`VisualShaderNodeVectorFunc`, :ref:`VisualShaderNodeVectorInterp`, :ref:`VisualShaderNodeVectorLen`, :ref:`VisualShaderNodeVectorOp`, :ref:`VisualShaderNodeVectorRefract`, :ref:`VisualShaderNodeVectorScalarMix`, :ref:`VisualShaderNodeVectorScalarSmoothStep`, :ref:`VisualShaderNodeVectorScalarStep`, :ref:`VisualShaderNodeVectorSmoothStep` + +Base class for nodes in a visual shader graph. + +Description +----------- + +Visual shader graphs consist of various nodes. Each node in the graph is a separate object and they are represented as a rectangular boxes with title and a set of properties. Each node has also connection ports that allow to connect it to another nodes and control the flow of the shader. + +Tutorials +--------- + +- :doc:`../tutorials/shaders/visual_shaders` + +Properties +---------- + ++-----------------------+-----------------------------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`output_port_for_preview` | ``-1`` | ++-----------------------+-----------------------------------------------------------------------------------------+--------+ + +Methods +------- + ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Array` | :ref:`get_default_input_values` **(** **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_input_port_default_value` **(** :ref:`int` port **)** |const| | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_default_input_values` **(** :ref:`Array` values **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_port_default_value` **(** :ref:`int` port, :ref:`Variant` value **)** | ++-------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualShaderNode_signal_editor_refresh_request: + +- **editor_refresh_request** **(** **)** + +Emitted when the node requests an editor refresh. Currently called only in setter of :ref:`VisualShaderNodeTexture.source`, :ref:`VisualShaderNodeTexture`, and :ref:`VisualShaderNodeCubeMap` (and their derivatives). + +Enumerations +------------ + +.. _enum_VisualShaderNode_PortType: + +.. _class_VisualShaderNode_constant_PORT_TYPE_SCALAR: + +.. _class_VisualShaderNode_constant_PORT_TYPE_VECTOR: + +.. _class_VisualShaderNode_constant_PORT_TYPE_BOOLEAN: + +.. _class_VisualShaderNode_constant_PORT_TYPE_TRANSFORM: + +.. _class_VisualShaderNode_constant_PORT_TYPE_SAMPLER: + +.. _class_VisualShaderNode_constant_PORT_TYPE_MAX: + +enum **PortType**: + +- **PORT_TYPE_SCALAR** = **0** --- Floating-point scalar. Translated to ``float`` type in shader code. + +- **PORT_TYPE_VECTOR** = **1** --- 3D vector of floating-point values. Translated to ``vec3`` type in shader code. + +- **PORT_TYPE_BOOLEAN** = **2** --- Boolean type. Translated to ``bool`` type in shader code. + +- **PORT_TYPE_TRANSFORM** = **3** --- Transform type. Translated to ``mat4`` type in shader code. + +- **PORT_TYPE_SAMPLER** = **4** --- Sampler type. Translated to reference of sampler uniform in shader code. Can only be used for input ports in non-uniform nodes. + +- **PORT_TYPE_MAX** = **5** --- Represents the size of the :ref:`PortType` enum. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNode_property_output_port_for_preview: + +- :ref:`int` **output_port_for_preview** + ++-----------+------------------------------------+ +| *Default* | ``-1`` | ++-----------+------------------------------------+ +| *Setter* | set_output_port_for_preview(value) | ++-----------+------------------------------------+ +| *Getter* | get_output_port_for_preview() | ++-----------+------------------------------------+ + +Sets the output port index which will be showed for preview. If set to ``-1`` no port will be open for preview. + +Method Descriptions +------------------- + +.. _class_VisualShaderNode_method_get_default_input_values: + +- :ref:`Array` **get_default_input_values** **(** **)** |const| + +Returns an :ref:`Array` containing default values for all of the input ports of the node in the form ``[index0, value0, index1, value1, ...]``. + +---- + +.. _class_VisualShaderNode_method_get_input_port_default_value: + +- :ref:`Variant` **get_input_port_default_value** **(** :ref:`int` port **)** |const| + +Returns the default value of the input ``port``. + +---- + +.. _class_VisualShaderNode_method_set_default_input_values: + +- void **set_default_input_values** **(** :ref:`Array` values **)** + +Sets the default input ports values using an :ref:`Array` of the form ``[index0, value0, index1, value1, ...]``. For example: ``[0, Vector3(0, 0, 0), 1, Vector3(0, 0, 0)]``. + +---- + +.. _class_VisualShaderNode_method_set_input_port_default_value: + +- void **set_input_port_default_value** **(** :ref:`int` port, :ref:`Variant` value **)** + +Sets the default value for the selected input ``port``. + +.. |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.)` diff --git a/classes/class_visualshadernodebooleanconstant.rst b/classes/class_visualshadernodebooleanconstant.rst new file mode 100644 index 0000000..db24f5e --- /dev/null +++ b/classes/class_visualshadernodebooleanconstant.rst @@ -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 VisualShaderNodeBooleanConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeBooleanConstant: + +VisualShaderNodeBooleanConstant +=============================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A boolean constant to be used within the visual shader graph. + +Description +----------- + +Has only one output port and no inputs. + +Translated to ``bool`` in the shader language. + +Properties +---------- + ++-------------------------+--------------------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`constant` | ``false`` | ++-------------------------+--------------------------------------------------------------------------+-----------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeBooleanConstant_property_constant: + +- :ref:`bool` **constant** + ++-----------+---------------------+ +| *Default* | ``false`` | ++-----------+---------------------+ +| *Setter* | set_constant(value) | ++-----------+---------------------+ +| *Getter* | get_constant() | ++-----------+---------------------+ + +A boolean constant which represents a state of this 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.)` diff --git a/classes/class_visualshadernodebooleanuniform.rst b/classes/class_visualshadernodebooleanuniform.rst new file mode 100644 index 0000000..85f2c72 --- /dev/null +++ b/classes/class_visualshadernodebooleanuniform.rst @@ -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 VisualShaderNodeBooleanUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeBooleanUniform: + +VisualShaderNodeBooleanUniform +============================== + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A boolean uniform to be used within the visual shader graph. + +Description +----------- + +Translated to ``uniform bool`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodecolorconstant.rst b/classes/class_visualshadernodecolorconstant.rst new file mode 100644 index 0000000..8f47703 --- /dev/null +++ b/classes/class_visualshadernodecolorconstant.rst @@ -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 VisualShaderNodeColorConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeColorConstant: + +VisualShaderNodeColorConstant +============================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Color` constant to be used within the visual shader graph. + +Description +----------- + +Has two output ports representing RGB and alpha channels of :ref:`Color`. + +Translated to ``vec3 rgb`` and ``float alpha`` in the shader language. + +Properties +---------- + ++---------------------------+------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`constant` | ``Color( 1, 1, 1, 1 )`` | ++---------------------------+------------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeColorConstant_property_constant: + +- :ref:`Color` **constant** + ++-----------+-------------------------+ +| *Default* | ``Color( 1, 1, 1, 1 )`` | ++-----------+-------------------------+ +| *Setter* | set_constant(value) | ++-----------+-------------------------+ +| *Getter* | get_constant() | ++-----------+-------------------------+ + +A :ref:`Color` constant which represents a state of this 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.)` diff --git a/classes/class_visualshadernodecolorfunc.rst b/classes/class_visualshadernodecolorfunc.rst new file mode 100644 index 0000000..1db8d77 --- /dev/null +++ b/classes/class_visualshadernodecolorfunc.rst @@ -0,0 +1,78 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeColorFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeColorFunc: + +VisualShaderNodeColorFunc +========================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Color` function to be used within the visual shader graph. + +Description +----------- + +Accept a :ref:`Color` to the input port and transform it according to :ref:`function`. + +Properties +---------- + ++----------------------------------------------------------+--------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++----------------------------------------------------------+--------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeColorFunc_Function: + +.. _class_VisualShaderNodeColorFunc_constant_FUNC_GRAYSCALE: + +.. _class_VisualShaderNodeColorFunc_constant_FUNC_SEPIA: + +enum **Function**: + +- **FUNC_GRAYSCALE** = **0** --- Converts the color to grayscale using the following formula: + +:: + + vec3 c = input; + float max1 = max(c.r, c.g); + float max2 = max(max1, c.b); + float max3 = max(max1, max2); + return vec3(max3, max3, max3); + +- **FUNC_SEPIA** = **1** --- Applies sepia tone effect using the following formula: + +:: + + vec3 c = input; + float r = (c.r * 0.393) + (c.g * 0.769) + (c.b * 0.189); + float g = (c.r * 0.349) + (c.g * 0.686) + (c.b * 0.168); + float b = (c.r * 0.272) + (c.g * 0.534) + (c.b * 0.131); + return vec3(r, g, b); + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeColorFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +A function to be applied to the input color. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodecolorop.rst b/classes/class_visualshadernodecolorop.rst new file mode 100644 index 0000000..8b197d9 --- /dev/null +++ b/classes/class_visualshadernodecolorop.rst @@ -0,0 +1,150 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeColorOp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeColorOp: + +VisualShaderNodeColorOp +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Color` operator to be used within the visual shader graph. + +Description +----------- + +Applies :ref:`operator` to two color inputs. + +Properties +---------- + ++--------------------------------------------------------+------------------------------------------------------------------+-------+ +| :ref:`Operator` | :ref:`operator` | ``0`` | ++--------------------------------------------------------+------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeColorOp_Operator: + +.. _class_VisualShaderNodeColorOp_constant_OP_SCREEN: + +.. _class_VisualShaderNodeColorOp_constant_OP_DIFFERENCE: + +.. _class_VisualShaderNodeColorOp_constant_OP_DARKEN: + +.. _class_VisualShaderNodeColorOp_constant_OP_LIGHTEN: + +.. _class_VisualShaderNodeColorOp_constant_OP_OVERLAY: + +.. _class_VisualShaderNodeColorOp_constant_OP_DODGE: + +.. _class_VisualShaderNodeColorOp_constant_OP_BURN: + +.. _class_VisualShaderNodeColorOp_constant_OP_SOFT_LIGHT: + +.. _class_VisualShaderNodeColorOp_constant_OP_HARD_LIGHT: + +enum **Operator**: + +- **OP_SCREEN** = **0** --- Produce a screen effect with the following formula: + +:: + + result = vec3(1.0) - (vec3(1.0) - a) * (vec3(1.0) - b); + +- **OP_DIFFERENCE** = **1** --- Produce a difference effect with the following formula: + +:: + + result = abs(a - b); + +- **OP_DARKEN** = **2** --- Produce a darken effect with the following formula: + +:: + + result = min(a, b); + +- **OP_LIGHTEN** = **3** --- Produce a lighten effect with the following formula: + +:: + + result = max(a, b); + +- **OP_OVERLAY** = **4** --- Produce an overlay effect with the following formula: + +:: + + for (int i = 0; i < 3; i++) { + float base = a[i]; + float blend = b[i]; + if (base < 0.5) { + result[i] = 2.0 * base * blend; + } else { + result[i] = 1.0 - 2.0 * (1.0 - blend) * (1.0 - base); + } + } + +- **OP_DODGE** = **5** --- Produce a dodge effect with the following formula: + +:: + + result = a / (vec3(1.0) - b); + +- **OP_BURN** = **6** --- Produce a burn effect with the following formula: + +:: + + result = vec3(1.0) - (vec3(1.0) - a) / b; + +- **OP_SOFT_LIGHT** = **7** --- Produce a soft light effect with the following formula: + +:: + + for (int i = 0; i < 3; i++) { + float base = a[i]; + float blend = b[i]; + if (base < 0.5) { + result[i] = base * (blend + 0.5); + } else { + result[i] = 1.0 - (1.0 - base) * (1.0 - (blend - 0.5)); + } + } + +- **OP_HARD_LIGHT** = **8** --- Produce a hard light effect with the following formula: + +:: + + for (int i = 0; i < 3; i++) { + float base = a[i]; + float blend = b[i]; + if (base < 0.5) { + result[i] = base * (2.0 * blend); + } else { + result[i] = 1.0 - (1.0 - base) * (1.0 - 2.0 * (blend - 0.5)); + } + } + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeColorOp_property_operator: + +- :ref:`Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +An operator to be applied to the inputs. See :ref:`Operator` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodecoloruniform.rst b/classes/class_visualshadernodecoloruniform.rst new file mode 100644 index 0000000..40d032b --- /dev/null +++ b/classes/class_visualshadernodecoloruniform.rst @@ -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 VisualShaderNodeColorUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeColorUniform: + +VisualShaderNodeColorUniform +============================ + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Color` uniform to be used within the visual shader graph. + +Description +----------- + +Translated to ``uniform vec4`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodecompare.rst b/classes/class_visualshadernodecompare.rst new file mode 100644 index 0000000..d0324c3 --- /dev/null +++ b/classes/class_visualshadernodecompare.rst @@ -0,0 +1,150 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeCompare.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeCompare: + +VisualShaderNodeCompare +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A comparison function for common types within the visual shader graph. + +Description +----------- + +Compares ``a`` and ``b`` of :ref:`type` by :ref:`function`. Returns a boolean scalar. Translates to ``if`` instruction in shader code. + +Properties +---------- + ++--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ +| :ref:`Condition` | :ref:`condition` | ``0`` | ++--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ +| :ref:`ComparisonType` | :ref:`type` | ``0`` | ++--------------------------------------------------------------------+--------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeCompare_ComparisonType: + +.. _class_VisualShaderNodeCompare_constant_CTYPE_SCALAR: + +.. _class_VisualShaderNodeCompare_constant_CTYPE_VECTOR: + +.. _class_VisualShaderNodeCompare_constant_CTYPE_BOOLEAN: + +.. _class_VisualShaderNodeCompare_constant_CTYPE_TRANSFORM: + +enum **ComparisonType**: + +- **CTYPE_SCALAR** = **0** --- A floating-point scalar. + +- **CTYPE_VECTOR** = **1** --- A 3D vector type. + +- **CTYPE_BOOLEAN** = **2** --- A boolean type. + +- **CTYPE_TRANSFORM** = **3** --- A transform (``mat4``) type. + +---- + +.. _enum_VisualShaderNodeCompare_Function: + +.. _class_VisualShaderNodeCompare_constant_FUNC_EQUAL: + +.. _class_VisualShaderNodeCompare_constant_FUNC_NOT_EQUAL: + +.. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN: + +.. _class_VisualShaderNodeCompare_constant_FUNC_GREATER_THAN_EQUAL: + +.. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN: + +.. _class_VisualShaderNodeCompare_constant_FUNC_LESS_THAN_EQUAL: + +enum **Function**: + +- **FUNC_EQUAL** = **0** --- Comparison for equality (``a == b``). + +- **FUNC_NOT_EQUAL** = **1** --- Comparison for inequality (``a != b``). + +- **FUNC_GREATER_THAN** = **2** --- Comparison for greater than (``a > b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. + +- **FUNC_GREATER_THAN_EQUAL** = **3** --- Comparison for greater than or equal (``a >= b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. + +- **FUNC_LESS_THAN** = **4** --- Comparison for less than (``a < b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. + +- **FUNC_LESS_THAN_EQUAL** = **5** --- Comparison for less than or equal (``a < b``). Cannot be used if :ref:`type` set to :ref:`CTYPE_BOOLEAN` or :ref:`CTYPE_TRANSFORM`. + +---- + +.. _enum_VisualShaderNodeCompare_Condition: + +.. _class_VisualShaderNodeCompare_constant_COND_ALL: + +.. _class_VisualShaderNodeCompare_constant_COND_ANY: + +enum **Condition**: + +- **COND_ALL** = **0** --- The result will be true if all of component in vector satisfy the comparison condition. + +- **COND_ANY** = **1** --- The result will be true if any of component in vector satisfy the comparison condition. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeCompare_property_condition: + +- :ref:`Condition` **condition** + ++-----------+----------------------+ +| *Default* | ``0`` | ++-----------+----------------------+ +| *Setter* | set_condition(value) | ++-----------+----------------------+ +| *Getter* | get_condition() | ++-----------+----------------------+ + +Extra condition which is applied if :ref:`type` is set to :ref:`CTYPE_VECTOR`. + +---- + +.. _class_VisualShaderNodeCompare_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +A comparison function. See :ref:`Function` for options. + +---- + +.. _class_VisualShaderNodeCompare_property_type: + +- :ref:`ComparisonType` **type** + ++-----------+----------------------------+ +| *Default* | ``0`` | ++-----------+----------------------------+ +| *Setter* | set_comparison_type(value) | ++-----------+----------------------------+ +| *Getter* | get_comparison_type() | ++-----------+----------------------------+ + +The type to be used in the comparison. See :ref:`ComparisonType` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodecubemap.rst b/classes/class_visualshadernodecubemap.rst new file mode 100644 index 0000000..c8a4d1a --- /dev/null +++ b/classes/class_visualshadernodecubemap.rst @@ -0,0 +1,114 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeCubeMap.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeCubeMap: + +VisualShaderNodeCubeMap +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`CubeMap` sampling node to be used within the visual shader graph. + +Description +----------- + +Translated to ``texture(cubemap, vec3)`` in the shader language. Returns a color vector and alpha channel as scalar. + +Properties +---------- + ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`CubeMap` | :ref:`cube_map` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`Source` | :ref:`source` | ``0`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`TextureType` | :ref:`texture_type` | ``0`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeCubeMap_Source: + +.. _class_VisualShaderNodeCubeMap_constant_SOURCE_TEXTURE: + +.. _class_VisualShaderNodeCubeMap_constant_SOURCE_PORT: + +enum **Source**: + +- **SOURCE_TEXTURE** = **0** --- Use the :ref:`CubeMap` set via :ref:`cube_map`. If this is set to :ref:`source`, the ``samplerCube`` port is ignored. + +- **SOURCE_PORT** = **1** --- Use the :ref:`CubeMap` sampler reference passed via the ``samplerCube`` port. If this is set to :ref:`source`, the :ref:`cube_map` texture is ignored. + +---- + +.. _enum_VisualShaderNodeCubeMap_TextureType: + +.. _class_VisualShaderNodeCubeMap_constant_TYPE_DATA: + +.. _class_VisualShaderNodeCubeMap_constant_TYPE_COLOR: + +.. _class_VisualShaderNodeCubeMap_constant_TYPE_NORMALMAP: + +enum **TextureType**: + +- **TYPE_DATA** = **0** --- No hints are added to the uniform declaration. + +- **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion. + +- **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeCubeMap_property_cube_map: + +- :ref:`CubeMap` **cube_map** + ++----------+---------------------+ +| *Setter* | set_cube_map(value) | ++----------+---------------------+ +| *Getter* | get_cube_map() | ++----------+---------------------+ + +The :ref:`CubeMap` texture to sample when using :ref:`SOURCE_TEXTURE` as :ref:`source`. + +---- + +.. _class_VisualShaderNodeCubeMap_property_source: + +- :ref:`Source` **source** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_source(value) | ++-----------+-------------------+ +| *Getter* | get_source() | ++-----------+-------------------+ + +Defines which source should be used for the sampling. See :ref:`Source` for options. + +---- + +.. _class_VisualShaderNodeCubeMap_property_texture_type: + +- :ref:`TextureType` **texture_type** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_texture_type(value) | ++-----------+-------------------------+ +| *Getter* | get_texture_type() | ++-----------+-------------------------+ + +Defines the type of data provided by the source texture. See :ref:`TextureType` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodecubemapuniform.rst b/classes/class_visualshadernodecubemapuniform.rst new file mode 100644 index 0000000..c75bdbf --- /dev/null +++ b/classes/class_visualshadernodecubemapuniform.rst @@ -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 VisualShaderNodeCubeMapUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeCubeMapUniform: + +VisualShaderNodeCubeMapUniform +============================== + +**Inherits:** :ref:`VisualShaderNodeTextureUniform` **<** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`CubeMap` uniform node to be used within the visual shader graph. + +Description +----------- + +Translated to ``uniform samplerCube`` in the shader language. The output value can be used as port for :ref:`VisualShaderNodeCubeMap`. + +.. |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.)` diff --git a/classes/class_visualshadernodecustom.rst b/classes/class_visualshadernodecustom.rst new file mode 100644 index 0000000..26a41dd --- /dev/null +++ b/classes/class_visualshadernodecustom.rst @@ -0,0 +1,208 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeCustom.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeCustom: + +VisualShaderNodeCustom +====================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Virtual class to define custom :ref:`VisualShaderNode`\ s for use in the Visual Shader Editor. + +Description +----------- + +By inheriting this class you can create a custom :ref:`VisualShader` script addon which will be automatically added to the Visual Shader Editor. The :ref:`VisualShaderNode`'s behavior is defined by overriding the provided virtual methods. + +In order for the node to be registered as an editor addon, you must use the ``tool`` keyword and provide a ``class_name`` for your custom script. For example: + +:: + + tool + extends VisualShaderNodeCustom + class_name VisualShaderNodeNoise + +Tutorials +--------- + +- :doc:`../tutorials/plugins/editor/visual_shader_plugins` + +Methods +------- + ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_category` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_code` **(** :ref:`Array` input_vars, :ref:`Array` output_vars, :ref:`int` mode, :ref:`int` type **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_description` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_global_code` **(** :ref:`int` mode **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_input_port_count` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_input_port_name` **(** :ref:`int` port **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_input_port_type` **(** :ref:`int` port **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_name` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_port_count` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_output_port_name` **(** :ref:`int` port **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_output_port_type` **(** :ref:`int` port **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`_get_return_icon_type` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`_get_subcategory` **(** **)** |virtual| | ++-----------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_VisualShaderNodeCustom_method__get_category: + +- :ref:`String` **_get_category** **(** **)** |virtual| + +Override this method to define the category of the associated custom node in the Visual Shader Editor's members dialog. The path may look like ``"MyGame/MyFunctions/Noise"``. + +Defining this method is **optional**. If not overridden, the node will be filed under the "Custom" category. + +---- + +.. _class_VisualShaderNodeCustom_method__get_code: + +- :ref:`String` **_get_code** **(** :ref:`Array` input_vars, :ref:`Array` output_vars, :ref:`int` mode, :ref:`int` type **)** |virtual| + +Override this method to define the actual shader code of the associated custom node. The shader code should be returned as a string, which can have multiple lines (the ``"""`` multiline string construct can be used for convenience). + +The ``input_vars`` and ``output_vars`` arrays contain the string names of the various input and output variables, as defined by ``_get_input_*`` and ``_get_output_*`` virtual methods in this class. + +The output ports can be assigned values in the shader code. For example, ``return output_vars[0] + " = " + input_vars[0] + ";"``. + +You can customize the generated code based on the shader ``mode`` (see :ref:`Mode`) and/or ``type`` (see :ref:`Type`). + +Defining this method is **required**. + +---- + +.. _class_VisualShaderNodeCustom_method__get_description: + +- :ref:`String` **_get_description** **(** **)** |virtual| + +Override this method to define the description of the associated custom node in the Visual Shader Editor's members dialog. + +Defining this method is **optional**. + +---- + +.. _class_VisualShaderNodeCustom_method__get_global_code: + +- :ref:`String` **_get_global_code** **(** :ref:`int` mode **)** |virtual| + +Override this method to add shader code on top of the global shader, to define your own standard library of reusable methods, varyings, constants, uniforms, etc. The shader code should be returned as a string, which can have multiple lines (the ``"""`` multiline string construct can be used for convenience). + +Be careful with this functionality as it can cause name conflicts with other custom nodes, so be sure to give the defined entities unique names. + +You can customize the generated code based on the shader ``mode`` (see :ref:`Mode`). + +Defining this method is **optional**. + +---- + +.. _class_VisualShaderNodeCustom_method__get_input_port_count: + +- :ref:`int` **_get_input_port_count** **(** **)** |virtual| + +Override this method to define the amount of input ports of the associated custom node. + +Defining this method is **required**. If not overridden, the node has no input ports. + +---- + +.. _class_VisualShaderNodeCustom_method__get_input_port_name: + +- :ref:`String` **_get_input_port_name** **(** :ref:`int` port **)** |virtual| + +Override this method to define the names of input ports of the associated custom node. The names are used both for the input slots in the editor and as identifiers in the shader code, and are passed in the ``input_vars`` array in :ref:`_get_code`. + +Defining this method is **optional**, but recommended. If not overridden, input ports are named as ``"in" + str(port)``. + +---- + +.. _class_VisualShaderNodeCustom_method__get_input_port_type: + +- :ref:`int` **_get_input_port_type** **(** :ref:`int` port **)** |virtual| + +Override this method to define the returned type of each input port of the associated custom node (see :ref:`PortType` for possible types). + +Defining this method is **optional**, but recommended. If not overridden, input ports will return the :ref:`VisualShaderNode.PORT_TYPE_SCALAR` type. + +---- + +.. _class_VisualShaderNodeCustom_method__get_name: + +- :ref:`String` **_get_name** **(** **)** |virtual| + +Override this method to define the name of the associated custom node in the Visual Shader Editor's members dialog and graph. + +Defining this method is **optional**, but recommended. If not overridden, the node will be named as "Unnamed". + +---- + +.. _class_VisualShaderNodeCustom_method__get_output_port_count: + +- :ref:`int` **_get_output_port_count** **(** **)** |virtual| + +Override this method to define the amount of output ports of the associated custom node. + +Defining this method is **required**. If not overridden, the node has no output ports. + +---- + +.. _class_VisualShaderNodeCustom_method__get_output_port_name: + +- :ref:`String` **_get_output_port_name** **(** :ref:`int` port **)** |virtual| + +Override this method to define the names of output ports of the associated custom node. The names are used both for the output slots in the editor and as identifiers in the shader code, and are passed in the ``output_vars`` array in :ref:`_get_code`. + +Defining this method is **optional**, but recommended. If not overridden, output ports are named as ``"out" + str(port)``. + +---- + +.. _class_VisualShaderNodeCustom_method__get_output_port_type: + +- :ref:`int` **_get_output_port_type** **(** :ref:`int` port **)** |virtual| + +Override this method to define the returned type of each output port of the associated custom node (see :ref:`PortType` for possible types). + +Defining this method is **optional**, but recommended. If not overridden, output ports will return the :ref:`VisualShaderNode.PORT_TYPE_SCALAR` type. + +---- + +.. _class_VisualShaderNodeCustom_method__get_return_icon_type: + +- :ref:`int` **_get_return_icon_type** **(** **)** |virtual| + +Override this method to define the return icon of the associated custom node in the Visual Shader Editor's members dialog. + +Defining this method is **optional**. If not overridden, no return icon is shown. + +---- + +.. _class_VisualShaderNodeCustom_method__get_subcategory: + +- :ref:`String` **_get_subcategory** **(** **)** |virtual| + +Override this method to define the subcategory of the associated custom node in the Visual Shader Editor's members dialog. + +Defining this method is **optional**. If not overridden, the node will be filed under the root of the main category (see :ref:`_get_category`). + +.. |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.)` diff --git a/classes/class_visualshadernodedeterminant.rst b/classes/class_visualshadernodedeterminant.rst new file mode 100644 index 0000000..70a92c0 --- /dev/null +++ b/classes/class_visualshadernodedeterminant.rst @@ -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 VisualShaderNodeDeterminant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeDeterminant: + +VisualShaderNodeDeterminant +=========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates the determinant of a :ref:`Transform` within the visual shader graph. + +Description +----------- + +Translates to ``determinant(x)`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodedotproduct.rst b/classes/class_visualshadernodedotproduct.rst new file mode 100644 index 0000000..915e79c --- /dev/null +++ b/classes/class_visualshadernodedotproduct.rst @@ -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 VisualShaderNodeDotProduct.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeDotProduct: + +VisualShaderNodeDotProduct +========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a dot product of two vectors within the visual shader graph. + +Description +----------- + +Translates to ``dot(a, b)`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodeexpression.rst b/classes/class_visualshadernodeexpression.rst new file mode 100644 index 0000000..3a9ef03 --- /dev/null +++ b/classes/class_visualshadernodeexpression.rst @@ -0,0 +1,51 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeExpression.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeExpression: + +VisualShaderNodeExpression +========================== + +**Inherits:** :ref:`VisualShaderNodeGroupBase` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeGlobalExpression` + +A custom visual shader graph expression written in Godot Shading Language. + +Description +----------- + +Custom Godot Shading Language expression, with a custom amount of input and output ports. + +The provided code is directly injected into the graph's matching shader function (``vertex``, ``fragment``, or ``light``), so it cannot be used to declare functions, varyings, uniforms, or global constants. See :ref:`VisualShaderNodeGlobalExpression` for such global definitions. + +Properties +---------- + ++-----------------------------+-------------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`expression` | ``""`` | ++-----------------------------+-------------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeExpression_property_expression: + +- :ref:`String` **expression** + ++-----------+-----------------------+ +| *Default* | ``""`` | ++-----------+-----------------------+ +| *Setter* | set_expression(value) | ++-----------+-----------------------+ +| *Getter* | get_expression() | ++-----------+-----------------------+ + +An expression in Godot Shading Language, which will be injected at the start of the graph's matching shader function (``vertex``, ``fragment``, or ``light``), and thus cannot be used to declare functions, varyings, uniforms, or global 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.)` diff --git a/classes/class_visualshadernodefaceforward.rst b/classes/class_visualshadernodefaceforward.rst new file mode 100644 index 0000000..a9061b8 --- /dev/null +++ b/classes/class_visualshadernodefaceforward.rst @@ -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 VisualShaderNodeFaceForward.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeFaceForward: + +VisualShaderNodeFaceForward +=========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Returns the vector that points in the same direction as a reference vector within the visual shader graph. + +Description +----------- + +Translates to ``faceforward(N, I, Nref)`` in the shader language. The function has three vector parameters: ``N``, the vector to orient, ``I``, the incident vector, and ``Nref``, the reference vector. If the dot product of ``I`` and ``Nref`` is smaller than zero the return value is ``N``. Otherwise, ``-N`` is returned. + +.. |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.)` diff --git a/classes/class_visualshadernodefresnel.rst b/classes/class_visualshadernodefresnel.rst new file mode 100644 index 0000000..b8580f7 --- /dev/null +++ b/classes/class_visualshadernodefresnel.rst @@ -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 VisualShaderNodeFresnel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeFresnel: + +VisualShaderNodeFresnel +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A Fresnel effect to be used within the visual shader graph. + +Description +----------- + +Returns falloff based on the dot product of surface normal and view direction of camera (pass associated inputs to it). + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_visualshadernodeglobalexpression.rst b/classes/class_visualshadernodeglobalexpression.rst new file mode 100644 index 0000000..4896ecf --- /dev/null +++ b/classes/class_visualshadernodeglobalexpression.rst @@ -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 VisualShaderNodeGlobalExpression.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeGlobalExpression: + +VisualShaderNodeGlobalExpression +================================ + +**Inherits:** :ref:`VisualShaderNodeExpression` **<** :ref:`VisualShaderNodeGroupBase` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A custom global visual shader graph expression written in Godot Shading Language. + +Description +----------- + +Custom Godot Shader Language expression, which is placed on top of the generated shader. You can place various function definitions inside to call later in :ref:`VisualShaderNodeExpression`\ s (which are injected in the main shader functions). You can also declare varyings, uniforms and global 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.)` diff --git a/classes/class_visualshadernodegroupbase.rst b/classes/class_visualshadernodegroupbase.rst new file mode 100644 index 0000000..e02eb00 --- /dev/null +++ b/classes/class_visualshadernodegroupbase.rst @@ -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 VisualShaderNodeGroupBase.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeGroupBase: + +VisualShaderNodeGroupBase +========================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeExpression` + +Base class for a family of nodes with variable amount of input and output ports within the visual shader graph. + +Description +----------- + +Currently, has no direct usage, use the derived classes instead. + +Properties +---------- + ++-------------------------------+------------------------------------------------------------+---------------------+ +| :ref:`Vector2` | :ref:`size` | ``Vector2( 0, 0 )`` | ++-------------------------------+------------------------------------------------------------+---------------------+ + +Methods +------- + ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_input_port` **(** :ref:`int` id, :ref:`int` type, :ref:`String` name **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`add_output_port` **(** :ref:`int` id, :ref:`int` type, :ref:`String` name **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_input_ports` **(** **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`clear_output_ports` **(** **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_free_input_port_id` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_free_output_port_id` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_input_port_count` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_inputs` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_output_port_count` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_outputs` **(** **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_input_port` **(** :ref:`int` id **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_output_port` **(** :ref:`int` id **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_valid_port_name` **(** :ref:`String` name **)** |const| | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_input_port` **(** :ref:`int` id **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_output_port` **(** :ref:`int` id **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_port_name` **(** :ref:`int` id, :ref:`String` name **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_input_port_type` **(** :ref:`int` id, :ref:`int` type **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_inputs` **(** :ref:`String` inputs **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_output_port_name` **(** :ref:`int` id, :ref:`String` name **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_output_port_type` **(** :ref:`int` id, :ref:`int` type **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_outputs` **(** :ref:`String` outputs **)** | ++-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeGroupBase_property_size: + +- :ref:`Vector2` **size** + ++-----------+---------------------+ +| *Default* | ``Vector2( 0, 0 )`` | ++-----------+---------------------+ +| *Setter* | set_size(value) | ++-----------+---------------------+ +| *Getter* | get_size() | ++-----------+---------------------+ + +The size of the node in the visual shader graph. + +Method Descriptions +------------------- + +.. _class_VisualShaderNodeGroupBase_method_add_input_port: + +- void **add_input_port** **(** :ref:`int` id, :ref:`int` type, :ref:`String` name **)** + +Adds an input port with the specified ``type`` (see :ref:`PortType`) and ``name``. + +---- + +.. _class_VisualShaderNodeGroupBase_method_add_output_port: + +- void **add_output_port** **(** :ref:`int` id, :ref:`int` type, :ref:`String` name **)** + +Adds an output port with the specified ``type`` (see :ref:`PortType`) and ``name``. + +---- + +.. _class_VisualShaderNodeGroupBase_method_clear_input_ports: + +- void **clear_input_ports** **(** **)** + +Removes all previously specified input ports. + +---- + +.. _class_VisualShaderNodeGroupBase_method_clear_output_ports: + +- void **clear_output_ports** **(** **)** + +Removes all previously specified output ports. + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_free_input_port_id: + +- :ref:`int` **get_free_input_port_id** **(** **)** |const| + +Returns a free input port ID which can be used in :ref:`add_input_port`. + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_free_output_port_id: + +- :ref:`int` **get_free_output_port_id** **(** **)** |const| + +Returns a free output port ID which can be used in :ref:`add_output_port`. + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_input_port_count: + +- :ref:`int` **get_input_port_count** **(** **)** |const| + +Returns the number of input ports in use. Alternative for :ref:`get_free_input_port_id`. + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_inputs: + +- :ref:`String` **get_inputs** **(** **)** |const| + +Returns a :ref:`String` description of the input ports as a colon-separated list using the format ``id,type,name;`` (see :ref:`add_input_port`). + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_output_port_count: + +- :ref:`int` **get_output_port_count** **(** **)** |const| + +Returns the number of output ports in use. Alternative for :ref:`get_free_output_port_id`. + +---- + +.. _class_VisualShaderNodeGroupBase_method_get_outputs: + +- :ref:`String` **get_outputs** **(** **)** |const| + +Returns a :ref:`String` description of the output ports as a colon-separated list using the format ``id,type,name;`` (see :ref:`add_output_port`). + +---- + +.. _class_VisualShaderNodeGroupBase_method_has_input_port: + +- :ref:`bool` **has_input_port** **(** :ref:`int` id **)** |const| + +Returns ``true`` if the specified input port exists. + +---- + +.. _class_VisualShaderNodeGroupBase_method_has_output_port: + +- :ref:`bool` **has_output_port** **(** :ref:`int` id **)** |const| + +Returns ``true`` if the specified output port exists. + +---- + +.. _class_VisualShaderNodeGroupBase_method_is_valid_port_name: + +- :ref:`bool` **is_valid_port_name** **(** :ref:`String` name **)** |const| + +Returns ``true`` if the specified port name does not override an existed port name and is valid within the shader. + +---- + +.. _class_VisualShaderNodeGroupBase_method_remove_input_port: + +- void **remove_input_port** **(** :ref:`int` id **)** + +Removes the specified input port. + +---- + +.. _class_VisualShaderNodeGroupBase_method_remove_output_port: + +- void **remove_output_port** **(** :ref:`int` id **)** + +Removes the specified output port. + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_input_port_name: + +- void **set_input_port_name** **(** :ref:`int` id, :ref:`String` name **)** + +Renames the specified input port. + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_input_port_type: + +- void **set_input_port_type** **(** :ref:`int` id, :ref:`int` type **)** + +Sets the specified input port's type (see :ref:`PortType`). + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_inputs: + +- void **set_inputs** **(** :ref:`String` inputs **)** + +Defines all input ports using a :ref:`String` formatted as a colon-separated list: ``id,type,name;`` (see :ref:`add_input_port`). + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_output_port_name: + +- void **set_output_port_name** **(** :ref:`int` id, :ref:`String` name **)** + +Renames the specified output port. + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_output_port_type: + +- void **set_output_port_type** **(** :ref:`int` id, :ref:`int` type **)** + +Sets the specified output port's type (see :ref:`PortType`). + +---- + +.. _class_VisualShaderNodeGroupBase_method_set_outputs: + +- void **set_outputs** **(** :ref:`String` outputs **)** + +Defines all output ports using a :ref:`String` formatted as a colon-separated list: ``id,type,name;`` (see :ref:`add_output_port`). + +.. |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.)` diff --git a/classes/class_visualshadernodeif.rst b/classes/class_visualshadernodeif.rst new file mode 100644 index 0000000..0879507 --- /dev/null +++ b/classes/class_visualshadernodeif.rst @@ -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 VisualShaderNodeIf.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeIf: + +VisualShaderNodeIf +================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_visualshadernodeinput.rst b/classes/class_visualshadernodeinput.rst new file mode 100644 index 0000000..6452a51 --- /dev/null +++ b/classes/class_visualshadernodeinput.rst @@ -0,0 +1,73 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeInput.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeInput: + +VisualShaderNodeInput +===================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Description +----------- + +Gives access to input variables (built-ins) available for the shader. See the shading reference for the list of available built-ins for each shader type (check ``Tutorials`` section for link). + +Tutorials +--------- + +- :doc:`../tutorials/shaders/shader_reference/index` + +Properties +---------- + ++-----------------------------+--------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`input_name` | ``"[None]"`` | ++-----------------------------+--------------------------------------------------------------------+--------------+ + +Methods +------- + ++-----------------------------+--------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_input_real_name` **(** **)** |const| | ++-----------------------------+--------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_VisualShaderNodeInput_signal_input_type_changed: + +- **input_type_changed** **(** **)** + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeInput_property_input_name: + +- :ref:`String` **input_name** + ++-----------+-----------------------+ +| *Default* | ``"[None]"`` | ++-----------+-----------------------+ +| *Setter* | set_input_name(value) | ++-----------+-----------------------+ +| *Getter* | get_input_name() | ++-----------+-----------------------+ + +One of the several input constants in lower-case style like: "vertex"(``VERTEX``) or "point_size"(``POINT_SIZE``). + +Method Descriptions +------------------- + +.. _class_VisualShaderNodeInput_method_get_input_real_name: + +- :ref:`String` **get_input_real_name** **(** **)** |const| + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_visualshadernodeis.rst b/classes/class_visualshadernodeis.rst new file mode 100644 index 0000000..f0205a7 --- /dev/null +++ b/classes/class_visualshadernodeis.rst @@ -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 VisualShaderNodeIs.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeIs: + +VisualShaderNodeIs +================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A boolean comparison operator to be used within the visual shader graph. + +Description +----------- + +Returns the boolean result of the comparison between ``INF`` or ``NaN`` and a scalar parameter. + +Properties +---------- + ++---------------------------------------------------+-------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++---------------------------------------------------+-------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeIs_Function: + +.. _class_VisualShaderNodeIs_constant_FUNC_IS_INF: + +.. _class_VisualShaderNodeIs_constant_FUNC_IS_NAN: + +enum **Function**: + +- **FUNC_IS_INF** = **0** --- Comparison with ``INF`` (Infinity). + +- **FUNC_IS_NAN** = **1** --- Comparison with ``NaN`` (Not a Number; denotes invalid numeric results, e.g. division by zero). + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeIs_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The comparison function. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodeouterproduct.rst b/classes/class_visualshadernodeouterproduct.rst new file mode 100644 index 0000000..bcdeec3 --- /dev/null +++ b/classes/class_visualshadernodeouterproduct.rst @@ -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 VisualShaderNodeOuterProduct.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeOuterProduct: + +VisualShaderNodeOuterProduct +============================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates an outer product of two vectors within the visual shader graph. + +Description +----------- + +``OuterProduct`` treats the first parameter ``c`` as a column vector (matrix with one column) and the second parameter ``r`` as a row vector (matrix with one row) and does a linear algebraic matrix multiply ``c * r``, yielding a matrix whose number of rows is the number of components in ``c`` and whose number of columns is the number of components in ``r``. + +.. |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.)` diff --git a/classes/class_visualshadernodeoutput.rst b/classes/class_visualshadernodeoutput.rst new file mode 100644 index 0000000..8b25e3b --- /dev/null +++ b/classes/class_visualshadernodeoutput.rst @@ -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 VisualShaderNodeOutput.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeOutput: + +VisualShaderNodeOutput +====================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Represents the output shader parameters within the visual shader graph. + +Description +----------- + +This visual shader node is present in all shader graphs in form of "Output" block with multiple output value ports. + +.. |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.)` diff --git a/classes/class_visualshadernodescalarclamp.rst b/classes/class_visualshadernodescalarclamp.rst new file mode 100644 index 0000000..f7433be --- /dev/null +++ b/classes/class_visualshadernodescalarclamp.rst @@ -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 VisualShaderNodeScalarClamp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarClamp: + +VisualShaderNodeScalarClamp +=========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Clamps a scalar value within the visual shader graph. + +Description +----------- + +Constrains a value to lie between ``min`` and ``max`` values. + +.. |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.)` diff --git a/classes/class_visualshadernodescalarconstant.rst b/classes/class_visualshadernodescalarconstant.rst new file mode 100644 index 0000000..5833464 --- /dev/null +++ b/classes/class_visualshadernodescalarconstant.rst @@ -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 VisualShaderNodeScalarConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarConstant: + +VisualShaderNodeScalarConstant +============================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------+-------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`constant` | ``0.0`` | ++---------------------------+-------------------------------------------------------------------------+---------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeScalarConstant_property_constant: + +- :ref:`float` **constant** + ++-----------+---------------------+ +| *Default* | ``0.0`` | ++-----------+---------------------+ +| *Setter* | set_constant(value) | ++-----------+---------------------+ +| *Getter* | get_constant() | ++-----------+---------------------+ + +.. |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.)` diff --git a/classes/class_visualshadernodescalarderivativefunc.rst b/classes/class_visualshadernodescalarderivativefunc.rst new file mode 100644 index 0000000..21debbe --- /dev/null +++ b/classes/class_visualshadernodescalarderivativefunc.rst @@ -0,0 +1,66 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeScalarDerivativeFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarDerivativeFunc: + +VisualShaderNodeScalarDerivativeFunc +==================================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a scalar derivative within the visual shader graph. + +Description +----------- + +This node is only available in ``Fragment`` and ``Light`` visual shaders. + +Properties +---------- + ++---------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeScalarDerivativeFunc_Function: + +.. _class_VisualShaderNodeScalarDerivativeFunc_constant_FUNC_SUM: + +.. _class_VisualShaderNodeScalarDerivativeFunc_constant_FUNC_X: + +.. _class_VisualShaderNodeScalarDerivativeFunc_constant_FUNC_Y: + +enum **Function**: + +- **FUNC_SUM** = **0** --- Sum of absolute derivative in ``x`` and ``y``. + +- **FUNC_X** = **1** --- Derivative in ``x`` using local differencing. + +- **FUNC_Y** = **2** --- Derivative in ``y`` using local differencing. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeScalarDerivativeFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The derivative type. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodescalarfunc.rst b/classes/class_visualshadernodescalarfunc.rst new file mode 100644 index 0000000..84e2b5b --- /dev/null +++ b/classes/class_visualshadernodescalarfunc.rst @@ -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 VisualShaderNodeScalarFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarFunc: + +VisualShaderNodeScalarFunc +========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++-----------------------------------------------------------+---------------------------------------------------------------------+--------+ +| :ref:`Function` | :ref:`function` | ``13`` | ++-----------------------------------------------------------+---------------------------------------------------------------------+--------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeScalarFunc_Function: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_SIN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_COS: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_TAN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ASIN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ACOS: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ATAN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_SINH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_COSH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_TANH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_LOG: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_EXP: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_SQRT: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ABS: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_SIGN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_FLOOR: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ROUND: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_CEIL: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_FRAC: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_SATURATE: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_NEGATE: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ACOSH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ASINH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ATANH: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_DEGREES: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_EXP2: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_INVERSE_SQRT: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_LOG2: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_RADIANS: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_RECIPROCAL: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ROUNDEVEN: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_TRUNC: + +.. _class_VisualShaderNodeScalarFunc_constant_FUNC_ONEMINUS: + +enum **Function**: + +- **FUNC_SIN** = **0** + +- **FUNC_COS** = **1** + +- **FUNC_TAN** = **2** + +- **FUNC_ASIN** = **3** + +- **FUNC_ACOS** = **4** + +- **FUNC_ATAN** = **5** + +- **FUNC_SINH** = **6** + +- **FUNC_COSH** = **7** + +- **FUNC_TANH** = **8** + +- **FUNC_LOG** = **9** + +- **FUNC_EXP** = **10** + +- **FUNC_SQRT** = **11** + +- **FUNC_ABS** = **12** + +- **FUNC_SIGN** = **13** + +- **FUNC_FLOOR** = **14** + +- **FUNC_ROUND** = **15** + +- **FUNC_CEIL** = **16** + +- **FUNC_FRAC** = **17** + +- **FUNC_SATURATE** = **18** + +- **FUNC_NEGATE** = **19** + +- **FUNC_ACOSH** = **20** + +- **FUNC_ASINH** = **21** + +- **FUNC_ATANH** = **22** + +- **FUNC_DEGREES** = **23** + +- **FUNC_EXP2** = **24** + +- **FUNC_INVERSE_SQRT** = **25** + +- **FUNC_LOG2** = **26** + +- **FUNC_RADIANS** = **27** + +- **FUNC_RECIPROCAL** = **28** + +- **FUNC_ROUNDEVEN** = **29** + +- **FUNC_TRUNC** = **30** + +- **FUNC_ONEMINUS** = **31** + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeScalarFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``13`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +.. |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.)` diff --git a/classes/class_visualshadernodescalarinterp.rst b/classes/class_visualshadernodescalarinterp.rst new file mode 100644 index 0000000..ad554dc --- /dev/null +++ b/classes/class_visualshadernodescalarinterp.rst @@ -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 VisualShaderNodeScalarInterp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarInterp: + +VisualShaderNodeScalarInterp +============================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Linearly interpolates between two scalars within the visual shader graph. + +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodescalarop.rst b/classes/class_visualshadernodescalarop.rst new file mode 100644 index 0000000..e03d1f8 --- /dev/null +++ b/classes/class_visualshadernodescalarop.rst @@ -0,0 +1,87 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeScalarOp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarOp: + +VisualShaderNodeScalarOp +======================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + + + +Properties +---------- + ++---------------------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`Operator` | :ref:`operator` | ``0`` | ++---------------------------------------------------------+-------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeScalarOp_Operator: + +.. _class_VisualShaderNodeScalarOp_constant_OP_ADD: + +.. _class_VisualShaderNodeScalarOp_constant_OP_SUB: + +.. _class_VisualShaderNodeScalarOp_constant_OP_MUL: + +.. _class_VisualShaderNodeScalarOp_constant_OP_DIV: + +.. _class_VisualShaderNodeScalarOp_constant_OP_MOD: + +.. _class_VisualShaderNodeScalarOp_constant_OP_POW: + +.. _class_VisualShaderNodeScalarOp_constant_OP_MAX: + +.. _class_VisualShaderNodeScalarOp_constant_OP_MIN: + +.. _class_VisualShaderNodeScalarOp_constant_OP_ATAN2: + +.. _class_VisualShaderNodeScalarOp_constant_OP_STEP: + +enum **Operator**: + +- **OP_ADD** = **0** + +- **OP_SUB** = **1** + +- **OP_MUL** = **2** + +- **OP_DIV** = **3** + +- **OP_MOD** = **4** + +- **OP_POW** = **5** + +- **OP_MAX** = **6** + +- **OP_MIN** = **7** + +- **OP_ATAN2** = **8** + +- **OP_STEP** = **9** + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeScalarOp_property_operator: + +- :ref:`Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +.. |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.)` diff --git a/classes/class_visualshadernodescalarsmoothstep.rst b/classes/class_visualshadernodescalarsmoothstep.rst new file mode 100644 index 0000000..7a05535 --- /dev/null +++ b/classes/class_visualshadernodescalarsmoothstep.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeScalarSmoothStep.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarSmoothStep: + +VisualShaderNodeScalarSmoothStep +================================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a scalar SmoothStep function within the visual shader graph. + +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. + +.. |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.)` diff --git a/classes/class_visualshadernodescalarswitch.rst b/classes/class_visualshadernodescalarswitch.rst new file mode 100644 index 0000000..37270d7 --- /dev/null +++ b/classes/class_visualshadernodescalarswitch.rst @@ -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 VisualShaderNodeScalarSwitch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarSwitch: + +VisualShaderNodeScalarSwitch +============================ + +**Inherits:** :ref:`VisualShaderNodeSwitch` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A boolean/scalar function for use within the visual shader graph. + +Description +----------- + +Returns an associated scalar if the provided boolean value is ``true`` or ``false``. + +.. |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.)` diff --git a/classes/class_visualshadernodescalaruniform.rst b/classes/class_visualshadernodescalaruniform.rst new file mode 100644 index 0000000..547baff --- /dev/null +++ b/classes/class_visualshadernodescalaruniform.rst @@ -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 VisualShaderNodeScalarUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeScalarUniform: + +VisualShaderNodeScalarUniform +============================= + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_visualshadernodeswitch.rst b/classes/class_visualshadernodeswitch.rst new file mode 100644 index 0000000..4d87460 --- /dev/null +++ b/classes/class_visualshadernodeswitch.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeSwitch.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeSwitch: + +VisualShaderNodeSwitch +====================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeScalarSwitch` + +A boolean/vector function for use within the visual shader graph. + +Description +----------- + +Returns an associated vector if the provided boolean value is ``true`` or ``false``. + +.. |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.)` diff --git a/classes/class_visualshadernodetexture.rst b/classes/class_visualshadernodetexture.rst new file mode 100644 index 0000000..8409643 --- /dev/null +++ b/classes/class_visualshadernodetexture.rst @@ -0,0 +1,130 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeTexture.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTexture: + +VisualShaderNodeTexture +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Performs a texture lookup within the visual shader graph. + +Description +----------- + +Performs a lookup operation on the provided texture, with support for multiple texture sources to choose from. + +Properties +---------- + ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`Source` | :ref:`source` | ``0`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`Texture` | :ref:`texture` | | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ +| :ref:`TextureType` | :ref:`texture_type` | ``0`` | ++--------------------------------------------------------------+--------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeTexture_Source: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_TEXTURE: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_SCREEN: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_2D_TEXTURE: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_2D_NORMAL: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_DEPTH: + +.. _class_VisualShaderNodeTexture_constant_SOURCE_PORT: + +enum **Source**: + +- **SOURCE_TEXTURE** = **0** --- Use the texture given as an argument for this function. + +- **SOURCE_SCREEN** = **1** --- Use the current viewport's texture as the source. + +- **SOURCE_2D_TEXTURE** = **2** --- Use the texture from this shader's texture built-in (e.g. a texture of a :ref:`Sprite`). + +- **SOURCE_2D_NORMAL** = **3** --- Use the texture from this shader's normal map built-in. + +- **SOURCE_DEPTH** = **4** --- Use the depth texture available for this shader. + +- **SOURCE_PORT** = **5** --- Use the texture provided in the input port for this function. + +---- + +.. _enum_VisualShaderNodeTexture_TextureType: + +.. _class_VisualShaderNodeTexture_constant_TYPE_DATA: + +.. _class_VisualShaderNodeTexture_constant_TYPE_COLOR: + +.. _class_VisualShaderNodeTexture_constant_TYPE_NORMALMAP: + +enum **TextureType**: + +- **TYPE_DATA** = **0** --- No hints are added to the uniform declaration. + +- **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion. + +- **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTexture_property_source: + +- :ref:`Source` **source** + ++-----------+-------------------+ +| *Default* | ``0`` | ++-----------+-------------------+ +| *Setter* | set_source(value) | ++-----------+-------------------+ +| *Getter* | get_source() | ++-----------+-------------------+ + +Determines the source for the lookup. See :ref:`Source` for options. + +---- + +.. _class_VisualShaderNodeTexture_property_texture: + +- :ref:`Texture` **texture** + ++----------+--------------------+ +| *Setter* | set_texture(value) | ++----------+--------------------+ +| *Getter* | get_texture() | ++----------+--------------------+ + +The source texture, if needed for the selected :ref:`source`. + +---- + +.. _class_VisualShaderNodeTexture_property_texture_type: + +- :ref:`TextureType` **texture_type** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_texture_type(value) | ++-----------+-------------------------+ +| *Getter* | get_texture_type() | ++-----------+-------------------------+ + +Specifies the type of the texture if :ref:`source` is set to :ref:`SOURCE_TEXTURE`. See :ref:`TextureType` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodetextureuniform.rst b/classes/class_visualshadernodetextureuniform.rst new file mode 100644 index 0000000..f0535b9 --- /dev/null +++ b/classes/class_visualshadernodetextureuniform.rst @@ -0,0 +1,104 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeTextureUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTextureUniform: + +VisualShaderNodeTextureUniform +============================== + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeCubeMapUniform`, :ref:`VisualShaderNodeTextureUniformTriplanar` + +Performs a uniform texture lookup within the visual shader graph. + +Description +----------- + +Performs a lookup operation on the texture provided as a uniform for the shader. + +Properties +---------- + ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------+ +| :ref:`ColorDefault` | :ref:`color_default` | ``0`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------+ +| :ref:`TextureType` | :ref:`texture_type` | ``0`` | ++-----------------------------------------------------------------------+-----------------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeTextureUniform_TextureType: + +.. _class_VisualShaderNodeTextureUniform_constant_TYPE_DATA: + +.. _class_VisualShaderNodeTextureUniform_constant_TYPE_COLOR: + +.. _class_VisualShaderNodeTextureUniform_constant_TYPE_NORMALMAP: + +.. _class_VisualShaderNodeTextureUniform_constant_TYPE_ANISO: + +enum **TextureType**: + +- **TYPE_DATA** = **0** --- No hints are added to the uniform declaration. + +- **TYPE_COLOR** = **1** --- Adds ``hint_albedo`` as hint to the uniform declaration for proper sRGB to linear conversion. + +- **TYPE_NORMALMAP** = **2** --- Adds ``hint_normal`` as hint to the uniform declaration, which internally converts the texture for proper usage as normal map. + +- **TYPE_ANISO** = **3** --- Adds ``hint_aniso`` as hint to the uniform declaration to use for a flowmap. + +---- + +.. _enum_VisualShaderNodeTextureUniform_ColorDefault: + +.. _class_VisualShaderNodeTextureUniform_constant_COLOR_DEFAULT_WHITE: + +.. _class_VisualShaderNodeTextureUniform_constant_COLOR_DEFAULT_BLACK: + +enum **ColorDefault**: + +- **COLOR_DEFAULT_WHITE** = **0** --- Defaults to white color. + +- **COLOR_DEFAULT_BLACK** = **1** --- Defaults to black color. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTextureUniform_property_color_default: + +- :ref:`ColorDefault` **color_default** + ++-----------+--------------------------+ +| *Default* | ``0`` | ++-----------+--------------------------+ +| *Setter* | set_color_default(value) | ++-----------+--------------------------+ +| *Getter* | get_color_default() | ++-----------+--------------------------+ + +Sets the default color if no texture is assigned to the uniform. + +---- + +.. _class_VisualShaderNodeTextureUniform_property_texture_type: + +- :ref:`TextureType` **texture_type** + ++-----------+-------------------------+ +| *Default* | ``0`` | ++-----------+-------------------------+ +| *Setter* | set_texture_type(value) | ++-----------+-------------------------+ +| *Getter* | get_texture_type() | ++-----------+-------------------------+ + +Defines the type of data provided by the source texture. See :ref:`TextureType` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodetextureuniformtriplanar.rst b/classes/class_visualshadernodetextureuniformtriplanar.rst new file mode 100644 index 0000000..7d0ed7e --- /dev/null +++ b/classes/class_visualshadernodetextureuniformtriplanar.rst @@ -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 VisualShaderNodeTextureUniformTriplanar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTextureUniformTriplanar: + +VisualShaderNodeTextureUniformTriplanar +======================================= + +**Inherits:** :ref:`VisualShaderNodeTextureUniform` **<** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Performs a uniform texture lookup with triplanar within the visual shader graph. + +Description +----------- + +Performs a lookup operation on the texture provided as a uniform for the shader, with support for triplanar mapping. + +.. |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.)` diff --git a/classes/class_visualshadernodetransformcompose.rst b/classes/class_visualshadernodetransformcompose.rst new file mode 100644 index 0000000..fa2ce30 --- /dev/null +++ b/classes/class_visualshadernodetransformcompose.rst @@ -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 VisualShaderNodeTransformCompose.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformCompose: + +VisualShaderNodeTransformCompose +================================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Composes a :ref:`Transform` from four :ref:`Vector3`\ s within the visual shader graph. + +Description +----------- + +Creates a 4x4 transform matrix using four vectors of type ``vec3``. Each vector is one row in the matrix and the last column is a ``vec4(0, 0, 0, 1)``. + +.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)` +.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)` +.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)` diff --git a/classes/class_visualshadernodetransformconstant.rst b/classes/class_visualshadernodetransformconstant.rst new file mode 100644 index 0000000..19fae61 --- /dev/null +++ b/classes/class_visualshadernodetransformconstant.rst @@ -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 VisualShaderNodeTransformConstant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformConstant: + +VisualShaderNodeTransformConstant +================================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Transform` constant for use within the visual shader graph. + +Description +----------- + +A constant :ref:`Transform`, which can be used as an input node. + +Properties +---------- + ++-----------------------------------+----------------------------------------------------------------------------+-----------------------------------------------------+ +| :ref:`Transform` | :ref:`constant` | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------------------------------+----------------------------------------------------------------------------+-----------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTransformConstant_property_constant: + +- :ref:`Transform` **constant** + ++-----------+-----------------------------------------------------+ +| *Default* | ``Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0 )`` | ++-----------+-----------------------------------------------------+ +| *Setter* | set_constant(value) | ++-----------+-----------------------------------------------------+ +| *Getter* | get_constant() | ++-----------+-----------------------------------------------------+ + +A :ref:`Transform` constant which represents the state of this 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.)` diff --git a/classes/class_visualshadernodetransformdecompose.rst b/classes/class_visualshadernodetransformdecompose.rst new file mode 100644 index 0000000..a2e7c31 --- /dev/null +++ b/classes/class_visualshadernodetransformdecompose.rst @@ -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 VisualShaderNodeTransformDecompose.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformDecompose: + +VisualShaderNodeTransformDecompose +================================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Decomposes a :ref:`Transform` into four :ref:`Vector3`\ s within the visual shader graph. + +Description +----------- + +Takes a 4x4 transform matrix and decomposes it into four ``vec3`` values, one from each row of the matrix. + +.. |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.)` diff --git a/classes/class_visualshadernodetransformfunc.rst b/classes/class_visualshadernodetransformfunc.rst new file mode 100644 index 0000000..fe3bd9a --- /dev/null +++ b/classes/class_visualshadernodetransformfunc.rst @@ -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 VisualShaderNodeTransformFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformFunc: + +VisualShaderNodeTransformFunc +============================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Computes a :ref:`Transform` function within the visual shader graph. + +Description +----------- + +Computes an inverse or transpose function on the provided :ref:`Transform`. + +Properties +---------- + ++--------------------------------------------------------------+------------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++--------------------------------------------------------------+------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeTransformFunc_Function: + +.. _class_VisualShaderNodeTransformFunc_constant_FUNC_INVERSE: + +.. _class_VisualShaderNodeTransformFunc_constant_FUNC_TRANSPOSE: + +enum **Function**: + +- **FUNC_INVERSE** = **0** --- Perform the inverse operation on the :ref:`Transform` matrix. + +- **FUNC_TRANSPOSE** = **1** --- Perform the transpose operation on the :ref:`Transform` matrix. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTransformFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The function to be computed. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodetransformmult.rst b/classes/class_visualshadernodetransformmult.rst new file mode 100644 index 0000000..dc9cb45 --- /dev/null +++ b/classes/class_visualshadernodetransformmult.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeTransformMult.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformMult: + +VisualShaderNodeTransformMult +============================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Multiplies :ref:`Transform` by :ref:`Transform` within the visual shader graph. + +Description +----------- + +A multiplication operation on two transforms (4x4 matrices), with support for different multiplication operators. + +Properties +---------- + ++--------------------------------------------------------------+------------------------------------------------------------------------+-------+ +| :ref:`Operator` | :ref:`operator` | ``0`` | ++--------------------------------------------------------------+------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeTransformMult_Operator: + +.. _class_VisualShaderNodeTransformMult_constant_OP_AxB: + +.. _class_VisualShaderNodeTransformMult_constant_OP_BxA: + +.. _class_VisualShaderNodeTransformMult_constant_OP_AxB_COMP: + +.. _class_VisualShaderNodeTransformMult_constant_OP_BxA_COMP: + +enum **Operator**: + +- **OP_AxB** = **0** --- Multiplies transform ``a`` by the transform ``b``. + +- **OP_BxA** = **1** --- Multiplies transform ``b`` by the transform ``a``. + +- **OP_AxB_COMP** = **2** --- Performs a component-wise multiplication of transform ``a`` by the transform ``b``. + +- **OP_BxA_COMP** = **3** --- Performs a component-wise multiplication of transform ``b`` by the transform ``a``. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTransformMult_property_operator: + +- :ref:`Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +The multiplication type to be performed on the transforms. See :ref:`Operator` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodetransformuniform.rst b/classes/class_visualshadernodetransformuniform.rst new file mode 100644 index 0000000..969a026 --- /dev/null +++ b/classes/class_visualshadernodetransformuniform.rst @@ -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 VisualShaderNodeTransformUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformUniform: + +VisualShaderNodeTransformUniform +================================ + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Transform` uniform for use within the visual shader graph. + +Description +----------- + +Translated to ``uniform mat4`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodetransformvecmult.rst b/classes/class_visualshadernodetransformvecmult.rst new file mode 100644 index 0000000..661a74a --- /dev/null +++ b/classes/class_visualshadernodetransformvecmult.rst @@ -0,0 +1,70 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeTransformVecMult.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeTransformVecMult: + +VisualShaderNodeTransformVecMult +================================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Multiplies a :ref:`Transform` and a :ref:`Vector3` within the visual shader graph. + +Description +----------- + +A multiplication operation on a transform (4x4 matrix) and a vector, with support for different multiplication operators. + +Properties +---------- + ++-----------------------------------------------------------------+---------------------------------------------------------------------------+-------+ +| :ref:`Operator` | :ref:`operator` | ``0`` | ++-----------------------------------------------------------------+---------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeTransformVecMult_Operator: + +.. _class_VisualShaderNodeTransformVecMult_constant_OP_AxB: + +.. _class_VisualShaderNodeTransformVecMult_constant_OP_BxA: + +.. _class_VisualShaderNodeTransformVecMult_constant_OP_3x3_AxB: + +.. _class_VisualShaderNodeTransformVecMult_constant_OP_3x3_BxA: + +enum **Operator**: + +- **OP_AxB** = **0** --- Multiplies transform ``a`` by the vector ``b``. + +- **OP_BxA** = **1** --- Multiplies vector ``b`` by the transform ``a``. + +- **OP_3x3_AxB** = **2** --- Multiplies transform ``a`` by the vector ``b``, skipping the last row and column of the transform. + +- **OP_3x3_BxA** = **3** --- Multiplies vector ``b`` by the transform ``a``, skipping the last row and column of the transform. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeTransformVecMult_property_operator: + +- :ref:`Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +The multiplication type to be performed. See :ref:`Operator` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodeuniform.rst b/classes/class_visualshadernodeuniform.rst new file mode 100644 index 0000000..6b0bda8 --- /dev/null +++ b/classes/class_visualshadernodeuniform.rst @@ -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 VisualShaderNodeUniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeUniform: + +VisualShaderNodeUniform +======================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`VisualShaderNodeBooleanUniform`, :ref:`VisualShaderNodeColorUniform`, :ref:`VisualShaderNodeScalarUniform`, :ref:`VisualShaderNodeTextureUniform`, :ref:`VisualShaderNodeTransformUniform`, :ref:`VisualShaderNodeVec3Uniform` + +A base type for the uniforms within the visual shader graph. + +Description +----------- + +A uniform represents a variable in the shader which is set externally, i.e. from the :ref:`ShaderMaterial`. Uniforms are exposed as properties in the :ref:`ShaderMaterial` and can be assigned from the inspector or from a script. + +Properties +---------- + ++-----------------------------+--------------------------------------------------------------------------+--------+ +| :ref:`String` | :ref:`uniform_name` | ``""`` | ++-----------------------------+--------------------------------------------------------------------------+--------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeUniform_property_uniform_name: + +- :ref:`String` **uniform_name** + ++-----------+-------------------------+ +| *Default* | ``""`` | ++-----------+-------------------------+ +| *Setter* | set_uniform_name(value) | ++-----------+-------------------------+ +| *Getter* | get_uniform_name() | ++-----------+-------------------------+ + +Name of the uniform, by which it can be accessed through the :ref:`ShaderMaterial` properties. + +.. |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.)` diff --git a/classes/class_visualshadernodeuniformref.rst b/classes/class_visualshadernodeuniformref.rst new file mode 100644 index 0000000..686d99f --- /dev/null +++ b/classes/class_visualshadernodeuniformref.rst @@ -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 VisualShaderNodeUniformRef.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeUniformRef: + +VisualShaderNodeUniformRef +========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A reference to an existing :ref:`VisualShaderNodeUniform`. + +Description +----------- + +Creating a reference to a :ref:`VisualShaderNodeUniform` allows you to reuse this uniform in different shaders or shader stages easily. + +Properties +---------- + ++-----------------------------+-----------------------------------------------------------------------------+--------------+ +| :ref:`String` | :ref:`uniform_name` | ``"[None]"`` | ++-----------------------------+-----------------------------------------------------------------------------+--------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeUniformRef_property_uniform_name: + +- :ref:`String` **uniform_name** + ++-----------+-------------------------+ +| *Default* | ``"[None]"`` | ++-----------+-------------------------+ +| *Setter* | set_uniform_name(value) | ++-----------+-------------------------+ +| *Getter* | get_uniform_name() | ++-----------+-------------------------+ + +The name of the uniform which this reference points to. + +.. |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.)` diff --git a/classes/class_visualshadernodevec3constant.rst b/classes/class_visualshadernodevec3constant.rst new file mode 100644 index 0000000..c597b71 --- /dev/null +++ b/classes/class_visualshadernodevec3constant.rst @@ -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 VisualShaderNodeVec3Constant.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVec3Constant: + +VisualShaderNodeVec3Constant +============================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Vector3` constant to be used within the visual shader graph. + +Description +----------- + +A constant :ref:`Vector3`, which can be used as an input node. + +Properties +---------- + ++-------------------------------+-----------------------------------------------------------------------+------------------------+ +| :ref:`Vector3` | :ref:`constant` | ``Vector3( 0, 0, 0 )`` | ++-------------------------------+-----------------------------------------------------------------------+------------------------+ + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeVec3Constant_property_constant: + +- :ref:`Vector3` **constant** + ++-----------+------------------------+ +| *Default* | ``Vector3( 0, 0, 0 )`` | ++-----------+------------------------+ +| *Setter* | set_constant(value) | ++-----------+------------------------+ +| *Getter* | get_constant() | ++-----------+------------------------+ + +A :ref:`Vector3` constant which represents the state of this 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.)` diff --git a/classes/class_visualshadernodevec3uniform.rst b/classes/class_visualshadernodevec3uniform.rst new file mode 100644 index 0000000..b6647b5 --- /dev/null +++ b/classes/class_visualshadernodevec3uniform.rst @@ -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 VisualShaderNodeVec3Uniform.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVec3Uniform: + +VisualShaderNodeVec3Uniform +=========================== + +**Inherits:** :ref:`VisualShaderNodeUniform` **<** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A :ref:`Vector3` uniform to be used within the visual shader graph. + +Description +----------- + +Translated to ``uniform vec3`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorclamp.rst b/classes/class_visualshadernodevectorclamp.rst new file mode 100644 index 0000000..460de52 --- /dev/null +++ b/classes/class_visualshadernodevectorclamp.rst @@ -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 VisualShaderNodeVectorClamp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorClamp: + +VisualShaderNodeVectorClamp +=========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Clamps a vector value within the visual shader graph. + +Description +----------- + +Constrains a value to lie between ``min`` and ``max`` values. The operation is performed on each component of the vector individually. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorcompose.rst b/classes/class_visualshadernodevectorcompose.rst new file mode 100644 index 0000000..7a2186b --- /dev/null +++ b/classes/class_visualshadernodevectorcompose.rst @@ -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 VisualShaderNodeVectorCompose.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorCompose: + +VisualShaderNodeVectorCompose +============================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Composes a :ref:`Vector3` from three scalars within the visual shader graph. + +Description +----------- + +Creates a ``vec3`` using three scalar values that can be provided from separate inputs. + +.. |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.)` diff --git a/classes/class_visualshadernodevectordecompose.rst b/classes/class_visualshadernodevectordecompose.rst new file mode 100644 index 0000000..5bc22f5 --- /dev/null +++ b/classes/class_visualshadernodevectordecompose.rst @@ -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 VisualShaderNodeVectorDecompose.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorDecompose: + +VisualShaderNodeVectorDecompose +=============================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Decomposes a :ref:`Vector3` into three scalars within the visual shader graph. + +Description +----------- + +Takes a ``vec3`` and decomposes it into three scalar values that can be used as separate inputs. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorderivativefunc.rst b/classes/class_visualshadernodevectorderivativefunc.rst new file mode 100644 index 0000000..cecb767 --- /dev/null +++ b/classes/class_visualshadernodevectorderivativefunc.rst @@ -0,0 +1,66 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorDerivativeFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorDerivativeFunc: + +VisualShaderNodeVectorDerivativeFunc +==================================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a vector derivative within the visual shader graph. + +Description +----------- + +This node is only available in ``Fragment`` and ``Light`` visual shaders. + +Properties +---------- + ++---------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++---------------------------------------------------------------------+-------------------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeVectorDerivativeFunc_Function: + +.. _class_VisualShaderNodeVectorDerivativeFunc_constant_FUNC_SUM: + +.. _class_VisualShaderNodeVectorDerivativeFunc_constant_FUNC_X: + +.. _class_VisualShaderNodeVectorDerivativeFunc_constant_FUNC_Y: + +enum **Function**: + +- **FUNC_SUM** = **0** --- Sum of absolute derivative in ``x`` and ``y``. + +- **FUNC_X** = **1** --- Derivative in ``x`` using local differencing. + +- **FUNC_Y** = **2** --- Derivative in ``y`` using local differencing. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeVectorDerivativeFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +A derivative type. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodevectordistance.rst b/classes/class_visualshadernodevectordistance.rst new file mode 100644 index 0000000..52edde8 --- /dev/null +++ b/classes/class_visualshadernodevectordistance.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorDistance.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorDistance: + +VisualShaderNodeVectorDistance +============================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Returns the distance between two points. To be used within the visual shader graph. + +Description +----------- + +Calculates distance from point represented by vector ``p0`` to vector ``p1``. + +Translated to ``distance(p0, p1)`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorfunc.rst b/classes/class_visualshadernodevectorfunc.rst new file mode 100644 index 0000000..24f82d3 --- /dev/null +++ b/classes/class_visualshadernodevectorfunc.rst @@ -0,0 +1,194 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorFunc.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorFunc: + +VisualShaderNodeVectorFunc +========================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A vector function to be used within the visual shader graph. + +Description +----------- + +A visual shader node able to perform different functions using vectors. + +Properties +---------- + ++-----------------------------------------------------------+---------------------------------------------------------------------+-------+ +| :ref:`Function` | :ref:`function` | ``0`` | ++-----------------------------------------------------------+---------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeVectorFunc_Function: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_NORMALIZE: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_SATURATE: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_NEGATE: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_RECIPROCAL: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_RGB2HSV: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_HSV2RGB: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ABS: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ACOS: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ACOSH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ASIN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ASINH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ATAN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ATANH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_CEIL: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_COS: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_COSH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_DEGREES: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_EXP: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_EXP2: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_FLOOR: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_FRAC: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_INVERSE_SQRT: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_LOG: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_LOG2: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_RADIANS: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ROUND: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ROUNDEVEN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_SIGN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_SIN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_SINH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_SQRT: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_TAN: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_TANH: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_TRUNC: + +.. _class_VisualShaderNodeVectorFunc_constant_FUNC_ONEMINUS: + +enum **Function**: + +- **FUNC_NORMALIZE** = **0** --- Normalizes the vector so that it has a length of ``1`` but points in the same direction. + +- **FUNC_SATURATE** = **1** --- Clamps the value between ``0.0`` and ``1.0``. + +- **FUNC_NEGATE** = **2** --- Returns the opposite value of the parameter. + +- **FUNC_RECIPROCAL** = **3** --- Returns ``1/vector``. + +- **FUNC_RGB2HSV** = **4** --- Converts RGB vector to HSV equivalent. + +- **FUNC_HSV2RGB** = **5** --- Converts HSV vector to RGB equivalent. + +- **FUNC_ABS** = **6** --- Returns the absolute value of the parameter. + +- **FUNC_ACOS** = **7** --- Returns the arc-cosine of the parameter. + +- **FUNC_ACOSH** = **8** --- Returns the inverse hyperbolic cosine of the parameter. + +- **FUNC_ASIN** = **9** --- Returns the arc-sine of the parameter. + +- **FUNC_ASINH** = **10** --- Returns the inverse hyperbolic sine of the parameter. + +- **FUNC_ATAN** = **11** --- Returns the arc-tangent of the parameter. + +- **FUNC_ATANH** = **12** --- Returns the inverse hyperbolic tangent of the parameter. + +- **FUNC_CEIL** = **13** --- Finds the nearest integer that is greater than or equal to the parameter. + +- **FUNC_COS** = **14** --- Returns the cosine of the parameter. + +- **FUNC_COSH** = **15** --- Returns the hyperbolic cosine of the parameter. + +- **FUNC_DEGREES** = **16** --- Converts a quantity in radians to degrees. + +- **FUNC_EXP** = **17** --- Base-e Exponential. + +- **FUNC_EXP2** = **18** --- Base-2 Exponential. + +- **FUNC_FLOOR** = **19** --- Finds the nearest integer less than or equal to the parameter. + +- **FUNC_FRAC** = **20** --- Computes the fractional part of the argument. + +- **FUNC_INVERSE_SQRT** = **21** --- Returns the inverse of the square root of the parameter. + +- **FUNC_LOG** = **22** --- Natural logarithm. + +- **FUNC_LOG2** = **23** --- Base-2 logarithm. + +- **FUNC_RADIANS** = **24** --- Converts a quantity in degrees to radians. + +- **FUNC_ROUND** = **25** --- Finds the nearest integer to the parameter. + +- **FUNC_ROUNDEVEN** = **26** --- Finds the nearest even integer to the parameter. + +- **FUNC_SIGN** = **27** --- Extracts the sign of the parameter, i.e. returns ``-1`` if the parameter is negative, ``1`` if it's positive and ``0`` otherwise. + +- **FUNC_SIN** = **28** --- Returns the sine of the parameter. + +- **FUNC_SINH** = **29** --- Returns the hyperbolic sine of the parameter. + +- **FUNC_SQRT** = **30** --- Returns the square root of the parameter. + +- **FUNC_TAN** = **31** --- Returns the tangent of the parameter. + +- **FUNC_TANH** = **32** --- Returns the hyperbolic tangent of the parameter. + +- **FUNC_TRUNC** = **33** --- Returns a value equal to the nearest integer to the parameter whose absolute value is not larger than the absolute value of the parameter. + +- **FUNC_ONEMINUS** = **34** --- Returns ``1.0 - vector``. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeVectorFunc_property_function: + +- :ref:`Function` **function** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_function(value) | ++-----------+---------------------+ +| *Getter* | get_function() | ++-----------+---------------------+ + +The function to be performed. See :ref:`Function` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorinterp.rst b/classes/class_visualshadernodevectorinterp.rst new file mode 100644 index 0000000..e1bc4fd --- /dev/null +++ b/classes/class_visualshadernodevectorinterp.rst @@ -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 VisualShaderNodeVectorInterp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorInterp: + +VisualShaderNodeVectorInterp +============================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Linearly interpolates between two vectors within the visual shader graph. + +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language, where ``weight`` is a :ref:`Vector3` with weights for each component. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorlen.rst b/classes/class_visualshadernodevectorlen.rst new file mode 100644 index 0000000..9a466d5 --- /dev/null +++ b/classes/class_visualshadernodevectorlen.rst @@ -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 VisualShaderNodeVectorLen.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorLen: + +VisualShaderNodeVectorLen +========================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Returns the length of a :ref:`Vector3` within the visual shader graph. + +Description +----------- + +Translated to ``length(p0)`` in the shader language. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorop.rst b/classes/class_visualshadernodevectorop.rst new file mode 100644 index 0000000..b37d543 --- /dev/null +++ b/classes/class_visualshadernodevectorop.rst @@ -0,0 +1,102 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorOp.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorOp: + +VisualShaderNodeVectorOp +======================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +A vector operator to be used within the visual shader graph. + +Description +----------- + +A visual shader node for use of vector operators. Operates on vector ``a`` and vector ``b``. + +Properties +---------- + ++---------------------------------------------------------+-------------------------------------------------------------------+-------+ +| :ref:`Operator` | :ref:`operator` | ``0`` | ++---------------------------------------------------------+-------------------------------------------------------------------+-------+ + +Enumerations +------------ + +.. _enum_VisualShaderNodeVectorOp_Operator: + +.. _class_VisualShaderNodeVectorOp_constant_OP_ADD: + +.. _class_VisualShaderNodeVectorOp_constant_OP_SUB: + +.. _class_VisualShaderNodeVectorOp_constant_OP_MUL: + +.. _class_VisualShaderNodeVectorOp_constant_OP_DIV: + +.. _class_VisualShaderNodeVectorOp_constant_OP_MOD: + +.. _class_VisualShaderNodeVectorOp_constant_OP_POW: + +.. _class_VisualShaderNodeVectorOp_constant_OP_MAX: + +.. _class_VisualShaderNodeVectorOp_constant_OP_MIN: + +.. _class_VisualShaderNodeVectorOp_constant_OP_CROSS: + +.. _class_VisualShaderNodeVectorOp_constant_OP_ATAN2: + +.. _class_VisualShaderNodeVectorOp_constant_OP_REFLECT: + +.. _class_VisualShaderNodeVectorOp_constant_OP_STEP: + +enum **Operator**: + +- **OP_ADD** = **0** --- Adds two vectors. + +- **OP_SUB** = **1** --- Subtracts a vector from a vector. + +- **OP_MUL** = **2** --- Multiplies two vectors. + +- **OP_DIV** = **3** --- Divides vector by vector. + +- **OP_MOD** = **4** --- Returns the remainder of the two vectors. + +- **OP_POW** = **5** --- Returns the value of the first parameter raised to the power of the second, for each component of the vectors. + +- **OP_MAX** = **6** --- Returns the greater of two values, for each component of the vectors. + +- **OP_MIN** = **7** --- Returns the lesser of two values, for each component of the vectors. + +- **OP_CROSS** = **8** --- Calculates the cross product of two vectors. + +- **OP_ATAN2** = **9** --- Returns the arc-tangent of the parameters. + +- **OP_REFLECT** = **10** --- Returns the vector that points in the direction of reflection. ``a`` is incident vector and ``b`` is the normal vector. + +- **OP_STEP** = **11** --- Vector step operator. Returns ``0.0`` if ``a`` is smaller than ``b`` and ``1.0`` otherwise. + +Property Descriptions +--------------------- + +.. _class_VisualShaderNodeVectorOp_property_operator: + +- :ref:`Operator` **operator** + ++-----------+---------------------+ +| *Default* | ``0`` | ++-----------+---------------------+ +| *Setter* | set_operator(value) | ++-----------+---------------------+ +| *Getter* | get_operator() | ++-----------+---------------------+ + +The operator to be used. See :ref:`Operator` for options. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorrefract.rst b/classes/class_visualshadernodevectorrefract.rst new file mode 100644 index 0000000..2af8d6d --- /dev/null +++ b/classes/class_visualshadernodevectorrefract.rst @@ -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 VisualShaderNodeVectorRefract.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorRefract: + +VisualShaderNodeVectorRefract +============================= + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Returns the :ref:`Vector3` that points in the direction of refraction. For use within the visual shader graph. + +Description +----------- + +Translated to ``refract(I, N, eta)`` in the shader language, where ``I`` is the incident vector, ``N`` is the normal vector and ``eta`` is the ratio of the indices of the refraction. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorscalarmix.rst b/classes/class_visualshadernodevectorscalarmix.rst new file mode 100644 index 0000000..b538576 --- /dev/null +++ b/classes/class_visualshadernodevectorscalarmix.rst @@ -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 VisualShaderNodeVectorScalarMix.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorScalarMix: + +VisualShaderNodeVectorScalarMix +=============================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Linearly interpolates between two vectors using a scalar. For use within the visual shader graph. + +Description +----------- + +Translates to ``mix(a, b, weight)`` in the shader language, where ``a`` and ``b`` are vectors and ``weight`` is a scalar. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorscalarsmoothstep.rst b/classes/class_visualshadernodevectorscalarsmoothstep.rst new file mode 100644 index 0000000..770b54b --- /dev/null +++ b/classes/class_visualshadernodevectorscalarsmoothstep.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorScalarSmoothStep.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorScalarSmoothStep: + +VisualShaderNodeVectorScalarSmoothStep +====================================== + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a vector SmoothStep function using scalar within the visual shader graph. + +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language, where ``x`` is a scalar. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorscalarstep.rst b/classes/class_visualshadernodevectorscalarstep.rst new file mode 100644 index 0000000..d1196ff --- /dev/null +++ b/classes/class_visualshadernodevectorscalarstep.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorScalarStep.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorScalarStep: + +VisualShaderNodeVectorScalarStep +================================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a vector Step function within the visual shader graph. + +Description +----------- + +Translates to ``step(edge, x)`` in the shader language. + +Returns ``0.0`` if ``x`` is smaller than ``edge`` and ``1.0`` otherwise. + +.. |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.)` diff --git a/classes/class_visualshadernodevectorsmoothstep.rst b/classes/class_visualshadernodevectorsmoothstep.rst new file mode 100644 index 0000000..ce7b661 --- /dev/null +++ b/classes/class_visualshadernodevectorsmoothstep.rst @@ -0,0 +1,25 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VisualShaderNodeVectorSmoothStep.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VisualShaderNodeVectorSmoothStep: + +VisualShaderNodeVectorSmoothStep +================================ + +**Inherits:** :ref:`VisualShaderNode` **<** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Calculates a vector SmoothStep function within the visual shader graph. + +Description +----------- + +Translates to ``smoothstep(edge0, edge1, x)`` in the shader language, where ``x`` is a vector. + +Returns ``0.0`` if ``x`` is smaller than ``edge0`` and ``1.0`` if ``x`` is larger than ``edge1``. Otherwise the return value is interpolated between ``0.0`` and ``1.0`` using Hermite polynomials. + +.. |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.)` diff --git a/classes/class_vscrollbar.rst b/classes/class_vscrollbar.rst new file mode 100644 index 0000000..4282c17 --- /dev/null +++ b/classes/class_vscrollbar.rst @@ -0,0 +1,148 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VScrollBar.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VScrollBar: + +VScrollBar +========== + +**Inherits:** :ref:`ScrollBar` **<** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Vertical scroll bar. + +Description +----------- + +Vertical version of :ref:`ScrollBar`, which goes from top (min) to bottom (max). + +Properties +---------- + ++-----------------------+-----------------------+---------------------------+ +| :ref:`int` | size_flags_horizontal | ``0`` *(parent override)* | ++-----------------------+-----------------------+---------------------------+ +| :ref:`int` | size_flags_vertical | ``1`` *(parent override)* | ++-----------------------+-----------------------+---------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`decrement_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`increment_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_highlight` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_pressed` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`scroll` | ++---------------------------------+-----------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`scroll_focus` | ++---------------------------------+-----------------------------------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_VScrollBar_theme_icon_decrement: + +- :ref:`Texture` **decrement** + +Icon used as a button to scroll the :ref:`ScrollBar` up. Supports custom step using the :ref:`ScrollBar.custom_step` property. + +---- + +.. _class_VScrollBar_theme_icon_decrement_highlight: + +- :ref:`Texture` **decrement_highlight** + +Displayed when the mouse cursor hovers over the decrement button. + +---- + +.. _class_VScrollBar_theme_icon_decrement_pressed: + +- :ref:`Texture` **decrement_pressed** + +Displayed when the decrement button is being pressed. + +---- + +.. _class_VScrollBar_theme_icon_increment: + +- :ref:`Texture` **increment** + +Icon used as a button to scroll the :ref:`ScrollBar` down. Supports custom step using the :ref:`ScrollBar.custom_step` property. + +---- + +.. _class_VScrollBar_theme_icon_increment_highlight: + +- :ref:`Texture` **increment_highlight** + +Displayed when the mouse cursor hovers over the increment button. + +---- + +.. _class_VScrollBar_theme_icon_increment_pressed: + +- :ref:`Texture` **increment_pressed** + +Displayed when the increment button is being pressed. + +---- + +.. _class_VScrollBar_theme_style_grabber: + +- :ref:`StyleBox` **grabber** + +Used as texture for the grabber, the draggable element representing current scroll. + +---- + +.. _class_VScrollBar_theme_style_grabber_highlight: + +- :ref:`StyleBox` **grabber_highlight** + +Used when the mouse hovers over the grabber. + +---- + +.. _class_VScrollBar_theme_style_grabber_pressed: + +- :ref:`StyleBox` **grabber_pressed** + +Used when the grabber is being dragged. + +---- + +.. _class_VScrollBar_theme_style_scroll: + +- :ref:`StyleBox` **scroll** + +Used as background of this :ref:`ScrollBar`. + +---- + +.. _class_VScrollBar_theme_style_scroll_focus: + +- :ref:`StyleBox` **scroll_focus** + +Used as background when the :ref:`ScrollBar` has the GUI focus. + +.. |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.)` diff --git a/classes/class_vseparator.rst b/classes/class_vseparator.rst new file mode 100644 index 0000000..5bd3bfa --- /dev/null +++ b/classes/class_vseparator.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VSeparator.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VSeparator: + +VSeparator +========== + +**Inherits:** :ref:`Separator` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Vertical version of :ref:`Separator`. + +Description +----------- + +Vertical version of :ref:`Separator`. Even though it looks vertical, it is used to separate objects horizontally. + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------+-------+ +| :ref:`int` | :ref:`separation` | ``4`` | ++---------------------------------+---------------------------------------------------------------+-------+ +| :ref:`StyleBox` | :ref:`separator` | | ++---------------------------------+---------------------------------------------------------------+-------+ + +Theme Property Descriptions +--------------------------- + +.. _class_VSeparator_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The width of the area covered by the separator. Effectively works like a minimum width. + +---- + +.. _class_VSeparator_theme_style_separator: + +- :ref:`StyleBox` **separator** + +The style for the separator line. Works best with :ref:`StyleBoxLine` (remember to enable :ref:`StyleBoxLine.vertical`). + +.. |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.)` diff --git a/classes/class_vslider.rst b/classes/class_vslider.rst new file mode 100644 index 0000000..77c951f --- /dev/null +++ b/classes/class_vslider.rst @@ -0,0 +1,108 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VSlider.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VSlider: + +VSlider +======= + +**Inherits:** :ref:`Slider` **<** :ref:`Range` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Vertical slider. + +Description +----------- + +Vertical slider. See :ref:`Slider`. This one goes from bottom (min) to top (max). + +**Note:** The :ref:`Range.changed` and :ref:`Range.value_changed` signals are part of the :ref:`Range` class which this class inherits from. + +Properties +---------- + ++-----------------------+-----------------------+---------------------------+ +| :ref:`int` | size_flags_horizontal | ``0`` *(parent override)* | ++-----------------------+-----------------------+---------------------------+ +| :ref:`int` | size_flags_vertical | ``1`` *(parent override)* | ++-----------------------+-----------------------+---------------------------+ + +Theme Properties +---------------- + ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber_disabled` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`grabber_highlight` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`Texture` | :ref:`tick` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_area` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`grabber_area_highlight` | ++---------------------------------+---------------------------------------------------------------------------------+ +| :ref:`StyleBox` | :ref:`slider` | ++---------------------------------+---------------------------------------------------------------------------------+ + +Theme Property Descriptions +--------------------------- + +.. _class_VSlider_theme_icon_grabber: + +- :ref:`Texture` **grabber** + +The texture for the grabber (the draggable element). + +---- + +.. _class_VSlider_theme_icon_grabber_disabled: + +- :ref:`Texture` **grabber_disabled** + +The texture for the grabber when it's disabled. + +---- + +.. _class_VSlider_theme_icon_grabber_highlight: + +- :ref:`Texture` **grabber_highlight** + +The texture for the grabber when it's focused. + +---- + +.. _class_VSlider_theme_icon_tick: + +- :ref:`Texture` **tick** + +The texture for the ticks, visible when :ref:`Slider.tick_count` is greater than 0. + +---- + +.. _class_VSlider_theme_style_grabber_area: + +- :ref:`StyleBox` **grabber_area** + +The background of the area below the grabber. + +---- + +.. _class_VSlider_theme_style_grabber_area_highlight: + +- :ref:`StyleBox` **grabber_area_highlight** + +---- + +.. _class_VSlider_theme_style_slider: + +- :ref:`StyleBox` **slider** + +The background for the whole slider. Determines the width of the ``grabber_area``. + +.. |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.)` diff --git a/classes/class_vsplitcontainer.rst b/classes/class_vsplitcontainer.rst new file mode 100644 index 0000000..c21c356 --- /dev/null +++ b/classes/class_vsplitcontainer.rst @@ -0,0 +1,75 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the VSplitContainer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_VSplitContainer: + +VSplitContainer +=============== + +**Inherits:** :ref:`SplitContainer` **<** :ref:`Container` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Vertical split container. + +Description +----------- + +Vertical split container. See :ref:`SplitContainer`. This goes from top to bottom. + +Theme Properties +---------------- + ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`autohide` | ``1`` | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`int` | :ref:`separation` | ``12`` | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`Texture` | :ref:`grabber` | | ++---------------------------------+--------------------------------------------------------------------+--------+ +| :ref:`StyleBox` | :ref:`bg` | | ++---------------------------------+--------------------------------------------------------------------+--------+ + +Theme Property Descriptions +--------------------------- + +.. _class_VSplitContainer_theme_constant_autohide: + +- :ref:`int` **autohide** + ++-----------+-------+ +| *Default* | ``1`` | ++-----------+-------+ + +Boolean value. If 1 (``true``), the grabber will hide automatically when it isn't under the cursor. If 0 (``false``), it's always visible. + +---- + +.. _class_VSplitContainer_theme_constant_separation: + +- :ref:`int` **separation** + ++-----------+--------+ +| *Default* | ``12`` | ++-----------+--------+ + +The space between sides of the container. + +---- + +.. _class_VSplitContainer_theme_icon_grabber: + +- :ref:`Texture` **grabber** + +The icon used for the grabber drawn in the middle area. + +---- + +.. _class_VSplitContainer_theme_style_bg: + +- :ref:`StyleBox` **bg** + +.. |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.)` diff --git a/classes/class_weakref.rst b/classes/class_weakref.rst new file mode 100644 index 0000000..ee0de6b --- /dev/null +++ b/classes/class_weakref.rst @@ -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 WeakRef.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WeakRef: + +WeakRef +======= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Holds an :ref:`Object`, but does not contribute to the reference count if the object is a reference. + +Description +----------- + +A weakref can hold a :ref:`Reference`, without contributing to the reference counter. A weakref can be created from an :ref:`Object` using :ref:`@GDScript.weakref`. If this object is not a reference, weakref still works, however, it does not have any effect on the object. Weakrefs are useful in cases where multiple classes have variables that refer to each other. Without weakrefs, using these classes could lead to memory leaks, since both references keep each other from being released. Making part of the variables a weakref can prevent this cyclic dependency, and allows the references to be released. + +Methods +------- + ++-------------------------------+------------------------------------------------------------------+ +| :ref:`Variant` | :ref:`get_ref` **(** **)** |const| | ++-------------------------------+------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_WeakRef_method_get_ref: + +- :ref:`Variant` **get_ref** **(** **)** |const| + +Returns the :ref:`Object` this weakref is referring to. + +.. |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.)` diff --git a/classes/class_webrtcdatachannel.rst b/classes/class_webrtcdatachannel.rst new file mode 100644 index 0000000..9bcb59d --- /dev/null +++ b/classes/class_webrtcdatachannel.rst @@ -0,0 +1,213 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebRTCDataChannel.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebRTCDataChannel: + +WebRTCDataChannel +================= + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`WebRTCDataChannelGDNative` + + + +Properties +---------- + ++----------------------------------------------------+----------------------------------------------------------------+-------+ +| :ref:`WriteMode` | :ref:`write_mode` | ``1`` | ++----------------------------------------------------+----------------------------------------------------------------+-------+ + +Methods +------- + ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_buffered_amount` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_id` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_label` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_max_packet_life_time` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_max_retransmits` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_protocol` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`ChannelState` | :ref:`get_ready_state` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_negotiated` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_ordered` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`poll` **(** **)** | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`was_string_packet` **(** **)** |const| | ++----------------------------------------------------------+--------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_WebRTCDataChannel_WriteMode: + +.. _class_WebRTCDataChannel_constant_WRITE_MODE_TEXT: + +.. _class_WebRTCDataChannel_constant_WRITE_MODE_BINARY: + +enum **WriteMode**: + +- **WRITE_MODE_TEXT** = **0** --- Tells the channel to send data over this channel as text. An external peer (non-Godot) would receive this as a string. + +- **WRITE_MODE_BINARY** = **1** --- Tells the channel to send data over this channel as binary. An external peer (non-Godot) would receive this as array buffer or blob. + +---- + +.. _enum_WebRTCDataChannel_ChannelState: + +.. _class_WebRTCDataChannel_constant_STATE_CONNECTING: + +.. _class_WebRTCDataChannel_constant_STATE_OPEN: + +.. _class_WebRTCDataChannel_constant_STATE_CLOSING: + +.. _class_WebRTCDataChannel_constant_STATE_CLOSED: + +enum **ChannelState**: + +- **STATE_CONNECTING** = **0** --- The channel was created, but it's still trying to connect. + +- **STATE_OPEN** = **1** --- The channel is currently open, and data can flow over it. + +- **STATE_CLOSING** = **2** --- The channel is being closed, no new messages will be accepted, but those already in queue will be flushed. + +- **STATE_CLOSED** = **3** --- The channel was closed, or connection failed. + +Property Descriptions +--------------------- + +.. _class_WebRTCDataChannel_property_write_mode: + +- :ref:`WriteMode` **write_mode** + ++-----------+-----------------------+ +| *Default* | ``1`` | ++-----------+-----------------------+ +| *Setter* | set_write_mode(value) | ++-----------+-----------------------+ +| *Getter* | get_write_mode() | ++-----------+-----------------------+ + +The transfer mode to use when sending outgoing packet. Either text or binary. + +Method Descriptions +------------------- + +.. _class_WebRTCDataChannel_method_close: + +- void **close** **(** **)** + +Closes this data channel, notifying the other peer. + +---- + +.. _class_WebRTCDataChannel_method_get_buffered_amount: + +- :ref:`int` **get_buffered_amount** **(** **)** |const| + +Returns the number of bytes currently queued to be sent over this channel. + +---- + +.. _class_WebRTCDataChannel_method_get_id: + +- :ref:`int` **get_id** **(** **)** |const| + +Returns the id assigned to this channel during creation (or auto-assigned during negotiation). + +If the channel is not negotiated out-of-band the id will only be available after the connection is established (will return ``65535`` until then). + +---- + +.. _class_WebRTCDataChannel_method_get_label: + +- :ref:`String` **get_label** **(** **)** |const| + +Returns the label assigned to this channel during creation. + +---- + +.. _class_WebRTCDataChannel_method_get_max_packet_life_time: + +- :ref:`int` **get_max_packet_life_time** **(** **)** |const| + +Returns the ``maxPacketLifeTime`` value assigned to this channel during creation. + +Will be ``65535`` if not specified. + +---- + +.. _class_WebRTCDataChannel_method_get_max_retransmits: + +- :ref:`int` **get_max_retransmits** **(** **)** |const| + +Returns the ``maxRetransmits`` value assigned to this channel during creation. + +Will be ``65535`` if not specified. + +---- + +.. _class_WebRTCDataChannel_method_get_protocol: + +- :ref:`String` **get_protocol** **(** **)** |const| + +Returns the sub-protocol assigned to this channel during creation. An empty string if not specified. + +---- + +.. _class_WebRTCDataChannel_method_get_ready_state: + +- :ref:`ChannelState` **get_ready_state** **(** **)** |const| + +Returns the current state of this channel, see :ref:`ChannelState`. + +---- + +.. _class_WebRTCDataChannel_method_is_negotiated: + +- :ref:`bool` **is_negotiated** **(** **)** |const| + +Returns ``true`` if this channel was created with out-of-band configuration. + +---- + +.. _class_WebRTCDataChannel_method_is_ordered: + +- :ref:`bool` **is_ordered** **(** **)** |const| + +Returns ``true`` if this channel was created with ordering enabled (default). + +---- + +.. _class_WebRTCDataChannel_method_poll: + +- :ref:`Error` **poll** **(** **)** + +Reserved, but not used for now. + +---- + +.. _class_WebRTCDataChannel_method_was_string_packet: + +- :ref:`bool` **was_string_packet** **(** **)** |const| + +Returns ``true`` if the last received packet was transferred as text. See :ref:`write_mode`. + +.. |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.)` diff --git a/classes/class_webrtcdatachannelgdnative.rst b/classes/class_webrtcdatachannelgdnative.rst new file mode 100644 index 0000000..23d95b5 --- /dev/null +++ b/classes/class_webrtcdatachannelgdnative.rst @@ -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 WebRTCDataChannelGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebRTCDataChannelGDNative: + +WebRTCDataChannelGDNative +========================= + +**Inherits:** :ref:`WebRTCDataChannel` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_webrtcmultiplayer.rst b/classes/class_webrtcmultiplayer.rst new file mode 100644 index 0000000..61fc3e0 --- /dev/null +++ b/classes/class_webrtcmultiplayer.rst @@ -0,0 +1,118 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebRTCMultiplayer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebRTCMultiplayer: + +WebRTCMultiplayer +================= + +**Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +A simple interface to create a peer-to-peer mesh network composed of :ref:`WebRTCPeerConnection` that is compatible with the :ref:`MultiplayerAPI`. + +Description +----------- + +This class constructs a full mesh of :ref:`WebRTCPeerConnection` (one connection for each peer) that can be used as a :ref:`MultiplayerAPI.network_peer`. + +You can add each :ref:`WebRTCPeerConnection` via :ref:`add_peer` or remove them via :ref:`remove_peer`. Peers must be added in :ref:`WebRTCPeerConnection.STATE_NEW` state to allow it to create the appropriate channels. This class will not create offers nor set descriptions, it will only poll them, and notify connections and disconnections. + +:ref:`NetworkedMultiplayerPeer.connection_succeeded` and :ref:`NetworkedMultiplayerPeer.server_disconnected` will not be emitted unless ``server_compatibility`` is ``true`` in :ref:`initialize`. Beside that data transfer works like in a :ref:`NetworkedMultiplayerPeer`. + +Properties +---------- + ++-----------------------------------------------------------------+------------------------+-------------------------------+ +| :ref:`bool` | refuse_new_connections | ``false`` *(parent override)* | ++-----------------------------------------------------------------+------------------------+-------------------------------+ +| :ref:`TransferMode` | transfer_mode | ``2`` *(parent override)* | ++-----------------------------------------------------------------+------------------------+-------------------------------+ + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`add_peer` **(** :ref:`WebRTCPeerConnection` peer, :ref:`int` peer_id, :ref:`int` unreliable_lifetime=1 **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_peer` **(** :ref:`int` peer_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Dictionary` | :ref:`get_peers` **(** **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_peer` **(** :ref:`int` peer_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`initialize` **(** :ref:`int` peer_id, :ref:`bool` server_compatibility=false **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`remove_peer` **(** :ref:`int` peer_id **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_WebRTCMultiplayer_method_add_peer: + +- :ref:`Error` **add_peer** **(** :ref:`WebRTCPeerConnection` peer, :ref:`int` peer_id, :ref:`int` unreliable_lifetime=1 **)** + +Add a new peer to the mesh with the given ``peer_id``. The :ref:`WebRTCPeerConnection` must be in state :ref:`WebRTCPeerConnection.STATE_NEW`. + +Three channels will be created for reliable, unreliable, and ordered transport. The value of ``unreliable_lifetime`` will be passed to the ``maxPacketLifetime`` option when creating unreliable and ordered channels (see :ref:`WebRTCPeerConnection.create_data_channel`). + +---- + +.. _class_WebRTCMultiplayer_method_close: + +- void **close** **(** **)** + +Close all the add peer connections and channels, freeing all resources. + +---- + +.. _class_WebRTCMultiplayer_method_get_peer: + +- :ref:`Dictionary` **get_peer** **(** :ref:`int` peer_id **)** + +Return a dictionary representation of the peer with given ``peer_id`` with three keys. ``connection`` containing the :ref:`WebRTCPeerConnection` to this peer, ``channels`` an array of three :ref:`WebRTCDataChannel`, and ``connected`` a boolean representing if the peer connection is currently connected (all three channels are open). + +---- + +.. _class_WebRTCMultiplayer_method_get_peers: + +- :ref:`Dictionary` **get_peers** **(** **)** + +Returns a dictionary which keys are the peer ids and values the peer representation as in :ref:`get_peer`. + +---- + +.. _class_WebRTCMultiplayer_method_has_peer: + +- :ref:`bool` **has_peer** **(** :ref:`int` peer_id **)** + +Returns ``true`` if the given ``peer_id`` is in the peers map (it might not be connected though). + +---- + +.. _class_WebRTCMultiplayer_method_initialize: + +- :ref:`Error` **initialize** **(** :ref:`int` peer_id, :ref:`bool` server_compatibility=false **)** + +Initialize the multiplayer peer with the given ``peer_id`` (must be between 1 and 2147483647). + +If ``server_compatibilty`` is ``false`` (default), the multiplayer peer will be immediately in state :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTED` and :ref:`NetworkedMultiplayerPeer.connection_succeeded` will not be emitted. + +If ``server_compatibilty`` is ``true`` the peer will suppress all :ref:`NetworkedMultiplayerPeer.peer_connected` signals until a peer with id :ref:`NetworkedMultiplayerPeer.TARGET_PEER_SERVER` connects and then emit :ref:`NetworkedMultiplayerPeer.connection_succeeded`. After that the signal :ref:`NetworkedMultiplayerPeer.peer_connected` will be emitted for every already connected peer, and any new peer that might connect. If the server peer disconnects after that, signal :ref:`NetworkedMultiplayerPeer.server_disconnected` will be emitted and state will become :ref:`NetworkedMultiplayerPeer.CONNECTION_CONNECTED`. + +---- + +.. _class_WebRTCMultiplayer_method_remove_peer: + +- void **remove_peer** **(** :ref:`int` peer_id **)** + +Remove the peer with given ``peer_id`` from the mesh. If the peer was connected, and :ref:`NetworkedMultiplayerPeer.peer_connected` was emitted for it, then :ref:`NetworkedMultiplayerPeer.peer_disconnected` will be emitted. + +.. |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.)` diff --git a/classes/class_webrtcpeerconnection.rst b/classes/class_webrtcpeerconnection.rst new file mode 100644 index 0000000..8e484d4 --- /dev/null +++ b/classes/class_webrtcpeerconnection.rst @@ -0,0 +1,236 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebRTCPeerConnection.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebRTCPeerConnection: + +WebRTCPeerConnection +==================== + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`WebRTCPeerConnectionGDNative` + +Interface to a WebRTC peer connection. + +Description +----------- + +A WebRTC connection between the local computer and a remote peer. Provides an interface to connect, maintain and monitor the connection. + +Setting up a WebRTC connection between two peers from now on) may not seem a trivial task, but it can be broken down into 3 main steps: + +- The peer that wants to initiate the connection (``A`` from now on) creates an offer and send it to the other peer (``B`` from now on). + +- ``B`` receives the offer, generate and answer, and sends it to ``A``). + +- ``A`` and ``B`` then generates and exchange ICE candidates with each other. + +After these steps, the connection should become connected. Keep on reading or look into the tutorial for more information. + +Methods +------- + ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`add_ice_candidate` **(** :ref:`String` media, :ref:`int` index, :ref:`String` name **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`WebRTCDataChannel` | :ref:`create_data_channel` **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`create_offer` **(** **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ConnectionState` | :ref:`get_connection_state` **(** **)** |const| | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`initialize` **(** :ref:`Dictionary` configuration={ } **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`poll` **(** **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`set_local_description` **(** :ref:`String` type, :ref:`String` sdp **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`set_remote_description` **(** :ref:`String` type, :ref:`String` sdp **)** | ++-------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebRTCPeerConnection_signal_data_channel_received: + +- **data_channel_received** **(** :ref:`Object` channel **)** + +Emitted when a new in-band channel is received, i.e. when the channel was created with ``negotiated: false`` (default). + +The object will be an instance of :ref:`WebRTCDataChannel`. You must keep a reference of it or it will be closed automatically. See :ref:`create_data_channel`. + +---- + +.. _class_WebRTCPeerConnection_signal_ice_candidate_created: + +- **ice_candidate_created** **(** :ref:`String` media, :ref:`int` index, :ref:`String` name **)** + +Emitted when a new ICE candidate has been created. The three parameters are meant to be passed to the remote peer over the signaling server. + +---- + +.. _class_WebRTCPeerConnection_signal_session_description_created: + +- **session_description_created** **(** :ref:`String` type, :ref:`String` sdp **)** + +Emitted after a successful call to :ref:`create_offer` or :ref:`set_remote_description` (when it generates an answer). The parameters are meant to be passed to :ref:`set_local_description` on this object, and sent to the remote peer over the signaling server. + +Enumerations +------------ + +.. _enum_WebRTCPeerConnection_ConnectionState: + +.. _class_WebRTCPeerConnection_constant_STATE_NEW: + +.. _class_WebRTCPeerConnection_constant_STATE_CONNECTING: + +.. _class_WebRTCPeerConnection_constant_STATE_CONNECTED: + +.. _class_WebRTCPeerConnection_constant_STATE_DISCONNECTED: + +.. _class_WebRTCPeerConnection_constant_STATE_FAILED: + +.. _class_WebRTCPeerConnection_constant_STATE_CLOSED: + +enum **ConnectionState**: + +- **STATE_NEW** = **0** --- The connection is new, data channels and an offer can be created in this state. + +- **STATE_CONNECTING** = **1** --- The peer is connecting, ICE is in progress, none of the transports has failed. + +- **STATE_CONNECTED** = **2** --- The peer is connected, all ICE transports are connected. + +- **STATE_DISCONNECTED** = **3** --- At least one ICE transport is disconnected. + +- **STATE_FAILED** = **4** --- One or more of the ICE transports failed. + +- **STATE_CLOSED** = **5** --- The peer connection is closed (after calling :ref:`close` for example). + +Method Descriptions +------------------- + +.. _class_WebRTCPeerConnection_method_add_ice_candidate: + +- :ref:`Error` **add_ice_candidate** **(** :ref:`String` media, :ref:`int` index, :ref:`String` name **)** + +Add an ice candidate generated by a remote peer (and received over the signaling server). See :ref:`ice_candidate_created`. + +---- + +.. _class_WebRTCPeerConnection_method_close: + +- void **close** **(** **)** + +Close the peer connection and all data channels associated with it. + +**Note:** You cannot reuse this object for a new connection unless you call :ref:`initialize`. + +---- + +.. _class_WebRTCPeerConnection_method_create_data_channel: + +- :ref:`WebRTCDataChannel` **create_data_channel** **(** :ref:`String` label, :ref:`Dictionary` options={ } **)** + +Returns a new :ref:`WebRTCDataChannel` (or ``null`` on failure) with given ``label`` and optionally configured via the ``options`` dictionary. This method can only be called when the connection is in state :ref:`STATE_NEW`. + +There are two ways to create a working data channel: either call :ref:`create_data_channel` on only one of the peer and listen to :ref:`data_channel_received` on the other, or call :ref:`create_data_channel` on both peers, with the same values, and the ``negotiated`` option set to ``true``. + +Valid ``options`` are: + +:: + + { + "negotiated": true, # When set to true (default off), means the channel is negotiated out of band. "id" must be set too. "data_channel_received" will not be called. + "id": 1, # When "negotiated" is true this value must also be set to the same value on both peer. + + # Only one of maxRetransmits and maxPacketLifeTime can be specified, not both. They make the channel unreliable (but also better at real time). + "maxRetransmits": 1, # Specify the maximum number of attempt the peer will make to retransmits packets if they are not acknowledged. + "maxPacketLifeTime": 100, # Specify the maximum amount of time before giving up retransmitions of unacknowledged packets (in milliseconds). + "ordered": true, # When in unreliable mode (i.e. either "maxRetransmits" or "maxPacketLifetime" is set), "ordered" (true by default) specify if packet ordering is to be enforced. + + "protocol": "my-custom-protocol", # A custom sub-protocol string for this channel. + } + +**Note:** You must keep a reference to channels created this way, or it will be closed. + +---- + +.. _class_WebRTCPeerConnection_method_create_offer: + +- :ref:`Error` **create_offer** **(** **)** + +Creates a new SDP offer to start a WebRTC connection with a remote peer. At least one :ref:`WebRTCDataChannel` must have been created before calling this method. + +If this functions returns :ref:`@GlobalScope.OK`, :ref:`session_description_created` will be called when the session is ready to be sent. + +---- + +.. _class_WebRTCPeerConnection_method_get_connection_state: + +- :ref:`ConnectionState` **get_connection_state** **(** **)** |const| + +Returns the connection state. See :ref:`ConnectionState`. + +---- + +.. _class_WebRTCPeerConnection_method_initialize: + +- :ref:`Error` **initialize** **(** :ref:`Dictionary` configuration={ } **)** + +Re-initialize this peer connection, closing any previously active connection, and going back to state :ref:`STATE_NEW`. A dictionary of ``options`` can be passed to configure the peer connection. + +Valid ``options`` are: + +:: + + { + "iceServers": [ + { + "urls": [ "stun:stun.example.com:3478" ], # One or more STUN servers. + }, + { + "urls": [ "turn:turn.example.com:3478" ], # One or more TURN servers. + "username": "a_username", # Optional username for the TURN server. + "credential": "a_password", # Optional password for the TURN server. + } + ] + } + +---- + +.. _class_WebRTCPeerConnection_method_poll: + +- :ref:`Error` **poll** **(** **)** + +Call this method frequently (e.g. in :ref:`Node._process` or :ref:`Node._physics_process`) to properly receive signals. + +---- + +.. _class_WebRTCPeerConnection_method_set_local_description: + +- :ref:`Error` **set_local_description** **(** :ref:`String` type, :ref:`String` sdp **)** + +Sets the SDP description of the local peer. This should be called in response to :ref:`session_description_created`. + +After calling this function the peer will start emitting :ref:`ice_candidate_created` (unless an :ref:`Error` different from :ref:`@GlobalScope.OK` is returned). + +---- + +.. _class_WebRTCPeerConnection_method_set_remote_description: + +- :ref:`Error` **set_remote_description** **(** :ref:`String` type, :ref:`String` sdp **)** + +Sets the SDP description of the remote peer. This should be called with the values generated by a remote peer and received over the signaling server. + +If ``type`` is ``offer`` the peer will emit :ref:`session_description_created` with the appropriate answer. + +If ``type`` is ``answer`` the peer will start emitting :ref:`ice_candidate_created`. + +.. |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.)` diff --git a/classes/class_webrtcpeerconnectiongdnative.rst b/classes/class_webrtcpeerconnectiongdnative.rst new file mode 100644 index 0000000..154fb44 --- /dev/null +++ b/classes/class_webrtcpeerconnectiongdnative.rst @@ -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 WebRTCPeerConnectionGDNative.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebRTCPeerConnectionGDNative: + +WebRTCPeerConnectionGDNative +============================ + +**Inherits:** :ref:`WebRTCPeerConnection` **<** :ref:`Reference` **<** :ref:`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.)` diff --git a/classes/class_websocketclient.rst b/classes/class_websocketclient.rst new file mode 100644 index 0000000..dd1cf8b --- /dev/null +++ b/classes/class_websocketclient.rst @@ -0,0 +1,170 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebSocketClient.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebSocketClient: + +WebSocketClient +=============== + +**Inherits:** :ref:`WebSocketMultiplayerPeer` **<** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +A WebSocket client implementation. + +Description +----------- + +This class implements a WebSocket client compatible with any RFC 6455-compliant WebSocket server. + +This client can be optionally used as a network peer for the :ref:`MultiplayerAPI`. + +After starting the client (:ref:`connect_to_url`), you will need to :ref:`NetworkedMultiplayerPeer.poll` it at regular intervals (e.g. inside :ref:`Node._process`). + +You will receive appropriate signals when connecting, disconnecting, or when new data is available. + +Properties +---------- + ++-----------------------------------------------+----------------------------------------------------------------------------------------+ +| :ref:`X509Certificate` | :ref:`trusted_ssl_certificate` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`verify_ssl` | ++-----------------------------------------------+----------------------------------------------------------------------------------------+ + +Methods +------- + ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`connect_to_url` **(** :ref:`String` url, :ref:`PoolStringArray` protocols=PoolStringArray( ), :ref:`bool` gd_mp_api=false, :ref:`PoolStringArray` custom_headers=PoolStringArray( ) **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_from_host` **(** :ref:`int` code=1000, :ref:`String` reason="" **)** | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | ++---------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebSocketClient_signal_connection_closed: + +- **connection_closed** **(** :ref:`bool` was_clean_close **)** + +Emitted when the connection to the server is closed. ``was_clean_close`` will be ``true`` if the connection was shutdown cleanly. + +---- + +.. _class_WebSocketClient_signal_connection_error: + +- **connection_error** **(** **)** + +Emitted when the connection to the server fails. + +---- + +.. _class_WebSocketClient_signal_connection_established: + +- **connection_established** **(** :ref:`String` protocol **)** + +Emitted when a connection with the server is established, ``protocol`` will contain the sub-protocol agreed with the server. + +---- + +.. _class_WebSocketClient_signal_data_received: + +- **data_received** **(** **)** + +Emitted when a WebSocket message is received. + +**Note:** This signal is *not* emitted when used as high-level multiplayer peer. + +---- + +.. _class_WebSocketClient_signal_server_close_request: + +- **server_close_request** **(** :ref:`int` code, :ref:`String` reason **)** + +Emitted when the server requests a clean close. You should keep polling until you get a :ref:`connection_closed` signal to achieve the clean close. See :ref:`WebSocketPeer.close` for more details. + +Property Descriptions +--------------------- + +.. _class_WebSocketClient_property_trusted_ssl_certificate: + +- :ref:`X509Certificate` **trusted_ssl_certificate** + ++----------+------------------------------------+ +| *Setter* | set_trusted_ssl_certificate(value) | ++----------+------------------------------------+ +| *Getter* | get_trusted_ssl_certificate() | ++----------+------------------------------------+ + +If specified, this :ref:`X509Certificate` will be the only one accepted when connecting to an SSL host. Any other certificate provided by the server will be regarded as invalid. + +**Note:** Specifying a custom ``trusted_ssl_certificate`` is not supported in HTML5 exports due to browsers restrictions. + +---- + +.. _class_WebSocketClient_property_verify_ssl: + +- :ref:`bool` **verify_ssl** + ++----------+-------------------------------+ +| *Setter* | set_verify_ssl_enabled(value) | ++----------+-------------------------------+ +| *Getter* | is_verify_ssl_enabled() | ++----------+-------------------------------+ + +If ``true``, SSL certificate verification is enabled. + +**Note:** You must specify the certificates to be used in the Project Settings for it to work when exported. + +Method Descriptions +------------------- + +.. _class_WebSocketClient_method_connect_to_url: + +- :ref:`Error` **connect_to_url** **(** :ref:`String` url, :ref:`PoolStringArray` protocols=PoolStringArray( ), :ref:`bool` gd_mp_api=false, :ref:`PoolStringArray` custom_headers=PoolStringArray( ) **)** + +Connects to the given URL requesting one of the given ``protocols`` as sub-protocol. If the list empty (default), no sub-protocol will be requested. + +If ``true`` is passed as ``gd_mp_api``, the client will behave like a network peer for the :ref:`MultiplayerAPI`, connections to non-Godot servers will not work, and :ref:`data_received` will not be emitted. + +If ``false`` is passed instead (default), you must call :ref:`PacketPeer` functions (``put_packet``, ``get_packet``, etc.) on the :ref:`WebSocketPeer` returned via ``get_peer(1)`` and not on this object directly (e.g. ``get_peer(1).put_packet(data)``). + +You can optionally pass a list of ``custom_headers`` to be added to the handshake HTTP request. + +**Note:** To avoid mixed content warnings or errors in HTML5, you may have to use a ``url`` that starts with ``wss://`` (secure) instead of ``ws://``. When doing so, make sure to use the fully qualified domain name that matches the one defined in the server's SSL certificate. Do not connect directly via the IP address for ``wss://`` connections, as it won't match with the SSL certificate. + +**Note:** Specifying ``custom_headers`` is not supported in HTML5 exports due to browsers restrictions. + +---- + +.. _class_WebSocketClient_method_disconnect_from_host: + +- void **disconnect_from_host** **(** :ref:`int` code=1000, :ref:`String` reason="" **)** + +Disconnects this client from the connected host. See :ref:`WebSocketPeer.close` for more information. + +---- + +.. _class_WebSocketClient_method_get_connected_host: + +- :ref:`String` **get_connected_host** **(** **)** |const| + +Return the IP address of the currently connected host. + +---- + +.. _class_WebSocketClient_method_get_connected_port: + +- :ref:`int` **get_connected_port** **(** **)** |const| + +Return the IP port of the currently connected host. + +.. |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.)` diff --git a/classes/class_websocketmultiplayerpeer.rst b/classes/class_websocketmultiplayerpeer.rst new file mode 100644 index 0000000..812e067 --- /dev/null +++ b/classes/class_websocketmultiplayerpeer.rst @@ -0,0 +1,77 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebSocketMultiplayerPeer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebSocketMultiplayerPeer: + +WebSocketMultiplayerPeer +======================== + +**Inherits:** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +**Inherited By:** :ref:`WebSocketClient`, :ref:`WebSocketServer` + +Base class for WebSocket server and client. + +Description +----------- + +Base class for WebSocket server and client, allowing them to be used as network peer for the :ref:`MultiplayerAPI`. + +Properties +---------- + ++-----------------------------------------------------------------+------------------------+-------------------------------+ +| :ref:`bool` | refuse_new_connections | ``false`` *(parent override)* | ++-----------------------------------------------------------------+------------------------+-------------------------------+ +| :ref:`TransferMode` | transfer_mode | ``2`` *(parent override)* | ++-----------------------------------------------------------------+------------------------+-------------------------------+ + +Methods +------- + ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`WebSocketPeer` | :ref:`get_peer` **(** :ref:`int` peer_id **)** |const| | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`set_buffers` **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** | ++-------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebSocketMultiplayerPeer_signal_peer_packet: + +- **peer_packet** **(** :ref:`int` peer_source **)** + +Emitted when a packet is received from a peer. + +**Note:** This signal is only emitted when the client or server is configured to use Godot multiplayer API. + +Method Descriptions +------------------- + +.. _class_WebSocketMultiplayerPeer_method_get_peer: + +- :ref:`WebSocketPeer` **get_peer** **(** :ref:`int` peer_id **)** |const| + +Returns the :ref:`WebSocketPeer` associated to the given ``peer_id``. + +---- + +.. _class_WebSocketMultiplayerPeer_method_set_buffers: + +- :ref:`Error` **set_buffers** **(** :ref:`int` input_buffer_size_kb, :ref:`int` input_max_packets, :ref:`int` output_buffer_size_kb, :ref:`int` output_max_packets **)** + +Configures the buffer sizes for this WebSocket peer. Default values can be specified in the Project Settings under ``network/limits``. For server, values are meant per connected peer. + +The first two parameters define the size and queued packets limits of the input buffer, the last two of the output buffer. + +Buffer sizes are expressed in KiB, so ``4 = 2^12 = 4096 bytes``. All parameters will be rounded up to the nearest power of two. + +**Note:** HTML5 exports only use the input buffer since the output one is managed by browsers. + +.. |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.)` diff --git a/classes/class_websocketpeer.rst b/classes/class_websocketpeer.rst new file mode 100644 index 0000000..6bb7d52 --- /dev/null +++ b/classes/class_websocketpeer.rst @@ -0,0 +1,146 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebSocketPeer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebSocketPeer: + +WebSocketPeer +============= + +**Inherits:** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +A class representing a specific WebSocket connection. + +Description +----------- + +This class represents a specific WebSocket connection, allowing you to do lower level operations with it. + +You can choose to write to the socket in binary or text mode, and you can recognize the mode used for writing by the other peer. + +Methods +------- + ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`close` **(** :ref:`int` code=1000, :ref:`String` reason="" **)** | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_connected_host` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_connected_port` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_outbound_buffered_amount` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`WriteMode` | :ref:`get_write_mode` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_connected_to_host` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_no_delay` **(** :ref:`bool` enabled **)** | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`set_write_mode` **(** :ref:`WriteMode` mode **)** | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`was_string_packet` **(** **)** |const| | ++------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_WebSocketPeer_WriteMode: + +.. _class_WebSocketPeer_constant_WRITE_MODE_TEXT: + +.. _class_WebSocketPeer_constant_WRITE_MODE_BINARY: + +enum **WriteMode**: + +- **WRITE_MODE_TEXT** = **0** --- Specifies that WebSockets messages should be transferred as text payload (only valid UTF-8 is allowed). + +- **WRITE_MODE_BINARY** = **1** --- Specifies that WebSockets messages should be transferred as binary payload (any byte combination is allowed). + +Method Descriptions +------------------- + +.. _class_WebSocketPeer_method_close: + +- void **close** **(** :ref:`int` code=1000, :ref:`String` reason="" **)** + +Closes this WebSocket connection. ``code`` is the status code for the closure (see RFC 6455 section 7.4 for a list of valid status codes). ``reason`` is the human readable reason for closing the connection (can be any UTF-8 string that's smaller than 123 bytes). + +**Note:** To achieve a clean close, you will need to keep polling until either :ref:`WebSocketClient.connection_closed` or :ref:`WebSocketServer.client_disconnected` is received. + +**Note:** The HTML5 export might not support all status codes. Please refer to browser-specific documentation for more details. + +---- + +.. _class_WebSocketPeer_method_get_connected_host: + +- :ref:`String` **get_connected_host** **(** **)** |const| + +Returns the IP address of the connected peer. + +**Note:** Not available in the HTML5 export. + +---- + +.. _class_WebSocketPeer_method_get_connected_port: + +- :ref:`int` **get_connected_port** **(** **)** |const| + +Returns the remote port of the connected peer. + +**Note:** Not available in the HTML5 export. + +---- + +.. _class_WebSocketPeer_method_get_current_outbound_buffered_amount: + +- :ref:`int` **get_current_outbound_buffered_amount** **(** **)** |const| + +Returns the current amount of data in the outbound websocket buffer. **Note:** HTML5 exports use WebSocket.bufferedAmount, while other platforms use an internal buffer. + +---- + +.. _class_WebSocketPeer_method_get_write_mode: + +- :ref:`WriteMode` **get_write_mode** **(** **)** |const| + +Gets the current selected write mode. See :ref:`WriteMode`. + +---- + +.. _class_WebSocketPeer_method_is_connected_to_host: + +- :ref:`bool` **is_connected_to_host** **(** **)** |const| + +Returns ``true`` if this peer is currently connected. + +---- + +.. _class_WebSocketPeer_method_set_no_delay: + +- void **set_no_delay** **(** :ref:`bool` enabled **)** + +Disable Nagle's algorithm on the underling TCP socket (default). See :ref:`StreamPeerTCP.set_no_delay` for more information. + +**Note:** Not available in the HTML5 export. + +---- + +.. _class_WebSocketPeer_method_set_write_mode: + +- void **set_write_mode** **(** :ref:`WriteMode` mode **)** + +Sets the socket to use the given :ref:`WriteMode`. + +---- + +.. _class_WebSocketPeer_method_was_string_packet: + +- :ref:`bool` **was_string_packet** **(** **)** |const| + +Returns ``true`` if the last received packet was sent as a text payload. See :ref:`WriteMode`. + +.. |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.)` diff --git a/classes/class_websocketserver.rst b/classes/class_websocketserver.rst new file mode 100644 index 0000000..8fb99e2 --- /dev/null +++ b/classes/class_websocketserver.rst @@ -0,0 +1,234 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebSocketServer.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebSocketServer: + +WebSocketServer +=============== + +**Inherits:** :ref:`WebSocketMultiplayerPeer` **<** :ref:`NetworkedMultiplayerPeer` **<** :ref:`PacketPeer` **<** :ref:`Reference` **<** :ref:`Object` + +A WebSocket server implementation. + +Description +----------- + +This class implements a WebSocket server that can also support the high-level multiplayer API. + +After starting the server (:ref:`listen`), you will need to :ref:`NetworkedMultiplayerPeer.poll` it at regular intervals (e.g. inside :ref:`Node._process`). When clients connect, disconnect, or send data, you will receive the appropriate signal. + +**Note:** Not available in HTML5 exports. + +Properties +---------- + ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`String` | :ref:`bind_ip` | ``"*"`` | ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`X509Certificate` | :ref:`ca_chain` | | ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`float` | :ref:`handshake_timeout` | ``3.0`` | ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`CryptoKey` | :ref:`private_key` | | ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ +| :ref:`X509Certificate` | :ref:`ssl_certificate` | | ++-----------------------------------------------+----------------------------------------------------------------------------+---------+ + +Methods +------- + ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`disconnect_peer` **(** :ref:`int` id, :ref:`int` code=1000, :ref:`String` reason="" **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_peer_address` **(** :ref:`int` id **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_peer_port` **(** :ref:`int` id **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_peer` **(** :ref:`int` id **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_listening` **(** **)** |const| | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`listen` **(** :ref:`int` port, :ref:`PoolStringArray` protocols=PoolStringArray( ), :ref:`bool` gd_mp_api=false **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`stop` **(** **)** | ++---------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebSocketServer_signal_client_close_request: + +- **client_close_request** **(** :ref:`int` id, :ref:`int` code, :ref:`String` reason **)** + +Emitted when a client requests a clean close. You should keep polling until you get a :ref:`client_disconnected` signal with the same ``id`` to achieve the clean close. See :ref:`WebSocketPeer.close` for more details. + +---- + +.. _class_WebSocketServer_signal_client_connected: + +- **client_connected** **(** :ref:`int` id, :ref:`String` protocol **)** + +Emitted when a new client connects. "protocol" will be the sub-protocol agreed with the client. + +---- + +.. _class_WebSocketServer_signal_client_disconnected: + +- **client_disconnected** **(** :ref:`int` id, :ref:`bool` was_clean_close **)** + +Emitted when a client disconnects. ``was_clean_close`` will be ``true`` if the connection was shutdown cleanly. + +---- + +.. _class_WebSocketServer_signal_data_received: + +- **data_received** **(** :ref:`int` id **)** + +Emitted when a new message is received. + +**Note:** This signal is *not* emitted when used as high-level multiplayer peer. + +Property Descriptions +--------------------- + +.. _class_WebSocketServer_property_bind_ip: + +- :ref:`String` **bind_ip** + ++-----------+--------------------+ +| *Default* | ``"*"`` | ++-----------+--------------------+ +| *Setter* | set_bind_ip(value) | ++-----------+--------------------+ +| *Getter* | get_bind_ip() | ++-----------+--------------------+ + +When not set to ``*`` will restrict incoming connections to the specified IP address. Setting ``bind_ip`` to ``127.0.0.1`` will cause the server to listen only to the local host. + +---- + +.. _class_WebSocketServer_property_ca_chain: + +- :ref:`X509Certificate` **ca_chain** + ++----------+---------------------+ +| *Setter* | set_ca_chain(value) | ++----------+---------------------+ +| *Getter* | get_ca_chain() | ++----------+---------------------+ + +When using SSL (see :ref:`private_key` and :ref:`ssl_certificate`), you can set this to a valid :ref:`X509Certificate` to be provided as additional CA chain information during the SSL handshake. + +---- + +.. _class_WebSocketServer_property_handshake_timeout: + +- :ref:`float` **handshake_timeout** + ++-----------+------------------------------+ +| *Default* | ``3.0`` | ++-----------+------------------------------+ +| *Setter* | set_handshake_timeout(value) | ++-----------+------------------------------+ +| *Getter* | get_handshake_timeout() | ++-----------+------------------------------+ + +The time in seconds before a pending client (i.e. a client that has not yet finished the HTTP handshake) is considered stale and forcefully disconnected. + +---- + +.. _class_WebSocketServer_property_private_key: + +- :ref:`CryptoKey` **private_key** + ++----------+------------------------+ +| *Setter* | set_private_key(value) | ++----------+------------------------+ +| *Getter* | get_private_key() | ++----------+------------------------+ + +When set to a valid :ref:`CryptoKey` (along with :ref:`ssl_certificate`) will cause the server to require SSL instead of regular TCP (i.e. the ``wss://`` protocol). + +---- + +.. _class_WebSocketServer_property_ssl_certificate: + +- :ref:`X509Certificate` **ssl_certificate** + ++----------+----------------------------+ +| *Setter* | set_ssl_certificate(value) | ++----------+----------------------------+ +| *Getter* | get_ssl_certificate() | ++----------+----------------------------+ + +When set to a valid :ref:`X509Certificate` (along with :ref:`private_key`) will cause the server to require SSL instead of regular TCP (i.e. the ``wss://`` protocol). + +Method Descriptions +------------------- + +.. _class_WebSocketServer_method_disconnect_peer: + +- void **disconnect_peer** **(** :ref:`int` id, :ref:`int` code=1000, :ref:`String` reason="" **)** + +Disconnects the peer identified by ``id`` from the server. See :ref:`WebSocketPeer.close` for more information. + +---- + +.. _class_WebSocketServer_method_get_peer_address: + +- :ref:`String` **get_peer_address** **(** :ref:`int` id **)** |const| + +Returns the IP address of the given peer. + +---- + +.. _class_WebSocketServer_method_get_peer_port: + +- :ref:`int` **get_peer_port** **(** :ref:`int` id **)** |const| + +Returns the remote port of the given peer. + +---- + +.. _class_WebSocketServer_method_has_peer: + +- :ref:`bool` **has_peer** **(** :ref:`int` id **)** |const| + +Returns ``true`` if a peer with the given ID is connected. + +---- + +.. _class_WebSocketServer_method_is_listening: + +- :ref:`bool` **is_listening** **(** **)** |const| + +Returns ``true`` if the server is actively listening on a port. + +---- + +.. _class_WebSocketServer_method_listen: + +- :ref:`Error` **listen** **(** :ref:`int` port, :ref:`PoolStringArray` protocols=PoolStringArray( ), :ref:`bool` gd_mp_api=false **)** + +Starts listening on the given port. + +You can specify the desired subprotocols via the "protocols" array. If the list empty (default), no sub-protocol will be requested. + +If ``true`` is passed as ``gd_mp_api``, the server will behave like a network peer for the :ref:`MultiplayerAPI`, connections from non-Godot clients will not work, and :ref:`data_received` will not be emitted. + +If ``false`` is passed instead (default), you must call :ref:`PacketPeer` functions (``put_packet``, ``get_packet``, etc.), on the :ref:`WebSocketPeer` returned via ``get_peer(id)`` to communicate with the peer with given ``id`` (e.g. ``get_peer(id).get_available_packet_count``). + +---- + +.. _class_WebSocketServer_method_stop: + +- void **stop** **(** **)** + +Stops the server and clear its state. + +.. |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.)` diff --git a/classes/class_webxrinterface.rst b/classes/class_webxrinterface.rst new file mode 100644 index 0000000..4f9b6a0 --- /dev/null +++ b/classes/class_webxrinterface.rst @@ -0,0 +1,429 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WebXRInterface.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WebXRInterface: + +WebXRInterface +============== + +**Inherits:** :ref:`ARVRInterface` **<** :ref:`Reference` **<** :ref:`Object` + +AR/VR interface using WebXR. + +Description +----------- + +WebXR is an open standard that allows creating VR and AR applications that run in the web browser. + +As such, this interface is only available when running in an HTML5 export. + +WebXR supports a wide range of devices, from the very capable (like Valve Index, HTC Vive, Oculus Rift and Quest) down to the much less capable (like Google Cardboard, Oculus Go, GearVR, or plain smartphones). + +Since WebXR is based on Javascript, it makes extensive use of callbacks, which means that ``WebXRInterface`` is forced to use signals, where other AR/VR interfaces would instead use functions that return a result immediately. This makes ``WebXRInterface`` quite a bit more complicated to initialize than other AR/VR interfaces. + +Here's the minimum code required to start an immersive VR session: + +:: + + extends Spatial + + var webxr_interface + var vr_supported = false + + func _ready(): + # We assume this node has a button as a child. + # This button is for the user to consent to entering immersive VR mode. + $Button.connect("pressed", self, "_on_Button_pressed") + + webxr_interface = ARVRServer.find_interface("WebXR") + if webxr_interface: + # WebXR uses a lot of asynchronous callbacks, so we connect to various + # signals in order to receive them. + webxr_interface.connect("session_supported", self, "_webxr_session_supported") + webxr_interface.connect("session_started", self, "_webxr_session_started") + webxr_interface.connect("session_ended", self, "_webxr_session_ended") + webxr_interface.connect("session_failed", self, "_webxr_session_failed") + + # This returns immediately - our _webxr_session_supported() method + # (which we connected to the "session_supported" signal above) will + # be called sometime later to let us know if it's supported or not. + webxr_interface.is_session_supported("immersive-vr") + + func _webxr_session_supported(session_mode, supported): + if session_mode == 'immersive-vr': + vr_supported = supported + + func _on_Button_pressed(): + if not vr_supported: + OS.alert("Your browser doesn't support VR") + return + + # We want an immersive VR session, as opposed to AR ('immersive-ar') or a + # simple 3DoF viewer ('viewer'). + webxr_interface.session_mode = 'immersive-vr' + # 'bounded-floor' is room scale, 'local-floor' is a standing or sitting + # experience (it puts you 1.6m above the ground if you have 3DoF headset), + # whereas as 'local' puts you down at the ARVROrigin. + # This list means it'll first try to request 'bounded-floor', then + # fallback on 'local-floor' and ultimately 'local', if nothing else is + # supported. + webxr_interface.requested_reference_space_types = 'bounded-floor, local-floor, local' + # In order to use 'local-floor' or 'bounded-floor' we must also + # mark the features as required or optional. + webxr_interface.required_features = 'local-floor' + webxr_interface.optional_features = 'bounded-floor' + + # This will return false if we're unable to even request the session, + # however, it can still fail asynchronously later in the process, so we + # only know if it's really succeeded or failed when our + # _webxr_session_started() or _webxr_session_failed() methods are called. + if not webxr_interface.initialize(): + OS.alert("Failed to initialize") + return + + func _webxr_session_started(): + $Button.visible = false + # This tells Godot to start rendering to the headset. + get_viewport().arvr = true + # This will be the reference space type you ultimately got, out of the + # types that you requested above. This is useful if you want the game to + # work a little differently in 'bounded-floor' versus 'local-floor'. + print ("Reference space type: " + webxr_interface.reference_space_type) + + func _webxr_session_ended(): + $Button.visible = true + # If the user exits immersive mode, then we tell Godot to render to the web + # page again. + get_viewport().arvr = false + + func _webxr_session_failed(message): + OS.alert("Failed to initialize: " + message) + +There are several ways to handle "controller" input: + +- Using :ref:`ARVRController` nodes and their :ref:`ARVRController.button_pressed` and :ref:`ARVRController.button_release` signals. This is how controllers are typically handled in AR/VR apps in Godot, however, this will only work with advanced VR controllers like the Oculus Touch or Index controllers, for example. The buttons codes are defined by `Section 3.3 of the WebXR Gamepads Module `__. + +- Using :ref:`Node._unhandled_input` and :ref:`InputEventJoypadButton` or :ref:`InputEventJoypadMotion`. This works the same as normal joypads, except the :ref:`InputEvent.device` starts at 100, so the left controller is 100 and the right controller is 101, and the button codes are also defined by `Section 3.3 of the WebXR Gamepads Module `__. + +- Using the :ref:`select`, :ref:`squeeze` and related signals. This method will work for both advanced VR controllers, and non-traditional "controllers" like a tap on the screen, a spoken voice command or a button press on the device itself. The ``controller_id`` passed to these signals is the same id as used in :ref:`ARVRController.controller_id`. + +You can use one or all of these methods to allow your game or app to support a wider or narrower set of devices and input methods, or to allow more advanced interations with more advanced devices. + +Tutorials +--------- + +- `How to make a VR game for WebXR with Godot `__ + +Properties +---------- + ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`PoolVector3Array` | :ref:`bounds_geometry` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`optional_features` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`reference_space_type` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`requested_reference_space_types` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`required_features` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`session_mode` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`visibility_state` | ++-------------------------------------------------+-------------------------------------------------------------------------------------------------------+ + +Methods +------- + ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`ARVRPositionalTracker` | :ref:`get_controller` **(** :ref:`int` controller_id **)** |const| | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`is_session_supported` **(** :ref:`String` session_mode **)** | ++-----------------------------------------------------------+------------------------------------------------------------------------------------------------------------------------------------+ + +Signals +------- + +.. _class_WebXRInterface_signal_reference_space_reset: + +- **reference_space_reset** **(** **)** + +Emitted to indicate that the reference space has been reset or reconfigured. + +When (or whether) this is emitted depends on the user's browser or device, but may include when the user has changed the dimensions of their play space (which you may be able to access via :ref:`bounds_geometry`) or pressed/held a button to recenter their position. + +See `WebXR's XRReferenceSpace reset event `__ for more information. + +---- + +.. _class_WebXRInterface_signal_select: + +- **select** **(** :ref:`int` controller_id **)** + +Emitted after one of the "controllers" has finished its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_selectend: + +- **selectend** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has finished its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_selectstart: + +- **selectstart** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has started its "primary action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_session_ended: + +- **session_ended** **(** **)** + +Emitted when the user ends the WebXR session (which can be done using UI from the browser or device). + +At this point, you should do ``get_viewport().arvr = false`` to instruct Godot to resume rendering to the screen. + +---- + +.. _class_WebXRInterface_signal_session_failed: + +- **session_failed** **(** :ref:`String` message **)** + +Emitted by :ref:`ARVRInterface.initialize` if the session fails to start. + +``message`` may optionally contain an error message from WebXR, or an empty string if no message is available. + +---- + +.. _class_WebXRInterface_signal_session_started: + +- **session_started** **(** **)** + +Emitted by :ref:`ARVRInterface.initialize` if the session is successfully started. + +At this point, it's safe to do ``get_viewport().arvr = true`` to instruct Godot to start rendering to the AR/VR device. + +---- + +.. _class_WebXRInterface_signal_session_supported: + +- **session_supported** **(** :ref:`String` session_mode, :ref:`bool` supported **)** + +Emitted by :ref:`is_session_supported` to indicate if the given ``session_mode`` is supported or not. + +---- + +.. _class_WebXRInterface_signal_squeeze: + +- **squeeze** **(** :ref:`int` controller_id **)** + +Emitted after one of the "controllers" has finished its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_squeezeend: + +- **squeezeend** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has finished its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_squeezestart: + +- **squeezestart** **(** :ref:`int` controller_id **)** + +Emitted when one of the "controllers" has started its "primary squeeze action". + +Use :ref:`get_controller` to get more information about the controller. + +---- + +.. _class_WebXRInterface_signal_visibility_state_changed: + +- **visibility_state_changed** **(** **)** + +Emitted when :ref:`visibility_state` has changed. + +Property Descriptions +--------------------- + +.. _class_WebXRInterface_property_bounds_geometry: + +- :ref:`PoolVector3Array` **bounds_geometry** + ++----------+-----------------------+ +| *Getter* | get_bounds_geometry() | ++----------+-----------------------+ + +The vertices of a polygon which defines the boundaries of the user's play area. + +This will only be available if :ref:`reference_space_type` is ``"bounded-floor"`` and only on certain browsers and devices that support it. + +The :ref:`reference_space_reset` signal may indicate when this changes. + +---- + +.. _class_WebXRInterface_property_optional_features: + +- :ref:`String` **optional_features** + ++----------+------------------------------+ +| *Setter* | set_optional_features(value) | ++----------+------------------------------+ +| *Getter* | get_optional_features() | ++----------+------------------------------+ + +A comma-seperated list of optional features used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +If a user's browser or device doesn't support one of the given features, initialization will continue, but you won't be able to use the requested feature. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_reference_space_type: + +- :ref:`String` **reference_space_type** + ++----------+----------------------------+ +| *Getter* | get_reference_space_type() | ++----------+----------------------------+ + +The reference space type (from the list of requested types set in the :ref:`requested_reference_space_types` property), that was ultimately used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_requested_reference_space_types: + +- :ref:`String` **requested_reference_space_types** + ++----------+--------------------------------------------+ +| *Setter* | set_requested_reference_space_types(value) | ++----------+--------------------------------------------+ +| *Getter* | get_requested_reference_space_types() | ++----------+--------------------------------------------+ + +A comma-seperated list of reference space types used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +The reference space types are requested in order, and the first on supported by the users device or browser will be used. The :ref:`reference_space_type` property contains the reference space type that was ultimately used. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_required_features: + +- :ref:`String` **required_features** + ++----------+------------------------------+ +| *Setter* | set_required_features(value) | ++----------+------------------------------+ +| *Getter* | get_required_features() | ++----------+------------------------------+ + +A comma-seperated list of required features used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +If a user's browser or device doesn't support one of the given features, initialization will fail and :ref:`session_failed` will be emitted. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRReferenceSpaceType `__. If you want to use a particular reference space type, it must be listed in either :ref:`required_features` or :ref:`optional_features`. + +---- + +.. _class_WebXRInterface_property_session_mode: + +- :ref:`String` **session_mode** + ++----------+-------------------------+ +| *Setter* | set_session_mode(value) | ++----------+-------------------------+ +| *Getter* | get_session_mode() | ++----------+-------------------------+ + +The session mode used by :ref:`ARVRInterface.initialize` when setting up the WebXR session. + +This doesn't have any effect on the interface when already initialized. + +Possible values come from `WebXR's XRSessionMode `__, including: ``"immersive-vr"``, ``"immersive-ar"``, and ``"inline"``. + +---- + +.. _class_WebXRInterface_property_visibility_state: + +- :ref:`String` **visibility_state** + ++----------+------------------------+ +| *Getter* | get_visibility_state() | ++----------+------------------------+ + +Indicates if the WebXR session's imagery is visible to the user. + +Possible values come from `WebXR's XRVisibilityState `__, including ``"hidden"``, ``"visible"``, and ``"visible-blurred"``. + +Method Descriptions +------------------- + +.. _class_WebXRInterface_method_get_controller: + +- :ref:`ARVRPositionalTracker` **get_controller** **(** :ref:`int` controller_id **)** |const| + +Gets an :ref:`ARVRPositionalTracker` for the given ``controller_id``. + +In the context of WebXR, a "controller" can be an advanced VR controller like the Oculus Touch or Index controllers, or even a tap on the screen, a spoken voice command or a button press on the device itself. When a non-traditional controller is used, interpret the position and orientation of the :ref:`ARVRPositionalTracker` as a ray pointing at the object the user wishes to interact with. + +Use this method to get information about the controller that triggered one of these signals: + +- :ref:`selectstart` + +- :ref:`select` + +- :ref:`selectend` + +- :ref:`squeezestart` + +- :ref:`squeeze` + +- :ref:`squeezestart` + +---- + +.. _class_WebXRInterface_method_is_session_supported: + +- void **is_session_supported** **(** :ref:`String` session_mode **)** + +Checks if the given ``session_mode`` is supported by the user's browser. + +Possible values come from `WebXR's XRSessionMode `__, including: ``"immersive-vr"``, ``"immersive-ar"``, and ``"inline"``. + +This method returns nothing, instead it emits the :ref:`session_supported` signal with the result. + +.. |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.)` diff --git a/classes/class_windowdialog.rst b/classes/class_windowdialog.rst new file mode 100644 index 0000000..4e4ee51 --- /dev/null +++ b/classes/class_windowdialog.rst @@ -0,0 +1,201 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the WindowDialog.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WindowDialog: + +WindowDialog +============ + +**Inherits:** :ref:`Popup` **<** :ref:`Control` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +**Inherited By:** :ref:`AcceptDialog` + +Base class for window dialogs. + +Description +----------- + +Windowdialog is the base class for all window-based dialogs. It's a by-default toplevel :ref:`Control` that draws a window decoration and allows motion and resizing. + +Properties +---------- + ++-----------------------------+---------------------------------------------------------------+-----------+ +| :ref:`bool` | :ref:`resizable` | ``false`` | ++-----------------------------+---------------------------------------------------------------+-----------+ +| :ref:`String` | :ref:`window_title` | ``""`` | ++-----------------------------+---------------------------------------------------------------+-----------+ + +Methods +------- + ++-------------------------------------------+---------------------------------------------------------------------------------+ +| :ref:`TextureButton` | :ref:`get_close_button` **(** **)** | ++-------------------------------------------+---------------------------------------------------------------------------------+ + +Theme Properties +---------------- + ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Color` | :ref:`title_color` | ``Color( 0, 0, 0, 1 )`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`close_h_ofs` | ``18`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`close_v_ofs` | ``18`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`scaleborder_size` | ``4`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`int` | :ref:`title_height` | ``20`` | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Font` | :ref:`title_font` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`close` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`Texture` | :ref:`close_highlight` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ +| :ref:`StyleBox` | :ref:`panel` | | ++---------------------------------+-----------------------------------------------------------------------------+-------------------------+ + +Property Descriptions +--------------------- + +.. _class_WindowDialog_property_resizable: + +- :ref:`bool` **resizable** + ++-----------+----------------------+ +| *Default* | ``false`` | ++-----------+----------------------+ +| *Setter* | set_resizable(value) | ++-----------+----------------------+ +| *Getter* | get_resizable() | ++-----------+----------------------+ + +If ``true``, the user can resize the window. + +---- + +.. _class_WindowDialog_property_window_title: + +- :ref:`String` **window_title** + ++-----------+------------------+ +| *Default* | ``""`` | ++-----------+------------------+ +| *Setter* | set_title(value) | ++-----------+------------------+ +| *Getter* | get_title() | ++-----------+------------------+ + +The text displayed in the window's title bar. + +Method Descriptions +------------------- + +.. _class_WindowDialog_method_get_close_button: + +- :ref:`TextureButton` **get_close_button** **(** **)** + +Returns the close :ref:`TextureButton`. + +**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` property. + +Theme Property Descriptions +--------------------------- + +.. _class_WindowDialog_theme_color_title_color: + +- :ref:`Color` **title_color** + ++-----------+-------------------------+ +| *Default* | ``Color( 0, 0, 0, 1 )`` | ++-----------+-------------------------+ + +The color of the title text. + +---- + +.. _class_WindowDialog_theme_constant_close_h_ofs: + +- :ref:`int` **close_h_ofs** + ++-----------+--------+ +| *Default* | ``18`` | ++-----------+--------+ + +The horizontal offset of the close button. + +---- + +.. _class_WindowDialog_theme_constant_close_v_ofs: + +- :ref:`int` **close_v_ofs** + ++-----------+--------+ +| *Default* | ``18`` | ++-----------+--------+ + +The vertical offset of the close button. + +---- + +.. _class_WindowDialog_theme_constant_scaleborder_size: + +- :ref:`int` **scaleborder_size** + ++-----------+-------+ +| *Default* | ``4`` | ++-----------+-------+ + +The thickness of the border that can be dragged when scaling the window (if :ref:`resizable` is enabled). + +---- + +.. _class_WindowDialog_theme_constant_title_height: + +- :ref:`int` **title_height** + ++-----------+--------+ +| *Default* | ``20`` | ++-----------+--------+ + +The vertical offset of the title text. + +---- + +.. _class_WindowDialog_theme_font_title_font: + +- :ref:`Font` **title_font** + +The font used to draw the title. + +---- + +.. _class_WindowDialog_theme_icon_close: + +- :ref:`Texture` **close** + +The icon for the close button. + +---- + +.. _class_WindowDialog_theme_icon_close_highlight: + +- :ref:`Texture` **close_highlight** + +The icon used for the close button when it's hovered with the mouse cursor. + +---- + +.. _class_WindowDialog_theme_style_panel: + +- :ref:`StyleBox` **panel** + +The style for both the content background of the ``WindowDialog`` and the title bar. The title bar is created with a top border and an expand margin using the ``panel`` stylebox. + +.. |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.)` diff --git a/classes/class_world.rst b/classes/class_world.rst new file mode 100644 index 0000000..59958b7 --- /dev/null +++ b/classes/class_world.rst @@ -0,0 +1,108 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the World.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_World: + +World +===== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class that has everything pertaining to a world. + +Description +----------- + +Class that has everything pertaining to a world. A physics space, a visual scenario and a sound space. Spatial nodes register their resources into the current world. + +Tutorials +--------- + +- :doc:`../tutorials/physics/ray-casting` + +Properties +---------- + ++---------------------------------------------------------------+------------------------------------------------------------------------+ +| :ref:`PhysicsDirectSpaceState` | :ref:`direct_space_state` | ++---------------------------------------------------------------+------------------------------------------------------------------------+ +| :ref:`Environment` | :ref:`environment` | ++---------------------------------------------------------------+------------------------------------------------------------------------+ +| :ref:`Environment` | :ref:`fallback_environment` | ++---------------------------------------------------------------+------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`scenario` | ++---------------------------------------------------------------+------------------------------------------------------------------------+ +| :ref:`RID` | :ref:`space` | ++---------------------------------------------------------------+------------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_World_property_direct_space_state: + +- :ref:`PhysicsDirectSpaceState` **direct_space_state** + ++----------+--------------------------+ +| *Getter* | get_direct_space_state() | ++----------+--------------------------+ + +Direct access to the world's physics 3D space state. Used for querying current and potential collisions. + +---- + +.. _class_World_property_environment: + +- :ref:`Environment` **environment** + ++----------+------------------------+ +| *Setter* | set_environment(value) | ++----------+------------------------+ +| *Getter* | get_environment() | ++----------+------------------------+ + +The World's :ref:`Environment`. + +---- + +.. _class_World_property_fallback_environment: + +- :ref:`Environment` **fallback_environment** + ++----------+---------------------------------+ +| *Setter* | set_fallback_environment(value) | ++----------+---------------------------------+ +| *Getter* | get_fallback_environment() | ++----------+---------------------------------+ + +The World's fallback_environment will be used if the World's :ref:`Environment` fails or is missing. + +---- + +.. _class_World_property_scenario: + +- :ref:`RID` **scenario** + ++----------+----------------+ +| *Getter* | get_scenario() | ++----------+----------------+ + +The World's visual scenario. + +---- + +.. _class_World_property_space: + +- :ref:`RID` **space** + ++----------+-------------+ +| *Getter* | get_space() | ++----------+-------------+ + +The World's physics space. + +.. |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.)` diff --git a/classes/class_world2d.rst b/classes/class_world2d.rst new file mode 100644 index 0000000..383dbc0 --- /dev/null +++ b/classes/class_world2d.rst @@ -0,0 +1,76 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the World2D.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_World2D: + +World2D +======= + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +Class that has everything pertaining to a 2D world. + +Description +----------- + +Class that has everything pertaining to a 2D world. A physics space, a visual scenario and a sound space. 2D nodes register their resources into the current 2D world. + +Tutorials +--------- + +- :doc:`../tutorials/physics/ray-casting` + +Properties +---------- + ++-------------------------------------------------------------------+----------------------------------------------------------------------+ +| :ref:`RID` | :ref:`canvas` | ++-------------------------------------------------------------------+----------------------------------------------------------------------+ +| :ref:`Physics2DDirectSpaceState` | :ref:`direct_space_state` | ++-------------------------------------------------------------------+----------------------------------------------------------------------+ +| :ref:`RID` | :ref:`space` | ++-------------------------------------------------------------------+----------------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_World2D_property_canvas: + +- :ref:`RID` **canvas** + ++----------+--------------+ +| *Getter* | get_canvas() | ++----------+--------------+ + +The :ref:`RID` of this world's canvas resource. Used by the :ref:`VisualServer` for 2D drawing. + +---- + +.. _class_World2D_property_direct_space_state: + +- :ref:`Physics2DDirectSpaceState` **direct_space_state** + ++----------+--------------------------+ +| *Getter* | get_direct_space_state() | ++----------+--------------------------+ + +Direct access to the world's physics 2D space state. Used for querying current and potential collisions. When using multi-threaded physics, access is limited to ``_physics_process(delta)`` in the main thread. + +---- + +.. _class_World2D_property_space: + +- :ref:`RID` **space** + ++----------+-------------+ +| *Getter* | get_space() | ++----------+-------------+ + +The :ref:`RID` of this world's physics space resource. Used by the :ref:`Physics2DServer` for 2D physics, treating it as both a space and an area. + +.. |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.)` diff --git a/classes/class_worldenvironment.rst b/classes/class_worldenvironment.rst new file mode 100644 index 0000000..43ba13a --- /dev/null +++ b/classes/class_worldenvironment.rst @@ -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 WorldEnvironment.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_WorldEnvironment: + +WorldEnvironment +================ + +**Inherits:** :ref:`Node` **<** :ref:`Object` + +Default environment properties for the entire scene (post-processing effects, lighting and background settings). + +Description +----------- + +The ``WorldEnvironment`` node is used to configure the default :ref:`Environment` for the scene. + +The parameters defined in the ``WorldEnvironment`` can be overridden by an :ref:`Environment` node set on the current :ref:`Camera`. Additionally, only one ``WorldEnvironment`` may be instanced in a given scene at a time. + +The ``WorldEnvironment`` allows the user to specify default lighting parameters (e.g. ambient lighting), various post-processing effects (e.g. SSAO, DOF, Tonemapping), and how to draw the background (e.g. solid color, skybox). Usually, these are added in order to improve the realism/color balance of the scene. + +Tutorials +--------- + +- :doc:`../tutorials/3d/environment_and_post_processing` + +- `3D Material Testers Demo `__ + +- `2D HDR Demo `__ + +- `Third Person Shooter Demo `__ + +Properties +---------- + ++---------------------------------------+-----------------------------------------------------------------+ +| :ref:`Environment` | :ref:`environment` | ++---------------------------------------+-----------------------------------------------------------------+ + +Property Descriptions +--------------------- + +.. _class_WorldEnvironment_property_environment: + +- :ref:`Environment` **environment** + ++----------+------------------------+ +| *Setter* | set_environment(value) | ++----------+------------------------+ +| *Getter* | get_environment() | ++----------+------------------------+ + +The :ref:`Environment` resource used by this ``WorldEnvironment``, defining the default properties. + +.. |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.)` diff --git a/classes/class_x509certificate.rst b/classes/class_x509certificate.rst new file mode 100644 index 0000000..77b97ef --- /dev/null +++ b/classes/class_x509certificate.rst @@ -0,0 +1,53 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the X509Certificate.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_X509Certificate: + +X509Certificate +=============== + +**Inherits:** :ref:`Resource` **<** :ref:`Reference` **<** :ref:`Object` + +An X509 certificate (e.g. for SSL). + +Description +----------- + +The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other :ref:`Resource`. + +They can be used as the server certificate in :ref:`StreamPeerSSL.accept_stream` (along with the proper :ref:`CryptoKey`), and to specify the only certificate that should be accepted when connecting to an SSL server via :ref:`StreamPeerSSL.connect_to_stream`. + +**Note:** Not available in HTML5 exports. + +Methods +------- + ++---------------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`load` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`save` **(** :ref:`String` path **)** | ++---------------------------------------+---------------------------------------------------------------------------------------------+ + +Method Descriptions +------------------- + +.. _class_X509Certificate_method_load: + +- :ref:`Error` **load** **(** :ref:`String` path **)** + +Loads a certificate from ``path`` ("\*.crt" file). + +---- + +.. _class_X509Certificate_method_save: + +- :ref:`Error` **save** **(** :ref:`String` path **)** + +Saves a certificate to the given ``path`` (should be a "\*.crt" file). + +.. |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.)` diff --git a/classes/class_xmlparser.rst b/classes/class_xmlparser.rst new file mode 100644 index 0000000..487e25a --- /dev/null +++ b/classes/class_xmlparser.rst @@ -0,0 +1,234 @@ +:github_url: hide + +.. Generated automatically by doc/tools/make_rst.py in Godot's source tree. +.. DO NOT EDIT THIS FILE, but the XMLParser.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_XMLParser: + +XMLParser +========= + +**Inherits:** :ref:`Reference` **<** :ref:`Object` + +Low-level class for creating parsers for `XML `__ files. + +Description +----------- + +This class can serve as base to make custom XML parsers. Since XML is a very flexible standard, this interface is low-level so it can be applied to any possible schema. + +Methods +------- + ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_attribute_count` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_attribute_name` **(** :ref:`int` idx **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_attribute_value` **(** :ref:`int` idx **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_current_line` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_named_attribute_value` **(** :ref:`String` name **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_named_attribute_value_safe` **(** :ref:`String` name **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_data` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`String` | :ref:`get_node_name` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`int` | :ref:`get_node_offset` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`NodeType` | :ref:`get_node_type` **(** **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`has_attribute` **(** :ref:`String` name **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`bool` | :ref:`is_empty` **(** **)** |const| | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open` **(** :ref:`String` file **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`open_buffer` **(** :ref:`PoolByteArray` buffer **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`read` **(** **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| :ref:`Error` | :ref:`seek` **(** :ref:`int` position **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ +| void | :ref:`skip_section` **(** **)** | ++------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------+ + +Enumerations +------------ + +.. _enum_XMLParser_NodeType: + +.. _class_XMLParser_constant_NODE_NONE: + +.. _class_XMLParser_constant_NODE_ELEMENT: + +.. _class_XMLParser_constant_NODE_ELEMENT_END: + +.. _class_XMLParser_constant_NODE_TEXT: + +.. _class_XMLParser_constant_NODE_COMMENT: + +.. _class_XMLParser_constant_NODE_CDATA: + +.. _class_XMLParser_constant_NODE_UNKNOWN: + +enum **NodeType**: + +- **NODE_NONE** = **0** --- There's no node (no file or buffer opened). + +- **NODE_ELEMENT** = **1** --- Element (tag). + +- **NODE_ELEMENT_END** = **2** --- End of element. + +- **NODE_TEXT** = **3** --- Text node. + +- **NODE_COMMENT** = **4** --- Comment node. + +- **NODE_CDATA** = **5** --- CDATA content. + +- **NODE_UNKNOWN** = **6** --- Unknown node. + +Method Descriptions +------------------- + +.. _class_XMLParser_method_get_attribute_count: + +- :ref:`int` **get_attribute_count** **(** **)** |const| + +Gets the amount of attributes in the current element. + +---- + +.. _class_XMLParser_method_get_attribute_name: + +- :ref:`String` **get_attribute_name** **(** :ref:`int` idx **)** |const| + +Gets the name of the attribute specified by the index in ``idx`` argument. + +---- + +.. _class_XMLParser_method_get_attribute_value: + +- :ref:`String` **get_attribute_value** **(** :ref:`int` idx **)** |const| + +Gets the value of the attribute specified by the index in ``idx`` argument. + +---- + +.. _class_XMLParser_method_get_current_line: + +- :ref:`int` **get_current_line** **(** **)** |const| + +Gets the current line in the parsed file (currently not implemented). + +---- + +.. _class_XMLParser_method_get_named_attribute_value: + +- :ref:`String` **get_named_attribute_value** **(** :ref:`String` name **)** |const| + +Gets the value of a certain attribute of the current element by name. This will raise an error if the element has no such attribute. + +---- + +.. _class_XMLParser_method_get_named_attribute_value_safe: + +- :ref:`String` **get_named_attribute_value_safe** **(** :ref:`String` name **)** |const| + +Gets the value of a certain attribute of the current element by name. This will return an empty :ref:`String` if the attribute is not found. + +---- + +.. _class_XMLParser_method_get_node_data: + +- :ref:`String` **get_node_data** **(** **)** |const| + +Gets the contents of a text node. This will raise an error in any other type of node. + +---- + +.. _class_XMLParser_method_get_node_name: + +- :ref:`String` **get_node_name** **(** **)** |const| + +Gets the name of the current element node. This will raise an error if the current node type is neither :ref:`NODE_ELEMENT` nor :ref:`NODE_ELEMENT_END`. + +---- + +.. _class_XMLParser_method_get_node_offset: + +- :ref:`int` **get_node_offset** **(** **)** |const| + +Gets the byte offset of the current node since the beginning of the file or buffer. + +---- + +.. _class_XMLParser_method_get_node_type: + +- :ref:`NodeType` **get_node_type** **(** **)** + +Gets the type of the current node. Compare with :ref:`NodeType` constants. + +---- + +.. _class_XMLParser_method_has_attribute: + +- :ref:`bool` **has_attribute** **(** :ref:`String` name **)** |const| + +Check whether the current element has a certain attribute. + +---- + +.. _class_XMLParser_method_is_empty: + +- :ref:`bool` **is_empty** **(** **)** |const| + +Check whether the current element is empty (this only works for completely empty tags, e.g. ````). + +---- + +.. _class_XMLParser_method_open: + +- :ref:`Error` **open** **(** :ref:`String` file **)** + +Opens an XML file for parsing. This returns an error code. + +---- + +.. _class_XMLParser_method_open_buffer: + +- :ref:`Error` **open_buffer** **(** :ref:`PoolByteArray` buffer **)** + +Opens an XML raw buffer for parsing. This returns an error code. + +---- + +.. _class_XMLParser_method_read: + +- :ref:`Error` **read** **(** **)** + +Reads the next node of the file. This returns an error code. + +---- + +.. _class_XMLParser_method_seek: + +- :ref:`Error` **seek** **(** :ref:`int` position **)** + +Moves the buffer cursor to a certain offset (since the beginning) and read the next node there. This returns an error code. + +---- + +.. _class_XMLParser_method_skip_section: + +- void **skip_section** **(** **)** + +Skips the current section. If the node contains other elements, they will be ignored and the cursor will go to the closing of the current element. + +.. |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.)` diff --git a/classes/class_ysort.rst b/classes/class_ysort.rst new file mode 100644 index 0000000..cf76bf9 --- /dev/null +++ b/classes/class_ysort.rst @@ -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 YSort.xml source instead. +.. The source is found in doc/classes or modules//doc_classes. + +.. _class_YSort: + +YSort +===== + +**Inherits:** :ref:`Node2D` **<** :ref:`CanvasItem` **<** :ref:`Node` **<** :ref:`Object` + +Sort all child nodes based on their Y positions. + +Description +----------- + +Sort all child nodes based on their Y positions. The child node must inherit from :ref:`CanvasItem` for it to be sorted. Nodes that have a higher Y position will be drawn later, so they will appear on top of nodes that have a lower Y position. + +Nesting of YSort nodes is possible. Children YSort nodes will be sorted in the same space as the parent YSort, allowing to better organize a scene or divide it in multiple ones, yet keep the unique sorting. + +Properties +---------- + ++-------------------------+--------------------------------------------------------+----------+ +| :ref:`bool` | :ref:`sort_enabled` | ``true`` | ++-------------------------+--------------------------------------------------------+----------+ + +Property Descriptions +--------------------- + +.. _class_YSort_property_sort_enabled: + +- :ref:`bool` **sort_enabled** + ++-----------+-------------------------+ +| *Default* | ``true`` | ++-----------+-------------------------+ +| *Setter* | set_sort_enabled(value) | ++-----------+-------------------------+ +| *Getter* | is_sort_enabled() | ++-----------+-------------------------+ + +If ``true``, child nodes are sorted, otherwise sorting is disabled. + +.. |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.)` diff --git a/classes/index.rst b/classes/index.rst new file mode 100644 index 0000000..1859465 --- /dev/null +++ b/classes/index.rst @@ -0,0 +1,11 @@ +:github_url: hide + +Godot API +========= + +.. toctree:: + :maxdepth: 1 + :name: toc-class-ref + :glob: + + class_* diff --git a/community/asset_library/img/assetlib_asset.png b/community/asset_library/img/assetlib_asset.png new file mode 100644 index 0000000..10319e4 Binary files /dev/null and b/community/asset_library/img/assetlib_asset.png differ diff --git a/community/asset_library/img/assetlib_editor.png b/community/asset_library/img/assetlib_editor.png new file mode 100644 index 0000000..c7c5776 Binary files /dev/null and b/community/asset_library/img/assetlib_editor.png differ diff --git a/community/asset_library/img/assetlib_editor_asset.png b/community/asset_library/img/assetlib_editor_asset.png new file mode 100644 index 0000000..16ebd9b Binary files /dev/null and b/community/asset_library/img/assetlib_editor_asset.png differ diff --git a/community/asset_library/img/assetlib_editor_download.png b/community/asset_library/img/assetlib_editor_download.png new file mode 100644 index 0000000..7b8dc79 Binary files /dev/null and b/community/asset_library/img/assetlib_editor_download.png differ diff --git a/community/asset_library/img/assetlib_editor_installer.png b/community/asset_library/img/assetlib_editor_installer.png new file mode 100644 index 0000000..c6dcf77 Binary files /dev/null and b/community/asset_library/img/assetlib_editor_installer.png differ diff --git a/community/asset_library/img/assetlib_editor_installer_error.png b/community/asset_library/img/assetlib_editor_installer_error.png new file mode 100644 index 0000000..b1080f4 Binary files /dev/null and b/community/asset_library/img/assetlib_editor_installer_error.png differ diff --git a/community/asset_library/img/assetlib_editor_installer_success.png b/community/asset_library/img/assetlib_editor_installer_success.png new file mode 100644 index 0000000..a673cba Binary files /dev/null and b/community/asset_library/img/assetlib_editor_installer_success.png differ diff --git a/community/asset_library/img/assetlib_editor_projects.png b/community/asset_library/img/assetlib_editor_projects.png new file mode 100644 index 0000000..af95754 Binary files /dev/null and b/community/asset_library/img/assetlib_editor_projects.png differ diff --git a/community/asset_library/img/assetlib_editor_workspace.png b/community/asset_library/img/assetlib_editor_workspace.png new file mode 100644 index 0000000..b569767 Binary files /dev/null and b/community/asset_library/img/assetlib_editor_workspace.png differ diff --git a/community/asset_library/img/assetlib_login.png b/community/asset_library/img/assetlib_login.png new file mode 100644 index 0000000..67a09a7 Binary files /dev/null and b/community/asset_library/img/assetlib_login.png differ diff --git a/community/asset_library/img/assetlib_login_header.png b/community/asset_library/img/assetlib_login_header.png new file mode 100644 index 0000000..eeaf8f9 Binary files /dev/null and b/community/asset_library/img/assetlib_login_header.png differ diff --git a/community/asset_library/img/assetlib_register-login.png b/community/asset_library/img/assetlib_register-login.png new file mode 100644 index 0000000..c5dffee Binary files /dev/null and b/community/asset_library/img/assetlib_register-login.png differ diff --git a/community/asset_library/img/assetlib_register.png b/community/asset_library/img/assetlib_register.png new file mode 100644 index 0000000..370bffb Binary files /dev/null and b/community/asset_library/img/assetlib_register.png differ diff --git a/community/asset_library/img/assetlib_search.png b/community/asset_library/img/assetlib_search.png new file mode 100644 index 0000000..87b8c8f Binary files /dev/null and b/community/asset_library/img/assetlib_search.png differ diff --git a/community/asset_library/img/assetlib_submit.png b/community/asset_library/img/assetlib_submit.png new file mode 100644 index 0000000..587e031 Binary files /dev/null and b/community/asset_library/img/assetlib_submit.png differ diff --git a/community/asset_library/img/assetlib_website.png b/community/asset_library/img/assetlib_website.png new file mode 100644 index 0000000..ec6cf5c Binary files /dev/null and b/community/asset_library/img/assetlib_website.png differ diff --git a/community/asset_library/index.rst b/community/asset_library/index.rst new file mode 100644 index 0000000..78bb27d --- /dev/null +++ b/community/asset_library/index.rst @@ -0,0 +1,10 @@ +Asset Library +============= + +.. toctree:: + :maxdepth: 1 + :name: toc-learn-features-assetlib + + what_is_assetlib + using_assetlib + submitting_to_assetlib diff --git a/community/asset_library/submitting_to_assetlib.rst b/community/asset_library/submitting_to_assetlib.rst new file mode 100644 index 0000000..07eaf78 --- /dev/null +++ b/community/asset_library/submitting_to_assetlib.rst @@ -0,0 +1,211 @@ +.. _doc_submitting_to_assetlib: + +Submitting to the Asset Library +=============================== + +Introduction +------------ + +This tutorial aims to serve as a guide on how you can submit your own assets +to the `Godot Asset Library `_ +and share them with the Godot community. + +As mentioned in the :ref:`doc_using_assetlib` document, in order to be able to +submit assets to the AssetLib, you need to have a registered account, and be +logged in. + +Submission guidelines +--------------------- + +Before submitting your asset, please ensure it follows all of the +requirements, and also consider following the recommendations. + +Requirements +~~~~~~~~~~~~ + +Generally speaking, most assets people submit to the asset library +are accepted. However, in order for your asset to be accepted, there +are a few requirements your asset needs to meet to be approved. + +* The asset must **work**. If the asset doesn't run or otherwise doesn't + work in the specified Godot version, then it will be rejected. + +* The asset must have a proper **.gitignore** file. It's important to + keep redundant data out of the repository. + `Here's a template. `_ + +* No **submodules**, or any submodules must be non-essential. GitHub + does not include submodules in the downloaded ZIP file, so if the + asset needs the contents of the submodule, your asset won't work. + +* The **license** needs to be correct. The license listed on the asset + library must match the license in the repository. The repo MUST + have a license file, called either "LICENSE" or "LICENSE.md". + This file must contain the license text itself and a copyright + statement that includes the year(s) and copyright holder. + +* Use proper **English** for the name and description of your asset. + This includes using correct capitalization, and using full + sentences in the description. You can also include other languages, + but there should at least be an English version. + +* The icon link must be a **direct link**. For icons hosted on GitHub, the + link must start with "raw.githubusercontent.com", not "github.com". + +Recommendations +~~~~~~~~~~~~~~~ + +These things are not required for your asset to be approved, but +if you follow these recommendations, you can help make the asset +library a better place for all users. + +* Fix or suppress all script **warnings**. The warning system is there to + help identify issues with your code, but people using your asset + don't need to see them. + +* Make your code conform to the official **style guides**. Having a + consistent style helps other people read your code, and it also helps + if other people wish to contribute to your asset. See: the + :ref:`doc_gdscript_styleguide` or the :ref:`doc_c_sharp_styleguide`. + +* If you have screenshots in your repo, place them in their own subfolder + and add an empty **.gdignore** file in the same folder (note: **gd**, not **git**). + This prevents Godot from importing your screenshots. + On Windows, open a command prompt in the project folder and run + ``type nul > .gdignore`` to create a file whose name starts with a period. + +* If your asset is a library for working with other files, + consider including **example files** in the asset. + +* Consider adding a **.gitattributes** file to your repo. This file allows + giving extra instructions to Git, such as specifying line endings and listing + files not required for your asset to function with the ``export-ignore`` + directive. This directive removes such files from the resulting ZIP file + and prevents them from being downloaded by the asset library users. + For a typical plugin **.gitattributes** may look like this: + + .. code-block:: none + + # Normalize EOL for all files that Git considers text files. + * text=auto eol=lf + + # Ignore some files when exporting to a ZIP. + /.gitattributes export-ignore + /.gitignore export-ignore + /LICENSE export-ignore + /LICENSE.md export-ignore + /README.md export-ignore + /project.godot export-ignore + /icon.png export-ignore + /icon.svg export-ignore + + Other types of assets may require a different configuration (e.g. + a project template requires **project.godot**). + +* If you are submitting a plugin, add a **copy** of your license and readme + to the plugin folder itself. This is the folder that users are guaranteed to + keep with their project, so a copy ensures they always have those files handy + (and helps them fulfill your licensing terms). + +* The **icon** should be a square, its aspect ratio should be 1:1. It should + also ideally have a minimum resolution of 64x64 pixels. + +* While the asset library allows more than just GitHub, consider + hosting your asset's source code on **GitHub**. Other services may not + work reliably, and a lack of familiarity can be a barrier to contributors. + +Submitting +---------- + +Once you are logged in, you will be able to head over to the "Submit Assets" page +of the AssetLib, which will look like this: + +|image0| + +While it may look like a lot (and there is more as you scroll down), each field is +described in terms of what you should put in. We will nonetheless go over what +is required in the submission form here as well. + +* **Asset Name**: + The name of your asset. Should be a unique, descriptive title of + what your asset is. +* **Category**: + The category that your asset belongs to, and will be shown in + search results. The category is split into **Addons** and **Projects**. + In-editor, assets of the Project type (Templates, Demos, Projects) only show + up when viewing the AssetLib from the Project Manager, while assets of the + Addon type will only be visible from inside a project. +* **Godot version**: + The version of the engine that the asset works with. + Currently, it's not possible to have a single asset entry contain downloads for + multiple engine versions, so you may need to re-submit the asset multiple times, + with an entry for each Godot version it supports. This is particularly important + when dealing with major versions of the engine, such as Godot 2.x and Godot 3.x. +* **Version**: + The version number of the asset. While you are free to choose + and use any versioning scheme that you like, you may want to look into + something such as `SemVer `_ if you want your asset's + versioning scheme to be clear and consistent. Note that there is also an + internal version number, incremented every time the asset download URL is + changed or updated. +* **Repository host**: + Assets uploaded to the AssetLib are not hosted on it + directly. Instead, they point to repositories hosted on third-party Git providers, + such as GitHub, GitLab or Bitbucket. This is where you choose which provider + your asset uses, so the site can compute the final download link. +* **Repository URL**: + The URL to your asset's files/webpage. This will vary + based on your choice of provider, but it should look similar to `https://github.com//`. +* **Issues URL**: + The URL to your asset's issue tracker. Again, this will differ + from repository host to repository host, but will likely look similar to + `https://github.com///issues`. You may leave this field empty + if you use your provider's issue tracker, and it's part of the same repository. +* **Download Commit**: + The commit of the asset. For example, + `b1d3172f89b86e52465a74f63a74ac84c491d3e1`. The site computes + the actual download URL from this. +* **Icon URL**: + The URL to your asset's icon (which will be used as a thumbnail + in the AssetLib search results and on the asset's page). Should be an image + in either the PNG or JPG format. +* **License**: + The license under which you are distributing the asset. The list + includes a variety of free and open-source software licenses, such as GPL + (v2 and v3), MIT, BSD and Boost Software License. You can visit `OpenSource.org `_ + for a detailed description of each of the listed licenses. +* **Description**: + Finally, you can use the Description field for a textual + overview of your asset, its features and behavior, a changelog, et cetera. In the + future, formatting with Markdown will be supported, but currently, your only + option is plain text. + +You may also include up to three video and/or image previews, which will be shown +at the bottom of the asset page. Use the "Enable" checkbox on each of the preview +submission boxes to enable them. + +* **Type**: + Either an image, or a video. +* **Image/YouTube URL**: + Either a link to the image, or to a video, hosted on YouTube. +* **Thumbnail URL**: + A URL to an image that will be used as a thumbnail for the + preview. This option will be removed eventually, and thumbnails will be automatically + computed instead. + +Once you are done, press "Submit". Your asset will be entered into the review queue. +You can check all assets currently pending a review `here `_ . +The approval process is manual and may take up to a few days for your asset to be accepted (or rejected), so please +be patient! + +.. note:: + + You may have some luck accelerating the approval process by messaging the + moderators and AssetLib reviewers on the `Godot Contributors Chat `_, + or the official Discord server. + +You will be informed when your asset is reviewed. If it was rejected, +you will be told why that may have been, and you will be able to submit it again +with the appropriate changes. + +.. |image0| image:: img/assetlib_submit.png diff --git a/community/asset_library/using_assetlib.rst b/community/asset_library/using_assetlib.rst new file mode 100644 index 0000000..3ca1a6e --- /dev/null +++ b/community/asset_library/using_assetlib.rst @@ -0,0 +1,199 @@ +.. _doc_using_assetlib: + +Using the Asset Library +======================= + +On the website +-------------- + +Overview +~~~~~~~~ + +As mentioned before, you can access the web frontend of the Asset Library on +`Godot's official website `_. +This is what it looks like when you first visit it: + +|image0| + +At the top, you see the **header**, which takes you to various other parts of the +AssetLib - at the moment, it's empty, as we are not logged in. + +Searching +~~~~~~~~~ + +In the center is the **search bar + settings** section, and the **assets** section +below it - this lets you filter out certain kinds of assets based on a host +of criteria. These include the asset **category** (such as 2D tools, scripts +and demos), **engine version** they are intended for, **sorting order** (by +update date, by name, etc.) and **support level**. + +While most other filter settings should be fairly self-explanatory, it's worth +going over what "support level" means in the Asset Library. +Currently there are three support levels, and each asset can belong to only one. + +**Official** assets are created and maintained by the official Godot Engine +developers. Currently, these include the official engine demos, which showcase +how various areas of the engine work. + +**Community** assets are submitted and maintained by the members of the +Godot community. + +**Testing** assets are works-in-progress, and may contain bugs and usability +issues. They are not recommended for use in serious projects, but you are +encouraged to download, test them, and submit issues to the original authors. + +You can mix and match any of the search filters and criteria, and upon clicking +the Search button, receive the list of all assets in the Library that match them. + +|image1| + +Note that the search results are not updated in real-time, so you will have to +re-submit the search query each time you change the query settings. + +Breakdown of an asset +~~~~~~~~~~~~~~~~~~~~~ + +Now let's take a look at what an asset's page looks like and what it contains. + +|image2| + +1. Asset's thumbnail/icon. +2. Asset's name. +3. Current version number of the asset. +4. Asset's category, Godot version, and support status. +5. Asset's original author/submitter. +6. The license the asset is distributed under. +7. The date of the asset's latest edit/update. +8. A textual description of the asset. +9. Links related to the asset (download link, file list, issue tracker). +10. Images and videos showcasing the asset. + +Registering and logging in +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In order to upload assets to the AssetLib, you need to be logged in, and to do +that, you need a registered user account. In the future, this may also give you +access to other features, such as commenting on or rating the existing assets. +You do *not* need to be logged in to browse and download the assets. + +The login/registration page can be accessed from the AssetLib header. + +|image3| + +From here, you can register your account, which requires a valid email address, +a username, and a (preferably strong) password. + +|image4| + +Then, you can use your username and password to log in. + +|image5| + +This will change the look of the AssetLib header. Now you get access to a handful of +new functions: + +- The feed, which shows a list of status updates on your submitted assets (and possibly more in the future). +- A list of your uploaded assets. +- The ability to submit new assets. + +|image6| + +You can learn how to submit assets to the Library, and what the asset submission +guidelines are, in the next part of this tutorial, :ref:`doc_submitting_to_assetlib`. + +In the editor +------------- + +.. note:: + + The editor will display different categories of assets depending on whether + you're browsing the project manager's **Templates** tab or the editor's + **AssetLib** tab. + + The project manager's **Templates** tab will only display assets that are + standalone projects by themselves. This is denoted on the asset library with + the *Templates*, *Demos* and *Projects* categories. + + The editor's **AssetLib** tab will only display assets that are *not* standalone + projects by themselves. In other words, it will display assets from all + categories except *Templates*, *Demos* and *Projects*. + +You can also access the AssetLib directly from Godot: + +|image7| + +|image14| + +Click on it, and Godot will fetch info about the assets from the AssetLib. Once +it's finished, you will see a window similar to what the AssetLib website looks +like, with some differences: + +|image8| + +Similarly to the web version of the AssetLib, here you can search +for assets by category, name, and sort them by factors such as name or edit date. + +Notably, you can only fetch assets for the current version of Godot you are running. +Projects, Demos and Templates can be downloaded from the Project Manager +view of the AssetLib. Addons (tools, scripts, materials etc.) can be downloaded from +the in-project AssetLib and added to the current project. +In addition, unlike when using the web frontend, the search results are updated +in real-time (you do not have to press Search after every change to your search +query for the changes to take place). + +In the future, you will be able to choose a different AssetLib provider to fetch +assets from (using the Site dropdown menu), however currently only the official +`Godot website `_ version of the AssetLib is supported, +as well as the version that may be running on your local machine's web server +(the localhost option). + +When you click on an asset, you will see more information about it. + +|image9| + +If you click on the Install button, Godot will fetch an archive of the asset, +and will track download progress of it at the bottom of the editor window. If +the download fails, you can retry it using the Retry button. + +|image10| + +When it finishes, you can proceed to install it using the Install button. +This will bring up the Package Installer window. + +|image11| + +Here you can see a list of all the files that will be installed. You can tick off +any of the files that you do not wish to install, and Godot will also inform you +about any problems with files that it cannot install. These files will be shown +in red, and hovering over them will show you a message stating why it cannot be +installed. + +|image12| + +Once you are done, you can press the Install button, which will unzip all the +files in the archive, and import any assets contained therein, such as images or +3D models. Once this is done, you should see a message stating that the Package +installation is complete. + +|image13| + +You may also use the Import button to import asset archives obtained +elsewhere (such as downloading them directly from the AssetLib web frontend), +which will take you through the same package installation procedure as with the +assets downloaded directly via Godot that we just covered. + +.. |image0| image:: img/assetlib_website.png +.. |image1| image:: img/assetlib_search.png +.. |image2| image:: img/assetlib_asset.png +.. |image3| image:: img/assetlib_register-login.png +.. |image4| image:: img/assetlib_register.png +.. |image5| image:: img/assetlib_login.png +.. |image6| image:: img/assetlib_login_header.png +.. |image7| image:: img/assetlib_editor_workspace.png +.. |image8| image:: img/assetlib_editor.png +.. |image9| image:: img/assetlib_editor_asset.png +.. |image10| image:: img/assetlib_editor_download.png +.. |image11| image:: img/assetlib_editor_installer.png +.. |image12| image:: img/assetlib_editor_installer_error.png +.. |image13| image:: img/assetlib_editor_installer_success.png +.. |image14| image:: img/assetlib_editor_projects.png diff --git a/community/asset_library/what_is_assetlib.rst b/community/asset_library/what_is_assetlib.rst new file mode 100644 index 0000000..10c2f7d --- /dev/null +++ b/community/asset_library/what_is_assetlib.rst @@ -0,0 +1,50 @@ +.. _doc_what_is_assetlib: + +About the Asset Library +======================= + +The Godot Asset Library, otherwise known as the AssetLib, is a repository of +user-submitted Godot addons, scripts, tools, and other resources, collectively referred +to as assets. They're available to all Godot users for download directly from within the +engine, but it can also be accessed at Godot's `official website `_. + +On the surface, the Asset Library might look and function similar to asset +stores available for other engines, such as Unity's Asset Store, or Unreal +Engine's Marketplace, where you can submit both freely-available assets, as well +as paid, commercial ones. In addition, often times such assets are distributed +under non-free, proprietary licenses, limiting what you can do with them. + +The Asset Library is different - all assets are distributed free of charge, and under +a host of open-source licenses (such as the MIT license, the GPL, and the Boost Software License). +This makes the AssetLib more similar to the software repositories of a Linux distribution. + +This set of pages will cover how to use the AssetLib (both from inside Godot, and on the +website), how you can submit your own assets, and what the guidelines for submission are. + +Please note that the AssetLib is relatively young - it may have various pain points, bugs, +and usability issues. As with all Godot projects, the code repository is available on `GitHub `_, +where you can submit pull requests and issues, so please do not hesitate to visit it! + +Types of assets +--------------- + +Be aware that there are, broadly, two different types of assets you can post. + +* Assets labeled as "Templates", "Projects", or "Demos" appear under + the "Templates" tab in the Godot project manager. These assets are + standalone Godot projects that can run by themselves. + +* Other assets show up inside of the Godot editor under the "AssetLib" + main screen tab, next to "2D", "3D", and "Script". These assets are + meant to be downloaded and placed into an existing Godot project. + +Frequently asked questions +-------------------------- + +Can paid assets be uploaded to the asset library? +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Not to the official one, though in the future, there might be other asset +libraries which allow it. +That said, you are allowed to monetize and sell Godot assets outside the +Asset Library. diff --git a/community/channels.rst b/community/channels.rst new file mode 100644 index 0000000..c96bd5e --- /dev/null +++ b/community/channels.rst @@ -0,0 +1,60 @@ +.. _doc_community_channels: + +Community channels +================== + +So, where is the Godot community and where can you ask questions and get help? + +Note that some of these channels are run and moderated by members of the Godot community or third parties. + +A brief overview over these and other channels is also available on the `Godot website `_. + +Q&A +--- + +- `Official Godot Questions & Answers `_ + +Rocket.Chat +----------- + +- `Godot Contributors Chat `_ + +IRC on Libera.Chat +------------------ + +.. note:: + + As of January 2021, core developer chat has moved to the Godot Contributors Chat platform listed above. + +- `General: #godotengine `_ + +IRC is less active than Discord. Please stick around to get an answer, as +it may take several hours for someone to see and answer your questions. + +Other chats +----------- + +- `Discord `_ +- `Matrix (IRC compatible) `_ + +Language-based communities +-------------------------- + +See the `User groups `_ page of +the website for a list of local communities. + +Social networks +--------------- + +- `GitHub `_ +- `Facebook group `_ +- `Twitter `_ + (see also the `#GodotEngine `_ hashtag) +- `Reddit `_ +- `YouTube `_ +- `Steam `_ + +Forum +----- + +- `Godot Forums `_ diff --git a/community/contributing/best_practices_for_engine_contributors.rst b/community/contributing/best_practices_for_engine_contributors.rst new file mode 100644 index 0000000..8df6626 --- /dev/null +++ b/community/contributing/best_practices_for_engine_contributors.rst @@ -0,0 +1,244 @@ +.. _doc_best_practices_for_engine_contributors: + +Best practices for engine contributors +====================================== + +Introduction +------------ + +Godot has a large amount of users who have the ability to contribute, given the +project itself is aimed mainly at users with the ability to do programming. +Despite this, not all of them have the same level of experience working in large +projects or in software engineering, which can lead to common misunderstandings +and bad practices during the process of contributing code to the project. + +Language +-------- + +The scope of this document is to be a list of best practices for contributors to +follow, as well as to create a language they can use to refer to common +situations that arise in the process of submitting their contributions. + +While some may find it useful to extend this to general software development, +our intention is to just restrict to situations that are most common in our +project. + +Contributions are most of the time categorized as bug fixes, enhancements or new +features. To abstract this idea, we will call them *Solutions*, because they +always seek to solve something that can be described as a *Problem*. + +Best Practices +-------------- + +#1: The problem always comes first +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Many contributors are extremely creative and just enjoy the process of designing +abstract data structures, creating nice user interfaces, or simply love +programming. Whatever the case may be, they come up with cool ideas, which may +or may not be solving any real problems. + +.. image:: img/best_practices1.png + +These are usually called *Solutions in search of a problem*. In an ideal world, +they would not be harmful but, in reality, code takes time to write, takes space +as source and binary and requires maintenance once it exists. Avoiding the +addition of anything unnecessary is always considered a good practice in +software development. + +#2: To solve the problem, it has to exist in the first place +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This is a variation of the previous practice. Adding anything unnecessary is not +a good idea, but what constitutes what is necessary and what isn't? + +.. image:: img/best_practices2.png + +The answer to this question is that the problem needs to *exist* before it can +be actually solved. It must not be speculation or a belief. The user must be +using the software as intended to create something they *need*. In this process, +the user may stumble into a problem that requires a solution to proceed, or in +order to achieve greater productivity. In this case, *a solution is needed*. + +Believing that problems may arise in the future and that the software needs to +be ready to solve them by the time they appear is called *"Future proofing"* and +its characterized by lines of thought such as: + +- I think it would be useful for users to... +- I think users will eventually need to... + +This is generally considered a bad habit because trying to solve problems that +*don't actually exist* in the present will often lead to code that will be +written but never used, or that is considerably more complex to use and maintain +than it needs to be. + +#3: The problem has to be complex or frequent +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Software is designed to solve problems, but we can't expect it to solve *every +problem that exists under the sun*. As a game engine, Godot will solve problems +for you, so it helps you to make games better and faster, but it won't make the +*entire game* for you. A line must be drawn somewhere. + +.. image:: img/best_practices3.png + +Whether a problem is worth solving is determined by the difficulty the user has +to work around it. This difficulty can be expressed as: + +- The complexity of the problem +- The frequency the problem + +If the problem is *too complex* for most users to solve, the software must offer +a ready-made solution for it. Likewise, if the problem is easy for the user to +work around, offering such a solution is unnecessary and it's up to the user to +do it. + +The exception, however, is when the user stumbles into this problem *frequently +enough* that having to do the simple solution every time becomes an annoyance. +In this case, the software must offer a solution to simplify this use case. + +In our experience, in most cases it's usually obvious to tell when a problem is +complex or frequent, but cases may arise where drawing this line is difficult. +This is why discussing with other developers (next point) is always advised. + +#4: The solution must be discussed with others +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +It is often the case that when users stumble upon problems, they are only +immersed in their project, so they will naturally try to solve the problem +from their perspective, thinking only about their use case. + +Because of this, user proposed solutions don't always contemplate other use +cases that developers are often aware of, so they are often biased towards their +own requirements. + +.. image:: img/best_practices4.png + +For developers, the perspective is different. They may find the user's problem +too unique to justify a solution (instead of a user workaround), or maybe they +will suggest a partial (usually simpler or lower level) solution that applies to +a wider range of known problems, and leave the rest of the solution up to the +user. + +In any case, before attempting a contribution, it is important to discuss the +actual problems with the other developers or contributors, so a better agreement +on implementation can be reached. + +The only exception, in this case, is when an area of code has a clear owner +(agreed by the other contributors), who talks to users directly and has the most +knowledge to implement a solution directly. + +Also, Godot's philosophy is to favor ease of use and maintenance over absolute +performance. Performance optimizations will be considered, but they may not +be accepted if they make something too difficult to use or if they add too much +complexity to the codebase. + +#5: To each problem, its own solution +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For programmers, it is always a most enjoyable challenge to find the most +optimal solutions to problems. Things, however, may go overboard sometimes and +programmers will try to come up with solutions that solve as many problems as +possible. + +The situation will often take a turn for the worse when, in order to make this +solution appear even more fantastic and flexible, the pure speculation-based +problems (as described in #2) also make their appearance on stage. + +.. image:: img/best_practices5.png + +The main problem is that, in reality, it rarely works this way. Most of the +time, writing an individual solution to each problem results in code that +is simpler and more maintainable. + +Additionally, solutions that target individual problems are better for the +users, as they find something that does exactly what they need, without having +to learn and remember a more complex system they will only need for simple +tasks. + +Big and flexible solutions also have an additional drawback which is that, over +time, they are rarely flexible enough for all users, who keep requesting more +functions added (and making the API and codebase more and more complex). + +#6: Cater to common use cases, leave the door open for the rare ones +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This is a continuation of the previous point, which further explains why this +way of thinking and designing software is preferred. + +As mentioned before (in point #2), it is very difficult for us (as human beings +who design software) to actually understand all future user needs. Trying to +write very flexible structures that cater to many use cases at once is often a +mistake. + +We may come up with something we believe is brilliant, but when it's actually +used, we will find that users will never even use half of it, or that they will +require features that don't quite accommodate our original design, forcing us to +either throw it away or make it even more complex. + +The question is then, how to design software that gives users what *we know they +need*, but that is flexible enough to allow them to do *what we don't know they +might need* in the future? + +.. image:: img/best_practices6.png + +The answer to this question is that, to ensure users still can do what they want +to do, we need to give them access to a *low level API* that they can use to +achieve what they want, even if it's more work for them because it means +reimplementing some logic that already exists. + +In real-life scenarios, these use cases will be at most rare and uncommon +anyway, so it makes sense a custom solution needs to be written. This is why +it's important to still provide users the basic building blocks to do it. + +#7: Prefer local solutions +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When looking for a solution to a problem, be it implementing a new feature or +fixing a bug, sometimes the easiest path is to add data or a new function in the +core layers of code. + +The main problem here is, adding something to the core layers that will only be +used from a single location far away will not only make the code more difficult +to follow (split in two), but also make the core API larger, more complex, more +difficult to understand in general. + +This is bad, because readability and cleanness of core APIs is always of extreme +importance given how much code relies on it, and because it's key for new +contributors as a starting point to learning the codebase. + + +.. image:: img/best_practices7.png + + +The common reasoning for wanting to do this is that it's usually less code to +simply add a hack in the core layers. + +Despite this, this practice is not advised. Generally, the code for a solution +should be closer to where the problem originates, even if it involves more code, +duplicated, more complex or is less efficient. More creativity might be needed, +but this path is always the advised one. + +#8: Don't use complex canned solutions for simple problems +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Not every problem has a simple solution and, many times, the right choice is to +use a third party library to solve the problem. + +As Godot requires to be shipped in a large amount of platforms, we can't +link libraries dynamically. Instead, we bundle them in our source tree. + +.. image:: img/best_practices8.png + +As a result, we are very picky with what goes in, and we tend to prefer smaller +libraries (in fact, single header ones are our favorite). Only in cases where +there is no other choice we end up bundling something larger. + +Also, libraries must use a permissive enough license to be included into Godot. +Some examples of acceptable licenses are Apache 2.0, BSD, MIT, ISC, and MPL 2.0. +In particular, we cannot accept libraries licensed under the GPL or LGPL since +these licenses effectively disallow static linking in proprietary software +(which Godot is distributed as in most exported projects). This requirement also +applies to the editor, since we may want to run it on iOS in the long term. +Since iOS doesn't support dynamic linking, static linking the only option on +that platform. diff --git a/community/contributing/bisecting_regressions.rst b/community/contributing/bisecting_regressions.rst new file mode 100644 index 0000000..b6a408d --- /dev/null +++ b/community/contributing/bisecting_regressions.rst @@ -0,0 +1,145 @@ +.. _doc_bisecting_regressions: + +Bisecting regressions +===================== + +.. highlight:: shell + +Bisecting is a way to find regressions in software. After reporting a bug on the +`Godot repository on GitHub `__, you may +be asked by a contributor to *bisect* the issue. Bisecting makes it possible for +contributors to fix bugs faster, as they can know in advance which commit caused +the regression. Your effort will be widely appreciated :) + +The guide below explains how to find a regression by bisecting. + +What is bisecting? +------------------ + +Godot developers use the `Git `__ version control system. +In the context of Git, bisecting is the process of performing a manual +`binary search `__ +to determine when a regression appeared. While it's typically used for bugs, +it can also be used to find other kinds of unexpected changes such as +performance regressions. + +Using official builds to speed up bisecting +------------------------------------------- + +Before using Git's ``bisect`` command, we strongly recommend trying to reproduce +the bug with an older (or newer) official release. This greatly reduces the +range of commits that potentially need to be built from source and tested. +You can find binaries of official releases, as well as alphas, betas, +and release candidates `here `__. + +For example, if you've reported a bug against Godot 3.2, you should first try to +reproduce the bug in Godot 3.1 (not a patch release, see below for the reason). +If the bug doesn't occur there, try to reproduce it in Godot 3.2 *beta 1* (which +is roughly in the middle of all test builds available). If you can't reproduce +the bug with Godot 3.2 beta 1, then try newer betas and RC builds. If you do +manage to reproduce the bug with Godot 3.2 beta 1, then try older alpha builds. + +.. warning:: + + For bisecting regressions, don't use patch releases such as Godot 3.1.2. + Instead, use the minor version's first release like Godot 3.1. This is + because patch releases are built from a separate *stable branch*. This kind + of branch doesn't follow the rest of Godot's development, which is done in + the ``master`` branch. + +The Git bisect command +---------------------- + +If you've found a build that didn't exhibit the bug in the above testing +process, you can now start bisecting the regression. The Git version control +system offers a built-in command for this: ``git bisect``. This makes the +process semi-automated as you only have to build the engine, run it and try to +reproduce the bug. + +.. note:: + + Before bisecting a regression, you need to set up a build environment to + compile Godot from source. To do so, read the + :ref:`Compiling ` page for your target platform. + (Compiling Godot from source doesn't require C++ programming knowledge.) + + Note that compiling Godot can take a while on slow hardware (up an hour for + each full rebuild on a slow dual-core CPU). This means the full process can + take up to several hours. If your hardware is too slow, you may want to stop + there and report the results of your "pre-bisecting" on the GitHub issue so + another contributor can continue bisecting from there. + +To start bisecting, you must first determine the commit hashes (identifiers) of +the "bad" and "good" build. "bad" refers to the build that exhibits the bug, +whereas "good" refers to the version that doesn't exhibit the bug. If you're +using a pre-release build as the "good" or "bad" build, browse the `download +mirror `__, go to the folder that +contains the pre-release you downloaded and look for the ``README.txt`` file. +The commit hash is written inside that file. + +If you're using a stable release as the "good" or "bad" build, use one of the +following commit hashes depending on the version: + +.. code-block:: none + + 3.2-stable + 3.1-stable + 3.0-stable + +To refer to the latest state of the master branch, you can use ``master`` +instead of a commit hash. + +:ref:`Get Godot's source code using Git `. Once this +is done, in the terminal window, use ``cd`` to reach the Godot repository +folder and enter the following command: + +.. code-block:: shell + + # is hash of the build that works as expected. + # is hash of the build exhibiting the bug. + $ git bisect start + $ git bisect good + $ git bisect bad + +Compile Godot. This assumes you've set up a build environment: + +.. code-block:: shell + + # is the platform you're targeting for regression testing, + # like "windows", "x11" or "osx". + $ scons platform= -j4 + +Since building Godot takes a while, you want to dedicate as many CPU threads as +possible to the task. This is what the ``-j`` parameter does. Here, the command +assigns 4 CPU threads to compiling Godot. + +Run the binary located in the ``bin/`` folder and try to reproduce the bug. + +If the build **still** exhibits the bug, run the following command: + +.. code-block:: shell + + $ git bisect bad + +If the build **does not** exhibit the bug, run the following command: + +.. code-block:: shell + + $ git bisect good + +After entering one of the commands above, Git will switch to a different commit. +You should now build Godot again, try to reproduce the bug, then enter ``git +bisect good`` or ``git bisect bad`` depending on the result. You'll have to +repeat this several times. The longer the commit range, the more steps will be +required. 5 to 10 steps are usually sufficient to find most regressions; Git +will remind you of the number of steps remaining (in the worst case scenario). + +Once you've completed enough steps, Git will display the commit hash where the +regression appeared. Write this commit hash as a comment to the GitHub issue +you've bisected. This will help in solving the issue. Thanks again for +contributing to Godot :) + +.. note:: + + You can read the full documentation on ``git bisect`` + `here `__. diff --git a/community/contributing/bug_triage_guidelines.rst b/community/contributing/bug_triage_guidelines.rst new file mode 100644 index 0000000..48c0c18 --- /dev/null +++ b/community/contributing/bug_triage_guidelines.rst @@ -0,0 +1,191 @@ +.. _doc_bug_triage_guidelines: + +Bug triage guidelines +===================== + +This page describes the typical workflow of the bug triage team aka +bugsquad when handling issues and pull requests on Godot's +`GitHub repository `__. +It is bound to evolve together with the bugsquad, so do not +hesitate to propose modifications to the following guidelines. + +Issues management +----------------- + +GitHub proposes various features to manage issues: + +- Set one or several labels from a predefined list +- Set one milestone from a predefined list +- Keep track of the issue in the project dashboard +- Define one contributor as "assignee" among the Godot engine + organization members + +As the Godot engine organization on GitHub currently has a restricted +number of contributors, we do not use assignees extensively for now. All +contributors are welcome to take on any issue, if relevant after mentioning +it on the issue ticket and/or discussing the best way to resolve it with +other developers. + +For the time being, we do not use the project dashboard feature either. + +As far as possible, we try to assign labels (and milestones, when relevant) +to both issues and pull requests. + +Labels +~~~~~~ + +The following labels are currently defined in the Godot repository: + +**Categories:** + +- *Archived*: either a duplicate of another issue, or invalid. Such an + issue would also be closed. +- *Breaks compat*: describes something that can only be fixed by breaking + compatibility with existing projects. +- *Bug*: describes something that is not working properly. +- *Cherrypick*: describes something that can be backported to a stable branch + after being merged in the ``master`` branch. +- *Crash:* describes a bug that causes the engine to crash. + This label is only used for "hard" crashes, not freezes. +- *Confirmed*: has been confirmed by at least one other contributor + than the bug reporter (typically for *Bug* reports). + The purpose of this label is to let developers know which issues are + still reproducible when they want to select what to work on. It is + therefore a good practice to add in a comment on what platform and + what version or commit of Godot the issue could be reproduced; if a + developer looks at the issue one year later, the *Confirmed* label + may not be relevant anymore. +- *Discussion*: the issue is not consensual and needs further + discussion to define what exactly should be done to address the + topic. +- *Documentation*: issue related to the documentation. Mainly to request + enhancements in the API documentation. Issues related to the ReadTheDocs + documentation should be filed on the + `godot-docs `_ repository. +- *Enhancement*: describes a proposed enhancement to an existing + functionality. +- *Feature proposal*: describes a wish for a new feature to be + implemented. Note that the main Godot repository no longer accepts + feature requests. Please use + `godot-proposals `__ instead. +- *For PR meeting*: the issue needs to be discussed in a pull request meeting. + These meetings are public and are held on the `Godot Contributors Chat `_. +- *Good first issue*: the issue is *assumed* to be an easy one to fix, which makes + it a great fit for new contributors who need to become familiar with + the code base. +- *High priority:* the issue is particularly important as it can + prevent people from releasing their projects or cause data loss. +- *Needs work*: the pull request needs additional work before it can be merged. +- *Needs testing*: the issue/pull request could not be completely tested + and thus need further testing. This can mean that it needs to be tested + on different hardware/software configurations or even that the steps to + reproduce are not certain. +- *Performance*: issues that directly impact engine or editor performance. + Can also be used for pull requests that improve performance or add low-end-friendly options. + Should not be coupled with *Usability*. +- *PR welcome / Hero wanted!*: Contributions for issues with these labels + are especially welcome. Note that this **doesn't** mean you can't work + on issues without these labels. +- *Regression*: the bug appeared after a stable release not exhibiting + the bug was released. +- *Salvageable*: the pull request can't be merged due to design issues or + merge conflicts and its author is not active anymore. However, it can still + be picked up by an external contributor to bring it to a mergeable state. + To do so, you need to open a new pull request based on the original pull request. +- *Tracker*: issue used to track other issues (like all issues related to + the plugin system). +- *Usability*: issues that directly impact user usability. Should not be coupled with *Performance*. + +The categories are used for general triage of the issues. They can be +combined in some way when relevant, e.g. an issue can be labelled +*Enhancement* and *Usability* at the same time if it's an issue to improve +usability. Or *Feature proposal* and *Discussion* if it's a non-consensual +feature request, or one that is not precise enough to be worked on. + +**Topics:** + +- *2D*: relates to 2D-specific issues. Should be coupled with one of the labels below, and should not be coupled with *3D*. +- *3D*: relates to 3D-specific issues. Should be coupled with one of the labels below, and should not be coupled with *2D*. +- *Assetlib*: relates to issues with the asset library. +- *Audio*: relates to the audio features (low and high level). +- *Buildsystem*: relates to building issues, either linked to the SCons + buildsystem or to compiler peculiarities. +- *Codestyle*: relates to the programming style used within the codebase. +- *Core*: anything related to the core engine. It might be further + split later on as it's a pretty big topic. +- *Editor*: relates to issues in the editor (mainly UI). +- *GDNative*: relates to the GDNative module. +- *GDScript*: relates to GDScript. +- *GUI*: relates to GUI (Control) nodes. +- *Import*: relates to the resource import system. +- *Input*: relates to input system. +- *Mono*: relates to the C# / Mono bindings. +- *Navigation*: relates to the navigation system (including A* and navmeshes). +- *Network*: relates to networking. +- *Physics*: relates to the physics engine (2D/3D). +- *Plugin*: relates to problems encountered while writing plugins. +- *Porting*: relates to some specific platforms or exporting projects. +- *Rendering*: relates to the 2D and 3D rendering engines. +- *Shaders*: relates to the Godot shader language or visual shaders. +- *Tests*: relates to unit tests. +- *Thirdparty*: relates to third-party libraries used in Godot. +- *VisualScript*: relates to issues with the visual scripting language (*not* visual shaders). +- *XR*: relates to Augmented Reality or Virtual Reality. + +Issues would typically correspond to only one topic, though it's not +unthinkable to see issues that fit two bills. The general idea is that +there will be specialized contributors teams behind all topics, so they +can focus on the issues labelled with their team's topic. + +**Platforms:** + +*Android*, *HTML5*, *iOS*, *Linux*, *macOS*, *Windows*, *UWP* + +By default, it is assumed that a given issue applies to all platforms. +If one of the platform labels is used, it is then exclusive and the +previous assumption doesn't stand anymore (so if it's a bug on e.g. +Android and Linux exclusively, select those two platforms). + +Documentation labels +~~~~~~~~~~~~~~~~~~~~ + +In the `documentation repository `__, we +use the following labels: + +- *Bug*: Incorrect information in an existing page. Not to be used for + *missing* information. +- *Class reference*: the issue is about the class reference, not a documentation page. +- *Discussion*: the issue is not consensual and needs further + discussion to define what exactly should be done to address the + topic. +- *Enhancememnt*: new information to be added in an existing page. +- *New page*: a new page to be created. +- *Hero wanted!*: contributions for issues with these labels + are especially welcome. Note that this **doesn't** mean you can't work + on issues without these labels. +- *Organization*: The issue involves moving pages around or reorganizing content. +- *Redirect*: a redirection needs to be created in the Read the Docs backend. + Only administrators can do this. +- *Salvageable*: the pull request can't be merged due to design issues or + merge conflicts and its author is not active anymore. However, it can still + be picked up by an external contributor to bring it to a mergeable state. + To do so, you need to open a new pull request based on the original pull request. +- *Topic:Mono*: the issue is about C# support in Godot. +- *Topic:Website*: the issue relates to the Sphinx/Read the Docs frontend or backend, + not the documentation contents. + +Milestones +~~~~~~~~~~ + +`Milestones `_ correspond to +planned future versions of Godot for which there is an existing roadmap. Issues +that fit in the said roadmap should be filed under the corresponding milestone; +if they don't correspond to any current roadmap, they should be left without +milestone. As a rule of thumb, an issue corresponds to a given milestone if it +concerns a feature that is new in the milestone, or a critical bug that can't be +accepted in any future stable release, or anything that Juan wants to work on +right now. :) + +Contributors are free to pick issues regardless of their assigned milestone; +if a fix is proposed for a bug that was not deemed urgent and thus without +milestone, it would likely still be very welcome. diff --git a/community/contributing/building_the_manual.rst b/community/contributing/building_the_manual.rst new file mode 100644 index 0000000..77779b2 --- /dev/null +++ b/community/contributing/building_the_manual.rst @@ -0,0 +1,98 @@ +.. _doc_building_the_manual: + +Building the manual with Sphinx +=============================== + +This page explains how to build a local copy of the Godot manual using the +Sphinx docs engine. This allows you to have local HTML files and build the +documentation as a PDF, EPUB, or LaTeX file, for example. + +To get started, you need to: + +1. Clone the `godot-docs repository `__. +2. Install `Sphinx `__ +3. To build the docs as HTML files, install the `readthedocs.org theme + `__. +4. Install the Sphinx extensions defined in the `godot-docs repository + `__ ``requirements.txt`` file. + +We recommend using `pip `__, Python’s package manager to +install all these tools. It comes pre-installed with `Python +`__. Ensure that you install and use Python 3. Here are +the commands to clone the repository and then install all requirements. + +.. note:: You may need to write ``python3 -m pip`` (Unix) or ``py -m pip`` (Windows) instead of ``pip3``. + If both approaches fail, `check that you have pip3 installed `__. + +.. code:: sh + + git clone https://github.com/godotengine/godot-docs.git + pip3 install -r requirements.txt + + +With the programs installed, you can build the HTML documentation from the root +folder of this repository with the following command: + +.. code:: sh + + # On Linux and macOS + make html + + # On Windows, you need to execute the ``make.bat`` file instead. + make.bat html + +If you run into errors, you may try the following command: + +.. code:: sh + + make SPHINXBUILD=~/.local/bin/sphinx-build html + +Building the documentation requires at least 8 GB of RAM to run without disk +swapping, which slows it down. If you have at least 16 GB of RAM, you can speed +up compilation by running: + +.. code:: sh + + # On Linux/macOS + make html SPHINXOPTS=-j2 + + # On Windows + set SPHINXOPTS=-j2 && make html + +The compilation will take some time as the ``classes/`` folder contains hundreds +of files. + +You can then browse the documentation by opening ``_build/html/index.html`` in +your web browser. + +In case you 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. + +.. note:: If you delete the ``classes/`` folder, do not use ``git add .`` when + working on a pull request or the whole ``classes/`` folder will be + removed when you commit. See `#3157 + `__ for more + detail. + +Alternatively, you can build the documentation by running the sphinx-build +program manually: + +.. code:: sh + + sphinx-build -b html ./ _build + +Building with Sphinx and virtualenv +----------------------------------- + +If you want your Sphinx installation scoped to the project, you can install +sphinx-build using virtualenv. To do so, run this command from this repository's +root folder: + +.. code:: sh + + virtualenv --system-site-packages env/ + . env/bin/activate + pip3 install -r requirements.txt + +Then, run ``make html`` as shown above. diff --git a/community/contributing/class_reference_writing_guidelines.rst b/community/contributing/class_reference_writing_guidelines.rst new file mode 100644 index 0000000..ab1715d --- /dev/null +++ b/community/contributing/class_reference_writing_guidelines.rst @@ -0,0 +1,254 @@ +.. _doc_class_reference_writing_guidelines: + +Class reference writing guidelines +================================== + +This page explains how to write the class reference. You will learn where to +write new descriptions for the classes, methods, and properties for Godot's +built-in node types. + +.. seealso:: + + To learn to submit your changes to the Godot project using the Git version + control system, see :ref:`doc_updating_the_class_reference`. + +The reference for each class is contained in an XML file like the one below: + +.. code-block:: xml + + + + A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. + + + A 2D game object, with a transform (position, rotation, and scale). All 2D nodes, including physics objects and sprites, inherit from Node2D. Use Node2D as a parent node to move, scale and rotate children in a 2D project. Also gives control of the node's render order. + + + https://docs.godotengine.org/en/latest/tutorials/2d/custom_drawing_in_2d.html + https://github.com/godotengine/godot-demo-projects/tree/master/2d + + + + + + + + + Multiplies the current scale by the [code]ratio[/code] vector. + + + [...] + + + + + + + Translates the node by the given [code]offset[/code] in local coordinates. + + + + + + Global position. + + [...] + + Z index. Controls the order in which the nodes render. A node with a higher Z index will display in front of others. + + + + + + + +It starts with brief and long descriptions. In the generated docs, the brief +description is always at the top of the page, while the long description lies +below the list of methods, variables, and constants. You can find methods, +member variables, constants, and signals in separate XML nodes. + +For each, you want to learn how they work in Godot's source code. Then, fill +their documentation by completing or improving the text in these tags: + +- `` +- `` +- `` +- `` (in its `` tag; return types and arguments don't take separate + documentation strings) +- `` +- `` (in its `` tag; arguments don't take separate documentation strings) +- `` + +Write in a clear and simple language. Always follow the :ref:`writing guidelines +` to keep your descriptions short and easy to read. +**Do not leave empty lines** in the descriptions: each line in the XML file will +result in a new paragraph, even if it is empty. + +.. _doc_class_reference_writing_guidelines_editing_xml: + +How to edit class XML +--------------------- + +Edit the file for your chosen class in ``doc/classes/`` to update the class +reference. The folder contains an XML file for each class. The XML lists the +constants and methods you will find in the class reference. Godot generates and +updates the XML automatically. + +.. note:: For some modules in the engine's source code, you'll find the XML + files in the ``modules//doc_classes/`` directory instead. + +Edit it using your favorite text editor. If you use a code editor, make sure +that it doesn't change the indent style: you should use tabs for the XML and +four spaces inside BBCode-style blocks. More on that below. + +To check that the modifications you've made are correct in the generated +documentation, navigate to the ``doc/`` folder and run the command ``make rst``. +This will convert the XML files to the online documentation's format and output +errors if anything's wrong. + +Alternatively, you can build Godot and open the modified page in the built-in +code reference. To learn how to compile the engine, read the :ref:`compilation +guide `. + +We recommend using a code editor that supports XML files like Vim, Atom, Visual Studio Code, +Notepad++, or another to comfortably edit the file. You can also use their +search feature to find classes and properties quickly. + +.. _doc_class_reference_writing_guidelines_bbcode: + +Improve formatting with BBCode style tags +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Godot's class reference supports BBCode-like tags. They add nice formatting to +the text. Here's the list of available tags: + ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| Tag | Effect | Usage | Result | ++============================+======================================+===================================+===================================================+ +| [Class] | Link a class | Move the [Sprite]. | Move the :ref:`class_Sprite`. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [method methodname] | Link to a method in this class | Call [method hide]. | Call :ref:`hide `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [method Class.methodname] | Link to another class's method | Call [method Node3D.hide]. | Call :ref:`hide `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [member membername] | Link to a member in this class | Get [member scale]. | Get :ref:`scale `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [member Class.membername] | Link to another class's member | Get [member Node2D.scale]. | Get :ref:`scale `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [signal signalname] | Link to a signal in this class | Emit [signal renamed]. | Emit :ref:`renamed `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [signal Class.signalname] | Link to another class's signal | Emit [signal Node.renamed]. | Emit :ref:`renamed `. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [b] [/b] | Bold | Some [b]bold[/b] text. | Some **bold** text. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [i] [/i] | Italic | Some [i]italic[/i] text. | Some *italic* text. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [code] [/code] | Monospace | Some [code]monospace[/code] text. | Some ``monospace`` text. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [kbd] [/kbd] | Keyboard/mouse shortcut | Some [kbd]Ctrl + C[/kbd] key. | Some :kbd:`Ctrl + C` key. | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [codeblock] [/codeblock] | Multiline preformatted block | *See below.* | *See below.* | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [codeblocks] [/codeblocks] | [codeblock] for multiple languages | *See below.* | *See below.* | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [gdscript] [/gdscript] | GDScript codeblock tab in codeblocks | *See below.* | *See below.* | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ +| [csharp] [/csharp] | C# codeblock tab in codeblocks | *See below.* | *See below.* | ++----------------------------+--------------------------------------+-----------------------------------+---------------------------------------------------+ + +Use ``[codeblock]`` for pre-formatted code blocks. Inside ``[codeblock]``, +always use **four spaces** for indentation. The parser will delete tabs. For +example: + +.. code-block:: none + + [codeblock] + func _ready(): + var sprite = get_node("Sprite") + print(sprite.get_pos()) + [/codeblock] + +Will display as: + +.. code-block:: gdscript + + func _ready(): + var sprite = get_node("Sprite") + print(sprite.get_pos()) + +If you need to have different code version in GDScript and C#, use +``[codeblocks]`` instead. If you use ``[codeblocks]``, you also need to have at +least one of the language-specific tags, ``[gdscript]`` and ``[csharp]``. + +Always write GDScript code examples first! You can use this `experimental code +translation tool `_ to speed up your +workflow. + +.. code-block:: none + + [codeblocks] + [gdscript] + func _ready(): + var sprite = get_node("Sprite") + print(sprite.get_pos()) + [/gdscript] + [csharp] + public override void _Ready() + { + var sprite = GetNode("Sprite"); + GD.Print(sprite.GetPos()); + } + [/csharp] + [/codeblocks] + +The above will display as: + +.. tabs:: + .. code-tab:: gdscript GDScript + + func _ready(): + var sprite = get_node("Sprite") + print(sprite.get_pos()) + + .. code-tab:: csharp + + public override void _Ready() + { + var sprite = GetNode("Sprite"); + GD.Print(sprite.GetPos()); + } + +To denote important information, add a paragraph starting with "[b]Note:[/b]" at +the end of the description: + +.. code-block:: none + + [b]Note:[/b] Only available when using the Vulkan renderer. + +To denote crucial information that could cause security issues or loss of data +if not followed carefully, add a paragraph starting with "[b]Warning:[/b]" at +the end of the description: + +.. code-block:: none + + [b]Warning:[/b] If this property is set to [code]true[/code], it allows clients to execute arbitrary code on the server. + +For deprecated properties, add a paragraph starting with "[i]Deprecated.[/i]". +Notice the use of italics instead of bold: + +.. code-block:: none + + [i]Deprecated.[/i] This property has been replaced by [member other_property]. + +In all the paragraphs described above, make sure the punctuation is part of the +BBCode tags for consistency. + +I don't know what this method does! +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +No problem. Leave it behind, and list the methods you skipped when you request a +pull of your changes. Another writer will take care of it. + +You can still look at the methods' implementation in Godot's source code on +GitHub. If you have doubts, feel free to ask on the `Q&A website +`__ and `Godot Contributors Chat `_. diff --git a/community/contributing/code_style_guidelines.rst b/community/contributing/code_style_guidelines.rst new file mode 100644 index 0000000..d53a8f5 --- /dev/null +++ b/community/contributing/code_style_guidelines.rst @@ -0,0 +1,372 @@ +.. _doc_code_style_guidelines: + +Code style guidelines +===================== + +.. highlight:: shell + +When contributing to Godot's source code, you will be expected to follow the +style guidelines outlined below. Some of them are checked via the Continuous +Integration process and reviewers will ask you to fix potential issues, so +best setup your system as outlined below to ensure all your commits follow the +guidelines. + +C++ and Objective-C +------------------- + +There are no written guidelines, but the code style agreed upon by the +developers is enforced via the `clang-format `__ +code beautifier, which takes care for you of all our conventions. +To name a few: + +- Indentation and alignment are both tab based (respectively one and two tabs) +- One space around math and assignments operators as well as after commas +- Pointer and reference operators are affixed to the variable identifier, not + to the type name +- See further down regarding header includes + +The rules used by clang-format are outlined in the +`.clang-format `__ +file of the Godot repository. + +As long as you ensure that your style matches the surrounding code and that you +not introducing trailing whitespace or space-based indentation, you should be +fine. If you plan to contribute regularly however, we strongly advise that you +setup clang-format locally to check and automatically fix all your commits. + +.. warning:: Godot's code style should *not* be applied to third-party code, + i.e. that is included in Godot's source tree but was not written + specifically for our project. Such code usually come from + different upstream projects with their own style guides (or lack + thereof), and don't want to introduce differences that would make + syncing with upstream repositories harder. + + Third-party code is usually included in the ``thirdparty/`` folder + and can thus easily be excluded from formatting scripts. For the + rare cases where a third-party code snippet needs to be included + directly within a Godot file, you can use + ``/* clang-format off */`` and ``/* clang-format on */`` to tell + clang-format to ignore a chunk of code. + +.. seealso:: + + These guidelines only cover code formatting. See :ref:`doc_cpp_usage_guidelines` + for a list of language features that are permitted in pull requests. + +Using clang-format locally +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +First of all, you will need to install clang-format. As of now, you need to use +**clang-format 13** to be compatible with Godot's format. Later versions might +be suitable, but previous versions may not support all used options, or format +some things differently, leading to style issues in pull requests. + +Installation +^^^^^^^^^^^^ + +Here's how to install clang-format: + +- Linux: It will usually be available out-of-the-box with the clang toolchain + packaged by your distribution. If your distro version is not the required one, + you can download a pre-compiled version from the + `LLVM website `__, or if you are on + a Debian derivative, use the `upstream repos `__. +- macOS and Windows: You can download precompiled binaries from the + `LLVM website `__. You may need to add + the path to the binary's folder to your system's ``PATH`` environment + variable to be able to call ``clang-format`` out of the box. + +You then have different possibilities to apply clang-format to your changes: + +Manual usage +^^^^^^^^^^^^ + +You can apply clang-format manually one or more files with the following +command: + +:: + + clang-format -i + +- ``-i`` means that the changes should be written directly to the file (by + default clang-format would only output the fixed version to the terminal). +- The path can point to several files, either one after the other or using + wildcards like in a typical Unix shell. Be careful when globbing so that + you don't run clang-format on compiled objects (.o and .a files) that are + in Godot's tree. So better use ``core/*.{cpp,h}`` than ``core/*``. + +Pre-commit hook +^^^^^^^^^^^^^^^ + +For ease of use, we provide a pre-commit hook for Git that will run +clang-format automatically on all your commits to check them, and let you apply +its changes in the final commit. + +This "hook" is a script which can be found in ``misc/hooks``, refer to that +folder's README.md for installation instructions. + +If your clang-format is not in the ``PATH``, you may have to edit the +``pre-commit-clang-format`` to point to the correct binary for it to work. +The hook was tested on Linux and macOS, but should also work in the Git Shell +on Windows. + +IDE plugin +^^^^^^^^^^ + +Most IDEs or code editors have beautifier plugins that can be configured to run +clang-format automatically, for example each time you save a file. + +Here is a non-exhaustive list of beautifier plugins for some IDEs: + +- Qt Creator: `Beautifier plugin `__ +- Visual Studio Code: `Clang-Format `__ +- Visual Studio: `ClangFormat `__ +- vim: `vim-clang-format `__ +- CLion: Starting from version ``2019.1``, no plugin is required. Instead, enable + `ClangFormat `__ + +(Pull requests welcome to extend this list with tested plugins.) + +.. _doc_code_style_guidelines_header_includes: + +Header includes +~~~~~~~~~~~~~~~ + +When adding new C++ or Objective-C files or including new headers in existing +ones, the following rules should be followed: + +- The first lines in the file should be Godot's copyright header and MIT + license, copy-pasted from another file. Make sure to adjust the filename. +- In a ``.h`` header, include guards should be used with the form + ``FILENAME_H``. + +- In a ``.cpp`` file (e.g. ``filename.cpp``), the first include should be the + one where the class is declared (e.g. ``#include "filename.h"``), followed by + an empty line for separation. +- Then come headers from Godot's own code base, included in alphabetical order + (enforced by ``clang-format``) with paths relative to the root folder. Those + includes should be done with quotes, e.g. ``#include "core/object.h"``. The + block of Godot header includes should then be followed by an empty line for + separation. +- Finally, third-party headers (either from ``thirdparty`` or from the system's + include paths) come next and should be included with the < and > symbols, e.g. + ``#include ``. The block of third-party headers should also be followed + by an empty line for separation. +- Godot and third-party headers should be included in the file that requires + them, i.e. in the `.h` header if used in the declarative code or in the `.cpp` + if used only in the imperative code. + +Example: + +.. code-block:: cpp + + /*************************************************************************/ + /* my_new_file.h */ + /*************************************************************************/ + /* This file is part of: */ + /* GODOT ENGINE */ + /* https://godotengine.org */ + /*************************************************************************/ + /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ + /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ + /* */ + /* 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. */ + /*************************************************************************/ + + #ifndef MY_NEW_FILE_H + #define MY_NEW_FILE_H + + #include "core/hash_map.h" + #include "core/list.h" + #include "scene/gui/control.h" + + #include + + ... + + #endif // MY_NEW_FILE_H + +.. code-block:: cpp + + /*************************************************************************/ + /* my_new_file.cpp */ + /*************************************************************************/ + /* This file is part of: */ + /* GODOT ENGINE */ + /* https://godotengine.org */ + /*************************************************************************/ + /* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ + /* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ + /* */ + /* 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. */ + /*************************************************************************/ + + #include "my_new_file.h" + + #include "core/math/math_funcs.h" + #include "scene/gui/line_edit.h" + + #include + #include + +Java +---- + +Godot's Java code (mostly in ``platform/android``) is also enforced via +``clang-format``, so see the instructions above to set it up. Keep in mind that +this style guide only applies to code written and maintained by Godot, not +third-party code such as the ``java/src/com/google`` subfolder. + +Python +------ + +Godot's SCons buildsystem is written in Python, and various scripts included +in the source tree are also using Python. + +For those, we follow the `Black style guide `__. +Blacken your Python changes using `Black `__. + +Using black locally +~~~~~~~~~~~~~~~~~~~ + +First of all, you will need to install black. Black requires Python 3.6.0+ +to run. + +Installation +^^^^^^^^^^^^ + +Here's how to install black: + +:: + + pip3 install black --user + + +You then have different possibilities to apply black to your changes: + +Manual usage +^^^^^^^^^^^^ + +You can apply ``black`` manually to one or more files with the following +command: + +:: + + black -l 120 + +- ``-l 120`` means that the allowed number of characters per line is 120. + This number was agreed upon by the developers. +- The path can point to several files, either one after the other or using + wildcards like in a typical Unix shell. + +Pre-commit hook +^^^^^^^^^^^^^^^ + +For ease of use, we provide a pre-commit hook for Git that will run +black automatically on all your commits to check them, and let you apply +its changes in the final commit. + +This "hook" is a script which can be found in ``misc/hooks``. Refer to that +folder's ``README.md`` for installation instructions. + + +Editor integration +^^^^^^^^^^^^^^^^^^ + +Many IDEs or code editors have beautifier plugins that can be configured to run +black automatically, for example each time you save a file. For details you can +check `Black editor integration `__. + +Comment style guide +------------------- + +This comment style guide applies to all programming languages used within +Godot's codebase. + +- Begin comments with a space character to distinguish them from disabled code. +- Use sentence case for comments. Begin comments with an uppercase character and + always end them with a period. +- Reference variable/function names and values using backticks. +- Wrap comments to ~100 characters. +- You can use ``TODO:``, ``FIXME:``, ``NOTE:``, or ``HACK:`` as adominitions + when needed. + +**Example:** + +.. code-block:: cpp + + // Compute the first 10,000 decimals of Pi. + // FIXME: Don't crash when computing the 1,337th decimal due to `increment` + // being negative. + +Don't repeat what the code says in a comment. Explain the *why* rather than *how*. + +**Bad:** + +.. code-block:: cpp + + // Draw loading screen. + draw_load_screen(); + +You can use Javadoc-style comments above function or macro definitions. It's +recommended to use Javadoc-style comments *only* for methods which are not +exposed to scripting. This is because exposed methods should be documented in +the :ref:`class reference XML ` +instead. + +**Example:** + +.. code-block:: cpp + + /** + * Returns the number of nodes in the universe. + * This can potentially be a very large number, hence the 64-bit return type. + */ + uint64_t Universe::get_node_count() { + // ... + } + +For member variables, don't use Javadoc-style comments but use single-line comments instead: + +.. code-block:: cpp + + class Universe { + // The cached number of nodes in the universe. + // This value may not always be up-to-date with the current number of nodes + // in the universe. + uint64_t node_count_cached = 0; + }; diff --git a/community/contributing/content_guidelines.rst b/community/contributing/content_guidelines.rst new file mode 100644 index 0000000..2c40103 --- /dev/null +++ b/community/contributing/content_guidelines.rst @@ -0,0 +1,97 @@ +.. _doc_content_guidelines: + +Content guidelines +================== + +This document is here to help us assess what we should include in the official +documentation. Below, you will find a couple of principles and recommendations +to write accessible content. + +We want to achieve two goals: + +1. **Empathize with our users.** We should write in a way that makes it easy for + them to learn from the docs. +2. **Write a complete reference manual**. Our goal here is not to teach + programming foundations. Instead, we should provide a reference for how + Godot's features work. + +Guidelines and principles +------------------------- + +Below are the guidelines we should strive to follow. They are not hard rules, +though: exceptionally, a topic will require breaking one or more of these. +Still, we should strive to achieve the two goals listed above. + +Writing complete and accessible documentation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**A feature doesn't exist unless it is documented**. If a user can't find +information about a feature and how it works, it doesn't exist to them. We +should ensure that we cover everything Godot does. + +.. note:: + + When adding or updating an engine feature, the documentation team needs to + know about it. Contributors should open an issue on the `godot-docs` repository + when their work gets merged and requires documentation. + +Do your best to keep documents **under 1000 words in length**. If a page goes +past that threshold, consider splitting it into two parts if possible. Limiting +page size forces us to write concisely and to break large documents so they each +focus on a particular problem. + +Make it clear what **problem** each page or section of a page tackles and what +the user will learn from it. Users need to know if they're reading the correct +guide to solving problems they encounter. For example, instead of writing the +heading "Signals", consider writing "Reacting to changes with signals". The +second title makes it clear what the purpose of signals is. + +.. note:: + + Long section titles lead to long entries in the side menu, which can make + navigation cumbersome. Try to keep headings five words long or less. + +If the page assumes specific knowledge of other Godot features, mention it and +link it to the corresponding documentation. For instance, a page about physics +may use signals, in which case we could note that the page that introduces +signals is a pre-requisite. + +Limiting cognitive load +~~~~~~~~~~~~~~~~~~~~~~~ + +Limit the cognitive load required to read the documentation. The simpler and +more explicit language we use, the more efficient it becomes for people to +learn. You can do so by: + +1. Introducing only one new concept at a time whenever possible. +2. Using simple English, as we recommend in our writing guidelines. +3. Including one or more **concrete usage examples**. Prefer a real-world example + to abstract code like ``foobar``. + +While many people may understand more complex language and abstract examples, +you will lose others. Also, understandable writing and practical examples +benefit everyone. + +Always make an effort to **put yourself in the user's shoes**. When we +understand something thoroughly, it becomes evident to us. We may fail to think +about details relevant to a newcomer, but **good documentation meets users where +they are**. We should strive to explain each feature's capabilities or intended +uses with the most straightforward language possible. + +Try to remember what you first needed to know when learning about the feature or +concept. What new terms did you need to learn? What confused you? What was the +hardest to grasp? You will want users to review your work, and we recommend you +practice explaining the feature before writing about it. + +.. note:: + + Having programming foundations is a pre-requisite to use a complex engine + like Godot. Talking about variables, functions, or classes is acceptable. + But we should favor plain language over specific terminology like + "metaprogramming". If you need to use precise terms, be sure to define them. + +When a page assumes knowledge of another engine feature, declare it at the +beginning and link to resources that cover what users need. You may also link to +other websites for pre-requisites beyond the documentation's scope. For example, +you could link to an introduction to programming in the getting started guide, or a +website that teaches math theory in the math section. diff --git a/community/contributing/contributing_to_the_documentation.rst b/community/contributing/contributing_to_the_documentation.rst new file mode 100644 index 0000000..9158d69 --- /dev/null +++ b/community/contributing/contributing_to_the_documentation.rst @@ -0,0 +1,188 @@ +.. _doc_contributing_to_the_documentation: + +Contributing to the documentation +================================= + +This guide explains how to contribute to Godot's documentation, be it by +writing or reviewing pages. + +.. seealso:: + + If you want to translate pages or the class reference from English to other + languages, read :ref:`doc_editor_and_docs_localization`. + +Getting started +--------------- + +To modify or create pages in the reference manual, you need to edit ``.rst`` +files in the `godot-docs GitHub repository +`_. Modifying those pages in a pull +request triggers a rebuild of the online documentation upon merging. + +.. seealso:: For details on Git usage and the pull request workflow, please + refer to the :ref:`doc_pr_workflow` page. Most of what it describes + regarding the main godotengine/godot repository is also valid for + the docs repository. + +.. warning:: The class reference's source files are in the `Godot engine + repository `_. We generate + the :ref:`Godot API ` section of this documentation + from them. If you want to update the description of a class, its + methods, or properties, read + :ref:`doc_updating_the_class_reference`. + +What is the Godot documentation +------------------------------- + +The Godot documentation is intended as a comprehensive reference manual for the +Godot game engine. It is not meant to contain step-by-step tutorials, except for +two game creation tutorials in the Getting Started section. + +We strive to write factual content in an accessible and well-written language. To +contribute, you should also read: + +1. The :ref:`doc_docs_writing_guidelines`. There, you will find rules and + recommendations to write in a way that everyone understands. +2. The content guidelines. They explain the principles we follow to write the + documentation and the kind of content we accept. + +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 less convenient to edit than a wiki, this Git repository is where we +write the documentation. Having direct access to the source files in a revision +control system is a plus to ensure our documentation quality. + +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 +reference `__. +See :ref:`doc_updating_the_class_reference` for details. + +.. seealso:: To build the manual and test changes on your computer, see + :ref:`doc_building_the_manual`. + +Editing pages online +-------------------- + +You can edit the documentation online by clicking the **Edit on GitHub** link in +the top-right of every page. + +Doing so takes you to the GitHub text editor. You need to have a GitHub account +and to log in to use it. Once logged in, you can propose change like so: + +1. Click the **Edit on GitHub** button. + +2. On the GitHub page you're taken to, click the pencil icon in the top-right + corner near the **Raw**, **Blame**, and **Delete** buttons. It has the + tooltip "Fork this project and edit the file". + +3. Edit the text in the text editor. + +4. At the bottom of the web page, summarize the changes you made and click the + button **Propose file change**. Make sure to replace the placeholder "Update file.rst" + by a short but clear one-line description, as this is the commit title. + +5. On the following screens, click the **Create pull request** button until you + see a message like *Username wants to merge 1 commit into godotengine:master + from Username:patch-1*. + +Another contributor will review your changes and merge them into the docs if +they're good. They may also make changes or ask you to do so before merging. + +Adding new pages +---------------- + +Before adding a new page, please ensure that it fits in the documentation: + +1. Look for `existing issues + `_ or open a new one to see + if the page is necessary. +2. Ensure there isn't a page that already covers the topic. +3. Read our :ref:`doc_content_guidelines`. + +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``. + +You should then add your page to the relevant "toctree" (table of contents, +e.g. ``tutorials/3d/index.rst``). Add your new filename to the list on a new +line, using a relative path and no extension, e.g. here ``light_baking``. + +Titles +~~~~~~ + +Always begin pages with their title and a Sphinx reference name: + +:: + + .. _doc_insert_your_title_here: + + Insert your title here + ====================== + +The reference ``_doc_insert_your_title_here`` and the title should match. + +The reference allows linking to this page using the ``:ref:`` format, e.g. +``:ref:`doc_insert_your_title_here``` would link to the above example page (note +the lack of leading underscore in the reference). + +Write your titles like plain sentences, without capitalizing each word: + +- **Good:** Understanding signals in Godot +- **Bad:** Understanding Signals In Godot + +Only propers nouns, projects, people, and node class names should have their +first letter capitalized. + +Sphinx and reStructuredText syntax +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Check Sphinx’s `reST Primer `__ +and the `official reference `__ 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 +`__ for more details. To learn +how to use Sphinx directives like ``.. note::`` or ``.. seealso::``, check out +the `Sphinx directives documentation +`__. + +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: + +.. code:: 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: + +.. code:: rst + + :download:`myfilename.zip ` + + +License +------- + +This documentation and every page it contains is published under the terms of +the `Creative Commons Attribution 3.0 license (CC-BY-3.0) +`_, with +attribution to "Juan Linietsky, Ariel Manzur and the Godot community". + +By contributing to the documentation on the GitHub repository, you agree that +your changes are distributed under this license. diff --git a/community/contributing/cpp_usage_guidelines.rst b/community/contributing/cpp_usage_guidelines.rst new file mode 100644 index 0000000..3aaeda1 --- /dev/null +++ b/community/contributing/cpp_usage_guidelines.rst @@ -0,0 +1,106 @@ +.. _doc_cpp_usage_guidelines: + +C++ usage guidelines +==================== + +Rationale +--------- + +Since Godot 4.0, the C++ standard used throughout the codebase is a subset of +**C++17**. While modern C++ brings a lot of opportunities to write faster, more +readable code, we chose to restrict our usage of C++ to a subset for a few +reasons: + +- It makes it easier to review code in online editors. This is because engine + contributors don't always have access to a full-featured IDE while reviewing + code. +- It makes the code easier to grasp for beginner contributors (who may not be + professional C++ programmers). Godot's codebase is known to be easy to learn + from, and we'd like to keep it that way. + +To get your pull request merged, it needs to follow the C++ usage guidelines +outlined here. Of course, you can use features not allowed here in your own C++ +modules or GDNative scripts. + +.. note:: + + Prior to Godot 4.0, the C++ standard used throughout the codebase was C++03, + with a handful of C++14 extensions. If you are contributing a pull request + to the `3.x` branch rather than `master`, your code can't use C++17 features. + Instead, your code must be able to be built with a C++14 compiler. + + The guidelines below don't apply to third-party dependencies, although we + generally favor small libraries instead of larger solutions. See also + :ref:`doc_best_practices_for_engine_contributors`. + +.. seealso:: + + See :ref:`doc_code_style_guidelines` for formatting guidelines. + +Disallowed features +------------------- + +**Any feature not listed below is allowed.** Using features like ``constexpr`` +variables and ``nullptr`` is encouraged when possible. Still, try to keep your +use of modern C++ features conservative. Their use needs to serve a real +purpose, such as improving code readability or performance. + +Standard Template Library +^^^^^^^^^^^^^^^^^^^^^^^^^ + +We don't allow using the `STL `__ +as Godot provides its own data types (among other things). +See :ref:`doc_faq_why_not_stl` for more information. + +This means that pull requests should **not** use ``std::string``, +``std::vector`` and the like. Instead, use Godot's datatypes as described below: + +- Use ``String`` instead of ``std::string``. +- Use ``Vector`` instead of ``std::vector``. In some cases, ``LocalVector`` + can be used as an alternative (ask core developers first). +- Use ``Array`` instead of ``std::array``. + +.. note:: + + Godot also has a List datatype (which is a linked list). While List is already used + in the codebase, it typically performs worse than other datatypes like Vector + and Array. Therefore, List should be avoided in new code unless necessary. + +``auto`` keyword +^^^^^^^^^^^^^^^^ + +Please don't use the ``auto`` keyword for type inference. While it can avoid +repetition, it can also lead to confusing code: + +.. code-block:: cpp + + // Not so confusing... + auto button = memnew(Button); + + // ...but what about this? + auto result = EditorNode::get_singleton()->get_complex_result(); + +Keep in mind hover documentation often isn't readily available for pull request +reviewers. Most of the time, reviewers will use GitHub's online viewer to review +pull requests. + +We chose to forbid ``auto`` instead of allowing it on a case-by-case basis to +avoid having to decide on difficult edge cases. Thank you for your understanding. + +Lambdas +^^^^^^^ + +Lambdas should be used conservatively when they make code effectively faster or +simpler, and do not impede readability. Please ask before using lambdas in a +pull request. + +``#pragma once`` directive +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To follow the existing style, please use standard ``#ifdef``-based include +guards instead of ``#pragma once`` in new files. + +.. seealso:: + + See :ref:`doc_code_style_guidelines_header_includes` for guidelines on sorting + includes in C++ and Objective-C files. diff --git a/community/contributing/docs_writing_guidelines.rst b/community/contributing/docs_writing_guidelines.rst new file mode 100644 index 0000000..b67ad59 --- /dev/null +++ b/community/contributing/docs_writing_guidelines.rst @@ -0,0 +1,540 @@ +.. _doc_docs_writing_guidelines: + +Docs writing guidelines +======================= + +The Godot community is rich and international. Users come from all +around the world. Some of them are young, and many aren't native English +speakers. That's why we must all write using a clear and a common +language. For the class reference, the goal is to make it easy to read +for everyone and precise. + +In summary, always try to: + +1. Use the direct voice +2. Use precise action verbs +3. Avoid verbs that end in -ing +4. Remove unnecessary adverbs and adjectives. +5. Ban these 8 words: obvious, simple, basic, easy, actual, just, clear, and however +6. Use explicit references +7. Use 's to show possession +8. Use the Oxford comma + +There are 3 rules to describe classes: + +1. Give an overview of the node in the brief description +2. Mention what methods return if it's useful +3. Use "if true" to describe booleans + +.. note:: + + A technical writer's job is to pack as much information as possible into + the smallest and clearest sentences possible. These guidelines will help + you work towards that goal. + +.. seealso:: + + See the :ref:`content guidelines ` for information + on the types of documentation you can write in the official documentation. + +7 rules for clear English +------------------------- + +Use the direct voice +~~~~~~~~~~~~~~~~~~~~ + +Use the direct voice when possible. Take the classes, methods, and +constants you describe as the subject. It's natural to write using the +passive voice, but it's harder to read and produces longer sentences. + +.. highlight:: none + +Passive: + +:: + + The man **was bitten** by the dog. + +Active: + +:: + + The dog bit the man. + +**Don't** use the passive voice: + +:: + + void edit_set_pivot ( Vector2 pivot ) + [...] This method **is implemented** only in some nodes that inherit Node2D. + +**Do** use the node's name as a noun: + +:: + + void edit_set_pivot ( Vector2 pivot ) + [...] Only some Node2Ds **implement** this method. + +Use precise action verbs +~~~~~~~~~~~~~~~~~~~~~~~~ + +Favor precise yet common verbs over generic ones like ``make``, ``set``, +and any expression you can replace with a single word. + +**Don't** repeat the method's name. It already states it sets the pivot +value to a new one: + +:: + + void edit_set_pivot ( Vector2 pivot ) + Set the pivot position of the 2D node to [code]pivot[/code] value. [...] + +**Do** explain what's the consequence of this "set": use precise verbs +like ``place``, ``position``, ``rotate``, ``fade``, etc. + +:: + + void edit_set_pivot ( Vector2 pivot ) + Position the node's pivot to the [code]pivot[/code] value. [...] + +Avoid verbs that end in -ing +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The progressive forms describe continuous actions. E.g. "is calling", +"is moving". + +**Don't** use the progressive form for instant changes. + +:: + + Vector2 move ( Vector2 rel_vec ) + Move the body in the given direction, **stopping** if there is an obstacle. [...] + +**Do** use simple present, past, or future. + +:: + + Vector2 move ( Vector2 rel_vec ) + Moves the body in the vector's direction. The body **stops** if it collides with an obstacle. [...] + +Exception: If the subject is not clear, replacing "ing" verbs is not an +improvement. For example, in the previous sentence, "it replaces" +would not make much sense where "replacing" currently is. + +You may use the progressive tense to describe actions that are +continuous in time. Anything like animation or coroutines. + +.. tip:: + + Verbs can turn into adjectival nouns with -ing. This is not a + conjugation, so you may use them: ``the remaining movement``, + ``the missing file``, etc. + +Remove unnecessary adverbs and adjectives +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Write as few adjectives and adverbs as possible. Only use them if they +add key information to the description. + +**Don't** use redundant or meaningless adverbs. Words that lengthen the +documentation but don't add any information: + +:: + + **Basically** a big texture [...] + +**Do** write short sentences in a simple, descriptive language: + +:: + + A big texture [...] + +Ban these 8 words +~~~~~~~~~~~~~~~~~ + +**Don't** ever use these 8 banned words: + +1. obvious +2. simple +3. basic +4. easy +5. actual +6. just +7. clear +8. however (some uses) + +Game creation and programming aren't simple, and nothing's easy to +someone learning to use the API for the first time. Other words in the +list, like ``just`` or ``actual`` won't add any info to the sentence. +Don't use corresponding adverbs either: obviously, simply, basically, +easily, actually, clearly. + +**Don't** example. The banned words lengthen the description and take +attention away from the most important info: + +:: + + **TextureRect** + Control frame that **simply** draws an assigned texture. It can stretch or not. It's a **simple** way to **just** show an image in a UI. + +**Do** remove them: + +:: + + **TextureRect** + [Control] node that displays a texture. The texture can stretch to the node's bounding box or stay in the center. Useful to display sprites in your UIs. + +"Simple" never helps. Remember, for other users, anything could be +complex or frustrate them. There's nothing like a good old *it's simple* +to make you cringe. Here's the old brief description, the first sentence +on the Timer node's page: + +:: + + **Timer** + A **simple** Timer node. + +**Do** explain what the node does instead: + +:: + + **Timer** + Calls a function of your choice after a certain duration. + +**Don't** use "basic", it is too vague: + +:: + + **Vector3** + Vector class, which performs **basic** 3D vector math operations. + +**Do** use the brief description to offer an overview of the node: + +:: + + **Vector3** + Provides essential math functions to manipulate 3D vectors: cross product, normalize, rotate, etc. + +Use explicit references +~~~~~~~~~~~~~~~~~~~~~~~ + +Favor explicit references over implicit ones. + +**Don't** use words like "the former", "the latter", etc. They're not +the most common in English, and they require you to check the reference. + +:: + + [code]w[/code] and [code]h[/code] define right and bottom margins. The **latter** two resize the texture so it fits in the defined margin. + +**Do** repeat words. They remove all ambiguity: + +:: + + [code]w[/code] and [code]h[/code] define right and bottom margins. **[code]w[/code] and [code]h[/code]** resize the texture so it fits the margin. + +If you need to repeat the same variable name 3 or 4 times, you probably +need to rephrase your description. + +Use 's to show possession +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Avoid "The milk **of** the cow". It feels unnatural in English. Write "The cow's +milk" instead. + +**Don't** write "of the X": + +:: + + The region **of the AtlasTexture that is** used. + +**Do** use ``'s``. It lets you put the main subject at the start of the +sentence, and keep it short: + +:: + + The **AtlasTexture's** used region. + +Use the Oxford comma to enumerate anything +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +From the Oxford dictionary: + + The 'Oxford comma' is an optional comma before the word 'and' at the end of a list: + *We sell books, videos, and magazines.* + + [...] Not all writers and publishers use it, but it can clarify the meaning of a sentence when the items in a list are not single words: + *These items are available in black and white, red and yellow, and blue and green.* + +**Don't** leave the last element of a list without a comma: + +:: + + Create a KinematicBody2D node, a CollisionShape2D node and a sprite node. + +**Do** add a comma before `and` or `or`, for the last +element of a list with more than two elements. + +:: + + Create a KinematicBody2D node, a CollisionShape2D node, and a sprite node. + + +How to write methods and classes +-------------------------------- + +Dynamic vs static typing +~~~~~~~~~~~~~~~~~~~~~~~~ + +The code examples in the documentation should follow a consistent style not to +confuse users. As static type hints are an optional feature of GDScript, we +chose to stick to writing dynamic code. This leads to writing GDScript that is +concise and accessible. + +The exception is topics that explain static typing concepts to users. + +**Don't** add a type hint with a colon or by casting: + +:: + + const MainAttack := preload("res://fire_attack.gd") + var hit_points := 5 + var name: String = "Bob" + var body_sprite := $Sprite as Sprite + + +**Do** write constants and variables with dynamic typing: + +:: + + const MainAttack = preload("res://fire_attack.gd") + var hit_points = 5 + var name = "Bob" + var body_sprite = $Sprite + + +**Don't** write functions with inferred arguments or return types: + +:: + + func choose(arguments: PackedStringArray) -> String: + # Chooses one of the arguments from array with equal chances + randomize() + var size := arguments.size() + var choice: int = randi() % size + return arguments[choice] + +**Do** write functions using dynamic typing: + +:: + + func choose(arguments): + # Chooses one of the arguments from array with equal chances + randomize() + var size = arguments.size() + var choice = randi() % size + return arguments[choice] + +Use real-world code examples where appropriate +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Real-world examples are more accessible to beginners than abstract ``foos`` and +``bars``. You can also copy them directly from your game projects, ensuring that +any code snippet compiles without errors. + +Writing ``var speed = 10`` rather than ``var my_var = 10`` allows beginners to +understand code better. It gives them a frame of reference as to where they +could use the code snippets in a live project. + +**Don't** write made-up examples: + +:: + + onready var a = preload("res://MyPath") + onready var my_node = $MyNode + + + func foo(): + # Do stuff + +**Do** write concrete examples: + +:: + + onready var sfx_player_gun = preload("res://Assets/Sound/SFXPlayerGun.ogg") + onready var audio_player = $Audio/AudioStreamPlayer + + + func play_shooting_sound(): + audio_player.stream = sfx_player_gun + audio_player.play() + +Of course, there are times when using real-world examples is impractical. In +those situations, you should still avoid using names such as ``my_var``, +``foo()`` or ``my_func()`` and consider more meaningful names for your examples. + +Give an overview of the node in the brief description +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The brief description is the reference's most important sentence. It's +the user's first contact with a node: + +1. It's the only description in the "Create New Node" dialog. +2. It's at the top of every page in the reference + +The brief description should explain the node's role and its +functionality, in up to 200 characters. + +**Don't** write tiny and vague summaries: + +:: + + **Node2D** + Base node for 2D system. + +**Do** give an overview of the node's functionality: + +:: + + **Node2D** + A 2D game object, inherited by all 2D-related nodes. Has a position, rotation, scale, and Z index. + +Use the node's full description to provide more information, and a code +example, if possible. + +Mention what methods return if it's useful +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Some methods return important values. Describe them at the end of the +description, ideally on a new line. No need to mention the return values +for any method whose name starts with ``set`` or ``get``. + +**Don't** use the passive voice: + +:: + + Vector2 move ( Vector2 rel_vec ) + [...] The returned vector is how much movement was remaining before being stopped. + +**Do** always use "Returns". + +:: + + Vector2 move ( Vector2 rel_vec ) + [...] Returns the remaining movement before the body was stopped. + +Notice the exception to the "direct voice" rule: with the move method, +an external collider can influence the method and the body that calls +``move``. In this case, you can use the passive voice. + +Use "if true" to describe booleans +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +For boolean member variables, always use ``if true`` and/or +``if false``, to stay explicit. ``Controls whether or not`` may be +ambiguous and won't work for every member variable. + +Also, surround boolean values, variable names and methods with ``[code][/code]``. + +**Do** start with "if true": + +:: + + Timer.autostart + If [code]true[/code], the timer will automatically start when entering the scene tree. + + +Use ``[code]`` around arguments +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +In the class reference, always surround arguments with ``[code][/code]``. In the +documentation and in Godot, it will display like ``this``. When you edit XML +files in the Godot repository, replace existing arguments written like 'this' or +\`this\` with ``[code]this[/code]``. + + +Common vocabulary to use in Godot's documentation +------------------------------------------------- + +The developers chose some specific words to refer to areas of the +interface. They're used in the sources, in the documentation, and you +should always use them instead of synonyms, so the users know what +you're talking about. + +.. figure:: img/editor-vocabulary-overview.png + :alt: Overview of the interface and common vocabulary + + Overview of the interface and common vocabulary + +In the top left corner of the editor lie the ``main menus``. In the +center, the buttons change the ``workspace``. And together the buttons +in the top right are the ``playtest buttons``. The area in the center, +that displays the 2D or the 3D space, is the ``viewport``. At its top, +you find a list of ``tools`` inside the ``toolbar``. + +The tabs or dockable panels on either side of the viewport are +``docks``. You have the ``FileSystem dock``, the ``Scene dock`` that +contains your scene tree, the ``Import dock``, the ``Node dock``, and +the ``Inspector`` or ``Inspector dock``. With the default layout you may +call the tabbed docks ``tabs``: the ``Scene tab``, the ``Node tab``... + +The Animation, Debugger, etc. at the bottom of the viewport are +``panels``. Together they make up the ``bottom panels``. + +Foldable areas of the Inspector are ``sections``. The node's parent +class names, which you can't fold, are ``Classes`` e.g. the +``KinematicBody2D class``. And individual lines with key-value pairs are +``properties``. E.g. ``position`` or ``modulate color`` are both +``properties``. + +Keyboard shortcut guidelines +---------------------------- + +Keyboard and mouse shortcuts should make use of the ``:kbd:`` tag, which allows +shortcuts to stand out from the rest of the text and inline code. Use the +compact form for modifier keys (:kbd:`Ctrl`/:kbd:`Cmd`) instead of their spelled +out form (:kbd:`Control`/:kbd:`Command`). For combinations, use the ``+`` symbol +with a space on either side of the symbol. + +Make sure to mention shortcuts that differ on macOS compared to other platforms. +On macOS, ``Cmd`` often replaces ``Ctrl`` in keyboard shortcuts. + +Try to integrate the shortcut into sentences the best you can. Here are some +examples with the ``:kbd:`` tag left as-is for better visibility: + +- Press ``:kbd:`Ctrl + Alt + T``` to toggle the panel (``:kbd:`Cmd + Alt + T``` on macOS). +- Press ``:kbd:`Space``` and hold the left mouse button to pan in the 2D editor. +- Press ``:kbd:`Shift + Up Arrow``` to move the node upwards by 8 pixels. + +Image contribution guidelines +----------------------------- + +A significant part of the documentation is images, and there are several +important guidelines to follow. + +First, you should always be using the default editor theme and text when taking +screenshots. + +To improve the appearance of 3D screenshots, use 4× MSAA, enable anisotropic +filtering on the project's textures, and set the anisotropic filter quality to +16× in Project Settings. + +Screenshot sizes should not exceed 1920×1080 to ensure fast loading on slower +connections. + +When you need to highlight an area of the editor to show something, like a +button or option, use a 2 pixel-thick yellow outline without a bevel. If the +outline is on a dark background, the outline should be yellow so it can be +easily seen by colorblind people. Please do not use red as it won't be visible +for some users. + +Before you add or replace any images in the documentation, they should be run +through a PNG compressor to save size. You can use the lossless OxiPNG +compressor included in `Squoosh `__ for this purpose. For +heavier images, consider using a lossy compressor like `pngquant +`_. With it, almost no image quality is lost during +compression. + +.. note:: + + The program pngquant must be installed locally as it's not available in Squoosh. diff --git a/community/contributing/documentation_guidelines.rst b/community/contributing/documentation_guidelines.rst new file mode 100644 index 0000000..9320710 --- /dev/null +++ b/community/contributing/documentation_guidelines.rst @@ -0,0 +1,141 @@ +.. _doc_documentation_guidelines: + +Documentation guidelines +======================== + +This page describes the rules to follow if you want to contribute to Godot +Engine by writing or reviewing documentation, or by translating existing +documentation. Also, have a look at README of the +`godot-docs GitHub repository `_ +and the `docs front page `_ +on what steps to follow and how to contact the docs team. + +How to contribute +----------------- + +Creating or modifying documentation pages is mainly done via the +`godot-docs GitHub repository `_. +The HTML (or PDF and EPUB) documentation is generated from the .rst files +(reStructuredText markup language) in that repository. Modifying those pages +in a pull request and getting it merged will trigger a rebuild of the online +documentation. + +.. seealso:: For details on Git usage and the pull request workflow, please + refer to the :ref:`doc_pr_workflow` page. Most of what it + describes regarding the main godotengine/godot repository is + also valid for the docs repository. + +.. warning:: The class reference's source files are in the `Godot engine repository + `_. We generate the :ref:`Godot API + ` section of this documentation from them. If you want to update the + description of a class, its methods, or properties, read + :ref:`doc_updating_the_class_reference`. + +.. warning:: If you want to edit the **API reference**, please note that it + should *not* be done in the godot-docs repository. Instead, you + should edit the ``doc/classes/*`` XML files of Godot's + main repository. These files are then later used to generate the + in-editor documentation as well as the API reference of the + online docs. Read more here: :ref:`doc_updating_the_class_reference`. + +The 'Edit on GitHub' link +------------------------- + +If you're reading documentation on `docs.godotengine.org `_, +you'll see an **Edit on GitHub** hyperlink at the top right of the page. +Once you've created a GitHub account, you can propose changes to a page you're +reading as follows: + +1. Click the **Edit on GitHub** button. + +2. On the GitHub page you're taken to, click the pencil icon in the top-right + corner near the **Raw**, **Blame** and **History** buttons. It has the tooltip + "Edit the file in a fork of this project". + +3. Complete all the edits you want to make for that page. + +4. Summarize the changes you made in the form at the bottom of the page and + click the button labelled **Propose file change** when done. + +5. On the following screens, click the **Create pull request** button until you + see a message like *Username wants to merge 1 commit into + godotengine:master from Username:patch-6*. + +6. A reviewer will evaluate your changes and incorporate them into the docs if + they're acceptable. You might also be asked to make + modifications to your changes before they're included. + +What makes good documentation? +------------------------------ + +Documentation should be well written in plain English, using well-formed +sentences and various levels of sections and subsections. It should be clear +and objective. Also, have a look at the :ref:`doc_docs_writing_guidelines`. + +We differentiate tutorial pages from other documentation pages by these +definitions: + +- Tutorial: a page aiming at explaining how to use one or more concepts in + the editor or scripts in order to achieve a specific goal with a learning + purpose (e.g. "Making a simple 2d Pong game", "Applying forces to an + object"). +- Documentation: a page describing precisely one and only one concept at a + time, if possible exhaustively (e.g. the list of methods of the + Sprite class, or an overview of the input management in Godot). + +You are free to write the kind of documentation you wish, as long as you +respect the following rules (and the ones on the repo). + +Titles +------ + +Always begin pages with their title and a Sphinx reference name: + +:: + + .. _doc_insert_your_title_here: + + Insert your title here + ====================== + +The reference allows linking to this page using the ``:ref:`` format, e.g. +``:ref:`doc_insert_your_title_here``` would link to the above example page +(note the lack of leading underscore in the reference). + +Also, avoid American CamelCase titles: title's first word should begin +with a capitalized letter, and every following word should not. Thus, +this is a good example: + +- Insert your title here + +And this is a bad example: + +- Insert Your Title Here + +Only project, people and node class names should have capitalized first +letter. + +Translating existing pages +-------------------------- + +You can help to translate the official Godot documentation on our `Hosted Weblate `_. + +.. image:: https://hosted.weblate.org/widgets/godot-engine/-/godot-docs/287x66-white.png + :alt: Translation state + :align: center + :target: https://hosted.weblate.org/engage/godot-engine/?utm_source=widget + :width: 287 + :height: 66 + +There also is the official +`Godot i18n repository `_ +where you can see when the data was last synchronized. + +License +------- + +This documentation and every page it contains is published under the terms of +the `Creative Commons Attribution 3.0 license (CC-BY-3.0) `_, with attribution to "Juan Linietsky, Ariel Manzur and the Godot community". + +By contributing to the documentation on the GitHub repository, you agree that +your changes are distributed under this license. diff --git a/community/contributing/editor_and_docs_localization.rst b/community/contributing/editor_and_docs_localization.rst new file mode 100644 index 0000000..d97c4b4 --- /dev/null +++ b/community/contributing/editor_and_docs_localization.rst @@ -0,0 +1,416 @@ +.. _doc_editor_and_docs_localization: + +Editor and docs localization +============================ + +.. highlight:: none + +Godot aims to make game development available to everyone, including people who +may not know or be comfortable with English. Therefore, we do our best to make +the most important resources available in many languages, thanks to the +translation effort of the community. + +These resources include: + +1. The `Godot editor's interface `__ + (ca. 15,000 words). +2. The `online documentation `__ + (editor manual and tutorials, ca. 300,000 words). +3. The `class reference `__, + available both online and in the editor (ca. 200,000 words). + +To manage translations, we use the GNU gettext file format (``PO`` files), and +the open source `Weblate `__ web-based localization +platform, which allows easy collaboration of many contributors to complete the +translation for the various components, and keep them up to date. Click the bold +links above to access each resource on Weblate. + +This page gives an overview of the general translation workflow on Weblate, and +some resource-specific instructions on e.g. how to handle some keywords or the +localization of images. + +.. tip:: + + Translating all the official Godot content is a massive undertaking, so we + advise prioritizing the resources as they are listed above: first the editor + interface, then the online documentation, and eventually the class reference + if there are enough translators to keep up with updates. + +Using Weblate for translations +------------------------------ + +While our translations eventually reside in the Git repositories of the Godot +engine and its documentation, all translation updates are handled through +Weblate, and thus direct pull requests to the Git repositories are not accepted. +Translations are synced manually between Weblate and the Godot repositories by +maintainers. + +You should therefore `register on Weblate `__ +to contribute to Godot's translations. + +Once signed in, browse to the Godot resource which you want to contribute to (in +this page we will use the `editor translation `__ +as an example) to find the list of all languages: + +.. image:: img/l10n_01_language_list.png + +.. seealso:: + + Feel free to consult Weblate's own documentation on the `translation + workflow `__ for + more details. + +Adding a new language +^^^^^^^^^^^^^^^^^^^^^ + +If your language is already listed, click on its name to access the overview, +and skip the rest of this section. + +If your language is not listed, scroll to the bottom of the list of languages +and click the "Start new translation" button, and select the language you want +to translate to: + +.. image:: img/l10n_02_new_translation.png + +.. important:: + + If your language is spoken in several countries with only limited regional + variations, please consider adding it with its generic variant (e.g. ``fr`` + for French) instead of a regional variant (e.g. ``fr_FR`` for French + (France), ``fr_CA`` for French (Canada), or ``fr_DZ`` for French (Algeria)). + + Godot has a huge amount of content to translate, so duplicating the work for + regional variants should only be done if the language variations are + significant enough. Additionally, if a translation is done with for a + regional variant, it will only be available automatically for users located + in this region (or having their system language configured for this region). + + When regional variations are significant enough to warrant separate + translations, we advise to focus on completing a generic variant first if + possible, then duplicate the fully completed translation for regional + variants and do the relevant edits. This is typically a good strategy for + e.g. Spanish (work on ``es`` first, then duplicate it to ``es_AR``, + ``es_ES``, ``es_MX``, etc. if necessary) or Portuguese (``pt_BR`` vs + ``pt_PT``). + +Translation interface +^^^^^^^^^^^^^^^^^^^^^ + +Once a language has been selected, you will see an overview of the translation +status, including how many strings are left to translate or review. Each item +can be clicked and used to browse through the corresponding list. You can also +click the "Translate" button to get started on the list of strings needing +action. + +.. image:: img/l10n_03_translation_overview.png + +After selecting a list of clicking "Translate", you will see the main +translation interface where all the work happens: + +.. image:: img/l10n_04_translation_interface.png + +On that page, you have: + + - A toolbar which lets you cycle through strings of the current list, change + to another predefined list or do a custom search, etc. There is also a "Zen" + editing mode with a simplified interface. + - The actual string you are working on in the "Translation" panel. By default, + there should be the English source string and an edit box for your language. + If you are familiar with other languages, you can add them in your user + settings to give you more context for translation. + Once you are done editing the current string, press "Save" to confirm changes + and move to the next entry. Alternatively, use the "Skip" button to skip it. + The "Needs editing" checkbox means that the original string was updated, and + the translation therefore needs review to take those changes into account (in + PO jargon, these are so-called "fuzzy" strings). Such strings won't be used + in the translation until fixed. + - The bottom panel has various tools which can help with the translation + effort, such as context from nearby strings (usually from the same editor + tool or documentation page, so they might use similar terms), comments from + other translators, machine translations, and a list of all other existing + translations for that string. + - On the top right, the glossary shows terms for which an entry has been added + previously, and which are included in the current string. For example, if + you decided with fellow translators to use a specific translation for the + "node" term in Godot, you can add it to the glossary to ensure that other + translators use the same convention. + - The bottom right panel includes information on the source string. The most + relevant item is the "source string location", which links you to the + original string on GitHub. You may need to search for the string in the page + to locate it and its surrounding context. + +Locating original content +------------------------- + +PO files are an ordered list of source strings (``msgid``) and their translation +(``msgstr``), and by default, Weblate will present the strings in that order. It +can therefore be useful to understand how the content is organized in the PO +files to help you locate the original content and use it as a reference when +translating. + +.. important:: + + It is primordial to use the original context as reference when translating, + as many words have several possible translations depending on the context. + Using the wrong translation can actually be detrimental to the user and make + things harder to understand than if they stayed in English. + Using the context also makes the translation effort much easier and more + enjoyable, as you can see directly if the translation you wrote will make + sense in context. + +- The editor interface's translation template is generated by parsing all the + C++ source code in **alphabetical order**, so all the strings defined in a + given file will be grouped together. For example, if the "source string + location" indicates ``editor/code_editor.cpp``, the current string (and the + nearby ones) is defined in the ``editor/code_editor.cpp`` code file, and is + thereby related to the code editors in Godot (GDScript, shaders). +- The online documentation's translation template is generated from the source + RST files in the same order as seen in the **table of contents**, so for + example the first strings are from the front page of the documentation. + The recommended workflow is therefore to find a unique string corresponding to + a page that you want to translate, and then translate all the strings with the + same source string location while comparing with the online version of that + page in English. An example of source string location could be + ``getting_started/step_by_step/nodes_and_scenes.rst`` for the + page :ref:`doc_nodes_and_scenes`. +- The class reference's translation template is generated from the source XML + files in **alphabetical order**, which is also the same as the order of the + table of contents for the online version. You can therefore locate the source + string corresponding to the brief description of a given class to find the + first string to translate and all other descriptions from that class should be + in the subsequent strings on Weblate. For example, the descriptions for the + :ref:`class_Node2D` class would have the source string location + ``doc/classes/Node2D.xml``. + +A handy tool to locate specific pages/classes is to use Weblate's advanced +search feature, and especially the "Location strings" query (which can also be +used with the ``location:`` token, e.g. ``location:nodes_and_scenes.rst``): + +.. image:: img/l10n_05_search_location.png + +.. image:: img/l10n_06_browse_by_location.png + +.. note:: + + When a given source string is used in multiple source locations, they will + all be concatenated into one. For example, the above + ``location:nodes_and_scenes.rst`` query would land first on the + "Introduction" source string which is used in dozens of pages, including + some that come before ``nodes_and_scenes.rst`` in the template. Clicking the + "Next" button then brings us to the "Scene and nodes" title string displayed + above. + So it may happen that a given paragraph or section title is not at the + location you'd expect it when reading the online version of a page. + +Respecting the markup syntax +---------------------------- + +Each translation resource originates from a different source code format, and +having some notions on the markup language used for each resource is important +to avoid creating syntax errors in your translations. + +Editor interface (C++) +^^^^^^^^^^^^^^^^^^^^^^ + +The editor translations originate from C++ strings, and may use: + +- **C format specifiers** such as ``%s`` (a string) or ``%d`` (a number). These + specifiers are replaced by content at runtime, and should be preserved and + placed in your translation where necessary for it to be meaningful after + substitution. You may need to refer to the source string location to + understand what kind of content will be substituted if it's not clear from the + sentence. Example (``%s`` will be substituted with a file name or path):: + + # PO file: + "There is no '%s' file." + + # Weblate: + There is no '%s' file. + +- **C escape characters** such as ``\n`` (line break) or ``\t`` (tabulation). In + the Weblate editor, the ``\n`` characters are replaced by ``↵`` (return) and + ``\t`` by ``↹``. Tabs are not used much, but you should make sure to use line + breaks in the same way as the original English string (Weblate will issue a + warning if you don't). Line breaks might sometimes be used for vertical + spacing, or manual wrapping of long lines which would otherwise be too long + especially in the editor translation). Example:: + + # PO file: + "Scene '%s' is currently being edited.\n" + "Changes will only take effect when reloaded." + + # Weblate: + Scene '%s' is currently being edited.↵ + Changes will only take effect when reloaded. + +.. note:: + Only logical order of the characters matters, in the right-to-left text, format + specifiers may be displayed as ``s%``. + +Online documentation (RST) +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The documentation translations originate from reStructuredText (RST) files, +which also use their own markup syntax to style text, create internal and +external links, etc. Here are some examples:: + + # "development" is styled bold. + # "Have a look here" is a link pointing to https://docs.godotengine.org/en/latest. + # You should translate "Have a look here", but not the URL, unless there is + # a matching URL for the same content in your language. + # Note: The `, <, >, and _ characters all have a meaning in the hyperlink + # syntax and should be preserved. + + Looking for the documentation of the current **development** branch? + `Have a look here `_. + + # "|supported|" is an inline reference to an image and should stay unchanged. + # "master" uses the markup for inline code, and will be styled as such. + # Note: Inline code in RST uses 2 backticks on each side, unlike Markdown. + # Single backticks are used for hyperlinks. + + |supported| Backwards-compatible new features (backported from the ``master`` + branch) as well as bug, security, and platform support fixes. + + # The :ref: Sphinx "role" is used for internal references to other pages of + # the documentation. + # It can be used with only the reference name of a page (which should not be + # changed), in which case the title of that page will be displayed: + + See :ref:`doc_ways_to_contribute`. + + # Or it can be used with an optional custom title, which should thus be translated: + + See :ref:`how to contribute `. + + # You may encounter other Sphinx roles, such as :kbd: used for shortcut keys. + # You can translate the content between backticks to match the usual key names, + # if it's different from the English one. + + Save the scene. Click Scene -> Save, or press :kbd:`Ctrl + S` on Windows/Linux + or :kbd:`Cmd + S` on macOS. + +.. seealso:: + + See Sphinx's `reStructured Text primer `__ + for a quick overview of the markup language you may find in source strings. + You may encounter especially the inline markup (bold, italics, inline code) + and the internal and external hyperlink markup. + +Class reference (BBCode) +^^^^^^^^^^^^^^^^^^^^^^^^ + +The class reference is documented in the main Godot repository using XML files, +and with BBCode-like markup for styling and internal references. + +Some of the tags used are from the original BBCode (e.g. ``[b]Bold[/b]`` and +``[i]Italics[/i]``), while others are Godot-specific and used for advanced +features such as inline code (e.g. ``[code]true[/code]``), linking to another +class (e.g. ``[Node2D]``) or to a property in a given class (e.g. +``[member Node2D.position]``), or for multiline code blocks. Example:: + + Returns a color according to the standardized [code]name[/code] with [code]alpha[/code] ranging from 0 to 1. + [codeblock] + red = ColorN("red", 1) + [/codeblock] + Supported color names are the same as the constants defined in [Color]. + +In the above example, ``[code]name[/code]``, ``[code]alpha[/code]``, and +``[Color]`` should *not* be translated, as they refer respectively to argument +names and a class of the Godot API. Similarly, the contents of the +``[codeblock]`` should not be translated, as ``ColorN`` is a function of the +Godot API and ``"red"`` is one of the named colors it supports. At most, you can +translate the name of the variable which holds the result (``red = ...``). + +Note also that in the XML, each line is a paragraph, so you should not add line +breaks if they are not part of the original translation. + +.. seealso:: + + See our documentation for class reference writers for the :ref:`list of + BBCode-like tags ` which are used + throughout the class reference. + +Offline translation and testing +------------------------------- + +While we advise using the Weblate interface to write translations, you also have +the possibility to download the PO file locally to translate it with your +preferred PO editing application, such as `Poedit `__ or +`Lokalize `__. + +To download the PO file locally, browse to the translation overview for your +language, and select the first item in the "Files" menu: + +.. image:: img/l10n_07_download_po_file.png + +Once you are done with a series of edits, use the "Upload translation" item in +that same menu and select your file. Choose "Add as translation" for the file +upload mode. + +.. note:: + + If a significant amount of time has passed between your download of the PO + file and the upload of the edited version, there is a risk to overwrite the + translations authored by other contributors in the meantime. This is why we + advise to use the online interface so that you always work on the latest + version. + +If you want to test changes locally (especially for the editor translation), you +can use the downloaded PO file and :ref:`compile Godot from source `. + +Rename the editor translation PO file to ``.po`` (e.g. ``eo.po`` for +Esperanto) and place it in the ``editor/translations/`` folder +(`GitHub `__). + +You can also test class reference changes the same way by renaming the PO file +similarly and placing it in the ``doc/translations/`` folder +(`GitHub `__). + +Localizing documentation images +------------------------------- + +The online documentation includes many images, which can be screenshots of the +Godot editor, custom-made graphs, of any other kind of visual content. Some of +it includes text and might thus be relevant to localize in your language. + +This part is not handled via Weblate, but directly on the `godot-docs-l10n +`_ Git repository where the +documentation translations are synced from Weblate. + +.. note:: + + The workflow is not the most straightforward and requires some knowledge of + Git. We plan to work on a simplified Web tool which could be used to manage + image localization in a convenient way, abstracting away these steps. + +To translate an image, you should first locate it in the original English +documentation. To do so, browse the relevant page in the docs, e.g. +:ref:`doc_intro_to_the_editor_interface`. Click the "Edit on GitHub" link in the +top right corner: + +.. image:: img/l10n_08_edit_on_github.png + +On GitHub, click on the image you want to translate. If relevant, click on +"Download" to download it locally and edit it with an image edition tool. +Note the full path to the image as it will be needed further down (here +``getting_started/step_by_step/img/project_manager_first_open.png``). + +.. image:: img/l10n_09_path_to_image.png + +Create your localized version of the image, either by editing the English one, +or by taking a screenshot of the editor with your language, if it's an editor +screenshot. Some images may also have source files available in SVG format, so +you can browse the ``img/`` folder which contains them to check for that. + +Name your localized image like the original one, but with the language code +added before the extension, e.g. ``project_manager_first_open.png`` would become +``project_manager_first_open.fr.png`` for the French localization. + +Finally, on godot-docs-l10n_, recreate the same folder structure as for the +original image in the ``images`` subfolder +(`GitHub `_), +and place your translated image there. In our example, the end result should be +``images/getting_started/step_by_step/img/project_manager_first_open.fr.png``. + +Repeat this for other images and :ref:`make a Pull Request `. diff --git a/community/contributing/img/best_practices1.png b/community/contributing/img/best_practices1.png new file mode 100644 index 0000000..96d3d12 Binary files /dev/null and b/community/contributing/img/best_practices1.png differ diff --git a/community/contributing/img/best_practices2.png b/community/contributing/img/best_practices2.png new file mode 100644 index 0000000..364e86a Binary files /dev/null and b/community/contributing/img/best_practices2.png differ diff --git a/community/contributing/img/best_practices3.png b/community/contributing/img/best_practices3.png new file mode 100644 index 0000000..3ecd554 Binary files /dev/null and b/community/contributing/img/best_practices3.png differ diff --git a/community/contributing/img/best_practices4.png b/community/contributing/img/best_practices4.png new file mode 100644 index 0000000..bcc4428 Binary files /dev/null and b/community/contributing/img/best_practices4.png differ diff --git a/community/contributing/img/best_practices5.png b/community/contributing/img/best_practices5.png new file mode 100644 index 0000000..5a50c2e Binary files /dev/null and b/community/contributing/img/best_practices5.png differ diff --git a/community/contributing/img/best_practices6.png b/community/contributing/img/best_practices6.png new file mode 100644 index 0000000..d8aa630 Binary files /dev/null and b/community/contributing/img/best_practices6.png differ diff --git a/community/contributing/img/best_practices7.png b/community/contributing/img/best_practices7.png new file mode 100644 index 0000000..4bd0aa1 Binary files /dev/null and b/community/contributing/img/best_practices7.png differ diff --git a/community/contributing/img/best_practices8.png b/community/contributing/img/best_practices8.png new file mode 100644 index 0000000..3c3dccd Binary files /dev/null and b/community/contributing/img/best_practices8.png differ diff --git a/community/contributing/img/editor-vocabulary-overview.png b/community/contributing/img/editor-vocabulary-overview.png new file mode 100644 index 0000000..066f256 Binary files /dev/null and b/community/contributing/img/editor-vocabulary-overview.png differ diff --git a/community/contributing/img/github_fork_button.png b/community/contributing/img/github_fork_button.png new file mode 100644 index 0000000..aa4436e Binary files /dev/null and b/community/contributing/img/github_fork_button.png differ diff --git a/community/contributing/img/github_fork_make_pr.png b/community/contributing/img/github_fork_make_pr.png new file mode 100644 index 0000000..c7a815f Binary files /dev/null and b/community/contributing/img/github_fork_make_pr.png differ diff --git a/community/contributing/img/github_fork_url.png b/community/contributing/img/github_fork_url.png new file mode 100644 index 0000000..eb359ae Binary files /dev/null and b/community/contributing/img/github_fork_url.png differ diff --git a/community/contributing/img/l10n_01_language_list.png b/community/contributing/img/l10n_01_language_list.png new file mode 100644 index 0000000..8d1726f Binary files /dev/null and b/community/contributing/img/l10n_01_language_list.png differ diff --git a/community/contributing/img/l10n_02_new_translation.png b/community/contributing/img/l10n_02_new_translation.png new file mode 100644 index 0000000..c953a33 Binary files /dev/null and b/community/contributing/img/l10n_02_new_translation.png differ diff --git a/community/contributing/img/l10n_03_translation_overview.png b/community/contributing/img/l10n_03_translation_overview.png new file mode 100644 index 0000000..96642cc Binary files /dev/null and b/community/contributing/img/l10n_03_translation_overview.png differ diff --git a/community/contributing/img/l10n_04_translation_interface.png b/community/contributing/img/l10n_04_translation_interface.png new file mode 100644 index 0000000..7666b03 Binary files /dev/null and b/community/contributing/img/l10n_04_translation_interface.png differ diff --git a/community/contributing/img/l10n_05_search_location.png b/community/contributing/img/l10n_05_search_location.png new file mode 100644 index 0000000..e4da602 Binary files /dev/null and b/community/contributing/img/l10n_05_search_location.png differ diff --git a/community/contributing/img/l10n_06_browse_by_location.png b/community/contributing/img/l10n_06_browse_by_location.png new file mode 100644 index 0000000..ed3a392 Binary files /dev/null and b/community/contributing/img/l10n_06_browse_by_location.png differ diff --git a/community/contributing/img/l10n_07_download_po_file.png b/community/contributing/img/l10n_07_download_po_file.png new file mode 100644 index 0000000..5b71307 Binary files /dev/null and b/community/contributing/img/l10n_07_download_po_file.png differ diff --git a/community/contributing/img/l10n_08_edit_on_github.png b/community/contributing/img/l10n_08_edit_on_github.png new file mode 100644 index 0000000..7c4e798 Binary files /dev/null and b/community/contributing/img/l10n_08_edit_on_github.png differ diff --git a/community/contributing/img/l10n_09_path_to_image.png b/community/contributing/img/l10n_09_path_to_image.png new file mode 100644 index 0000000..5574220 Binary files /dev/null and b/community/contributing/img/l10n_09_path_to_image.png differ diff --git a/community/contributing/img/testing_pull_requests_access_checks.png b/community/contributing/img/testing_pull_requests_access_checks.png new file mode 100644 index 0000000..1bd13ac Binary files /dev/null and b/community/contributing/img/testing_pull_requests_access_checks.png differ diff --git a/community/contributing/img/testing_pull_requests_access_fork.png b/community/contributing/img/testing_pull_requests_access_fork.png new file mode 100644 index 0000000..b53c8a7 Binary files /dev/null and b/community/contributing/img/testing_pull_requests_access_fork.png differ diff --git a/community/contributing/img/testing_pull_requests_checks_artifacts.png b/community/contributing/img/testing_pull_requests_checks_artifacts.png new file mode 100644 index 0000000..25697e2 Binary files /dev/null and b/community/contributing/img/testing_pull_requests_checks_artifacts.png differ diff --git a/community/contributing/img/testing_pull_requests_checks_platforms.png b/community/contributing/img/testing_pull_requests_checks_platforms.png new file mode 100644 index 0000000..2575abc Binary files /dev/null and b/community/contributing/img/testing_pull_requests_checks_platforms.png differ diff --git a/community/contributing/img/testing_pull_requests_fork_zip.png b/community/contributing/img/testing_pull_requests_fork_zip.png new file mode 100644 index 0000000..07ee9f5 Binary files /dev/null and b/community/contributing/img/testing_pull_requests_fork_zip.png differ diff --git a/community/contributing/img/testing_pull_requests_nightly_link.png b/community/contributing/img/testing_pull_requests_nightly_link.png new file mode 100644 index 0000000..e68e5ef Binary files /dev/null and b/community/contributing/img/testing_pull_requests_nightly_link.png differ diff --git a/community/contributing/index.rst b/community/contributing/index.rst new file mode 100644 index 0000000..66ab595 --- /dev/null +++ b/community/contributing/index.rst @@ -0,0 +1,109 @@ +Contributing +============ + +Everyone is most welcome to contribute to Godot. Here are some ways in which you +can contribute to the project: + +- Improving the engine by fixing bugs, coding new features, or refining existing ones. +- Writing or proofreading documentation. You can contribute both to this + reference manual or the code reference. +- Translating the editor or documentation from English to other languages. +- Reporting issues or `writing detailed proposals + `__. + +Getting started +--------------- + +You would like to contribute but you don't know how or what to do? You can get +answers below. + +.. toctree:: + :maxdepth: 1 + :name: toc-community-getting-started + + ways_to_contribute + +.. _doc_community_contributing_to_the_engine: + +Contributing to the engine +-------------------------- + +The guides below explain how to contribute to the engine's core. You will learn +about the code style, the contribution workflow, and more. + +.. toctree:: + :maxdepth: 1 + :name: toc-community-contributing-to-the-engine + + best_practices_for_engine_contributors + pr_workflow + testing_pull_requests + bisecting_regressions + bug_triage_guidelines + code_style_guidelines + cpp_usage_guidelines + +.. _doc_community_writing_documentation: + +Writing documentation +--------------------- + +We always need help to improve the documentation, be it the class reference or +the manual. Below, you can find our content and writing guidelines and +concrete guides to make changes to the documentation. + +Guidelines +~~~~~~~~~~ + +Here are the principles and guidelines we strive to follow to write accessible +documentation. + +.. toctree:: + :maxdepth: 1 + :name: toc-community-writing-guidelines + + content_guidelines + docs_writing_guidelines + documentation_guidelines + +Writing the manual +~~~~~~~~~~~~~~~~~~ + +.. toctree:: + :maxdepth: 1 + :name: toc-community-documentation + + contributing_to_the_documentation + building_the_manual + +Class reference guides +~~~~~~~~~~~~~~~~~~~~~~ + +The pages below focus on the class reference. + +As the reference is included in the Godot editor, its source files are part of +the `godot repository `_. We use XML files +to write it, so the process to contribute to the class reference differs from +writing the online manual. + +.. toctree:: + :maxdepth: 1 + :name: toc-community-class-reference + + updating_the_class_reference + class_reference_writing_guidelines + +.. _doc_community_translating_the_documentation: + +Translating the documentation +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The community is always working hard on making Godot and its documentation +available to more people. Localizing the documentation is a colossal and ongoing +effort you can be part of. + +.. toctree:: + :maxdepth: 1 + :name: toc-community-localization + + editor_and_docs_localization diff --git a/community/contributing/pr_workflow.rst b/community/contributing/pr_workflow.rst new file mode 100644 index 0000000..ffda16e --- /dev/null +++ b/community/contributing/pr_workflow.rst @@ -0,0 +1,550 @@ +.. _doc_pr_workflow: + +Pull request workflow +===================== + +.. highlight:: shell + +The so-called "PR workflow" used by Godot is common to many projects using +Git, and should be familiar to veteran free software contributors. The idea +is that only a small number (if any) commit directly to the *master* branch. +Instead, contributors *fork* the project (i.e. create a copy of it, which +they can modify as they wish), and then use the GitHub interface to request +a *pull* from one of their fork's branches to one branch of the original +(often named *upstream*) repository. + +The resulting *pull request* (PR) can then be reviewed by other contributors, +which might approve it, reject it, or most often request that modifications +be done. Once approved, the PR can then be merged by one of the core +developers, and its commit(s) will become part of the target branch (usually +the *master* branch). + +We will go together through an example to show the typical workflow and +associated Git commands. But first, let's have a quick look at the +organization of Godot's Git repository. + +Git source repository +--------------------- + +The `repository on GitHub `_ is a +`Git `_ code repository together with an embedded +issue tracker and PR system. + +.. note:: If you are contributing to the documentation, its repository can + be found `here `_. + +The Git version control system is the tool used to keep track of successive +edits to the source code - to contribute efficiently to Godot, learning the +basics of the Git command line is *highly* recommended. There exist some +graphical interfaces for Git, but they usually encourage users to take bad +habits regarding the Git and PR workflow, and we therefore recommend not to +use them. In particular, we advise not to use GitHub's online editor for code +contributions (although it's tolerated for small fixes or documentation changes) +as it enforces one commit per file and per modification, +which quickly leads to PRs with an unreadable Git history (especially after peer review). + +.. seealso:: The first sections of Git's "Book" are a good introduction to + the tool's philosophy and the various commands you need to + master in your daily workflow. You can read them online on the + `Git SCM `_ website. + You can also try out `GitHub's interactive guide `__. + +The branches on the Git repository are organized as follows: + +- The ``master`` branch is where the development of the next major version + occurs. As a development branch, it can be unstable + and is not meant for use in production. This is where PRs should be done + in priority. +- The stable branches are named after their version, e.g. ``3.1`` and ``2.1``. + They are used to backport bugfixes and enhancements from the ``master`` + branch to the currently maintained stable release (e.g. 3.1.2 or 2.1.6). + As a rule of thumb, the last stable branch is maintained until the next + major version (e.g. the ``3.0`` branch was maintained until the release of + Godot 3.1). + If you want to make PRs against a maintained stable branch, please check + first if your changes are also relevant for the ``master`` branch, and if so + make the PR for the ``master`` branch in priority. Release managers can then + cherry-pick the fix to a stable branch if relevant. +- There might occasionally be feature branches, usually meant to be merged into + the ``master`` branch at some time. + +Forking and cloning +------------------- + +The first step is to *fork* the `godotengine/godot `_ +repository on GitHub. To do so, you will need to have a GitHub account and to +be logged in. In the top right corner of the repository's GitHub page, you +should see the "Fork" button as shown below: + +.. image:: img/github_fork_button.png + +Click it, and after a while you should be redirected to your own fork of the +Godot repo, with your GitHub username as namespace: + +.. image:: img/github_fork_url.png + +You can then *clone* your fork, i.e. create a local copy of the online +repository (in Git speak, the *origin remote*). If you haven't already, +download Git from `its website `_ if you're using Windows or +macOS, or install it through your package manager if you're using Linux. + +.. note:: If you are on Windows, open Git Bash to type commands. macOS and Linux users + can use their respective terminals. + +To clone your fork from GitHub, use the following command: + +:: + + $ git clone https://github.com/USERNAME/godot + +.. note:: In our examples, the "$" character denotes the command line prompt + on typical UNIX shells. It is not part of the command and should + not be typed. + +After a little while, you should have a ``godot`` directory in your current +working directory. Move into it using the ``cd`` command: + +:: + + $ cd godot + +We will start by setting up a reference to the original repository that we forked: + +:: + + $ git remote add upstream https://github.com/godotengine/godot + $ git fetch upstream + +This will create a reference named ``upstream`` pointing to the original +``godotengine/godot`` repository. This will be useful when you want to pull new +commits from its ``master`` branch to update your fork. You have another +remote reference named ``origin``, which points to your fork (``USERNAME/godot``). + +You only need to do the above steps once, as long as you keep that local +``godot`` folder (which you can move around if you want, the relevant +metadata is hidden in its ``.git`` subfolder). + +.. note:: *Branch it, pull it, code it, stage it, commit, push it, rebase + it... technologic.* + + This bad take on Daft Punk's *Technologic* shows the general + conception Git beginners have of its workflow: lots of strange + commands to learn by copy and paste, hoping they will work as + expected. And that's actually not a bad way to learn, as long as + you're curious and don't hesitate to question your search engine + when lost, so we will give you the basic commands to know when + working in Git. + +In the following, we will assume as an example that you want to implement a feature in +Godot's project manager, which is coded in the ``editor/project_manager.cpp`` +file. + +Branching +--------- + +By default, the ``git clone`` should have put you on the ``master`` branch of +your fork (``origin``). To start your own feature development, we will create +a feature branch: + +:: + + # Create the branch based on the current branch (master) + $ git branch better-project-manager + + # Change the current branch to the new one + $ git checkout better-project-manager + +This command is equivalent: + +:: + + # Change the current branch to a new named one, based on the current branch + $ git checkout -b better-project-manager + +If you want to go back to the ``master`` branch, you'd use: + +:: + + $ git checkout master + +You can see which branch you are currently on with the ``git branch`` +command: + +:: + + $ git branch + 2.1 + * better-project-manager + master + +Be sure to always go back to the ``master`` branch before creating a new branch, +as your current branch will be used as the base for the new one. Alternatively, +you can specify a custom base branch after the new branch's name: + +:: + + $ git checkout -b my-new-feature master + +Updating your branch +-------------------- + +This would not be needed the first time (just after you forked the upstream +repository). However, the next time you want to work on something, you will +notice that your fork's ``master`` is several commits behind the upstream +``master`` branch: pull requests from other contributors would have been merged +in the meantime. + +To ensure there won't be conflicts between the feature you develop and the +current upstream ``master`` branch, you will have to update your branch by +*pulling* the upstream branch. + +:: + + $ git pull --rebase upstream master + +The ``--rebase`` argument will ensure that any local changes that you committed +will be re-applied *on top* of the pulled branch, which is usually what we want +in our PR workflow. This way, when you open a pull request, your own commits will +be the only difference with the upstream ``master`` branch. + +While rebasing, conflicts may arise if your commits modified code that has been +changed in the upstream branch in the meantime. If that happens, Git will stop at +the conflicting commit and will ask you to resolve the conflicts. You can do so +with any text editor, then stage the changes (more on that later), and proceed with +``git rebase --continue``. Repeat the operation if later commits have conflicts too, +until the rebase operation completes. + +If you're unsure about what is going on during a rebase and you panic (no worry, +we all do the first few times), you can abort the rebase with ``git rebase --abort``. +You will then be back to the original state of your branch before calling +``git pull --rebase``. + +.. note:: If you omit the ``--rebase`` argument, you will instead create a merge + commit which tells Git what to make of the two distinct branches. If any + conflicts arise, they would be resolved all at once via this merge commit. + + While this is a valid workflow and the default behavior of ``git pull``, + merge commits within PRs are frowned upon in our PR workflow. We only use + them when merging PRs into the upstream branch. + + The philosophy is that a PR should represent the final stage of the changes + made to the codebase, and we are not interested in mistakes and fixes that + would have been done in intermediate stages before merging. + Git gives us great tools to "rewrite the history" and make it as if we got + things right the first time, and we're happy to use it to ensure that + changes are easy to review and understand long after they have been merged. + +If you have already created a merge commit without using ``rebase``, or +have made any other changes that have resulted in undesired history, the best option +is to use an *interactive rebase* on the upstream branch. See the :ref:`dedicated +section ` for instructions. + +.. tip:: If at any time you want to *reset* a local branch to a given commit or branch, + you can do so with ``git reset --hard `` or + ``git reset --hard /`` (e.g. ``git reset --hard upstream/master``). + + Be warned that this will remove any changes that you might have committed in + this branch. If you ever lose commits by mistake, use the ``git reflog`` command + to find the commit ID of the previous state that you would like to restore, and + use it as argument of ``git reset --hard`` to go back to that state. + +Making changes +-------------- + +You would then do your changes to our example's +``editor/project_manager.cpp`` file with your usual development environment +(text editor, IDE, etc.). + +By default, those changes are *unstaged*. The staging area is a layer between +your working directory (where you make your modifications) and the local Git +repository (the commits and all the metadata in the ``.git`` folder). To +bring changes from the working directory to the Git repository, you need to +*stage* them with the ``git add`` command, and then to commit them with the +``git commit`` command. + +There are various commands you should know to review your current work, +before staging it, while it is staged, and after it has been committed. + +- ``git diff`` will show you the current unstaged changes, i.e. the + differences between your working directory and the staging area. +- ``git checkout -- `` will undo the unstaged changes to the given + files. +- ``git add `` will *stage* the changes on the listed files. +- ``git diff --staged`` will show the current staged changes, i.e. the + differences between the staging area and the last commit. +- ``git reset HEAD `` will *unstage* changes to the listed files. +- ``git status`` will show you what are the currently staged and unstaged + modifications. +- ``git commit`` will commit the staged files. It will open a text editor + (you can define the one you want to use with the ``GIT_EDITOR`` environment + variable or the ``core.editor`` setting in your Git configuration) to let you + write a commit log. You can use ``git commit -m "Cool commit log"`` to + write the log directly. +- ``git commit --amend`` lets you amend the last commit with your currently + staged changes (added with ``git add``). This is the best option if you + want to fix a mistake in the last commit (bug, typo, style issue, etc.). +- ``git log`` will show you the last commits of your current branch. If you + did local commits, they should be shown at the top. +- ``git show`` will show you the changes of the last commit. You can also + specify a commit hash to see the changes for that commit. + +That's a lot to memorize! Don't worry, just check this cheat sheet when you +need to make changes, and learn by doing. + +Here's how the shell history could look like on our example: + +:: + + # It's nice to know where you're starting from + $ git log + + # Do changes to the project manager with the nano text editor + $ nano editor/project_manager.cpp + + # Find an unrelated bug in Control and fix it + $ nano scene/gui/control.cpp + + # Review changes + $ git status + $ git diff + + # We'll do two commits for our unrelated changes, + # starting by the Control changes necessary for the PM enhancements + $ git add scene/gui/control.cpp + $ git commit -m "Fix handling of margins in Control" + + # Check we did good + $ git log + $ git show + $ git status + + # Make our second commit + $ git add editor/project_manager.cpp + $ git commit -m "Add a pretty banner to the project manager" + $ git log + +With this, we should have two new commits in our ``better-project-manager`` +branch which were not in the ``master`` branch. They are still only local +though, the remote fork does not know about them, nor does the upstream repo. + +Pushing changes to a remote +--------------------------- + +That's where ``git push`` will come into play. In Git, a commit is always +done in the local repository (unlike Subversion where a commit will modify +the remote repository directly). You need to *push* the new commits to a +remote branch to share them with the world. The syntax for this is: + +:: + + $ git push [:] + +The part about the remote branch can be omitted if you want it to have the +same name as the local branch, which is our case in this example, so we will +do: + +:: + + $ git push origin better-project-manager + +Git will ask you for your username and password, and the changes will be sent +to your remote. If you check the fork's page on GitHub, you should see a new +branch with your added commits. + +Issuing a pull request +---------------------- + +When you load your fork's branch on GitHub, you should see a line saying +*"This branch is 2 commits ahead of godotengine:master."* (and potentially some +commits behind, if your ``master`` branch was out of sync with the upstream +``master`` branch). + +.. image:: img/github_fork_make_pr.png + +On that line, there is a "Pull request" link. Clicking it will open a form +that will let you issue a pull request on the ``godotengine/godot`` upstream +repository. It should show you your two commits, and state "Able to merge". +If not (e.g. it has way more commits, or says there are merge conflicts), +don't create the PR yet, something went wrong. Go to our +`Godot Contributors Chat `_ and ask for support :) + +Use an explicit title for the PR and put the necessary details in the comment +area. You can drag and drop screenshots, GIFs or zipped projects if relevant, +to showcase what your work implements. Click "Create a pull request", and +tadaa! + +Modifying a pull request +------------------------ + +While it is reviewed by other contributors, you will often need to make +changes to your yet-unmerged PR, either because contributors requested them, +or because you found issues yourself while testing. + +The good news is that you can modify a pull request simply by acting on the +branch you made the pull request from. You can e.g. make a new commit on that +branch, push it to your fork, and the PR will be updated automatically: + +:: + + # Check out your branch again if you had changed in the meantime + $ git checkout better-project-manager + + # Fix a mistake + $ nano editor/project_manager.cpp + $ git add editor/project_manager.cpp + $ git commit -m "Fix a typo in the banner's title" + $ git push origin better-project-manager + +However, be aware that in our PR workflow, we favor commits that bring the +codebase from one functional state to another functional state, without having +intermediate commits fixing up bugs in your own code or style issues. Most of +the time, we will prefer a single commit in a given PR (unless there's a good +reason to keep the changes separate), so instead of authoring a new commit, +considering using ``git commit --amend`` to amend the previous commit with your +fixes. The above example would then become: + +:: + + # Check out your branch again if you had changed in the meantime + $ git checkout better-project-manager + + # Fix a mistake + $ nano editor/project_manager.cpp + $ git add editor/project_manager.cpp + # --amend will change the previous commit, so you will have the opportunity + # to edit its commit message if relevant. + $ git commit --amend + # As we modified the last commit, it no longer matches the one from your + # remote branch, so we need to force push to overwrite that branch. + $ git push --force origin better-project-manager + +.. Kept for compatibility with the previous title, linked in many PRs. + +.. _mastering-the-pr-workflow-the-rebase: + +.. _doc_pr_workflow_rebase: + +The interactive rebase +---------------------- + +If you didn't follow the above steps closely to *amend* changes into a commit +instead of creating fixup commits, or if you authored your changes without being +aware of our workflow and Git usage tips, reviewers might request of your to +*rebase* your branch to *squash* some or all of the commits into one. + +Indeed, if some commits have been made following reviews to fix bugs, typos, etc. +in the original commit, they are not relevant to a future changelog reader who +would want to know what happened in the Godot codebase, or when and how a given +file was last modified. + +To squash those extraneous commits into the main one, we will have to *rewrite +history*. Right, we have that power. You may read that it's a bad practice, and +it's true when it comes to branches of the upstream repo. But in your fork, you +can do whatever you want, and everything is allowed to get neat PRs :) + +We will use the *interactive rebase* ``git rebase -i`` to do this. This +command takes a commit ID or a branch name as argument, and will let you modify +all commits between that commit/branch and the last one in your working branch, +the so-called ``HEAD``. + +While you can give any commit ID to ``git rebase -i`` and review everything in +between, the most common and convenient workflow involves rebasing on the +*upstream ``master`` branch*, which you can do with: + +:: + + $ git rebase -i upstream/master + +.. note:: Referencing branches in Git is a bit tricky due to the distinction + between remote and local branches. Here, ``upstream/master`` (with a + `/`) is a local branch which has been pulled from the ``upstream`` + remote's ``master`` branch. + + Interactive rebases can only be done on local branches, so the `/` + is important here. As the upstream remote changes frequently, your + local ``upstream/master`` branch may become outdated, so you can + update it with ``git fetch upstream master``. Contrarily to + ``git pull --rebase upstream master`` which would update your + currently checked out branch, ``fetch`` will only update the + ``upstream/master`` reference (which is distinct from your local + ``master`` branch... yes it's confusing, but you'll become familiar + with this little by little). + +This will open a text editor (``vi`` by default, see +`Git docs `_ +to configure your favorite one) with something which may look like this: + +.. code-block:: text + + pick 1b4aad7 Add a pretty banner to the project manager + pick e07077e Fix a typo in the banner's title + +The editor will also show instructions regarding how you can act on those +commits. In particular, it should tell you that "pick" means to use that +commit (do nothing), and that "squash" and "fixup" can be used to *meld* the +commit in its parent commit. The difference between "squash" and "fixup" is +that "fixup" will discard the commit log from the squashed commit. In our +example, we are not interested in keeping the log of the "Fix a typo" commit, +so we use: + +.. code-block:: text + + pick 1b4aad7 Add a pretty banner to the project manager + fixup e07077e Fix a typo in the banner's title + +Upon saving and quitting the editor, the rebase will occur. The second commit +will be melded into the first one, and ``git log`` and ``git show`` should +now confirm that you have only one commit with the changes from both previous +commits. + +But! You rewrote the history, and now your local and remote branches have +diverged. Indeed, commit 1b4aad7 in the above example will have changed, and +therefore got a new commit hash. If you try to push to your remote branch, it +will raise an error: + +:: + + $ git push origin better-project-manager + To https://github.com/akien-mga/godot + ! [rejected] better-project-manager -> better-project-manager (non-fast-forward) + error: failed to push some refs to 'https://akien-mga@github.com/akien-mga/godot' + hint: Updates were rejected because the tip of your current branch is behind + hint: its remote counterpart. + +This is a sane behavior, Git will not let you push changes that would +override remote content. But that's actually what we want to do here, so we +will have to *force* it: + +:: + + $ git push --force origin better-project-manager + +And tadaa! Git will happily *replace* your remote branch with what you had +locally (so make sure that's what you wanted, using ``git log``). This will +also update the PR accordingly. + +Deleting a Git branch +--------------------- + +After your pull request gets merged, there's one last thing you should do: delete your +Git branch for the PR. There won't be issues if you don't delete your branch, but it's +good practice to do so. You'll need to do this twice, once for the local branch and another +for the remote branch on GitHub. + +To delete our better project manager branch locally, use this command: + +:: + + $ git branch -d better-project-manager + +Alternatively, if the branch hadn't been merged yet and we wanted to delete it anyway, instead +of ``-d`` you would use ``-D``. + +Next, to delete the remote branch on GitHub use this command: + +:: + + $ git push origin -d better-project-manager + +You can also delete the remote branch from the GitHub PR itself, a button should appear once +it has been merged or closed. diff --git a/community/contributing/testing_pull_requests.rst b/community/contributing/testing_pull_requests.rst new file mode 100644 index 0000000..b2ff558 --- /dev/null +++ b/community/contributing/testing_pull_requests.rst @@ -0,0 +1,104 @@ +.. _doc_testing_pull_requests: + +Testing pull requests +===================== + +Many people are developing new features or fixing bugs on GitHub. +To help with engine development, you may be asked to test those pull requests +with a Godot build that includes code from the pull request in question. + +Thanks to GitHub Actions, all `pull requests `__ +have continuous builds available. These builds let you try out pull requests +without having to compile anything from source. + +Downloading a compiled build +---------------------------- + +You can download pull request builds from GitHub Actions. Since only signed in +users may download builds directly from GitHub Actions, the procedure varies +depending on whether you have a GitHub account or not. + +.. note:: + + Due to a GitHub Actions limitation, builds are only available for 90 days + after the pull request was last updated. If you still wish to try a + pull request locally, you can + :ref:`compile the pull request branch from source ` + instead. + +If you have a GitHub account +^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Open the pull request page. Click the **Checks** tab near the top of the page: + +.. image:: img/testing_pull_requests_access_checks.png + +- In the list of platforms that appears on the left, select your platform by clicking + it then choose the type of build you need (editor or export template). + If in doubt, select an editor build: + +.. image:: img/testing_pull_requests_checks_platforms.png + +- Click the **Artifacts** dropdown on the right of the page then click the artifact's + name to download it: + +.. image:: img/testing_pull_requests_checks_artifacts.png + +- Extract the ZIP archive then run the executable. + Note that Windows and macOS binaries are not code signed. + This means you may have to bypass a security warning before you can run the executable. + If you frequently test pull request builds, it may be better to disable + Windows SmartScreen or `disable macOS Gatekeeper `__ permanently. + +If you don't have a GitHub account +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If you don't have a GitHub account and can't sign up for one, +you can use the third-party `nightly.link `__ service +to generate a universal download link. + +- Open the pull request page. Click the *fork*'s branch name near the top of the page: + +.. image:: img/testing_pull_requests_access_fork.png + +- Now that you are on the fork's branch page, click the ``.github`` folder at the top of the file list. + Then, click on the ``workflows`` folder (whicb is inside the ``.github`` folder). + Click the workflow file for the platform you wish to download artifacts for. + *After* clicking on the file (which opens the file view), copy the page URL from your browser's address bar. + +- Open the `nightly.link `__ website and paste the URL you just copied + into the text field located below the heading **Paste a GitHub link, get a nightly.link!**. + After pasting the URL, click **Get links** on the right. + If the the format of the URL you pasted is correct, you should be presented + with a page like this: + +.. image:: img/testing_pull_requests_nightly_link.png + +- Click the URL of the artifact you wish to download. + +- Extract the ZIP archive then run the executable. + Note that Windows and macOS binaries are not code signed. + This means you may have to bypass a security warning before you can run the executable. + If you frequently test pull request builds, it may be better to disable + Windows SmartScreen or `disable macOS Gatekeeper `__ permanently. + +.. _doc_testing_pull_requests_compile: + +Compiling a pull request branch from source +------------------------------------------- + +This approach may be needed for pull requests that were last updated more than +90 days ago, or to test on platforms and configurations that are not supported +by Godot's GitHub Actions setup. + +- Open the pull request page. Click the *fork*'s branch name near the top of the page: + +.. image:: img/testing_pull_requests_access_fork.png + +- Now that you are on the fork's branch page, click the green **Code** button on the right of the page + then choose **Download ZIP** in the dropdown: + +.. image:: img/testing_pull_requests_fork_zip.png + +- Extract the ZIP archive and follow the :ref:`compiling ` instructions + for your operating system. diff --git a/community/contributing/updating_the_class_reference.rst b/community/contributing/updating_the_class_reference.rst new file mode 100644 index 0000000..891e163 --- /dev/null +++ b/community/contributing/updating_the_class_reference.rst @@ -0,0 +1,76 @@ +.. _doc_updating_the_class_reference: + +Contributing to the class reference +=================================== + +.. highlight:: shell + +The class reference is available online in the :ref:`classes ` +section of the documentation and in the Godot editor, from the help menu. + +In the class reference, some methods, variables, and signals lack descriptions. +Others changed with recent releases and need updates. The developers can't write +the entire reference on their own. Godot needs you, and all of us, to +contribute. + +**Important:** If you plan to make large changes, you should create an issue on +the `godot-docs repository `_ +or comment on an existing issue. Doing so lets others know you're already +taking care of a given class. + +.. seealso:: + + You can find the writing guidelines for the class reference :ref:`here `. + + For details on Git usage and the pull request workflow, please + refer to the :ref:`doc_pr_workflow` page. + + If you want to translate the class reference from English to another + language, see :ref:`doc_editor_and_docs_localization`. + + This guide is also available as a `video tutorial on YouTube + `_. + +.. seealso:: + + Not sure which class to contribute to? Take a look at the class reference's + completion status `here `_. + +You can find the source files for the class reference in Godot's GitHub +repository: `doc/classes/ +`_. + +.. note:: For some modules in the engine's source code, you'll find the XML + files in the ``modules//doc_classes/`` directory instead. + +.. warning:: Always edit the API reference through these source XML files. Do + not edit the generated ``.rst`` files :ref:`in the online documentation + `, hosted in the `godot-docs + `_ repository. + +.. warning:: + + Unless you make minor changes, like fixing a typo, we do not recommend using the GitHub web editor to edit the class reference's XML. + + It lacks features to edit XML well, like keeping indentations consistent, and it does not allow amending commits based on reviews. + + Also, it doesn't allow you to test your changes in the engine or with validation + scripts as described in + :ref:`doc_class_reference_writing_guidelines_editing_xml`. + +Updating the documentation template +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When you create a new class or modify the engine's API, you need to re-generate the XML files in ``doc/classes/``. + +To do so, you first need to compile Godot. See the +:ref:`doc_introduction_to_the_buildsystem` page to learn how. Then, execute the +compiled Godot binary from the Godot root directory with the ``--doctool`` option. +For example, if you're on 64-bit Linux, the command is:: + + ./bin/godot.linuxbsd.tools.64 --doctool + +The XML files in doc/classes should then be up-to-date with current Godot Engine +features. You can then check what changed using the ``git diff`` command. Please +only include changes that are relevant to your work on the API in your commits. +You can discard changes in other XML files using ``git checkout``. diff --git a/community/contributing/ways_to_contribute.rst b/community/contributing/ways_to_contribute.rst new file mode 100644 index 0000000..ea22647 --- /dev/null +++ b/community/contributing/ways_to_contribute.rst @@ -0,0 +1,219 @@ +.. _doc_ways_to_contribute: + +Ways to contribute +================== + +Godot Engine is a non-profit, community-driven free and open source project. +Almost all (but our lead dev Juan, more on that below) developers are working +*pro bono* on their free time, out of personal interest and for the love of +creating a libre engine of exceptional quality. + +This means that to thrive, Godot needs as many users as possible to get +involved by contributing to the engine. There are many ways to contribute to +such a big project, making it possible for everybody to bring something +positive to the engine, regardless of their skill set: + +- **Be part of the community.** The best way to contribute to Godot and help + it become ever better is simply to use the engine and promote it by + word-of-mouth, in the credits or splash screen of your games, blog posts, tutorials, + videos, demos, gamedev or free software events, support on the Q&A, forums, + Contributors Chat, Discord, etc. Participate! + Being a user and advocate helps spread the word about our great engine, + which has no marketing budget and can therefore only rely on its community + to become more mainstream. + +- **Make games.** It's no secret that, to convince new users and especially the + industry at large that Godot is a relevant market player, we need great games + made with Godot. We know that the engine has a lot of potential, both for 2D + and 3D games, but given its young age we still lack big releases that will + draw attention to Godot. So keep working on your awesome projects, each new + game increases our credibility on the gamedev market! + +- **Get involved in the engine's development.** This can be by contributing + code via pull requests, testing the development snapshots or directly the + git *master* branch, report bugs or suggest enhancements on the issue + tracker, improve the official documentation (both the class reference and + tutorials) and its translations. + The following sections will cover each of those "direct" ways + of contributing to the engine. + +- **Donate.** Godot is a non-profit project, but it can still benefit from + user donations for many things. Apart from usual expenses such as hosting + costs or promotional material on events, we also use donation money to + acquire hardware when necessary (e.g. we used donation money to buy a + MacBook Pro to implement Retina/HiDPI support and various other + macOS-related features). + Most importantly, we also used donation money to hire core developers so they + can work full-time on the engine. Even with a low + monthly wage, we need a steady donation income to continue doing this, which + has been very beneficial to the project so far. So if you want to donate + some money to the project, check `our website `_ + for details. + +Contributing code +----------------- + +The possibility to study, use, modify and redistribute modifications of the +engine's source code are the fundamental rights that +Godot's `MIT `_ license grants you, +making it `free and open source software `_. + +As such, everyone is entitled to modify +`Godot's source code `_, and send those +modifications back to the upstream project in the form of a patch (a text file +describing the changes in a ready-to-apply manner) or - in the modern workflow +that we use - via a so-called "pull request" (PR), i.e. a proposal to directly +merge one or more Git commits (patches) into the main development branch. + +Contributing code changes upstream has two big advantages: + +- Your own code will be reviewed and improved by other developers, and will be + further maintained directly in the upstream project, so you won't have to + reapply your own changes every time you move to a newer version. On the + other hand it comes with a responsibility, as your changes have to be + generic enough to be beneficial to all users, and not just your project; so + in some cases it might still be relevant to keep your changes only for your + own project, if they are too specific. + +- The whole community will benefit from your work, and other contributors will + behave the same way, contributing code that will be beneficial to you. At + the time of this writing, more than 1000 developers have contributed code + changes to the engine! + +To ensure good collaboration and overall quality, the Godot developers +enforce some rules for code contributions, for example regarding the style to +use in the C++ code (indentation, brackets, etc.) or the Git and PR workflow. + +A good place to start is by searching for issues tagged as +`good first issue `_ +on GitHub. + +.. seealso:: Technical details about the PR workflow are outlined in a + specific section, :ref:`doc_pr_workflow`. + + Details about the code style guidelines and the ``clang-format`` + tool used to enforce them are outlined in + :ref:`doc_code_style_guidelines`. + +All pull requests must go through a review process before being accepted. +Depending on the scope of the changes, it may take some time for a maintainer +responsible for the modified part of the engine to provide their review. +We value all of our contributors and ask them to be patient in the meantime, +as it is expected that in an open source project like Godot, there is going to be +way more contributions than people validating them. + +To make sure that your time and efforts aren't wasted, it is recommended to vet the idea +first before implementing it and putting it for a review as a PR. To that end, Godot +has a `proposal system `_. Its +usage is encouraged to plan changes and discuss them with the community. Implementation +details can also be discussed with other contributors on the `Godot Contributors Chat `_. + +.. note:: Proposals are only required when working on an enhancement or a new feature. + Bug reports are sufficient for fixing issues. + +Testing and reporting issues +---------------------------- + +Another great way of contributing to the engine is to test development releases +or the development branch and to report issues. It is also helpful to report +issues discovered in stable releases, so that they can be fixed in +the development branch and in future maintenance releases. + +Testing development versions +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +To help with the testing, you have several possibilities: + +- Compile the engine from source yourself, following the instructions of the + :ref:`Compiling ` page for your platform. + +- Test official pre-release binaries when they are announced (usually on the + blog and other community platforms), such as alpha, beta and release candidate (RC) builds. + +- Test "trusted" unofficial builds of the development branch; just ask + community members for reliable providers. Whenever possible, it's best to + use official binaries or to compile yourself though, to be sure about the + provenance of your binaries. + +As mentioned previously, it is also helpful to keep your eyes peeled for +potential bugs that might still be present in the stable releases, especially +when using some niche features of the engine which might get less testing by +the developers. + +Filing an issue on GitHub +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Godot uses `GitHub's issue tracker `_ +for bug reports and enhancement suggestions. You will need a GitHub account to +be able to open a new issue there, and click on the **New issue** button. + +When you report a bug, you should keep in mind that the process is similar +to an appointment with your doctor. You noticed *symptoms* that make you think +that something might be wrong (the engine crashes, some features don't work as +expected, etc.). It's the role of the bug triaging team and the developers to +then help make the diagnosis of the issue you met, so that the actual cause of +the bug can be identified and addressed. + +You should therefore always ask yourself: what is relevant information to +give so that other Godot contributors can understand the bug, identify it and +hopefully fix it. Here are some of the most important infos that you should +always provide: + +- **Operating system.** Sometimes bugs are system-specific, i.e. they happen + only on Windows, or only on Linux, etc. That's particularly relevant for all + bugs related to OS interfaces, such as file management, input, window + management, audio, etc. + +- **Hardware.** Sometimes bugs are hardware-specific, i.e. they happen + only on certain processors, graphic cards, etc. If you are able to, + it can be helpful to include information on your hardware. + +- **Godot version.** This is a must-have. Some issues might be relevant in the + current stable release, but fixed in the development branch, or the other + way around. You might also be using an obsolete version of Godot and + experiencing a known issue fixed in a later version, so knowing this from + the start helps to speed up the diagnosis. + +- **How to reproduce the bug.** In the majority of cases, bugs are + reproducible, i.e. it is possible to trigger them reliably by following some + steps. Please always describe those steps as clearly as possible, so that + everyone can try to reproduce the issue and confirm it. Ideally, make a demo + project that reproduces this issue out of the box, zip it and attach it to + the issue (you can do this by drag and drop). + Even if you think that the issue is trivial to reproduce, adding a minimal + project that lets everyone reproduce it is a big added value. You have to keep in + mind that there are thousands of issues in the tracker, and developers can + only dedicate little time to each issue. + +When you click the **New issue** button, you should be presented with a text area +prefilled with our issue template. Please try to follow it so that all issues +are consistent and provide the required information. + +Contributing to the documentation +--------------------------------- + +There are two separate resources referred to as "documentation" in Godot: + +- **The class reference.** This is the documentation for the complete Godot API + as exposed to GDScript and the other scripting languages. It can be consulted + offline, directly in Godot's code editor, or online at :ref:`Godot API + `. To contribute to the class reference, you have to edit the + XML file corresponding to the class and make a pull request. + See :ref:`doc_updating_the_class_reference` and + :ref:`doc_class_reference_writing_guidelines` for more details. + +- **The tutorials and engine documentation and its translations.** + This is the part you are reading now, which is distributed in the HTML format. + Its contents are generated from plain text files in the reStructured Text + (rst) format, to which you can contribute via pull requests on the + `godot-docs `_ GitHub repository. + See :ref:`doc_contributing_to_the_documentation` for more details. + +Contributing translations +------------------------- + +To make Godot accessible to everyone, including users who may prefer resources +in their native language instead of English, our community helps translate both +the Godot editor and its documentation in many languages. + +See :ref:`doc_editor_and_docs_localization` for more details. diff --git a/community/tutorials.rst b/community/tutorials.rst new file mode 100644 index 0000000..637c0d3 --- /dev/null +++ b/community/tutorials.rst @@ -0,0 +1,65 @@ +.. _doc_community_tutorials: + +Tutorials and resources +======================= + +This is a list of third-party tutorials and resources created by the Godot community. For resources, remember that there is the official `Godot Asset Library `_ full of official and community resources too! Also, have a look at this `huge list over at Reddit `_. + +Think there is something missing here? Feel free to submit a `Pull Request `_ as always. + +Where to start +-------------- + +The Godot video tutorials by `GDQuest `_, `Game from Scratch `_ and `KidsCanCode `_ are well-regarded in the community and often recommended as a gentle introduction to beginners. + +If you're interested in Visual Scripting, `Emilio's tutorials `_ may be worth a look. + +If you're interested in a complete introduction to programming using Godot and GDScript, the unofficial `Godot Tutorials `_ YouTube channel is a good place to start. + +Some tutorials mentioned below provide more advanced tutorials, e.g. on 3D or shaders. + +Video tutorials +--------------- + +- `Godot Tutorials `_ (2D, GDScript, Programming Basics). +- `Emilio `_ (2D, GDScript and VisualScript). +- `FinePointCGI `_ (2D, 3D, GDScript and C#). +- `GDQuest `_ (2D and 3D, GDScript, VisualScript and C#). +- `Game Development Center `_ (2D, networked multiplayer, GDScript). +- `Game Endeavor `_ (2D, GDScript). +- `Game from Scratch `_ (2D and 3D, GDScript and C#). +- `HeartBeast `_ (2D, GDScript). +- `KidsCanCode `__ (2D and 3D, GDScript and VisualScript). +- `Mister Taft Creates `_ (2D, GDScript). +- `Miziziziz `_ (2D and 3D, GDScript). +- `P1X / Krzysztof Jankowski `_ (3D). +- `Pigdev `_ (2D, GDScript). +- `Steincodes `__ (2D, GDScript and VisualScript). +- `TheBuffED `_ (2D, GDScript). +- `Code with Tom `_ (2D and 3D, GDScript). +- `BornCG `_ (2D and 3D, GDScript). +- `Gonkee `_ (2D and 3D, GDScript, Shaders). +- `TheGuideKnight `_ (2D, GDScript). +- `GDScript Dude `_ (GDScript). +- `Garbaj `_ (3D, GDScript). +- `Kasper Frandsen `_ (3D, Shaders). + +Text tutorials +-------------- + +- `FinepointCGI website by Mitch `__ +- `GDScript website by Andrew Wilkes `__ +- `Godot Recipes by KidsCanCode `__ +- `Steincodes `__ + +Devlogs +------- + +- `Andrea Catania (Physics & AI) `_ +- `Bastiaan Olij (AR & VR) `_ + +Resources +--------- + +- `awesome-godot: A curated list of free/libre plugins, scripts and add-ons `_ +- `Zeef Godot Engine: A curated directory of resources by Andre Schmitz `_ diff --git a/conf.py b/conf.py new file mode 100644 index 0000000..9b08a3a --- /dev/null +++ b/conf.py @@ -0,0 +1,290 @@ +# -*- coding: utf-8 -*- +# +# Godot Engine documentation build configuration file + +import sphinx_rtd_theme +import sys +import os + +# -- General configuration ------------------------------------------------ + +needs_sphinx = "1.3" + +# Sphinx extension module names and templates location +sys.path.append(os.path.abspath("_extensions")) +extensions = [ + "sphinx_tabs.tabs", + "notfound.extension", + "sphinxext.opengraph", +] + +# Warning when the Sphinx Tabs extension is used with unknown +# builders (like the dummy builder) - as it doesn't cause errors, +# we can ignore this so we still can treat other warnings as errors. +sphinx_tabs_nowarn = True + +# Custom 4O4 page HTML template. +# https://github.com/readthedocs/sphinx-notfound-page +notfound_context = { + "title": "Page not found", + "body": """ +

Page not found

+

+ Sorry, we couldn't find that page. It may have been renamed or removed + in the version of the documentation you're currently browsing. +

+

+ If you're currently browsing the + stable version of the documentation, try browsing the + latest version of the documentation. +

+

+ Alternatively, use the + Search docs + box on the left or go to the homepage. +

+ """, +} + +# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org +on_rtd = os.environ.get("READTHEDOCS", None) == "True" + +# Don't add `/en/latest` prefix during local development. +# This makes it easier to test the custom 404 page by loading `/404.html` +# on a local web server. +if not on_rtd: + notfound_urls_prefix = '' + +# Specify the site name for the Open Graph extension. +ogp_site_name = "Godot Engine documentation" + +if not os.getenv("SPHINX_NO_GDSCRIPT"): + extensions.append("gdscript") + +if not os.getenv("SPHINX_NO_DESCRIPTIONS"): + extensions.append("godot_descriptions") + +templates_path = ["_templates"] + +# You can specify multiple suffix as a list of string: ['.rst', '.md'] +source_suffix = ".rst" +source_encoding = "utf-8-sig" + +# The master toctree document +master_doc = "index" + +# General information about the project +project = "Godot Engine" +copyright = ( + "2014-2022, Juan Linietsky, Ariel Manzur and the Godot community (CC-BY 3.0)" +) +author = "Juan Linietsky, Ariel Manzur and the Godot community" + +# Version info for the project, acts as replacement for |version| and |release| +# The short X.Y version +version = os.getenv("READTHEDOCS_VERSION", "3.4") +# The full version, including alpha/beta/rc tags +release = version + +# Parse Sphinx tags passed from RTD via environment +env_tags = os.getenv("SPHINX_TAGS") +if env_tags is not None: + for tag in env_tags.split(","): + print("Adding Sphinx tag: %s" % tag.strip()) + tags.add(tag.strip()) # noqa: F821 + +# Language / i18n + +supported_languages = { + "en": "Godot Engine (%s) documentation in English", + "de": "Godot Engine (%s) Dokumentation auf Deutsch", + "es": "Documentación de Godot Engine (%s) en español", + "fr": "Documentation de Godot Engine (%s) en français", + "fi": "Godot Engine (%s) dokumentaatio suomeksi", + "it": "Godot Engine (%s) documentazione in italiano", + "ja": "Godot Engine (%s)の日本語のドキュメント", + "ko": "Godot Engine (%s) 문서 (한국어)", + "pl": "Dokumentacja Godot Engine (%s) w języku polskim", + "pt_BR": "Documentação da Godot Engine (%s) em Português Brasileiro", + "ru": "Документация Godot Engine (%s) на русском языке", + "uk": "Документація до Godot Engine (%s) українською мовою", + "zh_CN": "Godot Engine (%s) 简体中文文档", + "zh_TW": "Godot Engine (%s) 正體中文 (台灣) 文件", +} + +language = os.getenv("READTHEDOCS_LANGUAGE", "en") +if not language in supported_languages.keys(): + print("Unknown language: " + language) + print("Supported languages: " + ", ".join(supported_languages.keys())) + print( + "The configured language is either wrong, or it should be added to supported_languages in conf.py. Falling back to 'en'." + ) + language = "en" + +is_i18n = tags.has("i18n") # noqa: F821 + +exclude_patterns = ["_build"] + +# fmt: off +# These imports should *not* be moved to the start of the file, +# they depend on the sys.path.append call registering "_extensions". +# GDScript syntax highlighting +from gdscript import GDScriptLexer +from sphinx.highlighting import lexers + +lexers["gdscript"] = GDScriptLexer() +# fmt: on + +smartquotes = False + +# Pygments (syntax highlighting) style to use +pygments_style = "sphinx" +highlight_language = "gdscript" + +# -- Options for HTML output ---------------------------------------------- + +html_theme = "sphinx_rtd_theme" +html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] +if on_rtd: + using_rtd_theme = True + +# Theme options +html_theme_options = { + # if we have a html_logo below, this shows /only/ the logo with no title text + "logo_only": True, + # Collapse navigation (False makes it tree-like) + "collapse_navigation": False, +} + +html_title = supported_languages[language] % version + +# VCS options: https://docs.readthedocs.io/en/latest/vcs.html#github +html_context = { + "display_github": not is_i18n, # Integrate GitHub + "github_user": "godotengine", # Username + "github_repo": "godot-docs", # Repo name + "github_version": "master", # Version + "conf_py_path": "/", # Path in the checkout to the docs root + "godot_inject_language_links": True, + "godot_docs_supported_languages": list(supported_languages.keys()), + "godot_docs_basepath": "https://docs.godotengine.org/", + "godot_docs_suffix": ".html", + "godot_default_lang": "en", + "godot_canonical_version": "stable", + # Distinguish local development website from production website. + # This prevents people from looking for changes on the production website after making local changes :) + "godot_title_prefix": "" if on_rtd else "(DEV) ", +} + +html_logo = "img/docs_logo.png" + +# These folders are copied to the documentation's HTML output +html_static_path = ["_static"] + +html_extra_path = ["robots.txt"] + +# These paths are either relative to html_static_path +# or fully qualified paths (e.g. https://...) +html_css_files = [ + "css/custom.css", +] + +html_js_files = [ + "js/custom.js", +] + +# Output file base name for HTML help builder +htmlhelp_basename = "GodotEnginedoc" + +# -- Options for reStructuredText parser ---------------------------------- + +# Enable directives that insert the contents of external files +file_insertion_enabled = False + +# -- Options for LaTeX output --------------------------------------------- + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + ( + master_doc, + "GodotEngine.tex", + "Godot Engine Documentation", + "Juan Linietsky, Ariel Manzur and the Godot community", + "manual", + ), +] + +# -- Options for linkcheck builder ---------------------------------------- + +# disable checking urls with about.html#this_part_of_page anchors +linkcheck_anchors = False + +linkcheck_timeout = 10 + +# -- I18n settings -------------------------------------------------------- + +# Godot localization is handled via https://github.com/godotengine/godot-docs-l10n +# where the main docs repo is a submodule. Therefore the translated material is +# actually in the parent folder of this conf.py, hence the "../". + +locale_dirs = ["../sphinx/po/"] +gettext_compact = False + +# We want to host the localized images in godot-docs-l10n, but Sphinx does not provide +# the necessary feature to do so. `figure_language_filename` has `{root}` and `{path}`, +# but they resolve to (host) absolute paths, so we can't use them as is to access "../". +# However, Python is glorious and lets us redefine Sphinx's internal method that handles +# `figure_language_filename`, so we do our own post-processing to fix the absolute path +# and point to the parallel folder structure in godot-docs-l10n. +# Note: Sphinx's handling of `figure_language_filename` may change in the future, monitor +# https://github.com/sphinx-doc/sphinx/issues/7768 to see what would be relevant for us. +figure_language_filename = "{root}.{language}{ext}" + +import sphinx +cwd = os.getcwd() + +sphinx_original_get_image_filename_for_language = sphinx.util.i18n.get_image_filename_for_language + +def godot_get_image_filename_for_language(filename, env): + """ + Hack the absolute path returned by Sphinx based on `figure_language_filename` + to insert our `../images` relative path to godot-docs-l10n's images folder, + which mirrors the folder structure of the docs repository. + The returned string should also be absolute so that `os.path.exists` can properly + resolve it when trying to concatenate with the original doc folder. + """ + path = sphinx_original_get_image_filename_for_language(filename, env) + path = os.path.abspath(os.path.join("../images/", os.path.relpath(path, cwd))) + return path + +sphinx.util.i18n.get_image_filename_for_language = godot_get_image_filename_for_language + +# Similar story for the localized class reference, it's out of tree and there doesn't +# seem to be an easy way for us to tweak the toctree to take this into account. +# So we're deleting the existing class reference and adding a symlink instead... +if is_i18n and os.path.exists("../classes/" + language): + import shutil + + if os.path.islink("classes"): # Previously made symlink. + os.unlink("classes") + else: + shutil.rmtree("classes") + + os.symlink("../classes/" + language, "classes") + +# Couldn't find a way to retrieve variables nor do advanced string +# concat from reST, so had to hardcode this in the "epilog" added to +# all pages. This is used in index.rst to display the Weblate badge. +# On English pages, the badge points to the language-neutral engage page. +rst_epilog = """ +.. |weblate_widget| image:: https://hosted.weblate.org/widgets/godot-engine/{image_locale}/godot-docs/287x66-white.png + :alt: Translation status + :target: https://hosted.weblate.org/engage/godot-engine{target_locale}/?utm_source=widget + :width: 287 + :height: 66 +""".format( + image_locale="-" if language == "en" else language, + target_locale="" if language == "en" else "/" + language, +) diff --git a/development/compiling/compiling_for_android.rst b/development/compiling/compiling_for_android.rst new file mode 100644 index 0000000..2c5f6cc --- /dev/null +++ b/development/compiling/compiling_for_android.rst @@ -0,0 +1,240 @@ +.. _doc_compiling_for_android: + +Compiling for Android +===================== + +.. highlight:: shell + +Note +---- + +In most cases, using the built-in deployer and export templates is good +enough. Compiling the Android APK manually is mostly useful for custom +builds or custom packages for the deployer. + +Also, you still need to follow the steps mentioned in the +:ref:`doc_exporting_for_android` tutorial before attempting to build +a custom export template. + +Requirements +------------ + +For compiling under Windows, Linux or macOS, the following is required: + +- `Python 3.5+ `_. +- `SCons 3.0+ `_ build system. +- `Android SDK `_ + (command-line tools are sufficient). + + - Required SDK components will be automatically installed. + - On Linux, + **do not use an Android SDK provided by your distribution's repositories as it will often be outdated**. + +- Gradle (will be downloaded and installed automatically if missing). +- JDK 11 (either OpenJDK or Oracle JDK). + + - You can download a build from `ojdkbuild `_. + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +.. _doc_android_setting_up_the_buildsystem: + +Setting up the buildsystem +-------------------------- + +- Set the environment variable ``ANDROID_SDK_ROOT`` to point to the Android + SDK. If you downloaded the Android command-line tools, this would be + the folder where you extracted the contents of the ZIP archive. + +- Install the necessary SDK components in this folder: + + - Accept the SDK component licenses by running the following command + where ``android_sdk_path`` is the path to the Android SDK, then answering all the prompts with ``y``: + + :: + + tools/bin/sdkmanager --sdk_root= --licenses + + - Complete setup by running the following command where ``android_sdk_path`` is the path to the Android SDK. + + :: + + tools/bin/sdkmanager --sdk_root= "platform-tools" "build-tools;30.0.3" "platforms;android-29" "cmdline-tools;latest" "cmake;3.10.2.4988404" + +.. seealso:: To set the environment variable on Windows, press :kbd:`Windows + R`, type + "control system", then click on **Advanced system settings** in the left + pane, then click on **Environment variables** on the window that appears. + +.. seealso:: To set the environment variable on Linux or macOS, use + ``export ANDROID_SDK_ROOT=/path/to/android-sdk`` where ``/path/to/android-sdk`` points to + the root of the SDK directories. + +Building the export templates +----------------------------- + +Godot needs two export templates for Android: the optimized "release" +template (``android_release.apk``) and the debug template (``android_debug.apk``). +As Google will require all APKs to include ARMv8 (64-bit) libraries starting +from August 2019, the commands below will build an APK containing both +ARMv7 and ARMv8 libraries. + +Compiling the standard export templates is done by calling SCons from the Godot +root directory with the following arguments: + +- Release template (used when exporting with **Debugging Enabled** unchecked) + +:: + + scons platform=android target=release android_arch=armv7 + scons platform=android target=release android_arch=arm64v8 + cd platform/android/java + # On Windows + .\gradlew generateGodotTemplates + # On Linux and macOS + ./gradlew generateGodotTemplates + + +The resulting APK will be located at ``bin/android_release.apk``. + +- Debug template (used when exporting with **Debugging Enabled** checked) + +:: + + scons platform=android target=release_debug android_arch=armv7 + scons platform=android target=release_debug android_arch=arm64v8 + cd platform/android/java + # On Windows + .\gradlew generateGodotTemplates + # On Linux and macOS + ./gradlew generateGodotTemplates + + +The resulting APK will be located at ``bin/android_debug.apk``. + +Adding support for x86 devices +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If you also want to include support for x86 and x86-64 devices, run the SCons +command a third and fourth time with the ``android_arch=x86``, and +``android_arch=x86_64`` arguments before building the APK with Gradle. For +example, for the release template: + +:: + + scons platform=android target=release android_arch=armv7 + scons platform=android target=release android_arch=arm64v8 + scons platform=android target=release android_arch=x86 + scons platform=android target=release android_arch=x86_64 + cd platform/android/java + # On Windows + .\gradlew generateGodotTemplates + # On Linux and macOS + ./gradlew generateGodotTemplates + + +This will create a fat binary that works on all platforms. +The final APK size of exported projects will depend on the platforms you choose +to support when exporting; in other words, unused platforms will be removed from +the APK. + +Cleaning the generated export templates +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +You can use the following commands to remove the generated export templates: + +:: + + cd platform/android/java + # On Windows + .\gradlew cleanGodotTemplates + # On Linux and macOS + ./gradlew cleanGodotTemplates + + +Using the export templates +-------------------------- + +Godot needs release and debug APKs that were compiled against the same +version/commit as the editor. If you are using official binaries +for the editor, make sure to install the matching export templates, +or build your own from the same version. + +When exporting your game, Godot opens the APK, changes a few things inside and +adds your files. + +Installing the templates +~~~~~~~~~~~~~~~~~~~~~~~~ + +The newly-compiled templates (``android_debug.apk`` +and ``android_release.apk``) must be copied to Godot's templates folder +with their respective names. The templates folder can be located in: + +- Windows: ``%APPDATA%\Godot\templates\\`` +- Linux: ``$HOME/.local/share/godot/templates//`` +- macOS: ``$HOME/Library/Application Support/Godot/templates//`` + +```` is of the form ``major.minor[.patch].status`` using values from +``version.py`` in your Godot source repository (e.g. ``3.0.5.stable`` or ``3.1.dev``). +You also need to write this same version string to a ``version.txt`` file located +next to your export templates. + +.. TODO: Move these paths to a common reference page + +However, if you are writing your custom modules or custom C++ code, you +might instead want to configure your APKs as custom export templates +here: + +.. image:: img/andtemplates.png + +You don't even need to copy them, you can just reference the resulting +file in the ``bin\`` directory of your Godot source folder, so that the +next time you build you will automatically have the custom templates +referenced. + +Troubleshooting +--------------- + +Platform doesn't appear in SCons +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Double-check that you've set the ``ANDROID_SDK_ROOT`` +environment variable. This is required for the platform to appear in SCons' +list of detected platforms. +See :ref:`Setting up the buildsystem ` +for more information. + +Application not installed +~~~~~~~~~~~~~~~~~~~~~~~~~ + +Android might complain the application is not correctly installed. +If so: + +- Check that the debug keystore is properly generated. +- Check that the jarsigner executable is from JDK 8. + +If it still fails, open a command line and run `logcat `_: + +:: + + adb logcat + +Then check the output while the application is installed; +the error message should be presented there. +Seek assistance if you can't figure it out. + +Application exits immediately +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +If the application runs but exits immediately, this might be due to +one of the following reasons: + +- Make sure to use export templates that match your editor version; if + you use a new Godot version, you *have* to update the templates too. +- ``libgodot_android.so`` is not in ``libs//`` + where ```` is the device's architecture. +- The device's architecture does not match the exported one(s). + Make sure your templates were built for that device's architecture, + and that the export settings included support for that architecture. + +In any case, ``adb logcat`` should also show the cause of the error. diff --git a/development/compiling/compiling_for_ios.rst b/development/compiling/compiling_for_ios.rst new file mode 100644 index 0000000..90faca5 --- /dev/null +++ b/development/compiling/compiling_for_ios.rst @@ -0,0 +1,78 @@ +.. _doc_compiling_for_ios: + +Compiling for iOS +================= + +.. highlight:: shell + +Requirements +------------ + +- SCons 3.0+ (you can install it via `Homebrew `_ or + `MacPorts `_, you should be able + to run ``scons`` in a terminal when installed). +- Xcode 10.0 (or later) with the iOS (10.0) SDK and the command line tools. + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Compiling +--------- + +Open a Terminal, go to the root dir of the engine source code and type: + +:: + + $ scons p=iphone target=debug + +for a debug build, or: + +:: + + $ scons p=iphone target=release + +for a release build (check ``platform/iphone/detect.py`` for the compiler +flags used for each configuration). + +Alternatively, you can run + +:: + + $ scons p=iphone arch=x86_64 target=debug + +for a Simulator executable. + +For recent devices, Apple requires 64-bit versions of application binaries when you are uploading to the Apple Store. +The best way to provide these is to create a bundle in which there are both 32-bit and 64-bit binaries, so every device will be able to run the game. + +It can be done in three steps: first compile the 32-bit version, then compile the 64-bit version and then use ``lipo`` to bundle them into one "universal" binary. +All those steps can be performed with following commands: + +:: + + $ scons p=iphone tools=no target=release arch=arm + $ scons p=iphone tools=no target=release arch=arm64 + $ lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a -output bin/libgodot.iphone.release.fat.a + $ lipo -create bin/libgodot_camera_module.iphone.opt.arm.a bin/libgodot_camera_module.iphone.opt.arm64.a -output bin/libgodot_camera_module.iphone.release.fat.a + $ lipo -create bin/libgodot_arkit_module.iphone.opt.arm.a bin/libgodot_arkit_module.iphone.opt.arm64.a -output bin/libgodot_arkit_module.iphone.release.fat.a + +If you also want to provide a simulator build (reduces the chance of any linker errors with dependencies), you'll need to build and lipo the ``x86_64`` architecture as well. + +:: + + $ scons p=iphone tools=no target=release arch=arm + $ scons p=iphone tools=no target=release arch=arm64 + $ scons p=iphone tools=no target=release arch=x86_64 + $ lipo -create bin/libgodot.iphone.opt.arm.a bin/libgodot.iphone.opt.arm64.a bin/libgodot.iphone.opt.x86_64.a -output bin/libgodot.iphone.release.fat.a + $ lipo -create bin/libgodot_camera_module.iphone.opt.arm.a bin/libgodot_camera_module.iphone.opt.arm64.a bin/libgodot_camera_module.iphone.opt.x86_64.a -output bin/libgodot_camera_module.iphone.release.fat.a + $ lipo -create bin/libgodot_arkit_module.iphone.opt.arm.a bin/libgodot_arkit_module.iphone.opt.arm64.a bin/libgodot_arkit_module.iphone.opt.x86_64.a -output bin/libgodot_arkit_module.iphone.release.fat.a + +Run +--- + +To run on a device or simulator, follow these instructions: +:ref:`doc_exporting_for_ios`. + +Replace or add your executable to the Xcode project, and change the +"executable name" property on Info.plist accordingly if you use an +alternative build. diff --git a/development/compiling/compiling_for_osx.rst b/development/compiling/compiling_for_osx.rst new file mode 100644 index 0000000..2c0f443 --- /dev/null +++ b/development/compiling/compiling_for_osx.rst @@ -0,0 +1,166 @@ +.. _doc_compiling_for_osx: + +Compiling for macOS +=================== + +.. highlight:: shell + +Requirements +------------ + +For compiling under macOS, the following is required: + +- `Python 3.5+ `_. +- `SCons 3.0+ `_ build system. +- `Xcode `_ + (or the more lightweight Command Line Tools for Xcode). +- *Optional* - `yasm `_ (for WebM SIMD optimizations). + +.. note:: If you have `Homebrew `_ installed, you can easily + install SCons and yasm using the following command:: + + brew install scons yasm + + Installing Homebrew will also fetch the Command Line Tools + for Xcode automatically if you don't have them already. + + Similarly, if you have `MacPorts `_ + installed, you can easily install SCons and yasm using the + following command:: + + sudo port install scons yasm + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Compiling +--------- + +Start a terminal, go to the root directory of the engine source code. + +To compile for Intel (x86-64) powered Macs, use:: + + scons platform=osx arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu) + +To compile for Apple Silicon (ARM64) powered Macs, use:: + + scons platform=osx arch=arm64 --jobs=$(sysctl -n hw.logicalcpu) + +To support both architectures in a single "Universal 2" binary, run the above two commands and then use ``lipo`` to bundle them together:: + + lipo -create bin/godot.osx.tools.x86_64 bin/godot.osx.tools.arm64 -output bin/godot.osx.tools.universal + +If all goes well, the resulting binary executable will be placed in the +``bin/`` subdirectory. This executable file contains the whole engine and +runs without any dependencies. Executing it will bring up the project +manager. + +.. note:: If you want to use separate editor settings for your own Godot builds + and official releases, you can enable + :ref:`doc_data_paths_self_contained_mode` by creating a file called + ``._sc_`` or ``_sc_`` in the ``bin/`` folder. + +To create an ``.app`` bundle like in the official builds, you need to use the +template located in ``misc/dist/osx_tools.app``. Typically, for an optimized +editor binary built with ``target=release_debug``:: + + cp -r misc/dist/osx_tools.app ./Godot.app + mkdir -p Godot.app/Contents/MacOS + cp bin/godot.osx.opt.tools.universal Godot.app/Contents/MacOS/Godot + chmod +x Godot.app/Contents/MacOS/Godot + +Compiling a headless/server build +--------------------------------- + +To compile a *headless* build which provides editor functionality to export +projects in an automated manner, use:: + + scons platform=server tools=yes target=release_debug --jobs=$(sysctl -n hw.logicalcpu) + +To compile a debug *server* build which can be used with +:ref:`remote debugging tools `, use:: + + scons platform=server tools=no target=release_debug --jobs=$(sysctl -n hw.logicalcpu) + +To compile a release *server* build which is optimized to run dedicated game servers, +use:: + + scons platform=server tools=no target=release --jobs=$(sysctl -n hw.logicalcpu) + +Building export templates +------------------------- + +To build macOS export templates, you have to compile with ``tools=no`` (no +editor) and respectively for ``target=release`` (release template) and +``target=release_debug``. + +Official templates are universal binaries which support both Intel x86_64 and +ARM64 architectures. You can also create export templates that support only one +of those two architectures by leaving out the ``lipo`` step below. + +- For Intel x86_64:: + + scons platform=osx tools=no target=release arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu) + scons platform=osx tools=no target=release_debug arch=x86_64 --jobs=$(sysctl -n hw.logicalcpu) + +- For ARM64 (Apple M1):: + + scons platform=osx tools=no target=release arch=arm64 --jobs=$(sysctl -n hw.logicalcpu) + scons platform=osx tools=no target=release_debug arch=arm64 --jobs=$(sysctl -n hw.logicalcpu) + +To support both architectures in a single "Universal 2" binary, run the above +two commands blocks and then use ``lipo`` to bundle them together:: + + lipo -create bin/godot.osx.opt.x86_64 bin/godot.osx.opt.arm64 -output bin/godot.osx.opt.universal + lipo -create bin/godot.osx.opt.debug.x86_64 bin/godot.osx.opt.debug.arm64 -output bin/godot.osx.opt.debug.universal + +To create an ``.app`` bundle like in the official builds, you need to use the +template located in ``misc/dist/osx_template.app``. The release and debug +builds should be placed in ``osx_template.app/Contents/MacOS`` with the names +``godot_osx_release.64`` and ``godot_osx_debug.64`` respectively. You can do so +with the following commands (assuming a universal build, otherwise replace the +``.universal`` extension with the one of your arch-specific binaries):: + + cp -r misc/dist/osx_template.app . + mkdir -p osx_template.app/Contents/MacOS + cp bin/godot.osx.opt.universal osx_template.app/Contents/MacOS/godot_osx_release.64 + cp bin/godot.osx.opt.debug.universal osx_template.app/Contents/MacOS/godot_osx_debug.64 + chmod +x osx_template.app/Contents/MacOS/godot_osx* + +You can then zip the ``osx_template.app`` folder to reproduce the ``osx.zip`` +template from the official Godot distribution:: + + zip -q -9 -r osx.zip osx_template.app + +Cross-compiling for macOS from Linux +------------------------------------ + +It is possible to compile for macOS in a Linux environment (and maybe also in +Windows using the Windows Subsystem for Linux). For that, you'll need to install +`OSXCross `__ to be able to use macOS +as a target. First, follow the instructions to install it: + +Clone the `OSXCross repository `__ +somewhere on your machine (or download a ZIP file and extract it somewhere), +e.g.:: + + git clone --depth=1 https://github.com/tpoechtrager/osxcross.git "$HOME/osxcross" + +1. Follow the instructions to package the SDK: + https://github.com/tpoechtrager/osxcross#packaging-the-sdk +2. Follow the instructions to install OSXCross: + https://github.com/tpoechtrager/osxcross#installation + +After that, you will need to define the ``OSXCROSS_ROOT`` as the path to +the OSXCross installation (the same place where you cloned the +repository/extracted the zip), e.g.:: + + export OSXCROSS_ROOT="$HOME/osxcross" + +Now you can compile with SCons like you normally would:: + + scons platform=osx + +If you have an OSXCross SDK version different from the one expected by the SCons buildsystem, you can specify a custom one with the ``osxcross_sdk`` argument:: + + scons platform=osx osxcross_sdk=darwin15 diff --git a/development/compiling/compiling_for_uwp.rst b/development/compiling/compiling_for_uwp.rst new file mode 100644 index 0000000..3d6f947 --- /dev/null +++ b/development/compiling/compiling_for_uwp.rst @@ -0,0 +1,144 @@ +.. _doc_compiling_for_uwp: + +Compiling for Universal Windows Platform +======================================== + +.. highlight:: shell + +Requirements +------------ + +- SCons 3.0+ (see :ref:`doc_compiling_for_windows` for more details). +- Visual Studio 2017 or later. See :ref:`doc_compiling_for_windows` about the + caveats of installing it and the various prompts. +- Windows 10 SDK (can be selected in Visual Studio installation). +- `ANGLE source `__. Use the + ``ms_master`` (default) branch. Keep it in a path without spaces to + avoid problems. + +.. note:: The ANGLE repo by Microsoft has been discontinued and the + ``ms_master`` branch has been cleared out. + + As a temporary workaround however, it is still possible to + download an older state of the source code via commit + `c61d048 `__. + + This page will eventually be updated in the future to reflect + the new build instructions. + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Compiling +--------- + +You need to open a proper Visual Studio prompt for the target architecture +you want to build. Check :ref:`doc_compiling_for_windows` to see how these +prompts work. + +There are three target architectures for UWP: x86 (32-bits), x64 (64-bits) +and ARM (32-bits). For the latter, you can run ``vcvarsall.bat`` with +``x86_arm`` or ``amd64_arm`` as argument to set the environment. + +Set the ``ANGLE_SRC_PATH`` to the directory where you downloaded the ANGLE +source code. The build process will also build ANGLE to produce the +required DLLs for the selected architecture. + +Once you're set, run the SCons command similarly to the other platforms:: + + C:\godot>scons platform=uwp + +Creating UWP export templates +----------------------------- + +To export using the editor you need to properly build package the templates. +You need all three architectures with ``debug`` and ``release`` templates to +be able to export. + +Open the command prompt for one architecture and run SCons twice (once for +each target):: + + C:\godot>scons platform=uwp target=release_debug + C:\godot>scons platform=uwp target=release + +Repeat for the other architectures. + +In the end your ``bin`` folder will have the ``.exe`` binaries with a name +like ``godot.uwp.opt.debug.32.x86.exe`` (with variations for each +target/arch). + +Copy one of these to ``misc/dist/uwp_template`` inside the Godot source +folder and rename the binary to ``godot.uwp.exe``. From the ANGLE source, +under ``winrt/10/src/Release_%arch%`` (where ``%arch%`` can be ``Win32``, +``x64`` or ``ARM``), get the ``libEGL.dll`` and the ``libGLESv2.dll``, +putting them along with the executable. + +Add the files in the ``uwp_template`` folder to a ZIP. Rename the resulting +Zip according to the target/architecture of the template:: + + uwp_x86_debug.zip + uwp_x86_release.zip + uwp_x64_debug.zip + uwp_x64_release.zip + uwp_arm_debug.zip + uwp_arm_release.zip + +Move those templates to the ``[versionstring]\templates`` folder in Godot +settings path, where `versionstring` is the version of Godot you have compiled +the export templates for - e.g. `3.0.alpha` for the alpha version of Godot 3. +If you don't want to replace the templates, you can set the "Custom Package" +property in the export window. + +Running UWP apps with Visual Studio +----------------------------------- + +If you want to debug the UWP port or simply run your apps without packaging +and signing, you can deploy and launch them using Visual Studio. It might be +the easiest way if you are testing on a device such as a Windows Phone or an +Xbox One. + +Within the ANGLE source folder, open ``templates`` and double-click the +``install.bat`` script file. This will install the Visual Studio project +templates for ANGLE apps. + +If you have not built Godot yet, open the ``winrt/10/src/angle.sln`` solution +from the ANGLE source and build it to Release/Win32 target. You may also need +to build it for ARM if you plan to run on a device. You can also use MSBuild if +you're comfortable with the command line. + +Create a new Windows App project using the "App for OpenGL ES +(Windows Universal)" project template, which can be found under the +``Visual C++/Windows/Universal`` category. + +This is a base project with the ANGLE dependencies already set up. However, by +default it picks the debug version of the DLLs which usually have poor +performance. So in the "Binaries" filter, click in each of the DLLs there +and in the "Properties" window and change the relative path from +``Debug_Win32`` to ``Release_Win32`` (or ``Release_ARM`` for devices). + +In the same "Binaries" filter, select "Add > Existing Item" and point to the +Godot executable for UWP you have. In the "Properties" window, set "Content" +to ``True`` so it's included in the project. + +Right-click the ``Package.appxmanifest`` file and select "Open With... > XML +(Text) Editor". In the ``Package/Applications/Application`` element, replace +the ``Executable`` attribute from ``$targetnametoken$.exe`` to +``godot.uwp.exe`` (or whatever your Godot executable is called). Also change +the ``EntryPoint`` attribute to ``GodotUWP.App``. This will ensure that +the Godot executable is correctly called when the app starts. + +Create a folder (*not* a filter) called ``game`` in your Visual Studio project +folder and there you can put either a ``data.pck`` file or your Godot project +files. After that, make sure to include it all with the "Add > Existing Item" +command and set their "Content" property to ``True`` so they're copied to the +app. + +To ease the workflow, you can open the "Solution Properties" and in the +"Configuration" section untick the "Build" option for the app. You still have +to build it at least once to generate some needed files, you can do so by +right-clicking the project (*not* the solution) in the "Solution Explorer" and +selecting "Build". + +Now you can just run the project and your app should open. You can also use +the "Start Without Debugging" option from the "Debug" menu (or press :kbd:`Ctrl + F5`) to make it +launch faster. diff --git a/development/compiling/compiling_for_web.rst b/development/compiling/compiling_for_web.rst new file mode 100644 index 0000000..6f9874c --- /dev/null +++ b/development/compiling/compiling_for_web.rst @@ -0,0 +1,101 @@ +.. _doc_compiling_for_web: + +Compiling for the Web +===================== + +.. highlight:: shell + +Requirements +------------ + +To compile export templates for the Web, the following is required: + +- `Emscripten 1.39.9+ `__. +- `Python 3.5+ `__. +- `SCons 3.0+ `__ build system. + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Building export templates +------------------------- + +Before starting, confirm that ``emcc`` is available in your PATH. This is +usually configured by the Emscripten SDK, e.g. when invoking ``emsdk activate`` +and ``source ./emsdk_env.sh``/``emsdk_env.bat``. + +Open a terminal and navigate to the root directory of the engine source code. +Then instruct SCons to build the JavaScript platform. Specify ``target`` as +either ``release`` for a release build or ``release_debug`` for a debug build:: + + scons platform=javascript tools=no target=release + scons platform=javascript tools=no target=release_debug + +By default, the :ref:`JavaScript singleton ` will be built +into the engine. Official export templates also have the JavaScript singleton +enabled. Since ``eval()`` calls can be a security concern, the +``javascript_eval`` option can be used to build without the singleton:: + + scons platform=javascript tools=no target=release javascript_eval=no + scons platform=javascript tools=no target=release_debug javascript_eval=no + +The engine will now be compiled to WebAssembly by Emscripten. Once finished, +the resulting file will be placed in the ``bin`` subdirectory. Its name is +``godot.javascript.opt.zip`` for release or ``godot.javascript.opt.debug.zip`` +for debug. + +Finally, rename the zip archive to ``webassembly_release.zip`` for the +release template:: + + mv bin/godot.javascript.opt.zip bin/webassembly_release.zip + +And ``webassembly_debug.zip`` for the debug template:: + + mv bin/godot.javascript.opt.debug.zip bin/webassembly_debug.zip + +Threads and GDNative +-------------------- + +The default export templates do not include threads and GDNative support for +performance and compatibility reasons. See the +:ref:`export page ` for more info. + +You can build the export templates using the option ``threads_enabled=yes`` or +``gdnative_enabled=yes`` to enable threads or GDNative support:: + + scons platform=javascript tools=no threads_enabled=yes target=release + scons platform=javascript tools=no threads_enabled=yes target=release_debug + + scons platform=javascript tools=no gdnative_enabled=yes target=release + scons platform=javascript tools=no gdnative_enabled=yes target=release_debug + +Once finished, the resulting file will be placed in the ``bin`` subdirectory. +Its name will have either the ``.threads`` or ``.gdnative`` suffix. + +Finally, rename the zip archives to ``webassembly_release_threads.zip`` and +``webassembly_release_gdnative.zip`` for the release template:: + + mv bin/godot.javascript.opt.threads.zip bin/webassembly_threads_release.zip + mv bin/godot.javascript.opt.gdnative.zip bin/webassembly_gdnative_release.zip + +And ``webassembly_debug_threads.zip`` and ``webassembly_debug_gdnative.zip`` for +the debug template:: + + mv bin/godot.javascript.opt.debug.threads.zip bin/webassembly_threads_debug.zip + mv bin/godot.javascript.opt.debug.gdnative.zip bin/webassembly_gdnative_debug.zip + +Building the Editor +------------------- + +It is also possible to build a version of the Godot editor that can run in the +browser. The editor version requires threads support and is not recommended +over the native build. You can build the editor with:: + + scons platform=javascript tools=yes threads_enabled=yes target=release_debug + +Once finished, the resulting file will be placed in the ``bin`` subdirectory. +Its name will be ``godot.javascript.opt.tools.threads.zip``. You can upload the +zip content to your web server and visit it with your browser to use the editor. + +Refer to the :ref:`export page ` for the web +server requirements. diff --git a/development/compiling/compiling_for_windows.rst b/development/compiling/compiling_for_windows.rst new file mode 100644 index 0000000..ea8369d --- /dev/null +++ b/development/compiling/compiling_for_windows.rst @@ -0,0 +1,293 @@ +.. _doc_compiling_for_windows: + +Compiling for Windows +===================== + +.. highlight:: shell + +Requirements +------------ + +For compiling under Windows, the following is required: + +- `Visual Studio Community `_, + version 2017 or later. VS 2019 is recommended. + **Make sure to read "Installing Visual Studio caveats" below or you + will have to run/download the installer again.** +- `MinGW-w64 `__ with GCC can be used as an alternative to + Visual Studio. Be sure to install/configure it to use the ``posix`` thread model. +- `Python 3.5+ `_. +- `SCons 3.0 `_ build system. If using Visual Studio 2019, + you need at least SCons 3.1.1. + +.. note:: If you have `Scoop `_ installed, you can easily + install MinGW and other dependencies using the following command:: + + scoop install gcc python scons make + +.. note:: If you have `MSYS2 `_ installed, you can easily + install MinGW and other dependencies using the following command:: + + pacman -S mingw-w64-x86_64-python3-pip mingw-w64-x86_64-gcc \ + mingw-w64-i686-python3-pip mingw-w64-i686-gcc make + + For each MSYS2 MinGW subsystem, you should then run + `pip3 install scons` in its shell. + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Setting up Python +----------------- + +First you need to install Python 3.5 or newer. Make sure to enable the option +to add Python to the ``PATH`` in the Python installer. The SCons installer +should then detect and use the existing Python installation. + +Setting up SCons +---------------- + +To install SCons, open the command prompt and run the following command:: + + python -m pip install scons + +If you are prompted with the message +``Defaulting to user installation because normal site-packages is not +writeable``, you may have to run that command again using elevated +permissions. Open a new command prompt as an Administrator then run the command +again to ensure that SCons is available from the ``PATH``. + +To check whether you have installed Python and SCons correctly, you can +type ``python --version`` and ``scons --version`` into a command prompt +(``cmd.exe``). + +If the commands above don't work, make sure to add Python to your ``PATH`` +environment variable after installing it, then check again. +You can do so by running the Python installer again and enabling the option +to add Python to the ``PATH``. + +.. _doc_compiling_for_windows_install_vs: + +Installing Visual Studio caveats +-------------------------------- + +If installing Visual Studio 2017 or 2019, make sure to enable **C++** in +the list of workflows to install. + +If installing Visual Studio 2015, make sure to run a **Custom** +installation instead of **Typical** and select **C++** as a language there. + +If you've already made the mistake of installing Visual Studio without +C++ support, run the installer again; it should present you a **Modify** button. +Running the installer from *Add/Remove Programs* will only give you +a **Repair** option, which won't let you install C++ tools. + +Downloading Godot's source +-------------------------- + +Godot's source code is `hosted on GitHub `_. +Downloading it (cloning) using `Git `_ is recommended. + +The tutorial will assume from now on that you placed the source code in +``C:\godot``. + +.. warning:: + + To prevent slowdowns caused by continuous virus scanning during compilation, + add the Godot source folder to the list of exceptions in your antivirus + software. + + For Windows Defender, hit the :kbd:`Windows` key, type + "Windows Defender Settings" then hit :kbd:`Enter`. + Under **Virus & threat protection**, go to **Virus & threat protection setting** + and scroll down to **Exclusions**. Click **Add or remove exclusions** then + add the Godot source folder. + +Compiling +--------- + +Selecting a compiler +~~~~~~~~~~~~~~~~~~~~ + +SCons will automatically find and use an existing Visual Studio installation. +If you do not have Visual Studio installed, it will attempt to use +MinGW instead. If you already have Visual Studio installed and want to +use MinGW, pass ``use_mingw=yes`` to the SCons command line. Note that MSVC +builds cannot be performed from the MSYS2 or MinGW shells. Use either +``cmd.exe`` or PowerShell instead. + +During development, using the Visual Studio compiler is usually a better idea, +as it links the Godot binary much faster than MinGW. However, MinGW can +produce more optimized binaries using link-time optimization (see below), +making it a better choice for production use. + +Running SCons +~~~~~~~~~~~~~ + +After opening a command prompt, change to the root directory of +the engine source code (using ``cd``) and type:: + + C:\godot> scons platform=windows + +You can specify a number of CPU threads to use to speed up the build:: + + C:\godot> scons -j6 platform=windows + +In general, it is OK to have at least as many threads compiling Godot as you +have cores in your CPU, if not one or two more. Feel free to add the ``-j`` +option to any SCons command you see below. + +.. note:: When compiling with multiple CPU threads, SCons may warn about + pywin32 being missing. You can safely ignore this warning. + +If all goes well, the resulting binary executable will be placed in +``C:\godot\bin\`` with the name ``godot.windows.tools.32.exe`` or +``godot.windows.tools.64.exe``. By default, SCons will build a binary matching +your CPU architecture, but this can be overridden using ``bits=64`` or +``bits=32``. + +This executable file contains the whole engine and runs without any +dependencies. Running it will bring up the Project Manager. + +.. note:: If you are compiling Godot for production use, then you can + make the final executable smaller and faster by adding the + SCons option ``target=release_debug``. + + If you are compiling Godot with MinGW, you can make the binary + even smaller and faster by adding the SCons option ``use_lto=yes``. + As link-time optimization is a memory-intensive process, + this will require about 7 GB of available RAM while compiling. + +.. note:: If you want to use separate editor settings for your own Godot builds + and official releases, you can enable + :ref:`doc_data_paths_self_contained_mode` by creating a file called + ``._sc_`` or ``_sc_`` in the ``bin/`` folder. + +Development in Visual Studio or other IDEs +------------------------------------------ + +For most projects, using only scripting is enough but when development +in C++ is needed, for creating modules or extending the engine, working +with an IDE is usually desirable. + +You can create a Visual Studio solution via SCons by running SCons with +the ``vsproj=yes`` parameter, like this:: + + scons p=windows vsproj=yes + +You will be able to open Godot's source in a Visual Studio solution now, +and able to build Godot using Visual Studio's **Build** button. + +If you need to edit the build commands, they are located in +"Godot" project settings, NMAKE sheet. SCons is called at the end of +the commands. If you make a mistake, copy the command from one of the +other build configurations (debug, release_debug, release) or +architectures (Win32/x64); they are equivalent. + +Cross-compiling for Windows from other operating systems +-------------------------------------------------------- + +If you are a Linux or macOS user, you need to install +`MinGW-w64 `__, which typically comes in 32-bit +and 64-bit variants. The package names may differ based on your distribution, +here are some known ones: + ++----------------+--------------------------------------------------------------+ +| **Arch Linux** | Install `mingw-w64-gcc from the AUR`_. | ++----------------+--------------------------------------------------------------+ +| **Debian** / | :: | +| **Ubuntu** | | +| | apt install mingw-w64 | ++----------------+--------------------------------------------------------------+ +| **Fedora** | :: | +| | | +| | dnf install mingw64-gcc-c++ mingw64-winpthreads-static \ | +| | mingw32-gcc-c++ mingw32-winpthreads-static | ++----------------+--------------------------------------------------------------+ +| **macOS** | :: | +| | | +| | brew install mingw-w64 | ++----------------+--------------------------------------------------------------+ +| **Mageia** | :: | +| | | +| | urpmi mingw64-gcc-c++ mingw64-winpthreads-static \ | +| | mingw32-gcc-c++ mingw32-winpthreads-static | ++----------------+--------------------------------------------------------------+ + +.. _mingw-w64-gcc from the AUR: https://aur.archlinux.org/packages/mingw-w64-gcc/ + +Before attempting the compilation, SCons will check for +the following binaries in your ``PATH`` environment variable:: + + i686-w64-mingw32-gcc + x86_64-w64-mingw32-gcc + +If the binaries are not located in the ``PATH`` (e.g. ``/usr/bin``), +you can define the following environment variables to give a hint to +the build system:: + + export MINGW32_PREFIX="/path/to/i686-w64-mingw32-" + export MINGW64_PREFIX="/path/to/x86_64-w64-mingw32-" + +To make sure you are doing things correctly, executing the following in +the shell should result in a working compiler (the version output may +differ based on your system):: + + ${MINGW32_PREFIX}gcc --version + # i686-w64-mingw32-gcc (GCC) 6.1.0 20160427 (Mageia MinGW 6.1.0-1.mga6) + +Troubleshooting +~~~~~~~~~~~~~~~ + +Cross-compiling from some Ubuntu versions may lead to +`this bug `_, +due to a default configuration lacking support for POSIX threading. + +You can change that configuration following those instructions, +for 64-bit:: + + sudo update-alternatives --config x86_64-w64-mingw32-gcc + + sudo update-alternatives --config x86_64-w64-mingw32-g++ + + +And for 32-bit:: + + sudo update-alternatives --config i686-w64-mingw32-gcc + + sudo update-alternatives --config i686-w64-mingw32-g++ + + +Creating Windows export templates +--------------------------------- + +Windows export templates are created by compiling Godot without the editor, +with the following flags:: + + C:\godot> scons platform=windows tools=no target=release_debug bits=32 + C:\godot> scons platform=windows tools=no target=release bits=32 + C:\godot> scons platform=windows tools=no target=release_debug bits=64 + C:\godot> scons platform=windows tools=no target=release bits=64 + +If you plan on replacing the standard export templates, copy these to the +following location, replacing ```` with the version identifier +(such as ``3.1.1.stable`` or ``3.2.dev``):: + + %USERPROFILE%\AppData\Roaming\Godot\templates\\ + +With the following names:: + + windows_32_debug.exe + windows_32_release.exe + windows_64_debug.exe + windows_64_release.exe + +However, if you are using custom modules or custom engine code, you +may instead want to configure your binaries as custom export templates +here: + +.. image:: img/wintemplates.png + +You don't need to copy them in this case, just reference the resulting +files in the ``bin\`` directory of your Godot source folder, so the next +time you build, you will automatically have the custom templates referenced. diff --git a/development/compiling/compiling_for_x11.rst b/development/compiling/compiling_for_x11.rst new file mode 100644 index 0000000..ed607e2 --- /dev/null +++ b/development/compiling/compiling_for_x11.rst @@ -0,0 +1,254 @@ +.. _doc_compiling_for_x11: + +Compiling for X11 (Linux, \*BSD) +================================ + +.. highlight:: shell + +Requirements +------------ + +For compiling under Linux or other Unix variants, the following is +required: + +- GCC 7+ or Clang 6+. +- Python 3.5+. +- SCons 3.0+ build system. If your distribution uses Python 2 by default, + or you are using a version of SCons prior to 3.1.2, you will need to change + the version of Python that SCons uses by changing the shebang (the first line) + of the SCons script file to ``#! /usr/bin/python3``. + Use the command ``which scons`` to find the location of the SCons script file. +- pkg-config (used to detect the dependencies below). +- X11, Xcursor, Xinerama, Xi and XRandR development libraries. +- MesaGL development libraries. +- ALSA development libraries. +- PulseAudio development libraries. +- *Optional* - libudev (build with ``udev=yes``). +- *Optional* - yasm (for WebM SIMD optimizations). + +.. seealso:: For a general overview of SCons usage for Godot, see + :ref:`doc_introduction_to_the_buildsystem`. + +Distro-specific one-liners +^^^^^^^^^^^^^^^^^^^^^^^^^^ ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Alpine Linux** | :: | +| | | +| | apk add scons pkgconf gcc g++ libx11-dev libxcursor-dev libxinerama-dev libxi-dev libxrandr-dev \ | +| | libexecinfo-dev | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Arch Linux** | :: | +| | | +| | pacman -S --needed scons pkgconf gcc libxcursor libxinerama libxi libxrandr mesa glu libglvnd \ | +| | alsa-lib pulseaudio yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Debian** / | :: | +| **Ubuntu** | | +| | sudo apt-get install build-essential scons pkg-config libx11-dev libxcursor-dev libxinerama-dev \ | +| | libgl1-mesa-dev libglu-dev libasound2-dev libpulse-dev libudev-dev libxi-dev libxrandr-dev yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Fedora** | :: | +| | | +| | sudo dnf install scons pkgconfig libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel \ | +| | libXi-devel mesa-libGL-devel mesa-libGLU-devel alsa-lib-devel pulseaudio-libs-devel \ | +| | libudev-devel yasm gcc-c++ libstdc++-static libatomic-static | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **FreeBSD** | :: | +| | | +| | sudo pkg install py37-scons pkgconf xorg-libraries libXcursor libXrandr libXi xorgproto libGLU \ | +| | alsa-lib pulseaudio yasm | +| | | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Gentoo** | :: | +| | | +| | emerge -an dev-util/scons x11-libs/libX11 x11-libs/libXcursor x11-libs/libXinerama x11-libs/libXi \ | +| | media-libs/mesa media-libs/glu media-libs/alsa-lib media-sound/pulseaudio dev-lang/yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Mageia** | :: | +| | | +| | urpmi scons task-c++-devel pkgconfig "pkgconfig(alsa)" "pkgconfig(glu)" "pkgconfig(libpulse)" \ | +| | "pkgconfig(udev)" "pkgconfig(x11)" "pkgconfig(xcursor)" "pkgconfig(xinerama)" "pkgconfig(xi)" \ | +| | "pkgconfig(xrandr)" yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **OpenBSD** | :: | +| | | +| | pkg_add python scons llvm yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **openSUSE** | :: | +| | | +| | sudo zypper install scons pkgconfig libX11-devel libXcursor-devel libXrandr-devel libXinerama-devel \ | +| | libXi-devel Mesa-libGL-devel alsa-devel libpulse-devel libudev-devel libGLU1 yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **NetBSD** | :: | +| | | +| | pkg_add pkg-config py37-scons yasm | +| | | +| | For audio support, you can optionally install ``pulseaudio``. | ++------------------+-----------------------------------------------------------------------------------------------------------+ +| **Solus** | :: | +| | | +| | sudo eopkg install -c system.devel scons libxcursor-devel libxinerama-devel libxi-devel \ | +| | libxrandr-devel mesalib-devel libglu alsa-lib-devel pulseaudio-devel yasm | ++------------------+-----------------------------------------------------------------------------------------------------------+ + +Compiling +--------- + +Start a terminal, go to the root dir of the engine source code and type: + +:: + + scons -j8 platform=x11 + +A good rule of thumb for the ``-j`` (*jobs*) flag, is to have at least as many +threads compiling Godot as you have cores in your CPU, if not one or two more. +Feel free to add the ``-j`` option to any SCons command you see below. + +If all goes well, the resulting binary executable will be placed in the +"bin" subdirectory. This executable file contains the whole engine and +runs without any dependencies. Executing it will bring up the project +manager. + +.. note:: + + If you wish to compile using Clang rather than GCC, use this command: + + :: + + scons platform=x11 use_llvm=yes + + Using Clang appears to be a requirement for OpenBSD, otherwise fonts + would not build. + +.. note:: If you are compiling Godot for production use, then you can + make the final executable smaller and faster by adding the + SCons option ``target=release_debug``. + + If you are compiling Godot with GCC, you can make the binary + even smaller and faster by adding the SCons option ``use_lto=yes``. + As link-time optimization is a memory-intensive process, + this will require about 7 GB of available RAM while compiling. + +.. note:: If you want to use separate editor settings for your own Godot builds + and official releases, you can enable + :ref:`doc_data_paths_self_contained_mode` by creating a file called + ``._sc_`` or ``_sc_`` in the ``bin/`` folder. + +Compiling a headless/server build +--------------------------------- + +To compile a *headless* build which provides editor functionality to export +projects in an automated manner, use:: + + scons -j8 platform=server tools=yes target=release_debug + +To compile a debug *server* build which can be used with +:ref:`remote debugging tools `, use:: + + scons -j8 platform=server tools=no target=release_debug + +To compile a *server* build which is optimized to run dedicated game servers, +use:: + + scons -j8 platform=server tools=no target=release + +Building export templates +------------------------- + +.. warning:: Linux binaries usually won't run on distributions that are + older than the distribution they were built on. If you wish to + distribute binaries that work on most distributions, + you should build them on an old distribution such as Ubuntu 16.04. + You can use a virtual machine or a container to set up a suitable + build environment. + + +To build X11 (Linux, \*BSD) export templates, run the build system with the +following parameters: + +- (32 bits) + +:: + + scons platform=x11 tools=no target=release bits=32 + scons platform=x11 tools=no target=release_debug bits=32 + +- (64 bits) + +:: + + scons platform=x11 tools=no target=release bits=64 + scons platform=x11 tools=no target=release_debug bits=64 + +Note that cross-compiling for the opposite bits (64/32) as your host +platform is not always straight-forward and might need a chroot environment. + +To create standard export templates, the resulting files must be copied to: + +:: + + $HOME/.local/share/godot/templates/[gd-version]/ + +and named like this (even for \*BSD which is seen as "Linux X11" by Godot): + +:: + + linux_x11_32_debug + linux_x11_32_release + linux_x11_64_debug + linux_x11_64_release + +However, if you are writing your custom modules or custom C++ code, you +might instead want to configure your binaries as custom export templates +here: + +.. image:: img/lintemplates.png + +You don't even need to copy them, you can just reference the resulting +files in the ``bin/`` directory of your Godot source folder, so the next +time you build, you automatically have the custom templates referenced. + +Using Clang and LLD for faster development +------------------------------------------ + +You can also use Clang and LLD to build Godot. This has two upsides compared to +the default GCC + GNU ld setup: + +- LLD links Godot significantly faster compared to GNU ld or gold. This leads to + faster iteration times. +- Clang tends to give more useful error messages compared to GCC. + +To do so, install Clang and the ``lld`` package from your distribution's package manager +then use the following SCons command:: + + scons platform=x11 use_llvm=yes use_lld=yes + +After the build is completed, a new binary with a ``.llvm`` suffix will be +created in the ``bin/`` folder. + +It's still recommended to use GCC for production builds as they can be compiled using +link-time optimization, making the resulting binaries smaller and faster. + +Using Pyston for faster development +----------------------------------- + +You can use `Pyston `__ to run SCons. Pyston is a JIT-enabled +implementation of the Python language (which SCons is written in). It is currently +only compatible with Linux. Pyston can speed up incremental builds significantly, +often by a factor between 1.5× and 2×. Pyston can be combined with Clang and LLD +to get even faster builds. + +- Download the `latest portable Pyston release `__. +- Extract the portable ``.tar.gz`` to a set location, such as ``$HOME/.local/opt/pyston/`` (create folders as needed). +- Use ``cd`` to reach the extracted Pyston folder from a terminal, + then run ``./pyston -m pip install scons`` to install SCons within Pyston. +- To make SCons via Pyston easier to run, create a symbolic link of its wrapper + script to a location in your ``PATH`` environment variable:: + + ln -s ~/.local/opt/pyston/bin/scons ~/.local/bin/pyston-scons + +- Instead of running ``scons ``, run ``pyston-scons `` + to compile Godot. + +If you can't run ``pyston-scons`` after creating the symbolic link, +make sure ``$HOME/.local/bin/`` is part of your user's ``PATH`` environment variable. diff --git a/development/compiling/compiling_with_mono.rst b/development/compiling/compiling_with_mono.rst new file mode 100644 index 0000000..8052ed8 --- /dev/null +++ b/development/compiling/compiling_with_mono.rst @@ -0,0 +1,387 @@ +.. _doc_compiling_with_mono: + +Compiling with Mono +=================== + +.. highlight:: shell + +Requirements +------------ + +- Mono 6.12.0 or greater +- MSBuild +- NuGet +- **On Linux/macOS only:** pkg-config + +You may need to import necessary certificates for NuGet to perform HTTPS +requests. + +The recommended method is to use **curl**'s CA (Certificate Authorities) certificate bundle. + +Run the following commands to download and import it. On Windows, you can run it +from the Mono command line prompt (or the regular prompt if you added Mono's +``bin`` directory to your ``PATH`` environment variable):: + + # If using PowerShell, replace `curl` with `curl.exe` below. + curl -LO https://curl.haxx.se/ca/cacert.pem + cert-sync --user cacert.pem + +Alternatively, you can use the following command, though it's deprecated and may not work correctly:: + + mozroots --import --sync + +Environment variables +--------------------- + +By default, SCons will try to find Mono in the Windows Registry on Windows or +via ``pkg-config`` on other platforms. You can specify a different installation +directory by passing the ``mono_prefix`` command-line option to SCons; e.g. +``scons [...] mono_prefix=%ProgramFiles%/Mono``. + +This is the directory that contains the subdirectories ``include`` and ``lib``. + +Enable the Mono module +---------------------- + +By default, the Mono module is disabled when building. To enable it, add the +option ``module_mono_enabled=yes`` to the SCons command line. + +Generate the glue +----------------- + +Glue sources are the wrapper functions that will be called by managed methods. +These source files must be generated before building your final binaries. In +order to generate them, first, you must build a temporary Godot binary with the +options ``tools=yes`` and ``mono_glue=no``:: + + scons p= tools=yes module_mono_enabled=yes mono_glue=no + +After the build finishes, you need to run the compiled executable with the +parameter ``--generate-mono-glue`` followed by the path to an output directory. +This path must be ``modules/mono/glue`` in the Godot directory:: + + --generate-mono-glue modules/mono/glue + +This command will tell Godot to generate the file ``modules/mono/glue/mono_glue.gen.cpp`` +and the C# solution for the Godot API at ``modules/mono/glue/Managed/Generated``. +Once these files are generated, you can build Godot for all the desired targets +without having to repeat this process. + +```` refers to the tools binary you compiled above with the Mono +module enabled. Its exact name will differ based on your system and +configuration, but should be of the form +``bin/godot..tools..mono``, e.g. ``bin/godot.x11.tools.64.mono`` +or ``bin/godot.windows.tools.64.mono.exe``. Be especially aware of the **.mono** +suffix! If you've previously compiled Godot without Mono support, you might have +similarly named binaries without this suffix. These binaries can't be used to +generate the Mono glue. + +Notes +^^^^^ + +- **Do not build your final binaries with** ``mono_glue=no``. + This disables C# scripting. This option must be used only for the temporary + binary that will generate the glue. Godot will print a warning at startup if + it was built without the glue sources. +- The glue sources must be regenerated every time the ClassDB-registered API + changes. That is, for example, when a new method is registered to the + scripting API or one of the parameters of such a method changes. + Godot will print an error at startup if there is an API mismatch + between ClassDB and the glue sources. + + +Rebuild with Mono glue +---------------------- + +Once you have generated the Mono glue, you can build the final binary with +``mono_glue=yes``. This is the default value for ``mono_glue``, so you can also +omit it. To build a Mono-enabled editor:: + + scons p= tools=yes module_mono_enabled=yes mono_glue=yes + +And Mono-enabled export templates:: + + scons p= tools=no module_mono_enabled=yes mono_glue=yes + +If everything went well, apart from the normal output, SCons should have created +the following files in the ``bin`` directory: + +- If you're not linking the Mono runtime statically, the build script will place + the Mono runtime shared library (``monosgen-2.0``) next to the Godot + binary in the output directory. Make sure to include this library when + distributing Godot. When targeting Android, no extra steps are required as + this library is automatically copied to ``#platform/android/java/libs`` and + Gradle takes care of the rest. +- Unlike "classical" Godot builds, when building with the Mono module enabled + (and depending on the target platform), a data directory may be created both + for the editor and for export templates. This directory is important for + proper functioning and must be distributed together with Godot. + More details about this directory in + :ref:`Data directory`. + +Examples +-------- + +Example (Windows) +^^^^^^^^^^^^^^^^^ + +:: + + # Build temporary binary + scons p=windows tools=yes module_mono_enabled=yes mono_glue=no + # Generate glue sources + bin\godot.windows.tools.64.mono --generate-mono-glue modules/mono/glue + + ### Build binaries normally + # Editor + scons p=windows target=release_debug tools=yes module_mono_enabled=yes + # Export templates + scons p=windows target=release_debug tools=no module_mono_enabled=yes + scons p=windows target=release tools=no module_mono_enabled=yes + +Example (X11) +^^^^^^^^^^^^^ + +:: + + # Build temporary binary + scons p=x11 tools=yes module_mono_enabled=yes mono_glue=no + # Generate glue sources + bin/godot.x11.tools.64.mono --generate-mono-glue modules/mono/glue + + ### Build binaries normally + # Editor + scons p=x11 target=release_debug tools=yes module_mono_enabled=yes + # Export templates + scons p=x11 target=release_debug tools=no module_mono_enabled=yes + scons p=x11 target=release tools=no module_mono_enabled=yes + +.. _compiling_with_mono_data_directory: + +Data directory +-------------- + +The data directory is a dependency for Godot binaries built with the Mono module +enabled. It contains important files for the correct functioning of Godot. It +must be distributed together with the Godot executable. + +.. note:: The information below doesn't apply for Android, iOS and WASM, + as there is no data directory for these platforms. + +Export templates +^^^^^^^^^^^^^^^^ + +The name of the data directory for an export template differs based on the +configuration it was built with. The format is +``data.mono...``, e.g. ``data.mono.x11.32.release_debug`` or +``data.mono.windows.64.release``. + +This directory must be placed with its original name next to the Godot export +templates. When exporting a project, Godot will also copy this directory with +the game executable but the name will be changed to ``data_``, where +```` is the application name as specified in the project setting +``application/config/name``. + +In the case of macOS, where the export template is compressed as a ZIP archive, +the contents of the data directory can be placed in the following locations +inside the ZIP archive: + ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Mono/lib`` | ``/osx_template.app/Contents/Frameworks/GodotSharp/Mono/lib`` | ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Mono/etc`` | ``/osx_template.app/Contents/Resources/GodotSharp/Mono/etc`` | ++-------------------------------------------------------+---------------------------------------------------------------+ + +Editor +^^^^^^ + +The name of the data directory for the Godot editor will always be +``GodotSharp``. The contents of this directory are the following: + +- ``Api`` +- ``Mono`` (optional) +- ``Tools`` + +The ``Api`` subdirectory contains the Godot API assemblies. On macOS, if the +Godot editor is distributed as a bundle, the contents of the data directory may +be placed in the following locations: + ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Api`` | ``.app/Contents/Frameworks/GodotSharp/Api`` | ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Mono/lib`` | ``.app/Contents/Frameworks/GodotSharp/Mono/lib`` | ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Mono/etc`` | ``.app/Contents/Resources/GodotSharp/Mono/etc`` | ++-------------------------------------------------------+---------------------------------------------------------------+ +| ``bin/data.mono.../Tools`` | ``.app/Contents/Frameworks/GodotSharp/Tools`` | ++-------------------------------------------------------+---------------------------------------------------------------+ + +The ``Mono`` subdirectory is optional. It will be needed when distributing the +editor, as issues can arise when the user-installed Mono version isn't identical +to the one the Godot editor was built with. Pass ``copy_mono_root=yes`` to SCons +when building the editor in order to create this folder and its contents. + +The ``Tools`` subdirectory contains tools required by the editor, like the +``GodotTools`` assemblies and its dependencies. + +Building the Mono runtime +------------------------- + +When building Godot for the desktop, you will likely use the pre-built Mono runtime +that is installed on your system. This likely won't be the case when targeting other +platforms like Android, iOS and WebAssembly. You will have to build the Mono runtime +yourself for those platforms. + +We recommend using these `build scripts `_. +They simplify this process but also include some patches needed +for proper functioning with Godot. See the README on the link above +for instructions on how to use the scripts. + +Targeting Android +----------------- + +Compiling the Android export templates with Mono is a bit simpler than it is for +the desktop platforms, as there are no additional steps required after building. +There is no need to worry about run-time dependencies like a data directory or +the shared library (when dynamically linking) as those are automatically added +to the Gradle project. + +Once you've built Mono, you can proceed to build Godot with the instructions +described in this page and the +:ref:`Compiling for Android` page. +Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: +``scons [...] mono_prefix="$HOME/mono-installs/android-armeabi-v7a-release"`` +(This path may be different on your system). + +Targeting iOS +------------- + +Once you've built Mono, you can proceed to build Godot with the instructions +described in this page and the +:ref:`Compiling for iOS` page. +Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: +``scons [...] mono_prefix="$HOME/mono-installs/ios-arm64-release"`` +(This path may be different on your system). + +After building Godot for each architecture, you will notice SCons has +copied the Mono libraries for each of them to the output directory: + +:: + + #bin/libmono-native.iphone..a + #bin/libmonosgen-2.0.iphone..a + #bin/libmonoprofiler-log.iphone..a + + #bin/libmono-ilgen.iphone..a + #bin/libmono-ee-interp.iphone..a + #bin/libmono-icall-table.iphone..a + +The last three are only for iOS devices and are not available for the iOS simulator. + +These libraries must be put in universal (multi-architecture) "fat" +files to be distributed with the export templates. + +The following bash script will create the "fat" libraries in the directory ``#bin/ios/iphone-mono-libs``: + +:: + + mkdir -p bin/ios + mkdir -p bin/ios/iphone-mono-libs + + lipo -create bin/libmonosgen-2.0.iphone.arm64.a bin/libmonosgen-2.0.iphone.x86_64.a -output bin/ios/iphone-mono-libs/libmonosgen-2.0.iphone.fat.a + lipo -create bin/libmono-native.iphone.arm64.a bin/libmono-native.iphone.x86_64.a -output bin/ios/iphone-mono-libs/libmono-native.iphone.fat.a + lipo -create bin/libmono-profiler-log.iphone.arm64.a bin/libmono-profiler-log.iphone.x86_64.a -output bin/ios/iphone-mono-libs/libmono-profiler-log.iphone.fat.a + + # The Mono libraries for the interpreter are not available for simulator builds + lipo -create bin/libmono-ee-interp.iphone.arm64.a -output bin/ios/iphone-mono-libs/libmono-ee-interp.iphone.fat.a + lipo -create bin/libmono-icall-table.iphone.arm64.a -output bin/ios/iphone-mono-libs/libmono-icall-table.iphone.fat.a + lipo -create bin/libmono-ilgen.iphone.arm64.a -output bin/ios/iphone-mono-libs/libmono-ilgen.iphone.fat.a + +The ``iphone-mono-libs`` folder must be distributed with the export templates. +The Godot editor will look for the libraries in ``/iphone-mono-libs/lib.iphone.fat.a``. + +Targeting WebAssembly +--------------------- + +Building for WebAssembly currently involves the same process regardless of whether the Mono module is enabled. + +Once you've built Mono, you can proceed to build Godot with the instructions +described in this page and the +:ref:`Compiling for the Web` page. +Make sure to let SCons know about the location of the Mono runtime you've just built, e.g.: +``scons [...] mono_prefix="$HOME/mono-installs/wasm-runtime-release"`` +(This path may be different on your system). + +Base Class Library +------------------ + +The export templates must also include the BCL (Base Class Library) for each target platform. +Godot looks for the BCL folder at ``/bcl/``, +where ```` is the same name passed to the SCons ``platform`` option, +e.g.: ``/bcl/windows``, ``/bcl/javascript``. + +Alternatively, Godot will look for them in the following locations: + ++-------------------+---------------------------------+ +| Android | ``/bcl/monodroid`` | ++-------------------+---------------------------------+ +| iOS | ``/bcl/monotouch`` | ++-------------------+---------------------------------+ +| WebAssembly | ``/bcl/wasm`` | ++-------------------+---------------------------------+ +| Linux and macOS | ``/bcl/net_4_x`` | ++-------------------+---------------------------------+ +| Windows | ``/bcl/net_4_x_win`` | ++-------------------+---------------------------------+ + +As of now, we're assuming the same BCL profile can be used for both Linux and macOS, +but this may change in the future as they're not guaranteed to be the same +(as is the case with the Windows BCL). + +If the target platform is the same as the platform of the Godot editor, +then the editor will use the BCL it's running on (``/Mono/lib/mono/4.5``) +if it cannot find the BCL in the export templates. + +AOT cross-compilers +------------------- + +To perform ahead-of-time (AOT) compilation for other platforms, Godot needs to have +access to the Mono cross-compilers for that platform and architecture. + +Godot will look for the cross-compiler executable in the AOT compilers folder. +The location of this folder is ``/Tools/aot-compilers/``. + +In order to build the cross-compilers we recommend using these +`build scripts `_. + +After building them, copy the executable to the Godot AOT compilers directory. The +executable name is ``-mono-sgen``, e.g.: ``aarch64-apple-darwin-mono-sgen``. + +Command-line options +-------------------- + +The following is the list of command-line options available when building with +the Mono module: + +- **module_mono_enabled**\ =yes | **no** + + - Build Godot with the Mono module enabled. + +- **mono_glue**\ =\ **yes** | no + + - Whether to include the glue source files in the build + and define ``MONO_GLUE_DISABLED`` as a preprocessor macro. + +- **mono_prefix**\ =path + + - Path to the Mono installation directory for the target platform and architecture. + +- **mono_static**\ =yes | no + + - Whether to link the Mono runtime statically. + - The default is **yes** for iOS and WASM, and **no** for other platforms. + +- **copy_mono_root**\ =yes | **no** + + - Whether to copy the Mono framework assemblies + and configuration files required by the Godot editor. diff --git a/development/compiling/compiling_with_script_encryption_key.rst b/development/compiling/compiling_with_script_encryption_key.rst new file mode 100644 index 0000000..b16fc9a --- /dev/null +++ b/development/compiling/compiling_with_script_encryption_key.rst @@ -0,0 +1,91 @@ +.. _doc_compiling_with_script_encryption_key: + +Compiling with script encryption key +==================================== + +.. highlight:: shell + +The export dialog gives you the option to encrypt your scripts with an 256bit +AES key, when releasing your game. This will make sure your scripts are not +stored in plain text and can not easily be ripped by some script kiddie. +Of course the key needs to be stored in the binary, but if it's compiled, +optimized and without symbols, it would take some effort to find it. + +For this to work, you need to build the export templates from source, +with that same key. + +Step by step +------------ + +1. Generate a 256bit AES key in HEX. You can use the aes-256-cbc variant from + `this service `_. + + Alternatively, you can generate it yourself by using OpenSSL: + + :: + + openssl rand -hex 32 > godot.gdkey + + The output in ``godot.gdkey`` should be similar to: + + :: + + aeb1bc56aaf580cc31784e9c41551e9ed976ecba10d315db591e749f3f64890f + + You can generate the key without redirecting the output to a file, but + that way you can minimize the risk of exposing the key. + +2. Set this key as environment variable in the console that you will use to + compile Godot, like this: + + .. tabs:: + .. code-tab:: bash Linux/macOS + + export SCRIPT_AES256_ENCRYPTION_KEY="your_generated_key" + + .. code-tab:: bat Windows (cmd) + + set SCRIPT_AES256_ENCRYPTION_KEY=your_generated_key + + .. code-tab:: bat Windows (PowerShell) + + $env:SCRIPT_AES256_ENCRYPTION_KEY="your_generated_key" + +3. Compile Godot export templates and set them as custom export templates + in the export preset options. + +4. Set the encryption key in the ``Script`` tab of the export preset: + + .. image:: img/script_encryption_key.png + +5. Export the project. The game should run with encrypted scripts now. + +Possible Errors +--------------- + +If you get an error like below, it means the key wasn't properly included in +your Godot build. Godot is encrypting the scripts during export, but can't read +them at runtime. + +:: + + ERROR: open_and_parse: Condition "String::md5(md5.digest) != String::md5(md5d)" is true. Returning: ERR_FILE_CORRUPT + At: core/io/file_access_encrypted.cpp:103 + ERROR: load_byte_code: Condition ' err ' is true. returned: err + At: modules/gdscript/gdscript.cpp:755 + ERROR: load: Condition ' err != OK ' is true. returned: RES() + At: modules/gdscript/gdscript.cpp:2135 + ERROR: Failed loading resource: res://Node2D.gde + At: core/io/resource_loader.cpp:279 + ERROR: poll: res://Node2D.tscn:3 - Parse Error: [ext_resource] referenced nonexistent resource at: res://Node2D.gd + At: scene/resources/scene_format_text.cpp:439 + ERROR: load: Condition ' err != OK ' is true. returned: RES() + At: core/io/resource_loader.cpp:202 + ERROR: Failed loading resource: res://Node2D.tscn + At: core/io/resource_loader.cpp:279 + ERROR: Failed loading scene: res://Node2D.tscn + At: main/main.cpp:1727 + WARNING: cleanup: ObjectDB Instances still exist! + At: core/object.cpp:2081 + ERROR: clear: Resources Still in use at Exit! + At: core/resource.cpp:425 diff --git a/development/compiling/cross-compiling_for_ios_on_linux.rst b/development/compiling/cross-compiling_for_ios_on_linux.rst new file mode 100644 index 0000000..df219e6 --- /dev/null +++ b/development/compiling/cross-compiling_for_ios_on_linux.rst @@ -0,0 +1,162 @@ +.. _doc_cross-compiling_for_ios_on_linux: + +Cross-compiling for iOS on Linux +================================ + +.. highlight:: shell + +The procedure for this is somewhat complex and requires a lot of steps, +but once you have the environment properly configured it will be easy to +compile Godot for iOS anytime you want. + +Disclaimer +---------- + +While it is possible to compile for iOS on a Linux environment, Apple is +very restrictive about the tools to be used (especially hardware-wise), +allowing pretty much only their products to be used for development. So +this is **not official**. However, a `statement from Apple in 2010 +`__ +says they relaxed some of the `App Store review guidelines +`__ +to allow any tool to be used, as long as the resulting binary does not +download any code, which means it should be OK to use the procedure +described here and cross-compiling the binary. + +Requirements +------------ + +- `XCode with the iOS SDK `__ + (a dmg image) +- `Clang >= 3.5 `__ for your development + machine installed and in the ``PATH``. It has to be version >= 3.5 + to target ``arm64`` architecture. +- `Fuse `__ for mounting and umounting + the dmg image. +- `darling-dmg `__, which + needs to be built from source. The procedure for that is explained + below. + + - For building darling-dmg, you'll need the development packages of + the following libraries: fuse, icu, openssl, zlib, bzip2. + +- `cctools-port `__ + for the needed build tools. The procedure for building is quite + peculiar and is described below. + + - This also has some extra dependencies: automake, autogen, libtool. + +Configuring the environment +--------------------------- + +darling-dmg +~~~~~~~~~~~ + +Clone the repository on your machine: + +:: + + $ git clone https://github.com/darlinghq/darling-dmg.git + +Build it: + +:: + + $ cd darling-dmg + $ mkdir build + $ cd build + $ cmake .. -DCMAKE_BUILD_TYPE=Release + $ make -j 4 # The number is the amount of cores your processor has, for faster build + $ cd ../.. + +Preparing the SDK +~~~~~~~~~~~~~~~~~ + +Mount the XCode image: + +:: + + $ mkdir xcode + $ ./darling-dmg/build/darling-dmg /path/to/Xcode_7.1.1.dmg xcode + [...] + Everything looks OK, disk mounted + +Extract the iOS SDK: + +:: + + $ mkdir -p iPhoneSDK/iPhoneOS9.1.sdk + $ cp -r xcode/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/* iPhoneSDK/iPhoneOS9.1.sdk + $ cp -r xcode/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/* iPhoneSDK/iPhoneOS9.1.sdk/usr/include/c++ + $ fusermount -u xcode # unmount the image + +Pack the SDK: + +:: + + $ cd iPhoneSDK + $ tar -cf - * | xz -9 -c - > iPhoneOS9.1.sdk.tar.xz + +Toolchain +~~~~~~~~~ + +Build cctools: + +:: + + $ git clone https://github.com/tpoechtrager/cctools-port.git + $ cd cctools-port/usage_examples/ios_toolchain + $ ./build.sh /path/iPhoneOS9.1.sdk.tar.xz arm64 + +Copy the tools to a nicer place. Note that the SCons scripts for +building will look under ``usr/bin`` inside the directory you provide +for the toolchain binaries, so you must copy to such subdirectory, akin +to the following commands: + +:: + + $ mkdir -p /home/user/iostoolchain/usr + $ cp -r target/bin /home/user/iostoolchain/usr/ + +Now you should have the iOS toolchain binaries in +``/home/user/iostoolchain/usr/bin``. + +Compiling Godot for iPhone +-------------------------- + +Once you've done the above steps, you should keep two things in your +environment: the built toolchain and the iPhoneOS SDK directory. Those +can stay anywhere you want since you have to provide their paths to the +SCons build command. + +For the iPhone platform to be detected, you need the ``OSXCROSS_IOS`` +environment variable defined to anything. + +:: + + $ export OSXCROSS_IOS=anything + +Now you can compile for iPhone using SCons like the standard Godot +way, with some additional arguments to provide the correct paths: + +:: + + $ scons -j 4 platform=iphone arch=arm target=release_debug IPHONESDK="/path/to/iPhoneSDK" IPHONEPATH="/path/to/iostoolchain" ios_triple="arm-apple-darwin11-" + $ scons -j 4 platform=iphone arch=arm64 target=release_debug IPHONESDK="/path/to/iPhoneSDK" IPHONEPATH="/path/to/iostoolchain" ios_triple="arm-apple-darwin11-" + +Producing fat binaries +~~~~~~~~~~~~~~~~~~~~~~ + +Apple requires a fat binary with both architectures (``armv7`` and +``arm64``) in a single file. To do this, use the +``arm-apple-darwin11-lipo`` executable. The following example assumes +you are in the root Godot source directory: + +:: + + $ /path/to/iostoolchain/usr/bin/arm-apple-darwin11-lipo -create bin/libgodot.iphone.opt.debug.arm.a bin/libgodot.iphone.opt.debug.arm64.a -output bin/libgodot.iphone.debug.fat.a + $ /path/to/iostoolchain/usr/bin/arm-apple-darwin11-lipo -create bin/libgodot_camera_module.iphone.opt.debug.arm.a bin/libgodot_camera_module.iphone.opt.debug.arm64.a -output bin/libgodot_camera_module.iphone.debug.fat.a + $ /path/to/iostoolchain/usr/bin/arm-apple-darwin11-lipo -create bin/libgodot_arkit_module.iphone.opt.debug.arm.a bin/libgodot_arkit_module.iphone.opt.debug.arm64.a -output bin/libgodot_arkit_module.iphone.debug.fat.a + + +Then you will have iOS fat binaries in ``bin`` directory. diff --git a/development/compiling/getting_source.rst b/development/compiling/getting_source.rst new file mode 100644 index 0000000..36e4e42 --- /dev/null +++ b/development/compiling/getting_source.rst @@ -0,0 +1,54 @@ +.. _doc_getting_source: + +Getting the source +================== + +.. highlight:: shell + +Downloading the Godot source code +--------------------------------- + +Before :ref:`getting into the SCons build system ` +and compiling Godot, you need to actually download the Godot source code. + +The source code is available on `GitHub `__ +and while you can manually download it via the website, in general you want to +do it via the ``git`` version control system. + +If you are compiling in order to make contributions or pull requests, you should +follow the instructions from the :ref:`Pull Request workflow `. + +If you don't know much about ``git`` yet, there are a great number of +`tutorials `__ available on various websites. + +In general, you need to install ``git`` and/or one of the various GUI clients. + +Afterwards, to get the latest development version of the Godot source code +(the unstable ``master`` branch), you can use ``git clone``. + +If you are using the ``git`` command line client, this is done by entering +the following in a terminal: + +:: + + git clone https://github.com/godotengine/godot.git + # You can add the --depth 1 argument to omit the commit history. + # Faster, but not all Git operations (like blame) will work. + +For any stable release, visit the `release page `__ +and click on the link for the release you want. +You can then download and extract the source from the download link on the page. + +With ``git``, you can also clone a stable release by specifying its branch or tag +after the ``--branch`` (or just ``-b``) argument:: + + # Clone the continuously maintained stable branch (`3.x` as of writing). + git clone https://github.com/godotengine/godot.git -b 3.x + + # Clone the `3.2.3-stable` tag. This is a fixed revision that will never change. + git clone https://github.com/godotengine/godot.git -b 3.2.3-stable + +There are also generally branches besides ``master`` for each major version. + +After downloading the Godot source code, +you can :ref:`continue to compiling Godot `. diff --git a/development/compiling/img/andtemplates.png b/development/compiling/img/andtemplates.png new file mode 100644 index 0000000..3732444 Binary files /dev/null and b/development/compiling/img/andtemplates.png differ diff --git a/development/compiling/img/lintemplates.png b/development/compiling/img/lintemplates.png new file mode 100644 index 0000000..5581a3e Binary files /dev/null and b/development/compiling/img/lintemplates.png differ diff --git a/development/compiling/img/script_encryption_key.png b/development/compiling/img/script_encryption_key.png new file mode 100644 index 0000000..e739a0f Binary files /dev/null and b/development/compiling/img/script_encryption_key.png differ diff --git a/development/compiling/img/wintemplates.png b/development/compiling/img/wintemplates.png new file mode 100644 index 0000000..b0e6763 Binary files /dev/null and b/development/compiling/img/wintemplates.png differ diff --git a/development/compiling/index.rst b/development/compiling/index.rst new file mode 100644 index 0000000..6b52563 --- /dev/null +++ b/development/compiling/index.rst @@ -0,0 +1,20 @@ +Compiling +========= + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-compiling + + getting_source + introduction_to_the_buildsystem + compiling_for_windows + compiling_for_x11 + compiling_for_osx + compiling_for_android + compiling_for_ios + cross-compiling_for_ios_on_linux + compiling_for_uwp + compiling_for_web + compiling_with_mono + optimizing_for_size + compiling_with_script_encryption_key diff --git a/development/compiling/introduction_to_the_buildsystem.rst b/development/compiling/introduction_to_the_buildsystem.rst new file mode 100644 index 0000000..082b201 --- /dev/null +++ b/development/compiling/introduction_to_the_buildsystem.rst @@ -0,0 +1,359 @@ +.. _doc_introduction_to_the_buildsystem: + +Introduction to the buildsystem +=============================== + +.. highlight:: shell + +SCons +----- + +Godot uses `SCons `__ to build. We love it, we are +not changing it for anything else. We are not even sure other build +systems are up to the task of building Godot. We constantly get requests +to move the build system to CMake, or Visual Studio, but this is not +going to happen. There are many reasons why we have chosen SCons over +other alternatives, for example: + +- Godot can be compiled for a dozen different platforms: all PC + platforms, all mobile platforms, many consoles, and WebAssembly. +- Developers often need to compile for several of the platforms **at + the same time**, or even different targets of the same platform. They + can't afford reconfiguring and rebuilding the project each time. + SCons can do this with no sweat, without breaking the builds. +- SCons will *never* break a build no matter how many changes, + configurations, additions, removals etc. You have more chances to die + struck by lightning than needing to clean and rebuild in SCons. +- Godot build process is not simple. Several files are generated by + code (binders), others are parsed (shaders), and others need to offer + customization (plugins). This requires complex logic which is easier + to write in an actual programming language (like Python) rather than + using a mostly macro-based language only meant for building. +- Godot build process makes heavy use of cross-compiling tools. Each + platform has a specific detection process, and all these must be + handled as specific cases with special code written for each. + +So, please try to keep an open mind and get at least a little familiar with it +if you are planning to build Godot yourself. + +Setup +----- + +Please refer to the documentation for :ref:`doc_compiling_for_android`, +:ref:`doc_compiling_for_ios`, :ref:`doc_compiling_for_osx`, +:ref:`doc_compiling_for_uwp`, :ref:`doc_compiling_for_web`, +:ref:`doc_compiling_for_windows` and :ref:`doc_compiling_for_x11`. + +Note that for **Windows/Visual Studio**, you need to use ``x86_x64 Cross Tools +Command Prompt for VS 2017`` or similar, depending on your install, instead of +the standard Windows command prompt to enter the commands below. + +Platform selection +------------------ + +Godot's build system will begin by detecting the platforms it can build +for. If not detected, the platform will simply not appear on the list of +available platforms. The build requirements for each platform are +described in the rest of this tutorial section. + +SCons is invoked by just calling ``scons``. If no platform is specified, +SCons will detect the target platform automatically based on the host platform. +It will then start building for the target platform right away. + +To list the available target platforms, use ``scons platform=list``:: + + scons platform=list + scons: Reading SConscript files ... + The following platforms are available: + + android + javascript + server + windows + x11 + + Please run SCons again and select a valid platform: platform= + +To build for a platform (for example, x11), run with the ``platform=`` (or +``p=`` to make it short) argument: + +:: + + scons platform=x11 + +This will start the build process, which will take a while. If you want +SCons to build faster, use the ``-j `` parameter to specify how many +cores will be used for the build. Or leave it using one core, so you +can use your computer for something else :) + +Example for using 4 cores: + +:: + + scons platform=x11 -j 4 + +Resulting binary +---------------- + +The resulting binaries will be placed in the ``bin/`` subdirectory, +generally with this naming convention:: + + godot..[opt].[tools/debug].[extension] + +For the previous build attempt, the result would look like this:: + + ls bin + bin/godot.x11.tools.64 + +This means that the binary is for X11, is not optimized, has tools (the +whole editor) compiled in, and is meant for 64 bits. + +A Windows binary with the same configuration will look like this: + +.. code-block:: console + + C:\godot> dir bin/ + godot.windows.tools.64.exe + +Copy that binary to any location you like, as it contains the project manager, +editor and all means to execute the game. However, it lacks the data to export +it to the different platforms. For that the export templates are needed (which +can be either downloaded from `godotengine.org `__, or +you can build them yourself). + +Aside from that, there are a few standard options that can be set in all +build targets, and which will be explained below. + +.. _doc_introduction_to_the_buildsystem_tools: + +Tools +----- + +Tools are enabled by default in all PC targets (Linux, Windows, macOS), +disabled for everything else. Disabling tools produces a binary that can +run projects but that does not include the editor or the project +manager. + +:: + + scons platform= tools=yes/no + +.. _doc_introduction_to_the_buildsystem_target: + +Target +------ + +Target controls optimization and debug flags. Each mode means: + +- **debug**: Build with C++ debugging symbols, runtime checks (performs + checks and reports error) and none to little optimization. +- **release_debug**: Build without C++ debugging symbols and + optimization, but keep the runtime checks (performs checks and + reports errors). Official editor binaries use this configuration. +- **release**: Build without symbols, with optimization and with little + to no runtime checks. This target can't be used together with + ``tools=yes``, as the editor requires some debug functionality and run-time + checks to run. + +:: + + scons platform= target=debug/release_debug/release + +This flag appends the ``.debug`` suffix (for debug), or ``.tools`` (for debug +with tools enabled). When optimization is enabled (release), it appends +the ``.opt`` suffix. + +Bits +---- + +Bits is meant to control the CPU or OS version intended to run the +binaries. It is focused mostly on desktop platforms and ignored everywhere +else. + +- **32**: Build binaries for 32-bit platforms. +- **64**: Build binaries for 64-bit platforms. +- **default**: Build for the architecture that matches the host platform. + +:: + + scons platform= bits=default/32/64 + +This flag appends ``.32`` or ``.64`` suffixes to resulting binaries when +relevant. If ``bits=default`` is used, the suffix will match the detected +architecture. + +.. _doc_buildsystem_custom_modules: + +Custom modules +-------------- + +It's possible to compile modules residing outside of Godot's directory +tree, along with the built-in modules. + +A ``custom_modules`` build option can be passed to the command line before +compiling. The option represents a comma-separated list of directory paths +containing a collection of independent C++ modules that can be seen as C++ +packages, just like the built-in ``modules/`` directory. + +For instance, it's possible to provide both relative, absolute, and user +directory paths containing such modules: + +:: + + scons custom_modules="../modules,/abs/path/to/modules,~/src/godot_modules" + +.. note:: + + If there's any custom module with the exact directory name as a built-in + module, the engine will only compile the custom one. This logic can be used + to override built-in module implementations. + +.. seealso:: + + :ref:`doc_custom_modules_in_c++` + +Cleaning generated files +------------------------ + +Sometimes, you may encounter an error due to generated files being present. You +can remove them by using ``scons --clean ``, where ```` is the +list of build options you've used to build Godot previously. + +Alternatively, you can use ``git clean -fixd`` which will clean build artifacts +for all platforms and configurations. Beware, as this will remove all untracked +and ignored files in the repository. Don't run this command if you have +uncommitted work! + +Other build options +------------------- + +There are several other build options that you can use to configure the +way Godot should be built (compiler, debug options, etc.) as well as the +features to include/disable. + +Check the output of ``scons --help`` for details about each option for +the version you are willing to compile. + +.. _doc_overriding_build_options: + +Overriding the build options +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Using a file +^^^^^^^^^^^^ + +The default ``custom.py`` file can be created at the root of the Godot Engine +source to initialize any SCons build options passed via the command line: + +.. code-block:: python + + # custom.py + + optimize = "size" + module_mono_enabled = "yes" + use_llvm = "yes" + extra_suffix = "game_title" + +You can also disable some of the builtin modules before compiling, saving some +time it takes to build the engine. See :ref:`doc_optimizing_for_size` page for more details. + +.. seealso:: + + You can use the online + `Godot build options generator `__ + to generate a ``custom.py`` file containing SCons options. + You can then save this file and place it at the root of your Godot source directory. + +Another custom file can be specified explicitly with the ``profile`` command +line option, both overriding the default build configuration: + +.. code-block:: shell + + scons profile=path/to/custom.py + +.. note:: Build options set from the file can be overridden by the command line + options. + +It's also possible to override the options conditionally: + +.. code-block:: python + + # custom.py + + import version + + # Override options specific for Godot 3.x and 4.x versions. + if version.major == 3: + pass + elif version.major == 4: + pass + +Using the SCONSFLAGS +^^^^^^^^^^^^^^^^^^^^ + +``SCONSFLAGS`` is an environment variable which is used by the SCons to set the +options automatically without having to supply them via the command line. + +For instance, you may want to build Godot in parallel with the aforementioned +``-j`` option for all the future builds: + +.. tabs:: + .. code-tab:: bash Linux/macOS + + export SCONSFLAGS="-j4" + + .. code-tab:: bat Windows (cmd) + + set SCONSFLAGS=-j4 + + .. code-tab:: powershell Windows (powershell) + + $env:SCONSFLAGS="-j4" + +Export templates +---------------- + +Official export templates are downloaded from the Godot Engine site: +`godotengine.org `__. However, you might want +to build them yourself (in case you want newer ones, you are using custom +modules, or simply don't trust your own shadow). + +If you download the official export templates package and unzip it, you +will notice that most files are optimized binaries or packages for each +platform: + +.. code-block:: none + + android_debug.apk + android_release.apk + webassembly_debug.zip + webassembly_release.zip + linux_server_32 + linux_server_64 + linux_x11_32_debug + linux_x11_32_release + linux_x11_64_debug + linux_x11_64_release + osx.zip + version.txt + windows_32_debug.exe + windows_32_release.exe + windows_64_debug.exe + windows_64_release.exe + +To create those yourself, follow the instructions detailed for each +platform in this same tutorial section. Each platform explains how to +create its own template. + +The ``version.txt`` file should contain the corresponding Godot version +identifier. This file is used to install export templates in a version-specific +directory to avoid conflicts. For instance, if you are building export templates +for Godot 3.1.1, ``version.txt`` should contain ``3.1.1.stable`` on the first +line (and nothing else). This version identifier is based on the ``major``, +``minor``, ``patch`` (if present) and ``status`` lines of the +`version.py file in the Godot Git repository `__. + +If you are developing for multiple platforms, macOS is definitely the most +convenient host platform for cross-compilation, since you can cross-compile for +almost every target (except for UWP). Linux and Windows come in second place, +but Linux has the advantage of being the easier platform to set this up. diff --git a/development/compiling/optimizing_for_size.rst b/development/compiling/optimizing_for_size.rst new file mode 100644 index 0000000..113d04e --- /dev/null +++ b/development/compiling/optimizing_for_size.rst @@ -0,0 +1,218 @@ +.. _doc_optimizing_for_size: + +Optimizing a build for size +=========================== + +.. highlight:: shell + +Rationale +--------- + +Sometimes, it is desired to optimize a build for size rather than speed. +This means not compiling unused functions from the engine, as well as using +specific compiler flags to aid on decreasing build size. +Common situations include creating builds for mobile and Web platforms. + +This tutorial aims to give an overview on different methods to create +a smaller binary. Before continuing, it is recommended to read the previous tutorials +on compiling Godot for each platform. + +The options below are listed from the most important (greatest size savings) +to the least important (lowest size savings). + +Stripping binaries +------------------ + +- **Space savings:** Very high +- **Difficulty:** Easy +- **Performed in official builds:** Yes + +If you build Windows (MinGW), Linux or macOS binaries from source, remember to +strip debug symbols from binaries by installing the ``strip`` package from your +distribution then running: + +:: + + strip path/to/godot.binary + +On Windows, ``strip.exe`` is included in most MinGW toolchain setups. + +This will reduce the size of compiled binaries by a factor between 5× and 10×. +The downside is that crash backtraces will no longer provide accurate information +(which is useful for troubleshooting the cause of a crash). +:ref:`C++ profilers ` will also no longer be able to display +function names (this does not affect the built-in GDScript profiler). + +.. note:: + + The above command will not work on Windows binaries compiled with MSVC + and platforms such as Android and HTML5. Instead, pass ``debug_symbols=no`` + on the SCons command line when compiling. + +Optimizing for size instead of speed +------------------------------------ + +- **Space savings:** High +- **Difficulty:** Easy +- **Performed in official builds:** Yes, but only for HTML5 + +Godot 3.1 onwards allows compiling using size optimizations (instead of speed). +To enable this, set the ``optimize`` flag to ``size``: + +:: + + scons p=windows target=release tools=no optimize=size + +Some platforms such as WebAssembly already use this mode by default. + +Compiling with link-time optimization +------------------------------------- + +- **Space savings:** High +- **Difficulty:** Easy +- **Performed in official builds:** Yes + +Enabling link-time optimization produces more efficient binaries, both in +terms of performance and file size. It works by eliminating duplicate +template functions and unused code. It can currently be used with the GCC +and MSVC compilers: + +:: + + scons p=windows target=release tools=no use_lto=yes + +Linking becomes much slower and more RAM-consuming with this option, +so it should be used only for release builds: + +- When compiling the ``master`` branch, you need to have at least 8 GB of RAM + available for successful linking with LTO enabled. +- When compiling the ``3.x`` branch, you need to have at least 6 GB of RAM + available for successful linking with LTO enabled. + +Disabling 3D +------------ + +- **Space savings:** Moderate +- **Difficulty:** Easy +- **Performed in official builds:** No + +For 2D games, having the whole 3D engine available usually makes no sense. Because of this, there is a build flag to disable it: + +:: + + scons p=windows target=release tools=no disable_3d=yes + +Tools must be disabled in order to use this flag, as the editor is not designed +to operate without 3D support. Without it, the binary size can be reduced +by about 15%. + +Disabling advanced GUI objects +------------------------------ + +- **Space savings:** Moderate +- **Difficulty:** Easy +- **Performed in official builds:** No + +Most small games don't require complex GUI controls such as Tree, ItemList, +TextEdit or GraphEdit. They can be disabled using a build flag: + +:: + + scons p=windows target=release tools=no disable_advanced_gui=yes + +This is everything that will be disabled: + +- FileDialog +- PopupMenu +- Tree +- TextEdit +- TreeItem +- OptionButton +- SpinBox +- ColorPicker +- ColorPickerButton +- RichTextLabel +- RichTextEffect +- CharFXTransform +- PopupDialog +- WindowDialog +- AcceptDialog +- ConfirmationDialog +- MarginContainer +- ViewportContainer +- SplitContainer +- HSplitContainer +- GraphNode +- GraphEdit + +Disabling unwanted modules +-------------------------- + +- **Space savings:** Very low to moderate depending on modules +- **Difficulty:** Medium to hard depending on modules +- **Performed in official builds:** No + +A lot of Godot's functions are offered as modules. +You can see a list of modules with the following command: + +:: + + scons --help + +The list of modules that can be disabled will appear, together with all +build options. If you are working on a simple 2D game, you could disable +a lot of them: + +:: + + scons p=windows target=release tools=no module_arkit_enabled=no module_assimp_enabled=no module_bmp_enabled=no module_bullet_enabled=no module_camera_enabled=no module_csg_enabled=no module_dds_enabled=no module_enet_enabled=no module_etc_enabled=no module_gdnative_enabled=no module_gridmap_enabled=no module_hdr_enabled=no module_jsonrpc_enabled=no module_mbedtls_enabled=no module_mobile_vr_enabled=no module_opensimplex_enabled=no module_opus_enabled=no module_pvr_enabled=no module_recast_enabled=no module_regex_enabled=no module_squish_enabled=no module_svg_enabled=no module_tga_enabled=no module_theora_enabled=no module_tinyexr_enabled=no module_upnp_enabled=no module_vhacd_enabled=no module_vorbis_enabled=no module_webm_enabled=no module_webrtc_enabled=no module_websocket_enabled=no module_xatlas_unwrap_enabled=no + +If this proves not to work for your use case, you should review the list of +modules and see which ones you actually still need for your game (e.g. you +might want to keep networking-related modules, regex support, or theora/webm +to play videos). + +Alternatively, you can supply a list of disabled modules by creating +``custom.py`` at the root of the source, with the contents similar to the +following: + +.. code-block:: python + + # custom.py + + module_arkit_enabled = "no" + module_assimp_enabled = "no" + module_bmp_enabled = "no" + module_bullet_enabled = "no" + module_camera_enabled = "no" + module_csg_enabled = "no" + module_dds_enabled = "no" + module_enet_enabled = "no" + module_etc_enabled = "no" + module_gdnative_enabled = "no" + module_gridmap_enabled = "no" + module_hdr_enabled = "no" + module_jsonrpc_enabled = "no" + module_mbedtls_enabled = "no" + module_mobile_vr_enabled = "no" + module_opensimplex_enabled = "no" + module_opus_enabled = "no" + module_pvr_enabled = "no" + module_recast_enabled = "no" + module_regex_enabled = "no" + module_squish_enabled = "no" + module_svg_enabled = "no" + module_tga_enabled = "no" + module_theora_enabled = "no" + module_tinyexr_enabled = "no" + module_upnp_enabled = "no" + module_vhacd_enabled = "no" + module_vorbis_enabled = "no" + module_webm_enabled = "no" + module_webrtc_enabled = "no" + module_websocket_enabled = "no" + module_xatlas_unwrap_enabled = "no" + +.. seealso:: + + :ref:`doc_overriding_build_options`. diff --git a/development/cpp/binding_to_external_libraries.rst b/development/cpp/binding_to_external_libraries.rst new file mode 100644 index 0000000..9025a8b --- /dev/null +++ b/development/cpp/binding_to_external_libraries.rst @@ -0,0 +1,228 @@ +.. _doc_binding_to_external_libraries: + +Binding to external libraries +============================= + +Modules +------- + +The Summator example in :ref:`doc_custom_modules_in_c++` is great for small, +custom modules, but what if you want to use a larger, external library? +Let's look at an example using `Festival `_, +a speech synthesis (text-to-speech) library written in C++. + +To bind to an external library, set up a module directory similar to the Summator example: + +.. code-block:: none + + godot/modules/tts/ + +Next, you will create a header file with a simple TTS class: + +.. code-block:: cpp + + /* tts.h */ + + #ifndef GODOT_TTS_H + #define GODOT_TTS_H + + #include "core/reference.h" + + class TTS : public Reference { + GDCLASS(TTS, Reference); + + protected: + static void _bind_methods(); + + public: + bool say_text(String p_txt); + + TTS(); + }; + + #endif // GODOT_TTS_H + +And then you'll add the cpp file. + +.. code-block:: cpp + + /* tts.cpp */ + + #include "tts.h" + + #include + + bool TTS::say_text(String p_txt) { + + //convert Godot String to Godot CharString to C string + return festival_say_text(p_txt.ascii().get_data()); + } + + void TTS::_bind_methods() { + + ClassDB::bind_method(D_METHOD("say_text", "txt"), &TTS::say_text); + } + + TTS::TTS() { + festival_initialize(true, 210000); //not the best way to do it as this should only ever be called once. + } + +Just as before, the new class needs to be registered somehow, so two more files +need to be created: + +.. code-block:: none + + register_types.h + register_types.cpp + +.. important:: + These files must be in the top-level folder of your module (next to your + ``SCsub`` and ``config.py`` files) for the module to be registered properly. + +These files should contain the following: + +.. code-block:: cpp + + /* register_types.h */ + + void register_tts_types(); + void unregister_tts_types(); + /* yes, the word in the middle must be the same as the module folder name */ + +.. code-block:: cpp + + /* register_types.cpp */ + + #include "register_types.h" + + #include "core/class_db.h" + #include "tts.h" + + void register_tts_types() { + ClassDB::register_class(); + } + + void unregister_tts_types() { + // Nothing to do here in this example. + } + +Next, you need to create a ``SCsub`` file so the build system compiles +this module: + +.. code-block:: python + + # SCsub + + Import('env') + + env_tts = env.Clone() + env_tts.add_source_files(env.modules_sources, "*.cpp") # Add all cpp files to the build + +You'll need to install the external library on your machine to get the .a library files. See the library's official +documentation for specific instructions on how to do this for your operation system. We've included the +installation commands for Linux below, for reference. + +.. code-block:: shell + + sudo apt-get install festival festival-dev <-- Installs festival and speech_tools libraries + apt-cache search festvox-* <-- Displays list of voice packages + sudo apt-get install festvox-don festvox-rablpc16k festvox-kallpc16k festvox-kdlpc16k <-- Installs voices + +.. important:: + The voices that Festival uses (and any other potential external/3rd-party + resource) all have varying licenses and terms of use; some (if not most) of them may be + be problematic with Godot, even if the Festival Library itself is MIT License compatible. + Please be sure to check the licenses and terms of use. + +The external library will also need to be installed inside your module to make the source +files accessible to the compiler, while also keeping the module code self-contained. The +festival and speech_tools libraries can be installed from the modules/tts/ directory via +git using the following commands: + +.. code-block:: shell + + git clone https://github.com/festvox/festival + git clone https://github.com/festvox/speech_tools + +If you don't want the external repository source files committed to your repository, you +can link to them instead by adding them as submodules (from within the modules/tts/ directory), as seen below: + +.. code-block:: shell + + git submodule add https://github.com/festvox/festival + git submodule add https://github.com/festvox/speech_tools + +.. important:: + Please note that Git submodules are not used in the Godot repository. If + you are developing a module to be merged into the main Godot repository, you should not + use submodules. If your module doesn't get merged in, you can always try to implement + the external library as a GDNative C++ plugin. + +To add include directories for the compiler to look at you can append it to the +environment's paths: + +.. code-block:: python + + # These paths are relative to /modules/tts/ + env_tts.Append(CPPPATH=["speech_tools/include", "festival/src/include"]) + + # LIBPATH and LIBS need to be set on the real "env" (not the clone) + # to link the specified libraries to the Godot executable. + + # This is a path relative to /modules/tts/ where your .a libraries reside. + # If you are compiling the module externally (not in the godot source tree), + # these will need to be full paths. + env.Append(LIBPATH=['libpath']) + + # Check with the documentation of the external library to see which library + # files should be included/linked. + env.Append(LIBS=['Festival', 'estools', 'estbase', 'eststring']) + +If you want to add custom compiler flags when building your module, you need to clone +`env` first, so it won't add those flags to whole Godot build (which can cause errors). +Example `SCsub` with custom flags: + +.. code-block:: python + + # SCsub + + Import('env') + + env_tts = env.Clone() + env_tts.add_source_files(env.modules_sources, "*.cpp") + # Append CCFLAGS flags for both C and C++ code. + env_tts.Append(CCFLAGS=['-O2']) + # If you need to, you can: + # - Append CFLAGS for C code only. + # - Append CXXFLAGS for C++ code only. + +The final module should look like this: + +.. code-block:: none + + godot/modules/tts/festival/ + godot/modules/tts/libpath/libestbase.a + godot/modules/tts/libpath/libestools.a + godot/modules/tts/libpath/libeststring.a + godot/modules/tts/libpath/libFestival.a + godot/modules/tts/speech_tools/ + godot/modules/tts/config.py + godot/modules/tts/tts.h + godot/modules/tts/tts.cpp + godot/modules/tts/register_types.h + godot/modules/tts/register_types.cpp + godot/modules/tts/SCsub + +Using the module +---------------- + +You can now use your newly created module from any script: + +:: + + var t = TTS.new() + var script = "Hello world. This is a test!" + var is_spoken = t.say_text(script) + print('is_spoken: ', is_spoken) + +And the output will be ``is_spoken: True`` if the text is spoken. diff --git a/development/cpp/common_engine_methods_and_macros.rst b/development/cpp/common_engine_methods_and_macros.rst new file mode 100644 index 0000000..17af34e --- /dev/null +++ b/development/cpp/common_engine_methods_and_macros.rst @@ -0,0 +1,246 @@ +.. _doc_common_engine_methods_and_macros: + +Common engine methods and macros +================================ + +Godot's C++ codebase makes use of dozens of custom methods and macros which are +used in almost every file. This page is geared towards beginner contributors, +but it can also be useful for those writing custom C++ modules. + +Print text +---------- + +.. code-block:: cpp + + // Prints a message to standard output. + print_line("Message"); + + // Prints a message to standard output, but only when the engine + // is started with the `--verbose` command line argument. + print_verbose("Message"); + + // Prints a formatted error or warning message with a trace. + ERR_PRINT("Message"); + WARN_PRINT("Message"); + + // Prints an error or warning message only once per session. + // This can be used to avoid spamming the console output. + ERR_PRINT_ONCE("Message"); + WARN_PRINT_ONCE("Message"); + +If you need to add placeholders in your messages, use format strings as +described below. + +Format a string +--------------- + +The ``vformat()`` function returns a formatted :ref:`class_String`. It behaves +in a way similar to C's ``sprintf()``: + +.. code-block:: cpp + + vformat("My name is %s.", "Godette"); + vformat("%d bugs on the wall!", 1234); + vformat("Pi is approximately %f.", 3.1416); + + // Converts the resulting String into a `const char *`. + // You may need to do this if passing the result as an argument + // to a method that expects a `const char *` instead of a String. + vformat("My name is %s.", "Godette").c_str(); + +In most cases, try to use ``vformat()`` instead of string concatenation as it +makes for more readable code. + +Convert an integer or float to a string +--------------------------------------- + +This is mainly useful when printing numbers directly. + +.. code-block:: cpp + + // Prints "42" using integer-to-string conversion. + print_line(itos(42)); + + // Prints "123.45" using real-to-string conversion. + print_line(rtos(123.45)); + +Internationalize a string +------------------------- + +There are two types of internationalization in Godot's codebase: + +- ``TTR()``: **Editor ("tools") translations** will only be processed in the + editor. If a user uses the same text in one of their projects, it won't be + translated if they provide a translation for it. When contributing to the + engine, this is generally the macro you should use for localizable strings. +- ``RTR()``: **Run-time translations** will be automatically localized in + projects if they provide a translation for the given string. This kind of + translation shouldn't be used in editor-only code. + +.. code-block:: cpp + + // Returns the translated string that matches the user's locale settings. + // Translations are located in `editor/translations`. + // The localization template is generated automatically; don't modify it. + TTR("Exit the editor?"); + +To insert placeholders in localizable strings, wrap the localization macro in a +``vformat()`` call as follows: + +.. code-block:: cpp + + String file_path = "example.txt"; + vformat(TTR("Couldn't open \"%s\" for reading."), file_path); + +.. note:: + + When using ``vformat()`` and a translation macro together, always wrap the + translation macro in ``vformat()``, not the other way around. Otherwise, the + string will never match the translation as it will have the placeholder + already replaced when it's passed to TranslationServer. + +Clamp a value +------------- + +Godot provides macros for clamping a value with a lower bound (``MAX``), an +upper bound (``MIN``) or both (``CLAMP``): + +.. code-block:: cpp + + int a = 3; + int b = 5; + + MAX(b, 6); // 6 + MIN(2, a); // 2 + CLAMP(a, 10, 30); // 10 + +This works with any type that can be compared to other values (like ``int`` and +``float``). + +Microbenchmarking +----------------- + +If you want to benchmark a piece of code but don't know how to use a profiler, +use this snippet: + +.. code-block:: cpp + + uint64_t begin = OS::get_singleton()->get_ticks_usec(); + + // Your code here... + + uint64_t end = OS::get_singleton()->get_ticks_usec(); + print_line(vformat("Snippet took %d microseconds", end - begin)); + +This will print the time spent between the ``begin`` declaration and the ``end`` +declaration. + +.. note:: + + You may have to ``#include "core/os/os.h"`` if it's not present already. + + When opening a pull request, make sure to remove this snippet as well as the + include if it wasn't there previously. + +Get project/editor settings +--------------------------- + +There are four macros available for this: + +.. code-block:: cpp + + // Returns the specified project setting's value, + // defaulting to `false` if it doesn't exist. + GLOBAL_DEF("section/subsection/value", false); + + // Returns the specified editor setting's value, + // defaulting to "Untitled" if it doesn't exist. + EDITOR_DEF("section/subsection/value", "Untitled"); + +If a default value has been specified elsewhere, don't specify it again to avoid +repetition: + +.. code-block:: cpp + + // Returns the value of the project setting. + GLOBAL_GET("section/subsection/value"); + // Returns the value of the editor setting. + EDITOR_GET("section/subsection/value"); + +It's recommended to use ``GLOBAL_DEF``/``EDITOR_DEF`` only once per setting and +use ``GLOBAL_GET``/``EDITOR_GET`` in all other places where it's referenced. + +Error macros +------------ + +Godot features many error macros to make error reporting more convenient. + +.. warning:: + + Conditions in error macros work in the **opposite** way of GDScript's + built-in ``assert()`` function. An error is reached if the condition inside + evaluates to ``true``, not ``false``. + +.. note:: + + Only variants with custom messages are documented here, as these should + always be used in new contributions. Make sure the custom message provided + includes enough information for people to diagnose the issue, even if they + don't know C++. In case a method was passed invalid arguments, you can print + the invalid value in question to ease debugging. + + For internal error checking where displaying a human-readable message isn't + necessary, remove ``_MSG`` at the end of the macro name and don't supply a + message argument. + + Also, always try to return processable data so the engine can keep running + well. + +.. code-block:: cpp + + // Conditionally prints an error message and returns from the function. + // Use this in methods which don't return a value. + ERR_FAIL_COND_MSG(!mesh.is_valid(), vformat("Couldn't load mesh at: %s", path)); + + // Conditionally prints an error message and returns `0` from the function. + // Use this in methods which must return a value. + ERR_FAIL_COND_V_MSG(rect.x < 0 || rect.y < 0, 0, + "Couldn't calculate the rectangle's area."); + + // Prints an error message if `index` is < 0 or >= `SomeEnum::QUALITY_MAX`, + // then returns from the function. + ERR_FAIL_INDEX_MSG(index, SomeEnum::QUALITY_MAX, + vformat("Invalid quality: %d. See SomeEnum for allowed values.", index)); + + // Prints an error message if `index` is < 0 >= `some_array.size()`, + // then returns `-1` from the function. + ERR_FAIL_INDEX_V_MSG(index, some_array.size(), -1, + vformat("Item %d is out of bounds.", index)); + + // Unconditionally prints an error message and returns from the function. + // Only use this if you need to perform complex error checking. + if (!complex_error_checking_routine()) { + ERR_FAIL_MSG("Couldn't reload the filesystem cache."); + } + + // Unconditionally prints an error message and returns `false` from the function. + // Only use this if you need to perform complex error checking. + if (!complex_error_checking_routine()) { + ERR_FAIL_V_MSG(false, "Couldn't parse the input arguments."); + } + + // Crashes the engine. This should generally never be used + // except for testing crash handling code. Godot's philosophy + // is to never crash, both in the editor and in exported projects. + CRASH_NOW_MSG("Can't predict the future! Aborting."); + + +.. seealso:: + + See `core/error_macros.h `__ + in Godot's codebase for more information about each error macro. + + Some functions return an error code (materialized by a return type of + ``Error``). This value can be returned directly from an error macro. + See the list of available error codes in + `core/error_list.h `__. diff --git a/development/cpp/configuring_an_ide/android_studio.rst b/development/cpp/configuring_an_ide/android_studio.rst new file mode 100644 index 0000000..7e84193 --- /dev/null +++ b/development/cpp/configuring_an_ide/android_studio.rst @@ -0,0 +1,28 @@ +.. _doc_configuring_an_ide_android_studio: + +Android Studio +============== + +`Android Studio `_ is a free +`JetBrains `_ IDE for Android development. +It has a feature-rich editor which supports Java and C/C++. It can be used to +work on Godot's core engine as well as the Android platform codebase. + +Importing the project +--------------------- + +- From the Android Studio's welcome window select **Open an existing + Android Studio project**. + +.. figure:: img/android_studio_setup_project_1.png + :figclass: figure-w480 + :align: center + + Android Studio's welcome window. + +- Navigate to ``/platform/android/java`` and select the ``settings.gradle`` file. +- Android Studio will import and index the project. +- To build the project, follow the :ref:`compiling instructions `. + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/clion.rst b/development/cpp/configuring_an_ide/clion.rst new file mode 100644 index 0000000..88febf2 --- /dev/null +++ b/development/cpp/configuring_an_ide/clion.rst @@ -0,0 +1,71 @@ +.. _doc_configuring_an_ide_clion: + +CLion +===== + +`CLion `_ is a commercial +`JetBrains `_ IDE for C++. + +Importing the project +--------------------- + +CLion requires a ``CMakeLists.txt`` file as a project file, which is problematic +for Godot because it uses the SCons buildsystem instead of CMake. However, +there is a ``CMakeLists.txt`` configuration for :ref:`Android Studio ` +which can also be used by CLion. + +- From the CLion's welcome window choose the option to import an existing + project. If you've already opened another project, choose **File > Open** + from the top menu. +- Navigate to ``/platform/android/java/nativeSrcsConfigs`` (the + ``CMakeLists.txt`` file is located there) and select it (but *not* the + ``CMakeLists.txt`` file itself), then click **OK**. + +.. figure:: img/clion_1_open.png + :align: center + + The folder containing the ``CMakeLists.txt`` file. + +- If this popup window appears, select **This Window** to open the project: + +.. figure:: img/clion_2_this_window.png + :align: center + +- Choose **Tools > CMake > Change Project Root** from the top menu and select + the Godot root folder. + +.. figure:: img/clion_3_change_project_root.png + :align: center + +- You should be now be able to see all the project files. Autocomplete should + work once the project has finished indexing. + +If you run into any issues, ask for help in one of +`Godot's community channels `__. + +Debugging the project +--------------------- + +Since CLion does not support SCons, you won't be able to compile, launch, and debug Godot from CLion in one step. +You will first need to `compile godot yourself `__ and run the binary without CLion. You will then be able to debug Godot by using the `Attach to process `__ feature. + +- Run the compilation in debug mode by entering ``scons``. + +- Run the binary you have created (in the bin directory). If you want to debug a specific project, run the binary with the following arguments : ``--editor --path path/to/your/godot/project``. To run the project instead of editing it, remove the ``--editor`` argument. + +- In CLion, go to **Run > Attach to Process...** + +.. figure:: img/clion_4_select_attach_to_process.png + :align: center + +- Find and Select godot in the list (or type the binary name/Process ID) + +.. figure:: img/clion_5_select_godot_process.png + :align: center + +You can now use the debugging tools from CLion. + +.. note:: + + If you run the binary without any arguments, you will only debug the project manager window. + Don't forget to add the ``--path path/to/your/godot/project`` argument to debug a project. diff --git a/development/cpp/configuring_an_ide/code_blocks.rst b/development/cpp/configuring_an_ide/code_blocks.rst new file mode 100644 index 0000000..2fa1d37 --- /dev/null +++ b/development/cpp/configuring_an_ide/code_blocks.rst @@ -0,0 +1,129 @@ +.. _doc_configuring_an_ide_code_blocks: + +Code::Blocks +============ + +`Code::Blocks `_ is a free, open source, cross platform IDE. + +Creating a new project +---------------------- + +From Code::Blocks' main screen, click **Create a new project** or select **File > New > Project...**. + +.. figure:: img/code_blocks_file_new_project.png + :figclass: figure-w480 + :align: center + +In the **New from template** window, from **Projects**, select **Empty project**, and click **Go**. + +.. figure:: img/code_blocks_new_empty_project.png + :figclass: figure-w480 + :align: center + +Click Next, to pass the welcome to the new empty project wizard. + +.. figure:: img/code_blocks_wizard_welcome.png + :figclass: figure-w480 + :align: center + +The project file should be created in the root of the cloned project folder. To achieve this, first, ensure that the **Project title** is the same as the folder name that Godot was cloned into. Unless you cloned the project into a folder with a different name, this will be ``godot``. + +Second, ensure that the **Folder to create project in** is the folder you ran the Git clone command from, not the ``godot`` project folder. Confirm that the **Resulting filename** field will create the project file in the root of the cloned project folder. + +.. figure:: img/code_blocks_project_title_and_location.png + :figclass: figure-w480 + :align: center + +The compiler and configuration settings are managed through **SCons** and will be configured later. However, it's worth deselecting the **Create "Release" configuration** option; so only a single build target is created before clicking **Finish**. + +.. figure:: img/code_blocks_compiler_and_configuration.png + :figclass: figure-w480 + :align: center + +Configuring the build +--------------------- + +The first step is to change the project properties. Right-click on the new project and select **Properties...**. + +.. figure:: img/code_blocks_open_properties.png + :figclass: figure-w480 + :align: center + +Check the **This is a custom Makefile** property. Click OK to save the changes. + +.. figure:: img/code_blocks_project_properties.png + :figclass: figure-w480 + :align: center + +The next step is to change the build options. Right-click on the new project and select **Build Options...**. + +.. figure:: img/code_blocks_open_build_options.png + :figclass: figure-w480 + :align: center + +Select the **"Make" commands** tab and remove all the existing commands for all the build targets. For each build target enter the **SCons** command for creating the desired build in the **Build project/target** field. The minimum is ``scons``. For details on the **SCons** build options, see :ref:`doc_introduction_to_the_buildsystem`. It's also useful to add the ``scons --clean`` command in the **Clean project/target** field to the project's default commmands. + +If you're using Windows, all the commands need to be preceded with ``cmd /c`` to iniitalize the command interpreter. + +.. figure:: img/code_blocks_scons_minimum.png + :figclass: figure-w480 + :align: center + +.. figure:: img/code_blocks_scons_clean.png + :figclass: figure-w480 + :align: center + +Windows example: + +.. figure:: img/code_blocks_scons_windows.png + :figclass: figure-w480 + :align: center + +Code::Blocks should now be configured to build Godot; so either select **Build > Build**, click the gear button, or press :kbd:`Ctrl + F9`. + +Configuring the run +------------------- + +Once **SCons** has successfully built the desired target, reopen the project **Properties...** and select the **Build targets** tab. In the **Output filename** field, browse to the ``bin`` folder and select the compiled file. + +Deselect the **Auto-generate filename prefix** and **Auto-generate filename extension** options. + +.. figure:: img/code_blocks_build_targets.png + :figclass: figure-w480 + :align: center + +Code::Blocks should now be configured to run your compiled Godot executable; so either select **Build > Run**, click the green arrow button, or press :kbd:`Ctrl + F10`. + +There are two additional points worth noting. First, if required, the **Execution working dir** field can be used to test specific projects, by setting it to the folder containing the ``project.godot`` file. Second, the **Build targets** tab can be used to add and remove build targets for working with and creating different builds. + +Adding files to the project +--------------------------- + +To add all the Godot code files to the project, right-click on the new project and select **Add files recursively...**. + +.. figure:: img/code_blocks_add_files_recursively.png + :figclass: figure-w480 + :align: center + +It should automatically select the project folder; so simply click **Open**. By default, all code files are included, so simply click **OK**. + +.. figure:: img/code_blocks_select_files.png + :figclass: figure-w480 + :align: center + +Code style configuration +------------------------ + +Before editing any files, remember that all code needs to comply with the :ref:`doc_code_style_guidelines`. One important difference with Godot is the use of tabs for indents. Therefore, the key default editor setting that needs to be changed in Code::Blocks is to enable tabs for indents. This setting can be found by selecting **Settings > Editor**. + +.. figure:: img/code_blocks_update_editor_settings.png + :figclass: figure-w480 + :align: center + +Under **General Settings**, on the **Editor Settings** tab, under **Tab Options** check **Use TAB character**. + +.. figure:: img/code_block_use_tab_character.png + :figclass: figure-w480 + :align: center + +That's it. You're ready to start contributing to Godot using the Code::Blocks IDE. Remember to save the project file and the **Workspace**. If you run into any issues, ask for help in one of `Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/img/android_studio_setup_project_1.png b/development/cpp/configuring_an_ide/img/android_studio_setup_project_1.png new file mode 100644 index 0000000..3725de0 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/android_studio_setup_project_1.png differ diff --git a/development/cpp/configuring_an_ide/img/clion_1_open.png b/development/cpp/configuring_an_ide/img/clion_1_open.png new file mode 100644 index 0000000..f2b2a77 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/clion_1_open.png differ diff --git a/development/cpp/configuring_an_ide/img/clion_2_this_window.png b/development/cpp/configuring_an_ide/img/clion_2_this_window.png new file mode 100644 index 0000000..81c5df6 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/clion_2_this_window.png differ diff --git a/development/cpp/configuring_an_ide/img/clion_3_change_project_root.png b/development/cpp/configuring_an_ide/img/clion_3_change_project_root.png new file mode 100644 index 0000000..e249935 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/clion_3_change_project_root.png differ diff --git a/development/cpp/configuring_an_ide/img/clion_4_select_attach_to_process.png b/development/cpp/configuring_an_ide/img/clion_4_select_attach_to_process.png new file mode 100644 index 0000000..81058cb Binary files /dev/null and b/development/cpp/configuring_an_ide/img/clion_4_select_attach_to_process.png differ diff --git a/development/cpp/configuring_an_ide/img/clion_5_select_godot_process.png b/development/cpp/configuring_an_ide/img/clion_5_select_godot_process.png new file mode 100644 index 0000000..5810dad Binary files /dev/null and b/development/cpp/configuring_an_ide/img/clion_5_select_godot_process.png differ diff --git a/development/cpp/configuring_an_ide/img/code_block_use_tab_character.png b/development/cpp/configuring_an_ide/img/code_block_use_tab_character.png new file mode 100644 index 0000000..f55c5e1 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_block_use_tab_character.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_add_files_recursively.png b/development/cpp/configuring_an_ide/img/code_blocks_add_files_recursively.png new file mode 100644 index 0000000..c4fe243 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_add_files_recursively.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_build_targets.png b/development/cpp/configuring_an_ide/img/code_blocks_build_targets.png new file mode 100644 index 0000000..909a20f Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_build_targets.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_compiler_and_configuration.png b/development/cpp/configuring_an_ide/img/code_blocks_compiler_and_configuration.png new file mode 100644 index 0000000..1308004 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_compiler_and_configuration.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_file_new_project.png b/development/cpp/configuring_an_ide/img/code_blocks_file_new_project.png new file mode 100644 index 0000000..f22a350 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_file_new_project.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_new_empty_project.png b/development/cpp/configuring_an_ide/img/code_blocks_new_empty_project.png new file mode 100644 index 0000000..15d2cea Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_new_empty_project.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_open_build_options.png b/development/cpp/configuring_an_ide/img/code_blocks_open_build_options.png new file mode 100644 index 0000000..b5a2b7f Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_open_build_options.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_open_properties.png b/development/cpp/configuring_an_ide/img/code_blocks_open_properties.png new file mode 100644 index 0000000..9a9ee4a Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_open_properties.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_project_properties.png b/development/cpp/configuring_an_ide/img/code_blocks_project_properties.png new file mode 100644 index 0000000..9ea1f80 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_project_properties.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_project_title_and_location.png b/development/cpp/configuring_an_ide/img/code_blocks_project_title_and_location.png new file mode 100644 index 0000000..527b9dd Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_project_title_and_location.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_scons_clean.png b/development/cpp/configuring_an_ide/img/code_blocks_scons_clean.png new file mode 100644 index 0000000..12387ce Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_scons_clean.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_scons_minimum.png b/development/cpp/configuring_an_ide/img/code_blocks_scons_minimum.png new file mode 100644 index 0000000..10e0cdf Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_scons_minimum.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_scons_windows.png b/development/cpp/configuring_an_ide/img/code_blocks_scons_windows.png new file mode 100644 index 0000000..ed6340c Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_scons_windows.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_select_files.png b/development/cpp/configuring_an_ide/img/code_blocks_select_files.png new file mode 100644 index 0000000..597e3ba Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_select_files.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_update_editor_settings.png b/development/cpp/configuring_an_ide/img/code_blocks_update_editor_settings.png new file mode 100644 index 0000000..b8fa32e Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_update_editor_settings.png differ diff --git a/development/cpp/configuring_an_ide/img/code_blocks_wizard_welcome.png b/development/cpp/configuring_an_ide/img/code_blocks_wizard_welcome.png new file mode 100644 index 0000000..4656df9 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/code_blocks_wizard_welcome.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_addincludes.png b/development/cpp/configuring_an_ide/img/kdevelop_addincludes.png new file mode 100644 index 0000000..61939f1 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_addincludes.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_buildconfig.png b/development/cpp/configuring_an_ide/img/kdevelop_buildconfig.png new file mode 100644 index 0000000..1ab15a1 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_buildconfig.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_configlaunches.png b/development/cpp/configuring_an_ide/img/kdevelop_configlaunches.png new file mode 100644 index 0000000..38f520b Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_configlaunches.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_configlaunches2.png b/development/cpp/configuring_an_ide/img/kdevelop_configlaunches2.png new file mode 100644 index 0000000..74a6a95 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_configlaunches2.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_custombuild.png b/development/cpp/configuring_an_ide/img/kdevelop_custombuild.png new file mode 100644 index 0000000..e85b4ea Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_custombuild.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_newproject.png b/development/cpp/configuring_an_ide/img/kdevelop_newproject.png new file mode 100644 index 0000000..896df8a Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_newproject.png differ diff --git a/development/cpp/configuring_an_ide/img/kdevelop_openconfig.png b/development/cpp/configuring_an_ide/img/kdevelop_openconfig.png new file mode 100644 index 0000000..0e64a4b Binary files /dev/null and b/development/cpp/configuring_an_ide/img/kdevelop_openconfig.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-apply-import-filter.png b/development/cpp/configuring_an_ide/img/qtcreator-apply-import-filter.png new file mode 100644 index 0000000..0a6cbb7 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-apply-import-filter.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-edit-codestyle.png b/development/cpp/configuring_an_ide/img/qtcreator-edit-codestyle.png new file mode 100644 index 0000000..643cb0b Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-edit-codestyle.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-edit-files-menu.png b/development/cpp/configuring_an_ide/img/qtcreator-edit-files-menu.png new file mode 100644 index 0000000..3ece003 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-edit-files-menu.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-new-project.png b/development/cpp/configuring_an_ide/img/qtcreator-new-project.png new file mode 100644 index 0000000..23df4a5 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-new-project.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-options-cpp.png b/development/cpp/configuring_an_ide/img/qtcreator-options-cpp.png new file mode 100644 index 0000000..956865d Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-options-cpp.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-project-name-includes.png b/development/cpp/configuring_an_ide/img/qtcreator-project-name-includes.png new file mode 100644 index 0000000..c02e440 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-project-name-includes.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-projects-build.png b/development/cpp/configuring_an_ide/img/qtcreator-projects-build.png new file mode 100644 index 0000000..a98d2c3 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-projects-build.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-run-command.png b/development/cpp/configuring_an_ide/img/qtcreator-run-command.png new file mode 100644 index 0000000..a82b5de Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-run-command.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-set-project-path.png b/development/cpp/configuring_an_ide/img/qtcreator-set-project-path.png new file mode 100644 index 0000000..e80772d Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-set-project-path.png differ diff --git a/development/cpp/configuring_an_ide/img/qtcreator-set-scons-command.png b/development/cpp/configuring_an_ide/img/qtcreator-set-scons-command.png new file mode 100644 index 0000000..56173e8 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/qtcreator-set-scons-command.png differ diff --git a/development/cpp/configuring_an_ide/img/vs_1_install_cpp_package.png b/development/cpp/configuring_an_ide/img/vs_1_install_cpp_package.png new file mode 100644 index 0000000..a97d29e Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vs_1_install_cpp_package.png differ diff --git a/development/cpp/configuring_an_ide/img/vs_2_project_properties.png b/development/cpp/configuring_an_ide/img/vs_2_project_properties.png new file mode 100644 index 0000000..a0fc1d8 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vs_2_project_properties.png differ diff --git a/development/cpp/configuring_an_ide/img/vs_3_debug_command_line.png b/development/cpp/configuring_an_ide/img/vs_3_debug_command_line.png new file mode 100644 index 0000000..1599824 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vs_3_debug_command_line.png differ diff --git a/development/cpp/configuring_an_ide/img/vs_4_debugging_main.png b/development/cpp/configuring_an_ide/img/vs_4_debugging_main.png new file mode 100644 index 0000000..b651259 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vs_4_debugging_main.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_1_create_launch.json.png b/development/cpp/configuring_an_ide/img/vscode_1_create_launch.json.png new file mode 100644 index 0000000..80bde15 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_1_create_launch.json.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_2_launch.json.png b/development/cpp/configuring_an_ide/img/vscode_2_launch.json.png new file mode 100644 index 0000000..7ba2575 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_2_launch.json.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_3_tasks.json.png b/development/cpp/configuring_an_ide/img/vscode_3_tasks.json.png new file mode 100644 index 0000000..0641deb Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_3_tasks.json.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_configure_task.png b/development/cpp/configuring_an_ide/img/vscode_configure_task.png new file mode 100644 index 0000000..f69e76b Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_configure_task.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_create_tasksjson.png b/development/cpp/configuring_an_ide/img/vscode_create_tasksjson.png new file mode 100644 index 0000000..bfc9903 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_create_tasksjson.png differ diff --git a/development/cpp/configuring_an_ide/img/vscode_create_tasksjson_others.png b/development/cpp/configuring_an_ide/img/vscode_create_tasksjson_others.png new file mode 100644 index 0000000..fa7b509 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/vscode_create_tasksjson_others.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_1_create_external_build_project.png b/development/cpp/configuring_an_ide/img/xcode_1_create_external_build_project.png new file mode 100644 index 0000000..22efaa8 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_1_create_external_build_project.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_2_configure_scons.png b/development/cpp/configuring_an_ide/img/xcode_2_configure_scons.png new file mode 100644 index 0000000..7ab24ac Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_2_configure_scons.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_3_add_new_target.png b/development/cpp/configuring_an_ide/img/xcode_3_add_new_target.png new file mode 100644 index 0000000..d68d4fb Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_3_add_new_target.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_4_select_command_line_target.png b/development/cpp/configuring_an_ide/img/xcode_4_select_command_line_target.png new file mode 100644 index 0000000..70fb709 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_4_select_command_line_target.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_5_after_add_godot_source_to_project.png b/development/cpp/configuring_an_ide/img/xcode_5_after_add_godot_source_to_project.png new file mode 100644 index 0000000..a69bfcb Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_5_after_add_godot_source_to_project.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_6_after_add_godot_source_to_project_2.png b/development/cpp/configuring_an_ide/img/xcode_6_after_add_godot_source_to_project_2.png new file mode 100644 index 0000000..8afdcd5 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_6_after_add_godot_source_to_project_2.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_7_setup_build_post_action.png b/development/cpp/configuring_an_ide/img/xcode_7_setup_build_post_action.png new file mode 100644 index 0000000..75a2657 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_7_setup_build_post_action.png differ diff --git a/development/cpp/configuring_an_ide/img/xcode_8_setup_run_scheme.png b/development/cpp/configuring_an_ide/img/xcode_8_setup_run_scheme.png new file mode 100644 index 0000000..7bc4c37 Binary files /dev/null and b/development/cpp/configuring_an_ide/img/xcode_8_setup_run_scheme.png differ diff --git a/development/cpp/configuring_an_ide/index.rst b/development/cpp/configuring_an_ide/index.rst new file mode 100644 index 0000000..c0be071 --- /dev/null +++ b/development/cpp/configuring_an_ide/index.rst @@ -0,0 +1,24 @@ +Configuring an IDE +================== + +We assume that you have already `cloned `_ +and :ref:`compiled ` Godot. + +You can easily develop Godot with any text editor and by invoking ``scons`` +on the command line, but if you want to work with an IDE (Integrated +Development Environment), here are setup instructions for some popular ones: + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-configuring_an_ide + + android_studio + clion + code_blocks + kdevelop + qt_creator + visual_studio + visual_studio_code + xcode + +It is possible to use other IDEs, but their setup is not documented yet. diff --git a/development/cpp/configuring_an_ide/kdevelop.rst b/development/cpp/configuring_an_ide/kdevelop.rst new file mode 100644 index 0000000..914e29a --- /dev/null +++ b/development/cpp/configuring_an_ide/kdevelop.rst @@ -0,0 +1,87 @@ +.. _doc_configuring_an_ide_kdevelop: + +KDevelop +======== + +`KDevelop `_ is a free, open source IDE for all desktop platforms. + +Importing the project +--------------------- + +- From the KDevelop's main screen select **Open Project**. + +.. figure:: img/kdevelop_newproject.png + :figclass: figure-w480 + :align: center + + KDevelop's main screen. + +- Navigate to the Godot root folder and select it. +- On the next screen, choose **Custom Build System** for the **Project Manager**. + +.. figure:: img/kdevelop_custombuild.png + :figclass: figure-w480 + :align: center + +- After the project has been imported, open the project configuration by right-clicking + on it in the **Projects** panel and selecting **Open Configuration..** option. + +.. figure:: img/kdevelop_openconfig.png + :figclass: figure-w480 + :align: center + +- Under **Language Support** open the **Includes/Imports** tab and add the following paths: + + .. code-block:: none + + . // A dot, to indicate the root of the Godot project + core/ + core/os/ + core/math/ + drivers/ + platform// // Replace with a folder + corresponding to your current platform + +.. figure:: img/kdevelop_addincludes.png + :figclass: figure-w480 + :align: center + +- Apply the changes. +- Under **Custom Build System** add a new build configuration with the following settings: + + +-----------------+------------------------------------------------------------------------------+ + | Build Directory | *blank* | + +-----------------+------------------------------------------------------------------------------+ + | Enable | **True** | + +-----------------+------------------------------------------------------------------------------+ + | Executable | **scons** | + +-----------------+------------------------------------------------------------------------------+ + | Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | + +-----------------+------------------------------------------------------------------------------+ + +.. figure:: img/kdevelop_buildconfig.png + :figclass: figure-w480 + :align: center + +- Apply the changes and close the configuration window. + +Debugging the project +--------------------- + +- Select **Run > Configure Launches...** from the top menu. + +.. figure:: img/kdevelop_configlaunches.png + :figclass: figure-w480 + :align: center + +- Click **Add** to create a new launch configuration. +- Select **Executable** option and specify the path to your executable located in + the ``/bin`` folder. The name depends on your build configuration, + e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled. + +.. figure:: img/kdevelop_configlaunches2.png + :figclass: figure-w480 + :align: center + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/qt_creator.rst b/development/cpp/configuring_an_ide/qt_creator.rst new file mode 100644 index 0000000..9f0b8b1 --- /dev/null +++ b/development/cpp/configuring_an_ide/qt_creator.rst @@ -0,0 +1,111 @@ +.. _doc_configuring_an_ide_qtcreator: + +Qt Creator +========== + +`Qt Creator `_ is a free, open source IDE for all desktop platforms. + +Importing the project +--------------------- + +- From the Qt Creator's main screen select **New Project > Import Project > Import Existing Project**. + +.. figure:: img/qtcreator-new-project.png + :figclass: figure-w480 + :align: center + +- Under **Location** select the Godot root folder. + +.. figure:: img/qtcreator-set-project-path.png + :figclass: figure-w480 + :align: center + +- Next, you can choose which folders and files will be visible to the project. + While C/C++ files are added automatically, other extensions can be potentially useful: + ``*.glsl`` for shader files, ``*.py`` for buildsystem files, + ``*.java`` for Android platform development, ``*.mm`` for macOS platform development. + +.. figure:: img/qtcreator-apply-import-filter.png + :figclass: figure-w480 + :align: center + +.. note:: You can change this configuration later by right-clicking on your project + and selecting the **Edit Files...** option. + + .. figure:: img/qtcreator-edit-files-menu.png + :figclass: figure-w480 + :align: center + + +- Finish the import. +- Open the ``project_name.includes`` file and add a line containing ``.`` to it + to correctly enable the code completion. + +.. figure:: img/qtcreator-project-name-includes.png + :figclass: figure-w480 + :align: center + +- From the left-side menu select **Projects** and open the **Build** tab. +- Delete the predefined ``make`` build step. + +.. figure:: img/qtcreator-projects-build.png + :figclass: figure-w480 + :align: center + +- Click **Add Build Step > Custom Process Step** to add a new build step + with the following settings: + + +-----------+------------------------------------------------------------------------------+ + | Command | **scons** | + +-----------+------------------------------------------------------------------------------+ + | Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | + +-----------+------------------------------------------------------------------------------+ + +.. figure:: img/qtcreator-set-scons-command.png + :figclass: figure-w480 + :align: center + +.. note:: If the build fails with ``Could not start process "scons"``, it can mean that ``scons`` + is not in your ``PATH`` environment variable. In this case, you'll have to specify the + full path to the SCons binary. + +Debugging the project +--------------------- + +- From the left-side menu select **Projects** and open the **Run** tab. +- Under **Executable** specify the path to your executable located in + the ``/bin`` folder. The name depends on your build configuration, + e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled. + You can use ``%{buildDir}`` to reference the project root, e.g: ``%{buildDir}/bin/godot.x11.opt.tools.64``. +- If you want to run a specific project, specify its root folder under **Working directory**. +- If you want to run the editor, add ``-e`` to the **Command line arguments** field. + +.. figure:: img/qtcreator-run-command.png + :figclass: figure-w480 + :align: center + +To learn more about command line arguments, refer to the +:ref:`command line tutorial `. + +Code style configuration +------------------------ + +Developers must follow the project's :ref:`code style ` +and the IDE should help them follow it. By default, Qt Creator uses spaces +for indentation which doesn't match the Godot code style guidelines. You can +change this behavior by changing the **Code Style** in **Tools > Options > C++**. + +.. figure:: img/qtcreator-options-cpp.png + :figclass: figure-w480 + :align: center + +Click on **Edit** to change the current settings, then click on +**Copy Built-in Code Style** button to set a new code style. Set a name for it +(e.g. Godot) and change the Tab policy to be **Tabs Only**. + +.. figure:: img/qtcreator-edit-codestyle.png + :figclass: figure-w480 + :align: center + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/visual_studio.rst b/development/cpp/configuring_an_ide/visual_studio.rst new file mode 100644 index 0000000..4a46351 --- /dev/null +++ b/development/cpp/configuring_an_ide/visual_studio.rst @@ -0,0 +1,68 @@ +.. _doc_configuring_an_ide_vs: + +Visual Studio +============= + +`Visual Studio Community `__ is a Windows-only IDE +by `Microsoft `_ that's free for non-commercial use. +It has many useful features, such as memory view, performance view, source +control and more. + +Importing the project +--------------------- + +Visual Studio requires a solution file to work on a project. While Godot does not come +with the solution file, it can be generated using SCons. + +- Navigate to the Godot root folder and open a Command Prompt or PowerShell window. +- Run ``scons platform=windows vsproj=yes`` to generate the solution. +- You can now open the project by double-clicking on the ``godot.sln`` in the project root + or by using the **Open a project or solution** option inside of the Visual Studio. +- Use the **Build** top menu to build the project. + +.. warning:: Visual Studio must be configured with the C++ package. It can be selected + in the intaller: + + .. figure:: img/vs_1_install_cpp_package.png + :align: center + +Debugging the project +--------------------- + +Visual Studio features a powerful debugger. This allows the user to examine Godot's +source code, stop at specific points in the code, inspect the current execution context, +and make live changes to the codebase. + +You can launch the project with the debugger attached using the **Debug > Start Debugging** +option from the top menu. However, unless you want to debug the project manager specifically, +you'd need to configure debugging options first. This is due to the fact that when the Godot +project manager opens a project, the initial process is terminated and the debugger gets detached. + +- To configure the launch options to use with the debugger use **Project > Properties** + from the top menu: + +.. figure:: img/vs_2_project_properties.png + :align: center + +- Open the **Debugging** section and under **Command Arguments** add two new arguments: + the ``-e`` flag opens the editor instead of the project manager, and the ``--path`` argument + tells the executable to open the specified project (must be provided as an *absolute* path + to the project root, not the ``project.godot`` file). + +.. figure:: img/vs_3_debug_command_line.png + :align: center + +To learn more about command line arguments, refer to the +:ref:`command line tutorial `. + +Even if you start the project without a debugger attached it can still be connected to the running +process using **Debug > Attach to Process...** menu. + +To check that everything is working, put a breakpoint in ``main.cpp`` and press :kbd:`F5` to +start debugging. + +.. figure:: img/vs_4_debugging_main.png + :align: center + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/visual_studio_code.rst b/development/cpp/configuring_an_ide/visual_studio_code.rst new file mode 100644 index 0000000..8cdc387 --- /dev/null +++ b/development/cpp/configuring_an_ide/visual_studio_code.rst @@ -0,0 +1,170 @@ +.. _doc_configuring_an_ide_vscode: + +Visual Studio Code +================== + +`Visual Studio Code `_ is a free cross-platform code editor +by `Microsoft `_ (not to be confused with :ref:`doc_configuring_an_ide_vs`). + +Importing the project +--------------------- + +- Make sure the C/C++ extension is installed. You can find instructions in + the `official documentation `_. +- From the Visual Studio Code's main screen open the Godot root folder with + **File > Open Folder...**. +- Press :kbd:`Ctrl + Shift + P` to open the command prompt window and enter *Configure Task*. + +.. figure:: img/vscode_configure_task.png + :align: center + +- Select the **Create tasks.json file from template** option. + +.. figure:: img/vscode_create_tasksjson.png + :align: center + +- Then select **Others**. + +.. figure:: img/vscode_create_tasksjson_others.png + :align: center + +- Within the ``tasks.json`` file find the ``"tasks"`` array and add a new section to it: + +.. tabs:: + .. code-tab:: js Linux/X11 + + { + "label": "build", + "group": "build", + "type": "shell", + "command": "scons", + "args": [ + "-j $(nproc)" + ], + "problemMatcher": "$msCompile" + } + + .. code-tab:: js Windows + + { + "label": "build", + "group": "build", + "type": "shell", + "command": "scons", + "args": [ + // Use this when your default shell is Command Prompt (cmd.exe). + "-j %NUMBER_OF_PROCESSORS%", + // Use this when your default shell is PowerShell. + "-j $env:NUMBER_OF_PROCESSORS" + ], + "problemMatcher": "$msCompile" + } + +.. figure:: img/vscode_3_tasks.json.png + :figclass: figure-w480 + :align: center + + An example of a filled out ``tasks.json``. + +Arguments can be different based on your own setup and needs. See +:ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. + +Debugging the project +--------------------- + +To run and debug the project you need to create a new configuration in the ``launch.json`` file. + +- Press :kbd:`Ctrl + Shift + D` to open the Run panel. +- If ``launch.json`` file is missing you will be prompted to create a new one. + +.. figure:: img/vscode_1_create_launch.json.png + :align: center + +- Select **C++ (GDB/LLDB)**. There may be another platform specific option here. If selected, + adjust the configuration example provided accordingly. +- Within the ``launch.json`` file find the ``"configurations"`` array and add a new section to it: + +.. tabs:: + .. code-tab:: js X11 + + { + "name": "Launch Project", + "type": "lldb", + "request": "launch", + // Change to godot.x11.tools.64.llvm for llvm-based builds. + "program": "${workspaceFolder}/bin/godot.x11.tools.64", + // Change the arguments below for the project you want to test with. + // To run the project instead of editing it, remove the "--editor" argument. + "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "preLaunchTask": "build" + } + .. code-tab:: js X11_gdb + + { + "name": "Launch Project", + "type": "cppdbg", + "request": "launch", + // Change to godot.x11.tools.64.llvm for llvm-based builds. + "program": "${workspaceFolder}/bin/godot.x11.tools.64", + // Change the arguments below for the project you want to test with. + // To run the project instead of editing it, remove the "--editor" argument. + "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "externalConsole": false, + "setupCommands": + [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "build" + } + + .. code-tab:: js Windows + + { + "name": "Launch Project", + "type": "cppvsdbg", + "request": "launch", + "program": "${workspaceFolder}/bin/godot.windows.tools.64.exe", + // Change the arguments below for the project you want to test with. + // To run the project instead of editing it, remove the "--editor" argument. + "args": [ "--editor", "--path", "path-to-your-godot-project-folder" ], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [], + "console": "internalConsole", + "visualizerFile": "${workspaceFolder}/platform/windows/godot.natvis", + "preLaunchTask": "build" + } + +.. figure:: img/vscode_2_launch.json.png + :figclass: figure-w480 + :align: center + + An example of a filled out ``launch.json``. + + +.. note:: + + Due to sporadic performance issues, it is recommended to use LLDB over GDB on Unix-based systems. + Make sure that the `CodeLLDB extension `_ + is installed. + + If you encounter issues with lldb, you may consider using gdb (see the X11_gdb configuration). + + Do note that lldb may work better with llvm-based builds. See :ref:`doc_compiling_for_x11` for further information. + +The name under ``program`` depends on your build configuration, +e.g. ``godot.x11.tools.64`` for 64-bit X11 platform with ``tools`` enabled. + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/configuring_an_ide/xcode.rst b/development/cpp/configuring_an_ide/xcode.rst new file mode 100644 index 0000000..4fcf4cc --- /dev/null +++ b/development/cpp/configuring_an_ide/xcode.rst @@ -0,0 +1,110 @@ +.. _doc_configuring_an_ide_xcode: + +Xcode +===== + +`Xcode `_ is a free macOS-only IDE. You can +download it from the Mac App Store. + +Importing the project +--------------------- + +- From Xcode's main screen create a new project using the **Other > External Build System** template. + +.. figure:: img/xcode_1_create_external_build_project.png + :figclass: figure-w480 + :align: center + +- Open your build targets from the **Targets** section and select the **Info** tab. +- Fill out the form with the following settings: + + +------------+------------------------------------------------------------------------------+ + | Build Tool | A full path to the **scons** executable, e.g. **/usr/local/bin/scons** | + +------------+------------------------------------------------------------------------------+ + | Arguments | See :ref:`doc_introduction_to_the_buildsystem` for a full list of arguments. | + +------------+------------------------------------------------------------------------------+ + | Directory | A full path to the Godot root folder | + +------------+------------------------------------------------------------------------------+ + +.. figure:: img/xcode_2_configure_scons.png + :figclass: figure-w480 + :align: center + +- Add a Command Line Tool target which will be used for indexing the project by + choosing **File > New > Target...**. + +.. figure:: img/xcode_3_add_new_target.png + :figclass: figure-w480 + :align: center + +- Select **OS X > Application > Command Line Tool**. + +.. figure:: img/xcode_4_select_command_line_target.png + :figclass: figure-w480 + :align: center + +.. note:: Name it something so you know not to compile with this target (e.g. ``GodotXcodeIndex``). + +- For this target open the **Build Settings** tab and look for **Header Search Paths**. +- Set **Header Search Paths** to the absolute path to the Godot root folder. You need to + include subdirectories as well. To achieve that, add two two asterisks (``**``) to the + end of the path, e.g. ``/Users/me/repos/godot-source/**``. + +- Add the Godot source to the project by dragging and dropping it into the project file browser. +- Uncheck **Create external build system project**. + +.. figure:: img/xcode_5_after_add_godot_source_to_project.png + :figclass: figure-w480 + :align: center + +- Next select **Create groups** for the **Added folders** option and check *only* + your command line indexing target in the **Add to targets** section. + +.. figure:: img/xcode_6_after_add_godot_source_to_project_2.png + :figclass: figure-w480 + :align: center + +- Xcode will now index the files. This may take a few minutes. +- Once Xcode is done indexing, you should have jump-to-definition, + autocompletion, and full syntax highlighting. + +Debugging the project +--------------------- + +To enable debugging support you need to edit the external build target's build and run schemes. + +- Open the scheme editor of the external build target. +- Locate the **Build > Post Actions** section. +- Add a new script run action +- Under **Provide build settings from** select your project. This allows to reference + the project directory within the script. +- Create a script that will give the binary a name that Xcode can recognize, e.g.: + +.. code-block:: shell + + ln -f ${PROJECT_DIR}/godot/bin/godot.osx.tools.64 ${PROJECT_DIR}/godot/bin/godot + +.. figure:: img/xcode_7_setup_build_post_action.png + :figclass: figure-w480 + :align: center + +- Build the external build target. + +- Open the scheme editor again and select **Run**. + +.. figure:: img/xcode_8_setup_run_scheme.png + :figclass: figure-w480 + :align: center + +- Set the **Executable** to the file you linked in your post-build action script. +- Check **Debug executable**. +- You can add two arguments on the **Arguments** tab: + the ``-e`` flag opens the editor instead of the project manager, and the ``--path`` argument + tells the executable to open the specified project (must be provided as an *absolute* path + to the project root, not the ``project.godot`` file). + +To check that everything is working, put a breakpoint in ``platform/osx/godot_main_osx.mm`` and +run the project. + +If you run into any issues, ask for help in one of +`Godot's community channels `__. diff --git a/development/cpp/core_types.rst b/development/cpp/core_types.rst new file mode 100644 index 0000000..94238cb --- /dev/null +++ b/development/cpp/core_types.rst @@ -0,0 +1,235 @@ +.. _doc_core_types: + +Core types +========== + +Godot has a rich set of classes and templates that compose its core, +and everything is built upon them. + +This reference will try to list them in order for their better +understanding. + +Definitions +----------- + +Godot uses the standard C99 datatypes, such as ``uint8_t``, +``uint32_t``, ``int64_t``, etc. which are nowadays supported by every +compiler. Reinventing the wheel for those is not fun, as it makes code +more difficult to read. + +In general, care is not taken to use the most efficient datatype for a +given task unless using large structures or arrays. ``int`` is used +through most of the code unless necessary. This is done because nowadays +every device has at least a 32 bits bus and can do such operations in +one cycle. It makes code more readable too. + +For files or memory sizes, ``size_t`` is used, which is warranted to be +64 bits. + +For Unicode characters, CharType instead of wchar_t is used, because +many architectures have 4 bytes long wchar_t, where 2 bytes might be +desired. However, by default, this has not been forced and CharType maps +directly to wchar_t. + +References: +~~~~~~~~~~~ + +- `core/typedefs.h `__ + +Memory model +------------ + +PC is a wonderful architecture. Computers often have gigabytes of RAM, +terabytes of storage and gigahertz of CPU, and when an application needs +more resources the OS will swap out the inactive ones. Other +architectures (like mobile or consoles) are in general more limited. + +The most common memory model is the heap, where an application will +request a region of memory, and the underlying OS will try to fit it +somewhere and return it. This often works best and is flexible, +but over time and with abuse, this can lead to segmentation. + +Segmentation slowly creates holes that are too small for most common +allocations, so that memory is wasted. There is a lot of literature +about heap and segmentation, so this topic will not be developed +further here. Modern operating systems use paged memory, which helps +mitigate the problem of segmentation but doesn't solve it. + +However, in many studies and tests, it is shown that given enough +memory, if the maximum allocation size is below a given threshold in +proportion to the maximum heap size and proportion of memory intended to +be unused, segmentation will not be a problem over time as it will +remain constant. In other words, leave 10-20% of your memory free +and perform all small allocations and you are fine. + +Godot ensures that all objects that can be allocated dynamically are +small (less than a few kb at most). But what happens if an allocation is +too large (like an image or mesh geometry or large array)? In this case +Godot has the option to use a dynamic memory pool. This memory needs to +be locked to be accessed, and if an allocation runs out of memory, the +pool will be rearranged and compacted on demand. Depending on the need +of the game, the programmer can configure the dynamic memory pool size. + +Allocating memory +----------------- + +Godot has many tools for tracking memory usage in a game, especially +during debug. Because of this, the regular C and C++ library calls +should not be used. Instead, a few other ones are provided. + +For C-style allocation, Godot provides a few macros: + +.. code-block:: none + + memalloc() + memrealloc() + memfree() + +These are equivalent to the usual malloc, realloc, free of the standard C +library. + +For C++-style allocation, special macros are provided: + +.. code-block:: none + + memnew( Class / Class(args) ) + memdelete( instance ) + + memnew_arr( Class , amount ) + memdelete_arr( pointer to array ) + +which are equivalent to new, delete, new[] and delete[]. + +memnew/memdelete also use a little C++ magic and notify Objects right +after they are created, and right before they are deleted. + +For dynamic memory, the PoolVector<> template is provided. PoolVector is a +standard vector class, and is very similar to vector in the C++ standard library. +To create a PoolVector buffer, use this: + +.. code-block:: cpp + + PoolVector data; + +PoolVector can be accessed using the [] operator and a few helpers exist for this: + +.. code-block:: cpp + + PoolVector::Read r = data.read() + int someint = r[4] + +.. code-block:: cpp + + PoolVector::Write w = data.write() + w[4] = 22; + +These operations allow fast read/write from PoolVectors and keep it +locked until they go out of scope. However, PoolVectors should be used +for small, dynamic memory operations, as read() and write() are too slow for a +large amount of accesses. + +References: +~~~~~~~~~~~ + +- `core/os/memory.h `__ +- `core/pool_vector.h `__ + +Containers +---------- + +Godot provides also a set of common containers: + +- Vector +- List +- Set +- Map + +They are simple and aim to be as minimal as possible, as templates +in C++ are often inlined and make the binary size much fatter, both in +debug symbols and code. List, Set and Map can be iterated using +pointers, like this: + +.. code-block:: cpp + + for(List::Element *E=somelist.front();E;E=E->next()) { + print_line(E->get()); // print the element + } + +The Vector<> class also has a few nice features: + +- It does copy on write, so making copies of it is cheap as long as + they are not modified. +- It supports multi-threading, by using atomic operations on the + reference counter. + +References: +~~~~~~~~~~~ + +- `core/vector.h `__ +- `core/list.h `__ +- `core/set.h `__ +- `core/map.h `__ + +String +------ + +Godot also provides a String class. This class has a huge amount of +features, full Unicode support in all the functions (like case +operations) and utf8 parsing/extracting, as well as helpers for +conversion and visualization. + +References: +~~~~~~~~~~~ + +- `core/ustring.h `__ + +StringName +---------- + +StringNames are like a String, but they are unique. Creating a +StringName from a string results in a unique internal pointer for all +equal strings. StringNames are useful for using strings as +identifier, as comparing them is basically comparing a pointer. + +Creation of a StringName (especially a new one) is slow, but comparison +is fast. + +References: +~~~~~~~~~~~ + +- `core/string_name.h `__ + +Math types +---------- + +There are several linear math types available in the core/math +directory. + +References: +~~~~~~~~~~~ + +- `core/math `__ + +NodePath +-------- + +This is a special datatype used for storing paths in a scene tree and +referencing them fast. + +References: +~~~~~~~~~~~ + +- `core/node_path.h `__ + +RID +--- + +RIDs are resource IDs. Servers use these to reference data stored in +them. RIDs are opaque, meaning that the data they reference can't be +accessed directly. RIDs are unique, even for different types of +referenced data. + +References: +~~~~~~~~~~~ + +- `core/rid.h `__ diff --git a/development/cpp/custom_audiostreams.rst b/development/cpp/custom_audiostreams.rst new file mode 100644 index 0000000..33d9095 --- /dev/null +++ b/development/cpp/custom_audiostreams.rst @@ -0,0 +1,351 @@ +.. _doc_custom_audiostreams: + +Custom AudioStreams +=================== + +Introduction +------------ + +AudioStream is the base class of all audio emitting objects. +AudioStreamPlayer binds onto an AudioStream to emit PCM data +into an AudioServer which manages audio drivers. + +All audio resources require two audio based classes: AudioStream +and AudioStreamPlayback. As a data container, AudioStream contains +the resource and exposes itself to GDScript. AudioStream references +its own internal custom AudioStreamPlayback which translates +AudioStream into PCM data. + +This guide assumes the reader knows how to create C++ modules. If not, refer to this guide +:ref:`doc_custom_modules_in_c++`. + +References: +~~~~~~~~~~~ + +- `servers/audio/audio_stream.h `__ +- `scene/audio/audioplayer.cpp `__ + +What for? +--------- + +- Binding external libraries (like Wwise, FMOD, etc). +- Adding custom audio queues +- Adding support for more audio formats + +Create an AudioStream +--------------------- + +An AudioStream consists of three components: data container, stream name, +and an AudioStreamPlayback friend class generator. Audio data can be +loaded in a number of ways such as with an internal counter for a tone generator, +internal/external buffer, or a file reference. + +Some AudioStreams need to be stateless such as objects loaded from +ResourceLoader. ResourceLoader loads once and references the same +object regardless how many times ``load`` is called on a specific resource. +Therefore, playback state must be self-contained in AudioStreamPlayback. + +.. code-block:: cpp + + /* audiostream_mytone.h */ + + #include "core/reference.h" + #include "core/resource.h" + #include "servers/audio/audio_stream.h" + + class AudioStreamMyTone : public AudioStream { + GDCLASS(AudioStreamMyTone, AudioStream) + + private: + friend class AudioStreamPlaybackMyTone; + uint64_t pos; + int mix_rate; + bool stereo; + int hz; + + public: + void reset(); + void set_position(uint64_t pos); + virtual Ref instance_playback(); + virtual String get_stream_name() const; + void gen_tone(int16_t *pcm_buf, int size); + virtual float get_length() const { return 0; } // if supported, otherwise return 0 + AudioStreamMyTone(); + + protected: + static void _bind_methods(); + }; + +.. code-block:: cpp + + /* audiostream_mytone.cpp */ + + #include "audiostream_mytone.h" + + AudioStreamMyTone::AudioStreamMyTone() + : mix_rate(44100), stereo(false), hz(639) { + } + + Ref AudioStreamMyTone::instance_playback() { + Ref talking_tree; + talking_tree.instance(); + talking_tree->base = Ref(this); + return talking_tree; + } + + String AudioStreamMyTone::get_stream_name() const { + return "MyTone"; + } + void AudioStreamMyTone::reset() { + set_position(0); + } + void AudioStreamMyTone::set_position(uint64_t p) { + pos = p; + } + void AudioStreamMyTone::gen_tone(int16_t *pcm_buf, int size) { + for (int i = 0; i < size; i++) { + pcm_buf[i] = 32767.0 * sin(2.0 * Math_PI * double(pos + i) / (double(mix_rate) / double(hz))); + } + pos += size; + } + void AudioStreamMyTone::_bind_methods() { + ClassDB::bind_method(D_METHOD("reset"), &AudioStreamMyTone::reset); + ClassDB::bind_method(D_METHOD("get_stream_name"), &AudioStreamMyTone::get_stream_name); + } + +References: +~~~~~~~~~~~ + +- `servers/audio/audio_stream.h `__ + + +Create an AudioStreamPlayback +----------------------------- + +AudioStreamPlayer uses ``mix`` callback to obtain PCM data. The callback must match sample rate and fill the buffer. + +Since AudioStreamPlayback is controlled by the audio thread, i/o and dynamic memory allocation are forbidden. + +.. code-block:: cpp + + /* audiostreamplayer_mytone.h */ + + #include "core/reference.h" + #include "core/resource.h" + #include "servers/audio/audio_stream.h" + + class AudioStreamPlaybackMyTone : public AudioStreamPlayback { + GDCLASS(AudioStreamPlaybackMyTone, AudioStreamPlayback) + friend class AudioStreamMyTone; + + private: + enum { + PCM_BUFFER_SIZE = 4096 + }; + enum { + MIX_FRAC_BITS = 13, + MIX_FRAC_LEN = (1 << MIX_FRAC_BITS), + MIX_FRAC_MASK = MIX_FRAC_LEN - 1, + }; + void *pcm_buffer; + Ref base; + bool active; + + public: + virtual void start(float p_from_pos = 0.0); + virtual void stop(); + virtual bool is_playing() const; + virtual int get_loop_count() const; // times it looped + virtual float get_playback_position() const; + virtual void seek(float p_time); + virtual void mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames); + virtual float get_length() const; // if supported, otherwise return 0 + AudioStreamPlaybackMyTone(); + ~AudioStreamPlaybackMyTone(); + }; + +.. code-block:: cpp + + /* audiostreamplayer_mytone.cpp */ + + #include "audiostreamplayer_mytone.h" + + #include "core/math/math_funcs.h" + #include "core/print_string.h" + + AudioStreamPlaybackMyTone::AudioStreamPlaybackMyTone() + : active(false) { + AudioServer::get_singleton()->lock(); + pcm_buffer = AudioServer::get_singleton()->audio_data_alloc(PCM_BUFFER_SIZE); + zeromem(pcm_buffer, PCM_BUFFER_SIZE); + AudioServer::get_singleton()->unlock(); + } + AudioStreamPlaybackMyTone::~AudioStreamPlaybackMyTone() { + if(pcm_buffer) { + AudioServer::get_singleton()->audio_data_free(pcm_buffer); + pcm_buffer = NULL; + } + } + void AudioStreamPlaybackMyTone::stop() { + active = false; + base->reset(); + } + void AudioStreamPlaybackMyTone::start(float p_from_pos) { + seek(p_from_pos); + active = true; + } + void AudioStreamPlaybackMyTone::seek(float p_time) { + float max = get_length(); + if (p_time < 0) { + p_time = 0; + } + base->set_position(uint64_t(p_time * base->mix_rate) << MIX_FRAC_BITS); + } + void AudioStreamPlaybackMyTone::mix(AudioFrame *p_buffer, float p_rate, int p_frames) { + ERR_FAIL_COND(!active); + if (!active) { + return; + } + zeromem(pcm_buffer, PCM_BUFFER_SIZE); + int16_t *buf = (int16_t *)pcm_buffer; + base->gen_tone(buf, p_frames); + + for(int i = 0; i < p_frames; i++) { + float sample = float(buf[i]) / 32767.0; + p_buffer[i] = AudioFrame(sample, sample); + } + } + int AudioStreamPlaybackMyTone::get_loop_count() const { + return 0; + } + float AudioStreamPlaybackMyTone::get_playback_position() const { + return 0.0; + } + float AudioStreamPlaybackMyTone::get_length() const { + return 0.0; + } + bool AudioStreamPlaybackMyTone::is_playing() const { + return active; + } + +Resampling +~~~~~~~~~~ + +Godot's AudioServer currently uses 44100 Hz sample rate. When other sample rates are +needed such as 48000, either provide one or use AudioStreamPlaybackResampled. +Godot provides cubic interpolation for audio resampling. + +Instead of overloading ``mix``, AudioStreamPlaybackResampled uses ``_mix_internal`` to +query AudioFrames and ``get_stream_sampling_rate`` to query current mix rate. + +.. code-block:: cpp + + #include "core/reference.h" + #include "core/resource.h" + #include "servers/audio/audio_stream.h" + + class AudioStreamMyToneResampled; + + class AudioStreamPlaybackResampledMyTone : public AudioStreamPlaybackResampled { + GDCLASS(AudioStreamPlaybackResampledMyTone, AudioStreamPlaybackResampled) + friend class AudioStreamMyToneResampled; + + private: + enum { + PCM_BUFFER_SIZE = 4096 + }; + enum { + MIX_FRAC_BITS = 13, + MIX_FRAC_LEN = (1 << MIX_FRAC_BITS), + MIX_FRAC_MASK = MIX_FRAC_LEN - 1, + }; + void *pcm_buffer; + Ref base; + bool active; + + protected: + virtual void _mix_internal(AudioFrame *p_buffer, int p_frames); + + public: + virtual void start(float p_from_pos = 0.0); + virtual void stop(); + virtual bool is_playing() const; + virtual int get_loop_count() const; // times it looped + virtual float get_playback_position() const; + virtual void seek(float p_time); + virtual float get_length() const; // if supported, otherwise return 0 + virtual float get_stream_sampling_rate(); + AudioStreamPlaybackResampledMyTone(); + ~AudioStreamPlaybackResampledMyTone(); + }; + +.. code-block:: cpp + + #include "mytone_audiostream_resampled.h" + + #include "core/math/math_funcs.h" + #include "core/print_string.h" + + AudioStreamPlaybackResampledMyTone::AudioStreamPlaybackResampledMyTone() + : active(false) { + AudioServer::get_singleton()->lock(); + pcm_buffer = AudioServer::get_singleton()->audio_data_alloc(PCM_BUFFER_SIZE); + zeromem(pcm_buffer, PCM_BUFFER_SIZE); + AudioServer::get_singleton()->unlock(); + } + AudioStreamPlaybackResampledMyTone::~AudioStreamPlaybackResampledMyTone() { + if (pcm_buffer) { + AudioServer::get_singleton()->audio_data_free(pcm_buffer); + pcm_buffer = NULL; + } + } + void AudioStreamPlaybackResampledMyTone::stop() { + active = false; + base->reset(); + } + void AudioStreamPlaybackResampledMyTone::start(float p_from_pos) { + seek(p_from_pos); + active = true; + } + void AudioStreamPlaybackResampledMyTone::seek(float p_time) { + float max = get_length(); + if (p_time < 0) { + p_time = 0; + } + base->set_position(uint64_t(p_time * base->mix_rate) << MIX_FRAC_BITS); + } + void AudioStreamPlaybackResampledMyTone::_mix_internal(AudioFrame *p_buffer, int p_frames) { + ERR_FAIL_COND(!active); + if (!active) { + return; + } + zeromem(pcm_buffer, PCM_BUFFER_SIZE); + int16_t *buf = (int16_t *)pcm_buffer; + base->gen_tone(buf, p_frames); + + for(int i = 0; i < p_frames; i++) { + float sample = float(buf[i]) / 32767.0; + p_buffer[i] = AudioFrame(sample, sample); + } + } + float AudioStreamPlaybackResampledMyTone::get_stream_sampling_rate() { + return float(base->mix_rate); + } + int AudioStreamPlaybackResampledMyTone::get_loop_count() const { + return 0; + } + float AudioStreamPlaybackResampledMyTone::get_playback_position() const { + return 0.0; + } + float AudioStreamPlaybackResampledMyTone::get_length() const { + return 0.0; + } + bool AudioStreamPlaybackResampledMyTone::is_playing() const { + return active; + } + +References: +~~~~~~~~~~~ +- `core/math/audio_frame.h `__ +- `servers/audio/audio_stream.h `__ +- `scene/audio/audioplayer.cpp `__ diff --git a/development/cpp/custom_godot_servers.rst b/development/cpp/custom_godot_servers.rst new file mode 100644 index 0000000..ebf6fa3 --- /dev/null +++ b/development/cpp/custom_godot_servers.rst @@ -0,0 +1,509 @@ +.. _doc_custom_godot_servers: + +Custom Godot servers +==================== + +Introduction +------------ + +Godot implements multi-threading as servers. Servers are daemons which +manage data, process it, and push the result. Servers implement the +mediator pattern which interprets resource ID and process data for the +engine and other modules. In addition, the server claims ownership for +its RID allocations. + +This guide assumes the reader knows how to create C++ modules and Godot +data types. If not, refer to :ref:`doc_custom_modules_in_c++`. + +References +~~~~~~~~~~~ + +- `Why does Godot use servers and RIDs? `__ +- `Singleton pattern `__ +- `Mediator pattern `__ + +What for? +--------- + +- Adding artificial intelligence. +- Adding custom asynchronous threads. +- Adding support for a new input device. +- Adding writing threads. +- Adding a custom VoIP protocol. +- And more... + +Creating a Godot server +----------------------- + +At minimum, a server must have a static instance, a sleep timer, a thread loop, +an initialization state and a cleanup procedure. + +.. code-block:: cpp + + #ifndef HILBERT_HOTEL_H + #define HILBERT_HOTEL_H + + #include "core/list.h" + #include "core/object.h" + #include "core/os/thread.h" + #include "core/os/mutex.h" + #include "core/rid.h" + #include "core/set.h" + #include "core/variant.h" + + class HilbertHotel : public Object { + GDCLASS(HilbertHotel, Object); + + static HilbertHotel *singleton; + static void thread_func(void *p_udata); + + private: + bool thread_exited; + mutable bool exit_thread; + Thread *thread; + Mutex *mutex; + + public: + static HilbertHotel *get_singleton(); + Error init(); + void lock(); + void unlock(); + void finish(); + + protected: + static void _bind_methods(); + + private: + uint64_t counter; + RID_Owner bus_owner; + // https://github.com/godotengine/godot/blob/3.x/core/rid.h#L196 + Set buses; + void _emit_occupy_room(uint64_t room, RID rid); + + public: + RID create_bus(); + Variant get_bus_info(RID id); + bool empty(); + bool delete_bus(RID id); + void clear(); + void register_rooms(); + HilbertHotel(); + }; + + #endif + +.. code-block:: cpp + + #include "hilbert_hotel.h" + + #include "core/dictionary.h" + #include "core/list.h" + #include "core/os/os.h" + #include "core/variant.h" + + #include "prime_225.h" + + void HilbertHotel::thread_func(void *p_udata) { + + HilbertHotel *ac = (HilbertHotel *) p_udata; + uint64_t msdelay = 1000; + + while (!ac->exit_thread) { + if (!ac->empty()) { + ac->lock(); + ac->register_rooms(); + ac->unlock(); + } + OS::get_singleton()->delay_usec(msdelay * 1000); + } + } + + Error HilbertHotel::init() { + thread_exited = false; + counter = 0; + mutex = Mutex::create(); + thread = Thread::create(HilbertHotel::thread_func, this); + return OK; + } + + HilbertHotel *HilbertHotel::singleton = NULL; + + HilbertHotel *HilbertHotel::get_singleton() { + return singleton; + } + + void HilbertHotel::register_rooms() { + for (Set::Element *e = buses.front(); e; e = e->next()) { + auto bus = bus_owner.getornull(e->get()); + + if (bus) { + uint64_t room = bus->next_room(); + _emit_occupy_room(room, bus->get_self()); + } + } + } + + void HilbertHotel::unlock() { + if (!thread || !mutex) { + return; + } + + mutex->unlock(); + } + + void HilbertHotel::lock() { + if (!thread || !mutex) { + return; + } + + mutex->lock(); + } + + void HilbertHotel::_emit_occupy_room(uint64_t room, RID rid) { + _HilbertHotel::get_singleton()->_occupy_room(room, rid); + } + + Variant HilbertHotel::get_bus_info(RID id) { + InfiniteBus *)bus = bus_owner.getornull(id); + + if (bus) { + Dictionary d; + d["prime"] = bus->get_bus_num(); + d["current_room"] = bus->get_current_room(); + return d; + } + + return Variant(); + } + + void HilbertHotel::finish() { + if (!thread) { + return; + } + + exit_thread = true; + Thread::wait_to_finish(thread); + + memdelete(thread); + + if (mutex) { + memdelete(mutex); + } + + thread = NULL; + } + + RID HilbertHotel::create_bus() { + lock(); + InfiniteBus *ptr = memnew(InfiniteBus(PRIME[counter++])); + RID ret = bus_owner.make_rid(ptr); + ptr->set_self(ret); + buses.insert(ret); + unlock(); + + return ret; + } + + // https://github.com/godotengine/godot/blob/3.x/core/rid.h#L187 + bool HilbertHotel::delete_bus(RID id) { + if (bus_owner.owns(id)) { + lock(); + InfiniteBus *b = bus_owner.get(id); + bus_owner.free(id); + buses.erase(id); + memdelete(b); + unlock(); + return true; + } + + return false; + } + + void HilbertHotel::clear() { + for (Set::Element *e = buses.front(); e; e = e->next()) { + delete_bus(e->get()); + } + } + + bool HilbertHotel::empty() { + return buses.size() <= 0; + } + + void HilbertHotel::_bind_methods() { + } + + HilbertHotel::HilbertHotel() { + singleton = this; + } + +.. code-block:: cpp + + /* prime_225.h */ + + #include "core/int_types.h" + + const uint64_t PRIME[225] = { + 2,3,5,7,11,13,17,19,23, + 29,31,37,41,43,47,53,59,61, + 67,71,73,79,83,89,97,101,103, + 107,109,113,127,131,137,139,149,151, + 157,163,167,173,179,181,191,193,197, + 199,211,223,227,229,233,239,241,251, + 257,263,269,271,277,281,283,293,307, + 311,313,317,331,337,347,349,353,359, + 367,373,379,383,389,397,401,409,419, + 421,431,433,439,443,449,457,461,463, + 467,479,487,491,499,503,509,521,523, + 541,547,557,563,569,571,577,587,593, + 599,601,607,613,617,619,631,641,643, + 647,653,659,661,673,677,683,691,701, + 709,719,727,733,739,743,751,757,761, + 769,773,787,797,809,811,821,823,827, + 829,839,853,857,859,863,877,881,883, + 887,907,911,919,929,937,941,947,953, + 967,971,977,983,991,997,1009,1013,1019, + 1021,1031,1033,1039,1049,1051,1061,1063,1069, + 1087,1091,1093,1097,1103,1109,1117,1123,1129, + 1151,1153,1163,1171,1181,1187,1193,1201,1213, + 1217,1223,1229,1231,1237,1249,1259,1277,1279, + 1283,1289,1291,1297,1301,1303,1307,1319,1321, + 1327,1361,1367,1373,1381,1399,1409,1423,1427 + }; + +Custom managed resource data +---------------------------- + +Godot servers implement a mediator pattern. All data types inherit ``RID_Data``. +``RID_Owner`` owns the object when ``make_rid`` is called. During debug mode only, +RID_Owner maintains a list of RIDs. In practice, RIDs are similar to writing +object-oriented C code. + +.. code-block:: cpp + + class InfiniteBus : public RID_Data { + RID self; + + private: + uint64_t prime_num; + uint64_t num; + + public: + uint64_t next_room() { + return prime_num * num++; + } + + uint64_t get_bus_num() const { + return prime_num; + } + + uint64_t get_current_room() const { + return prime_num * num; + } + + _FORCE_INLINE_ void set_self(const RID &p_self) { + self = p_self; + } + + _FORCE_INLINE_ RID get_self() const { + return self; + } + + InfiniteBus(uint64_t prime) : prime_num(prime), num(1) {}; + ~InfiniteBus() {}; + } + +References +~~~~~~~~~~~ + +- :ref:`RID` +- `core/rid.h `__ + +Registering the class in GDScript +--------------------------------- + +Servers are allocated in ``register_types.cpp``. The constructor sets the static +instance and ``init()`` creates the managed thread; ``unregister_types.cpp`` +cleans up the server. + +Since a Godot server class creates an instance and binds it to a static singleton, +binding the class might not reference the correct instance. Therefore, a dummy +class must be created to reference the proper Godot server. + +In ``register_server_types()``, ``Engine::get_singleton()->add_singleton`` +is used to register the dummy class in GDScript. + +.. code-block:: cpp + + /* register_types.cpp */ + + #include "register_types.h" + + #include "core/class_db.h" + #include "core/engine.h" + + #include "hilbert_hotel.h" + + static HilbertHotel *hilbert_hotel = NULL; + static _HilbertHotel *_hilbert_hotel = NULL; + + void register_hilbert_hotel_types() { + hilbert_hotel = memnew(HilbertHotel); + hilbert_hotel->init(); + _hilbert_hotel = memnew(_HilbertHotel); + ClassDB::register_class<_HilbertHotel>(); + Engine::get_singleton()->add_singleton(Engine::Singleton("HilbertHotel", _HilbertHotel::get_singleton())); + } + + void unregister_hilbert_hotel_types() { + if (hilbert_hotel) { + hilbert_hotel->finish(); + memdelete(hilbert_hotel); + } + + if (_hilbert_hotel) { + memdelete(_hilbert_hotel); + } + } + +.. code-block:: cpp + + /* register_types.h */ + + /* Yes, the word in the middle must be the same as the module folder name */ + void register_hilbert_hotel_types(); + void unregister_hilbert_hotel_types(); + +- `servers/register_server_types.cpp `__ + +Bind methods +~~~~~~~~~~~~ + +The dummy class binds singleton methods to GDScript. In most cases, the dummy class methods wraps around. + +.. code-block:: cpp + + Variant _HilbertHotel::get_bus_info(RID id) { + return HilbertHotel::get_singleton()->get_bus_info(id); + } + +Binding Signals + +It is possible to emit signals to GDScript by calling the GDScript dummy object. + +.. code-block:: cpp + + void HilbertHotel::_emit_occupy_room(uint64_t room, RID rid) { + _HilbertHotel::get_singleton()->_occupy_room(room, rid); + } + +.. code-block:: cpp + + class _HilbertHotel : public Object { + GDCLASS(_HilbertHotel, Object); + + friend class HilbertHotel; + static _HilbertHotel *singleton; + + protected: + static void _bind_methods(); + + private: + void _occupy_room(int room_number, RID bus); + + public: + RID create_bus(); + void connect_signals(); + bool delete_bus(RID id); + static _HilbertHotel *get_singleton(); + Variant get_bus_info(RID id); + + _HilbertHotel(); + ~_HilbertHotel(); + }; + + #endif + +.. code-block:: cpp + + _HilbertHotel *_HilbertHotel::singleton = NULL; + _HilbertHotel *_HilbertHotel::get_singleton() { return singleton; } + + RID _HilbertHotel::create_bus() { + return HilbertHotel::get_singleton()->create_bus(); + } + + bool _HilbertHotel::delete_bus(RID rid) { + return HilbertHotel::get_singleton()->delete_bus(rid); + } + + void _HilbertHotel::_occupy_room(int room_number, RID bus) { + emit_signal("occupy_room", room_number, bus); + } + + Variant _HilbertHotel::get_bus_info(RID id) { + return HilbertHotel::get_singleton()->get_bus_info(id); + } + + void _HilbertHotel::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_bus_info", "r_id"), &_HilbertHotel::get_bus_info); + ClassDB::bind_method(D_METHOD("create_bus"), &_HilbertHotel::create_bus); + ClassDB::bind_method(D_METHOD("delete_bus"), &_HilbertHotel::delete_bus); + ADD_SIGNAL(MethodInfo("occupy_room", PropertyInfo(Variant::INT, "room_number"), PropertyInfo(Variant::_RID, "r_id"))); + } + + void _HilbertHotel::connect_signals() { + HilbertHotel::get_singleton()->connect("occupy_room", _HilbertHotel::get_singleton(), "_occupy_room"); + } + + _HilbertHotel::_HilbertHotel() { + singleton = this; + } + + _HilbertHotel::~_HilbertHotel() { + } + +MessageQueue +------------ + +In order to send commands into SceneTree, MessageQueue is a thread-safe buffer +to queue set and call methods for other threads. To queue a command, obtain +the target object RID and use either ``push_call``, ``push_set``, or ``push_notification`` +to execute the desired behavior. The queue will be flushed whenever either +``SceneTree::idle`` or ``SceneTree::iteration`` is executed. + +References: +~~~~~~~~~~~ + +- `core/message_queue.cpp `__ + +Summing it up +------------- + +Here is the GDScript sample code: + +:: + + extends Node + + func _ready(): + print("Start debugging") + HilbertHotel.connect("occupy_room", self, "_print_occupy_room") + var rid = HilbertHotel.create_bus() + OS.delay_msec(2000) + HilbertHotel.create_bus() + OS.delay_msec(2000) + HilbertHotel.create_bus() + OS.delay_msec(2000) + print(HilbertHotel.get_bus_info(rid)) + HilbertHotel.delete_bus(rid) + print("Ready done") + + func _print_occupy_room(room_number, r_id): + print("Room number: " + str(room_number) + ", RID: " + str(r_id)) + print(HilbertHotel.get_bus_info(r_id)) + +Notes +~~~~~ + +- The actual `Hilbert Hotel `__ is impossible. +- Connecting signal example code is pretty hacky. diff --git a/development/cpp/custom_modules_in_cpp.rst b/development/cpp/custom_modules_in_cpp.rst new file mode 100644 index 0000000..9633268 --- /dev/null +++ b/development/cpp/custom_modules_in_cpp.rst @@ -0,0 +1,563 @@ +.. _doc_custom_modules_in_c++: + +Custom modules in C++ +===================== + +Modules +------- + +Godot allows extending the engine in a modular way. New modules can be +created and then enabled/disabled. This allows for adding new engine +functionality at every level without modifying the core, which can be +split for use and reuse in different modules. + +Modules are located in the ``modules/`` subdirectory of the build system. +By default, dozens of modules are enabled, such as GDScript (which, yes, +is not part of the base engine), the Mono runtime, a regular expressions +module, and others. As many new modules as desired can be +created and combined. The SCons build system will take care of it +transparently. + +What for? +--------- + +While it's recommended that most of a game be written in scripting (as +it is an enormous time saver), it's perfectly possible to use C++ +instead. Adding C++ modules can be useful in the following scenarios: + +- Binding an external library to Godot (like PhysX, FMOD, etc). +- Optimize critical parts of a game. +- Adding new functionality to the engine and/or editor. +- Porting an existing game. +- Write a whole, new game in C++ because you can't live without C++. + +Creating a new module +--------------------- + +Before creating a module, make sure to :ref:`download the source code of Godot +and compile it `. + +To create a new module, the first step is creating a directory inside +``modules/``. If you want to maintain the module separately, you can checkout +a different VCS into modules and use it. + +The example module will be called "summator" (``godot/modules/summator``). +Inside we will create a simple summator class: + +.. code-block:: cpp + + /* summator.h */ + + #ifndef SUMMATOR_H + #define SUMMATOR_H + + #include "core/reference.h" + + class Summator : public Reference { + GDCLASS(Summator, Reference); + + int count; + + protected: + static void _bind_methods(); + + public: + void add(int p_value); + void reset(); + int get_total() const; + + Summator(); + }; + + #endif // SUMMATOR_H + +And then the cpp file. + +.. code-block:: cpp + + /* summator.cpp */ + + #include "summator.h" + + void Summator::add(int p_value) { + count += p_value; + } + + void Summator::reset() { + count = 0; + } + + int Summator::get_total() const { + return count; + } + + void Summator::_bind_methods() { + ClassDB::bind_method(D_METHOD("add", "value"), &Summator::add); + ClassDB::bind_method(D_METHOD("reset"), &Summator::reset); + ClassDB::bind_method(D_METHOD("get_total"), &Summator::get_total); + } + + Summator::Summator() { + count = 0; + } + +Then, the new class needs to be registered somehow, so two more files +need to be created: + +.. code-block:: none + + register_types.h + register_types.cpp + +.. important:: + These files must be in the top-level folder of your module (next to your + ``SCsub`` and ``config.py`` files) for the module to be registered properly. + +These files should contain the following: + +.. code-block:: cpp + + /* register_types.h */ + + void register_summator_types(); + void unregister_summator_types(); + /* yes, the word in the middle must be the same as the module folder name */ + +.. code-block:: cpp + + /* register_types.cpp */ + + #include "register_types.h" + + #include "core/class_db.h" + #include "summator.h" + + void register_summator_types() { + ClassDB::register_class(); + } + + void unregister_summator_types() { + // Nothing to do here in this example. + } + +Next, we need to create a ``SCsub`` file so the build system compiles +this module: + +.. code-block:: python + + # SCsub + + Import('env') + + env.add_source_files(env.modules_sources, "*.cpp") # Add all cpp files to the build + +With multiple sources, you can also add each file individually to a Python +string list: + +.. code-block:: python + + src_list = ["summator.cpp", "other.cpp", "etc.cpp"] + env.add_source_files(env.modules_sources, src_list) + +This allows for powerful possibilities using Python to construct the file list +using loops and logic statements. Look at some modules that ship with Godot by +default for examples. + +To add include directories for the compiler to look at you can append it to the +environment's paths: + +.. code-block:: python + + env.Append(CPPPATH=["mylib/include"]) # this is a relative path + env.Append(CPPPATH=["#myotherlib/include"]) # this is an 'absolute' path + +If you want to add custom compiler flags when building your module, you need to clone +``env`` first, so it won't add those flags to whole Godot build (which can cause errors). +Example ``SCsub`` with custom flags: + +.. code-block:: python + + # SCsub + + Import('env') + + module_env = env.Clone() + module_env.add_source_files(env.modules_sources, "*.cpp") + # Append CCFLAGS flags for both C and C++ code. + module_env.Append(CCFLAGS=['-O2']) + # If you need to, you can: + # - Append CFLAGS for C code only. + # - Append CXXFLAGS for C++ code only. + +And finally, the configuration file for the module, this is a simple +python script that must be named ``config.py``: + +.. code-block:: python + + # config.py + + def can_build(env, platform): + return True + + def configure(env): + pass + +The module is asked if it's OK to build for the specific platform (in +this case, ``True`` means it will build for every platform). + +And that's it. Hope it was not too complex! Your module should look like +this: + +.. code-block:: none + + godot/modules/summator/config.py + godot/modules/summator/summator.h + godot/modules/summator/summator.cpp + godot/modules/summator/register_types.h + godot/modules/summator/register_types.cpp + godot/modules/summator/SCsub + +You can then zip it and share the module with everyone else. When +building for every platform (instructions in the previous sections), +your module will be included. + +.. note:: There is a parameter limit of 5 in C++ modules for things such + as subclasses. This can be raised to 13 by including the header + file ``core/method_bind_ext.gen.inc``. + +Using the module +---------------- + +You can now use your newly created module from any script: + +.. tabs:: + .. code-tab:: gdscript GDScript + + var s = Summator.new() + s.add(10) + s.add(20) + s.add(30) + print(s.get_total()) + s.reset() + +The output will be ``60``. + +.. seealso:: The previous Summator example is great for small, custom modules, + but what if you want to use a larger, external library? Refer to + :ref:`doc_binding_to_external_libraries` for details about binding to + external libraries. + +.. warning:: If your module is meant to be accessed from the running project + (not just from the editor), you must also recompile every export + template you plan to use, then specify the path to the custom + template in each export preset. Otherwise, you'll get errors when + running the project as the module isn't compiled in the export + template. See the :ref:`Compiling ` pages + for more information. + +Compiling a module externally +----------------------------- + +Compiling a module involves moving the module's sources directly under the +engine's ``modules/`` directory. While this is the most straightforward way to +compile a module, there are a couple of reasons as to why this might not be a +practical thing to do: + +1. Having to manually copy modules sources every time you want to compile the + engine with or without the module, or taking additional steps needed to + manually disable a module during compilation with a build option similar to + ``module_summator_enabled=no``. Creating symbolic links may also be a solution, + but you may additionally need to overcome OS restrictions like needing the + symbolic link privilege if doing this via script. + +2. Depending on whether you have to work with the engine's source code, the + module files added directly to ``modules/`` changes the working tree to the + point where using a VCS (like ``git``) proves to be cumbersome as you need to + make sure that only the engine-related code is committed by filtering + changes. + +So if you feel like the independent structure of custom modules is needed, lets +take our "summator" module and move it to the engine's parent directory: + +.. code-block:: shell + + mkdir ../modules + mv modules/summator ../modules + +Compile the engine with our module by providing ``custom_modules`` build option +which accepts a comma-separated list of directory paths containing custom C++ +modules, similar to the following: + +.. code-block:: shell + + scons custom_modules=../modules + +The build system shall detect all modules under the ``../modules`` directory +and compile them accordingly, including our "summator" module. + +.. warning:: + + Any path passed to ``custom_modules`` will be converted to an absolute path + internally as a way to distinguish between custom and built-in modules. It + means that things like generating module documentation may rely on a + specific path structure on your machine. + +.. seealso:: + + :ref:`Introduction to the buildsystem - Custom modules build option `. + +Improving the build system for development +------------------------------------------ + +So far we defined a clean and simple SCsub that allows us to add the sources +of our new module as part of the Godot binary. + +This static approach is fine when we want to build a release version of our +game given we want all the modules in a single binary. + +However, the trade-off is every single change means a full recompilation of the +game. Even if SCons is able to detect and recompile only the file that have +changed, finding such files and eventually linking the final binary is a +long and costly part. + +The solution to avoid such a cost is to build our own module as a shared +library that will be dynamically loaded when starting our game's binary. + +.. code-block:: python + + # SCsub + + Import('env') + + sources = [ + "register_types.cpp", + "summator.cpp" + ] + + # First, create a custom env for the shared library. + module_env = env.Clone() + + # Position-independent code is required for a shared library. + module_env.Append(CCFLAGS=['-fPIC']) + + # Don't inject Godot's dependencies into our shared library. + module_env['LIBS'] = [] + + # Define the shared library. By default, it would be built in the module's + # folder, however it's better to output it into `bin` next to the + # Godot binary. + shared_lib = module_env.SharedLibrary(target='#bin/summator', source=sources) + + # Finally, notify the main build environment it now has our shared library + # as a new dependency. + + # LIBPATH and LIBS need to be set on the real "env" (not the clone) + # to link the specified libraries to the Godot executable. + + env.Append(LIBPATH=['#bin']) + + # SCons wants the name of the library with it custom suffixes + # (e.g. ".x11.tools.64") but without the final ".so". + shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] + env.Append(LIBS=[shared_lib_shim]) + +Once compiled, we should end up with a ``bin`` directory containing both the +``godot*`` binary and our ``libsummator*.so``. However given the .so is not in +a standard directory (like ``/usr/lib``), we have to help our binary find it +during runtime with the ``LD_LIBRARY_PATH`` environment variable: + +.. code-block:: shell + + export LD_LIBRARY_PATH="$PWD/bin/" + ./bin/godot* + +.. note:: + You have to ``export`` the environment variable otherwise + you won't be able to play your project from within the editor. + +On top of that, it would be nice to be able to select whether to compile our +module as shared library (for development) or as a part of the Godot binary +(for release). To do that we can define a custom flag to be passed to SCons +using the `ARGUMENT` command: + +.. code-block:: python + + # SCsub + + Import('env') + + sources = [ + "register_types.cpp", + "summator.cpp" + ] + + module_env = env.Clone() + module_env.Append(CCFLAGS=['-O2']) + + if ARGUMENTS.get('summator_shared', 'no') == 'yes': + # Shared lib compilation + module_env.Append(CCFLAGS=['-fPIC']) + module_env['LIBS'] = [] + shared_lib = module_env.SharedLibrary(target='#bin/summator', source=sources) + shared_lib_shim = shared_lib[0].name.rsplit('.', 1)[0] + env.Append(LIBS=[shared_lib_shim]) + env.Append(LIBPATH=['#bin']) + else: + # Static compilation + module_env.add_source_files(env.modules_sources, sources) + +Now by default ``scons`` command will build our module as part of Godot's binary +and as a shared library when passing ``summator_shared=yes``. + +Finally, you can even speed up the build further by explicitly specifying your +shared module as target in the SCons command: + +.. code-block:: shell + + scons summator_shared=yes platform=x11 bin/libsummator.x11.tools.64.so + +Writing custom documentation +---------------------------- + +Writing documentation may seem like a boring task, but it is highly recommended +to document your newly created module in order to make it easier for users to +benefit from it. Not to mention that the code you've written one year ago may +become indistinguishable from the code that was written by someone else, so be +kind to your future self! + +There are several steps in order to setup custom docs for the module: + +1. Make a new directory in the root of the module. The directory name can be + anything, but we'll be using the ``doc_classes`` name throughout this section. + +2. Now, we need to edit ``config.py``, add the following snippet: + + .. code-block:: python + + def get_doc_path(): + return "doc_classes" + + def get_doc_classes(): + return [ + "Summator", + ] + +The ``get_doc_path()`` function is used by the build system to determine +the location of the docs. In this case, they will be located in the +``modules/summator/doc_classes`` directory. If you don't define this, +the doc path for your module will fall back to the main ``doc/classes`` +directory. + +The ``get_doc_classes()`` method is necessary for the build system to +know which registered classes belong to the module. You need to list all of your +classes here. The classes that you don't list will end up in the +main ``doc/classes`` directory. + +.. tip:: + + You can use Git to check if you have missed some of your classes by checking the + untracked files with ``git status``. For example:: + + user@host:~/godot$ git status + + Example output:: + + Untracked files: + (use "git add ..." to include in what will be committed) + + doc/classes/MyClass2D.xml + doc/classes/MyClass4D.xml + doc/classes/MyClass5D.xml + doc/classes/MyClass6D.xml + ... + + +3. Now we can generate the documentation: + +We can do this via running Godot's doctool i.e. ``godot --doctool ``, +which will dump the engine API reference to the given ```` in XML format. + +In our case we'll point it to the root of the cloned repository. You can point it +to an another folder, and just copy over the files that you need. + +Run command: + + :: + + user@host:~/godot/bin$ ./bin/ --doctool . + +Now if you go to the ``godot/modules/summator/doc_classes`` folder, you will see +that it contains a ``Summator.xml`` file, or any other classes, that you referenced +in your ``get_doc_classes`` function. + +Edit the file(s) following :ref:`doc_updating_the_class_reference` and recompile the engine. + +Once the compilation process is finished, the docs will become accessible within +the engine's built-in documentation system. + +In order to keep documentation up-to-date, all you'll have to do is simply modify +one of the XML files and recompile the engine from now on. + +If you change your module's API, you can also re-extract the docs, they will contain +the things that you previously added. Of course if you point it to your godot +folder, make sure you don't lose work by extracting older docs from an older engine build +on top of the newer ones. + +Note that if you don't have write access rights to your supplied ````, +you might encounter an error similar to the following: + +.. code-block:: console + + ERROR: Can't write doc file: docs/doc/classes/@GDScript.xml + At: editor/doc/doc_data.cpp:956 + + +.. _doc_custom_module_icons: + +Adding custom editor icons +-------------------------- + +Similarly to how you can write self-contained documentation within a module, +you can also create your own custom icons for classes to appear in the editor. + +For the actual process of creating editor icons to be integrated within the engine, +please refer to :ref:`doc_editor_icons` first. + +Once you've created your icon(s), proceed with the following steps: + +1. Make a new directory in the root of the module named ``icons``. This is the + default path for the engine to look for module's editor icons. + +2. Move your newly created ``svg`` icons (optimized or not) into that folder. + +3. Recompile the engine and run the editor. Now the icon(s) will appear in + editor's interface where appropriate. + +If you'd like to store your icons somewhere else within your module, +add the following code snippet to ``config.py`` to override the default path: + + .. code-block:: python + + def get_icons_path(): + return "path/to/icons" + +Summing up +---------- + +Remember to: + +- use ``GDCLASS`` macro for inheritance, so Godot can wrap it +- use ``_bind_methods`` to bind your functions to scripting, and to + allow them to work as callbacks for signals. + +But this is not all, depending what you do, you will be greeted with +some (hopefully positive) surprises. + +- If you inherit from :ref:`class_Node` (or any derived node type, such as + Sprite), your new class will appear in the editor, in the inheritance + tree in the "Add Node" dialog. +- If you inherit from :ref:`class_Resource`, it will appear in the resource + list, and all the exposed properties can be serialized when + saved/loaded. +- By this same logic, you can extend the Editor and almost any area of + the engine. diff --git a/development/cpp/custom_resource_format_loaders.rst b/development/cpp/custom_resource_format_loaders.rst new file mode 100644 index 0000000..7eba16e --- /dev/null +++ b/development/cpp/custom_resource_format_loaders.rst @@ -0,0 +1,386 @@ +.. _doc_custom_resource_format_loaders: + +Custom resource format loaders +============================== + +Introduction +------------ + +ResourceFormatLoader is a factory interface for loading file assets. +Resources are primary containers. When load is called on the same file +path again, the previous loaded Resource will be referenced. Naturally, +loaded resources must be stateless. + +This guide assumes the reader knows how to create C++ modules and Godot +data types. If not, refer to this guide :ref:`doc_custom_modules_in_c++`. + +References +~~~~~~~~~~ + +- :ref:`ResourceLoader` +- `core/io/resource_loader.cpp `_ + +What for? +--------- + +- Adding new support for many file formats +- Audio formats +- Video formats +- Machine learning models + +What not? +--------- + +- Raster images + +ImageFormatLoader should be used to load images. + +References +~~~~~~~~~~ + +- `core/io/image_loader.h `_ + + +Creating a ResourceFormatLoader +------------------------------- + +Each file format consist of a data container and a ``ResourceFormatLoader``. + +ResourceFormatLoaders are usually simple classes which return all the +necessary metadata for supporting new extensions in Godot. The +class must return the format name and the extension string. + +In addition, ResourceFormatLoaders must convert file paths into +resources with the ``load`` function. To load a resource, ``load`` must +read and handle data serialization. + + +.. code-block:: cpp + + /* resource_loader_json.h */ + + #ifndef RESOURCE_LOADER_JSON_H + #define RESOURCE_LOADER_JSON_H + + #include "core/io/resource_loader.h" + + class ResourceFormatLoaderJson : public ResourceFormatLoader { + GDCLASS(ResourceFormatLoaderJson, ResourceFormatLoader); + public: + virtual RES load(const String &p_path, const String &p_original_path, Error *r_error = NULL); + virtual void get_recognized_extensions(List *r_extensions) const; + virtual bool handles_type(const String &p_type) const; + virtual String get_resource_type(const String &p_path) const; + }; + #endif // RESOURCE_LOADER_JSON_H + +.. code-block:: cpp + + /* resource_loader_json.cpp */ + + #include "resource_loader_json.h" + + #include "resource_json.h" + + RES ResourceFormatLoaderJson::load(const String &p_path, const String &p_original_path, Error *r_error) { + Ref json = memnew(JsonResource); + if (r_error) { + *r_error = OK; + } + Error err = json->load_file(p_path); + return json; + } + + void ResourceFormatLoaderJson::get_recognized_extensions(List *r_extensions) const { + if (!r_extensions->find("json")) { + r_extensions->push_back("json"); + } + } + + String ResourceFormatLoaderJson::get_resource_type(const String &p_path) const { + return "Resource"; + } + + bool ResourceFormatLoaderJson::handles_type(const String &p_type) const { + return ClassDB::is_parent_class(p_type, "Resource"); + } + +Creating a ResourceFormatSaver +------------------------------ + +If you'd like to be able to edit and save a resource, you can implement a +``ResourceFormatSaver``: + +.. code-block:: cpp + + /* resource_saver_json.h */ + + #ifndef RESOURCE_SAVER_JSON_H + #define RESOURCE_SAVER_JSON_H + + #include "core/io/resource_saver.h" + + class ResourceFormatSaverJson : public ResourceFormatSaver { + GDCLASS(ResourceFormatSaverJson, ResourceFormatSaver); + public: + virtual Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0); + virtual bool recognize(const RES &p_resource) const; + virtual void get_recognized_extensions(const RES &p_resource, List *r_extensions) const; + }; + #endif // RESOURCE_SAVER_JSON_H + +.. code-block:: cpp + + /* resource_saver_json.cpp */ + + #include "resource_saver_json.h" + + #include "resource_json.h" + #include "scene/resources/resource_format_text.h" + + Error ResourceFormatSaverJson::save(const String &p_path, const RES &p_resource, uint32_t p_flags) { + Ref json = memnew(JsonResource); + Error error = json->save_file(p_path, p_resource); + return error; + } + + bool ResourceFormatSaverJson::recognize(const RES &p_resource) const { + return Object::cast_to(*p_resource) != NULL; + } + + void ResourceFormatSaverJson::get_recognized_extensions(const RES &p_resource, List *r_extensions) const { + if (Object::cast_to(*p_resource)) { + r_extensions->push_back("json"); + } + } + +Creating custom data types +-------------------------- + +Godot may not have a proper substitute within its :ref:`doc_core_types` +or managed resources. Godot needs a new registered data type to +understand additional binary formats such as machine learning models. + +Here is an example of creating a custom datatype: + +.. code-block:: cpp + + /* resource_json.h */ + + #ifndef RESOURCE_JSON_H + #define RESOURCE_JSON_H + + #include "core/io/json.h" + #include "core/variant_parser.h" + + class JsonResource : public Resource { + GDCLASS(JsonResource, Resource); + + protected: + static void _bind_methods() { + ClassDB::bind_method(D_METHOD("set_dict", "dict"), &JsonResource::set_dict); + ClassDB::bind_method(D_METHOD("get_dict"), &JsonResource::get_dict); + + ADD_PROPERTY(PropertyInfo(Variant::DICTIONARY, "content"), "set_dict", "get_dict"); + } + + private: + Dictionary content; + + public: + Error load_file(const String &p_path); + Error save_file(const String &p_path, const RES &p_resource); + + void set_dict(const Dictionary &p_dict); + Dictionary get_dict(); + }; + #endif // RESOURCE_JSON_H + +.. code-block:: cpp + + /* resource_json.cpp */ + + #include "resource_json.h" + + Error JsonResource::load_file(const String &p_path) { + Error error; + FileAccess *file = FileAccess::open(p_path, FileAccess::READ, &error); + if (error != OK) { + if (file) { + file->close(); + } + return error; + } + + String json_string = String(""); + while (!file->eof_reached()) { + json_string += file->get_line(); + } + file->close(); + + String error_string; + int error_line; + JSON json; + Variant result; + error = json.parse(json_string, result, error_string, error_line); + if (error != OK) { + file->close(); + return error; + } + + content = Dictionary(result); + return OK; + } + + Error JsonResource::save_file(const String &p_path, const RES &p_resource) { + Error error; + FileAccess *file = FileAccess::open(p_path, FileAccess::WRITE, &error); + if (error != OK) { + if (file) { + file->close(); + } + return error; + } + + Ref json_ref = p_resource.get_ref_ptr(); + JSON json; + + file->store_string(json.print(json_ref->get_dict(), " ")); + file->close(); + return OK; + } + + void JsonResource::set_dict(const Dictionary &p_dict) { + content = p_dict; + } + + Dictionary JsonResource::get_dict() { + return content; + } + +Considerations +~~~~~~~~~~~~~~ + +Some libraries may not define certain common routines such as IO handling. +Therefore, Godot call translations are required. + +For example, here is the code for translating ``FileAccess`` +calls into ``std::istream``. + +.. code-block:: cpp + + #include "core/os/file_access.h" + + #include + #include + + class GodotFileInStreamBuf : public std::streambuf { + + public: + GodotFileInStreamBuf(FileAccess *fa) { + _file = fa; + } + int underflow() { + if (_file->eof_reached()) { + return EOF; + } else { + size_t pos = _file->get_position(); + uint8_t ret = _file->get_8(); + _file->seek(pos); // Required since get_8() advances the read head. + return ret; + } + } + int uflow() { + return _file->eof_reached() ? EOF : _file->get_8(); + } + + private: + FileAccess *_file; + }; + + +References +~~~~~~~~~~ + +- `istream `_ +- `streambuf `_ +- `core/io/fileaccess.h `_ + +Registering the new file format +------------------------------- + +Godot registers ``ResourcesFormatLoader`` with a ``ResourceLoader`` +handler. The handler selects the proper loader automatically +when ``load`` is called. + +.. code-block:: cpp + + /* register_types.h */ + + void register_json_types(); + void unregister_json_types(); + +.. code-block:: cpp + + /* register_types.cpp */ + + #include "register_types.h" + + #include "core/class_db.h" + #include "resource_loader_json.h" + #include "resource_saver_json.h" + #include "resource_json.h" + + static Ref json_loader; + static Ref json_saver; + + void register_json_types() { + ClassDB::register_class(); + + json_loader.instance(); + ResourceLoader::add_resource_format_loader(json_loader); + + json_saver.instance(); + ResourceSaver::add_resource_format_saver(json_saver); + } + + void unregister_json_types() { + ResourceLoader::remove_resource_format_loader(json_loader); + json_loader.unref(); + + ResourceSaver::remove_resource_format_saver(json_saver); + json_saver.unref(); + } + +References +~~~~~~~~~~ + +- `core/io/resource_loader.cpp `_ + +Loading it on GDScript +---------------------- + +Save a file called ``demo.json`` with the following contents and place it in the +project's root folder: + +.. code-block:: json + + { + "savefilename": "demo.json", + "demo": [ + "welcome", + "to", + "godot", + "resource", + "loaders" + ] + } + +Then attach the following script to any node:: + + extends Node + + onready var json_resource = load("res://demo.json") + + func _ready(): + print(json_resource.get_dict()) diff --git a/development/cpp/files/class_tree.zip b/development/cpp/files/class_tree.zip new file mode 100644 index 0000000..396986d Binary files /dev/null and b/development/cpp/files/class_tree.zip differ diff --git a/development/cpp/img/Control.png b/development/cpp/img/Control.png new file mode 100644 index 0000000..160b299 Binary files /dev/null and b/development/cpp/img/Control.png differ diff --git a/development/cpp/img/Node2D.png b/development/cpp/img/Node2D.png new file mode 100644 index 0000000..dc2ec7e Binary files /dev/null and b/development/cpp/img/Node2D.png differ diff --git a/development/cpp/img/Object.png b/development/cpp/img/Object.png new file mode 100644 index 0000000..bde1d61 Binary files /dev/null and b/development/cpp/img/Object.png differ diff --git a/development/cpp/img/Reference.png b/development/cpp/img/Reference.png new file mode 100644 index 0000000..2d19a60 Binary files /dev/null and b/development/cpp/img/Reference.png differ diff --git a/development/cpp/img/Spatial.png b/development/cpp/img/Spatial.png new file mode 100644 index 0000000..f5734fd Binary files /dev/null and b/development/cpp/img/Spatial.png differ diff --git a/development/cpp/img/architecture_diagram.jpg b/development/cpp/img/architecture_diagram.jpg new file mode 100644 index 0000000..b7dcb4a Binary files /dev/null and b/development/cpp/img/architecture_diagram.jpg differ diff --git a/development/cpp/img/cpp_profiler_hotspot_flame_graph.png b/development/cpp/img/cpp_profiler_hotspot_flame_graph.png new file mode 100644 index 0000000..a297374 Binary files /dev/null and b/development/cpp/img/cpp_profiler_hotspot_flame_graph.png differ diff --git a/development/cpp/img/cpp_profiler_hotspot_record.png b/development/cpp/img/cpp_profiler_hotspot_record.png new file mode 100644 index 0000000..29993f4 Binary files /dev/null and b/development/cpp/img/cpp_profiler_hotspot_record.png differ diff --git a/development/cpp/img/cpp_profiler_hotspot_view_results.png b/development/cpp/img/cpp_profiler_hotspot_view_results.png new file mode 100644 index 0000000..47f68ff Binary files /dev/null and b/development/cpp/img/cpp_profiler_hotspot_view_results.png differ diff --git a/development/cpp/img/cpp_profiler_hotspot_welcome.png b/development/cpp/img/cpp_profiler_hotspot_welcome.png new file mode 100644 index 0000000..ba52e98 Binary files /dev/null and b/development/cpp/img/cpp_profiler_hotspot_welcome.png differ diff --git a/development/cpp/img/cpp_profiler_time_profiler.png b/development/cpp/img/cpp_profiler_time_profiler.png new file mode 100644 index 0000000..f790aa2 Binary files /dev/null and b/development/cpp/img/cpp_profiler_time_profiler.png differ diff --git a/development/cpp/img/cpp_profiler_time_profiler_record.png b/development/cpp/img/cpp_profiler_time_profiler_record.png new file mode 100644 index 0000000..25bd5fc Binary files /dev/null and b/development/cpp/img/cpp_profiler_time_profiler_record.png differ diff --git a/development/cpp/img/cpp_profiler_time_profiler_result.png b/development/cpp/img/cpp_profiler_time_profiler_result.png new file mode 100644 index 0000000..035ad5b Binary files /dev/null and b/development/cpp/img/cpp_profiler_time_profiler_result.png differ diff --git a/development/cpp/img/cpp_profiler_verysleepy_results_filtered.png b/development/cpp/img/cpp_profiler_verysleepy_results_filtered.png new file mode 100644 index 0000000..f178a28 Binary files /dev/null and b/development/cpp/img/cpp_profiler_verysleepy_results_filtered.png differ diff --git a/development/cpp/img/cpp_profiler_verysleepy_select_process.png b/development/cpp/img/cpp_profiler_verysleepy_select_process.png new file mode 100644 index 0000000..41e5f92 Binary files /dev/null and b/development/cpp/img/cpp_profiler_verysleepy_select_process.png differ diff --git a/development/cpp/img/cpp_profiler_xcode_menu.png b/development/cpp/img/cpp_profiler_xcode_menu.png new file mode 100644 index 0000000..c77bc30 Binary files /dev/null and b/development/cpp/img/cpp_profiler_xcode_menu.png differ diff --git a/development/cpp/index.rst b/development/cpp/index.rst new file mode 100644 index 0000000..5718ba9 --- /dev/null +++ b/development/cpp/index.rst @@ -0,0 +1,56 @@ +Engine development +================== + +Setting up a development environment +------------------------------------ + +To modify Godot's source code, you need to set up a development environment. Start here. + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-cpp-dev-env + + configuring_an_ide/index + +Getting started with Godot's source code +---------------------------------------- + +This section covers the basics that you will encounter in (almost) every source file. + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-cpp-source-beginner + + introduction_to_godot_development + common_engine_methods_and_macros + core_types + variant_class + object_class + inheritance_class_tree + +Extending Godot by modifying its source code +--------------------------------------------- + +This section covers what you can do by modifying Godot's C++ source code. + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-cpp-source-advanced + + custom_modules_in_cpp + binding_to_external_libraries + custom_godot_servers + custom_resource_format_loaders + custom_audiostreams + +Debugging and profiling +----------------------- + +This section is about finding spots to optimize in the engine code when you need it in your project. + +.. toctree:: + :maxdepth: 1 + :name: toc-devel-cpp-debug-profiling + + macos_debug + using_cpp_profilers diff --git a/development/cpp/inheritance_class_tree.rst b/development/cpp/inheritance_class_tree.rst new file mode 100644 index 0000000..8a51e52 --- /dev/null +++ b/development/cpp/inheritance_class_tree.rst @@ -0,0 +1,29 @@ +Inheritance class tree +====================== + +Object +------ + +.. image:: img/Object.png + +Reference +--------- + +.. image:: img/Reference.png + +Control +------- + +.. image:: img/Control.png + +Node2D +------ + +.. image:: img/Node2D.png + +Spatial +------- + +.. image:: img/Spatial.png + +Source files: :download:`class_tree.zip `. diff --git a/development/cpp/introduction_to_godot_development.rst b/development/cpp/introduction_to_godot_development.rst new file mode 100644 index 0000000..fc3c7da --- /dev/null +++ b/development/cpp/introduction_to_godot_development.rst @@ -0,0 +1,40 @@ +.. _doc_introduction_to_godot_development: + +Introduction to Godot development +================================= + +This page is meant to introduce the global organization of Godot Engine's +source code, and give useful tips for extending/fixing the engine on the +C++ side. + +Architecture diagram +-------------------- + +The following diagram describes the architecture used by Godot, from the +core components down to the abstracted drivers, via the scene +structure and the servers. + +.. image:: img/architecture_diagram.jpg + +Debugging the editor with gdb +----------------------------- + +If you are writing or correcting bugs affecting Godot Engine's editor, +remember that the binary will by default run the project manager first, +and then only run the editor in another process once you've selected a +project. To launch a project directly, you need to run the editor by +passing the ``-e`` argument to Godot Engine's binary from within your +project's folder. Typically: + +.. code-block:: none + + $ cd ~/myproject + $ gdb godot + > run -e + +Or: + +.. code-block:: none + + $ gdb godot + > run -e --path ~/myproject diff --git a/development/cpp/macos_debug.rst b/development/cpp/macos_debug.rst new file mode 100644 index 0000000..fa254ba --- /dev/null +++ b/development/cpp/macos_debug.rst @@ -0,0 +1,42 @@ +Debugging on macOS +================== + +Debugging Godot editor +---------------------- + +Attaching a debugger to the signed macOS process requires the "com.apple.security.get-task-allow" entitlement, which is not enabled by default, since apps can't be notarized as long as it is enabled. +If you want to debug an official build of the editor it should be re-signed with the proper entitlements. + +Create an ``editor.entitlements`` text file with the following contents: + +.. code-block:: xml + + + + + + com.apple.security.cs.allow-dyld-environment-variables + + com.apple.security.cs.allow-jit + + com.apple.security.cs.allow-unsigned-executable-memory + + com.apple.security.cs.disable-executable-page-protection + + com.apple.security.cs.disable-library-validation + + com.apple.security.device.audio-input + + com.apple.security.device.camera + + + + +Then use the following command to re-sign the editor:: + + codesign -s - --deep --force --options=runtime --entitlements ./editor.entitlements ./path/to/Godot.app + +Debugging exported project +-------------------------- + +To allow debugging, select the ``codesign\debugging`` (``com.apple.security.get-task-allow``) entitlement during the export. When it is selected, notarization is not supported and should be disabled. diff --git a/development/cpp/object_class.rst b/development/cpp/object_class.rst new file mode 100644 index 0000000..adefb44 --- /dev/null +++ b/development/cpp/object_class.rst @@ -0,0 +1,324 @@ +.. _doc_object_class: + +Object class +============ + +.. seealso:: + + This page describes the C++ implementation of objects in Godot. + Looking for the Object class reference? :ref:`Have a look here. ` + +General definition +------------------ + +:ref:`Object ` is the base class for almost everything. Most classes in Godot +inherit directly or indirectly from it. Objects provide reflection and +editable properties, and declaring them is a matter of using a single +macro like this. + +.. code-block:: cpp + + class CustomObject : public Object { + + GDCLASS(CustomObject, Object); // this is required to inherit + }; + +This makes Objects gain a lot of functionality, like for example + +.. code-block:: cpp + + obj = memnew(CustomObject); + print_line("Object class: ", obj->get_class()); // print object class + + obj2 = Object::cast_to(obj); // converting between classes, this also works without RTTI enabled. + +References: +~~~~~~~~~~~ + +- `core/object.h `__ + +Registering an Object +--------------------- + +ClassDB is a static class that holds the entire list of registered +classes that inherit from Object, as well as dynamic bindings to all +their methods properties and integer constants. + +Classes are registered by calling: + +.. code-block:: cpp + + ClassDB::register_class() + +Registering it will allow the class to be instanced by scripts, code, or +creating them again when deserializing. + +Registering as virtual is the same but it can't be instanced. + +.. code-block:: cpp + + ClassDB::register_virtual_class() + +Object-derived classes can override the static function +``static void _bind_methods()``. When one class is registered, this +static function is called to register all the object methods, +properties, constants, etc. It's only called once. If an Object derived +class is instanced but has not been registered, it will be registered as +virtual automatically. + +Inside ``_bind_methods``, there are a couple of things that can be done. +Registering functions is one: + +.. code-block:: cpp + + ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name"), &MyCustomMethod); + +Default values for arguments can be passed in reverse order: + +.. code-block:: cpp + + ClassDB::bind_method(D_METHOD("methodname", "arg1name", "arg2name"), &MyCustomType::method, DEFVAL(-1)); // default value for arg2name + +``D_METHOD`` is a macro that converts "methodname" to a StringName for more +efficiency. Argument names are used for introspection, but when +compiling on release, the macro ignores them, so the strings are unused +and optimized away. + +Check ``_bind_methods`` of Control or Object for more examples. + +If just adding modules and functionality that is not expected to be +documented as thoroughly, the ``D_METHOD()`` macro can safely be ignored and a +string passing the name can be passed for brevity. + +References: +~~~~~~~~~~~ + +- `core/class_db.h `__ + +Constants +--------- + +Classes often have enums such as: + +.. code-block:: cpp + + enum SomeMode { + MODE_FIRST, + MODE_SECOND + }; + +For these to work when binding to methods, the enum must be declared +convertible to int, for this a macro is provided: + +.. code-block:: cpp + + VARIANT_ENUM_CAST(MyClass::SomeMode); // now functions that take SomeMode can be bound. + +The constants can also be bound inside ``_bind_methods``, by using: + +.. code-block:: cpp + + BIND_CONSTANT(MODE_FIRST); + BIND_CONSTANT(MODE_SECOND); + +Properties (set/get) +-------------------- + +Objects export properties, properties are useful for the following: + +- Serializing and deserializing the object. +- Creating a list of editable values for the Object derived class. + +Properties are usually defined by the PropertyInfo() class. Usually +constructed as: + +.. code-block:: cpp + + PropertyInfo(type, name, hint, hint_string, usage_flags) + +For example: + +.. code-block:: cpp + + PropertyInfo(Variant::INT, "amount", PROPERTY_HINT_RANGE, "0,49,1", PROPERTY_USAGE_EDITOR) + +This is an integer property, named "amount", hint is a range, range goes +from 0 to 49 in steps of 1 (integers). It is only usable for the editor +(edit value visually) but won't be serialized. + +Another example: + +.. code-block:: cpp + + PropertyInfo(Variant::STRING, "modes", PROPERTY_HINT_ENUM, "Enabled,Disabled,Turbo") + +This is a string property, can take any string but the editor will only +allow the defined hint ones. Since no usage flags were specified, the +default ones are PROPERTY_USAGE_STORAGE and PROPERTY_USAGE_EDITOR. + +There are plenty of hints and usage flags available in object.h, give them a +check. + +Properties can also work like C# properties and be accessed from script +using indexing, but this usage is generally discouraged, as using +functions is preferred for legibility. Many properties are also bound +with categories, such as "animation/frame" which also make indexing +impossible unless using operator []. + +From ``_bind_methods()``, properties can be created and bound as long as +set/get functions exist. Example: + +.. code-block:: cpp + + ADD_PROPERTY(PropertyInfo(Variant::INT, "amount"), "set_amount", "get_amount") + +This creates the property using the setter and the getter. + +.. _doc_binding_properties_using_set_get_property_list: + +Binding properties using ``_set``/``_get``/``_get_property_list`` +----------------------------------------------------------------- + +An additional method of creating properties exists when more flexibility +is desired (i.e. adding or removing properties on context). + +The following functions can be overridden in an Object derived class, +they are NOT virtual, DO NOT make them virtual, they are called for +every override and the previous ones are not invalidated (multilevel +call). + +.. code-block:: cpp + + protected: + void _get_property_list(List *r_props) const; // return list of properties + bool _get(const StringName &p_property, Variant &r_value) const; // return true if property was found + bool _set(const StringName &p_property, const Variant &p_value); // return true if property was found + +This is also a little less efficient since ``p_property`` must be +compared against the desired names in serial order. + +Dynamic casting +--------------- + +Godot provides dynamic casting between Object-derived classes, for +example: + +.. code-block:: cpp + + void somefunc(Object *some_obj) { + + Button *button = Object::cast_to